Paging Void. Linux questions

Related:
Create New Tag

8/28/2018 4:09 PM

I am interested in possibly using a program written by Linux called EMC2. It is a CNC controller. It runs under Ubuntu. I have an older windows7 spare PC. Can I install Linux on that machine or do I have to uninstall Windows first?
Help!
THX

|

8/28/2018 9:17 PM

Are you going to use stepper motors? 34 or 23 frame size
How big will your router be?

|

www.alljackedupinc.com home of the Switch Hauler, the only modular hauling system www.sprocketstuff.com home of the Counter Sprocket Tool

8/29/2018 5:26 AM

ToolMaker wrote:

Are you going to use stepper motors? 34 or 23 frame size
How big will your router be?

Nema 23 steppers. I will end up with roughly 18" X 24" and 6" Z.

|

8/30/2018 7:51 PM

Never mind. I figured it out.

|

8/31/2018 7:34 AM

Ooops, just seeing this. Sorry! smile

|

8/31/2018 9:09 AM

The drunk penguin is late again..... whistling

Photo

|

"We don't rent pigs."

9/1/2018 10:37 AM

This is some interesting stuff. The new version of linuxcnc runs on debian not ubuntu. I think I have it all set up. The only thing I'm not sure about is if it is talking to the parallel port. I really wont know that until I connect it to the machine.

|

9/1/2018 6:22 PM

It's funny I've been thinking about building some sort of CNC machine. I've been wanting to play around with some stepper motors. I picked up several of these Raspberry Pis and have been controlling all sorts of things with them.

|

9/2/2018 5:22 AM

Do you know of a way that I can verify communication with the par port? I found a listing and port address using lspci-vv but I'm not sure about it. I dont have anything that needs the parallel port. I dont even have a cable. Can I use my meter? This is the area where I have little experience.

|

9/2/2018 12:55 PM

I have a lot more experience with serial ports but I would think you should be able to test it with a meter. It looks like you could use a test program similar to this:

http://wiki.linuxcnc.org/cgi-bin/wiki.pl?Parallel_Port_Tester

|

9/2/2018 1:53 PM

That tester comes with linuxcnc. I tried it with the meter and nothing. If the program puts out pulses I doubt that my meter is fast enough to show up. I'll probably just have to order the kit I want and bench test it. I also understand that debian does not really like hardware that it has to download drivers for. I may have to get a linux recommended parport card.
Hey! It's an adventure. I originally wanted a dual boot setup but the download choice I was told to use pretty much ended that idea. Oh well. It's a linux machine now.

|

9/2/2018 2:08 PM

Actually now that I think about it I have played around with using the parallel port to control things. Basic things like controlling LEDs etc I'll try and dig around and see if I can find my code this evening and come up with some better suggestions.

|

9/2/2018 3:12 PM
Edited Date/Time: 9/2/2018 3:13 PM

I hate it when folks come on the forum and speak in some foreign language...lol.silly My best friend in high school got in on the ground floor of this kinda stuff. He just travels the world programming machines and training people to use them. But mostly he rides his Harley and catches bucket mouth bass. I wish I had been born smart instead of so damn good looking.w00t

|

If it ain't yer's don't take it, If it ain't the truth dont say it, If it ain't right don't do it...Marcus Aurelius

9/2/2018 6:34 PM

plowboy wrote:

I hate it when folks come on the forum and speak in some foreign language...lol.silly My best friend in high school got in on the ground floor of this kinda stuff. He just travels the world programming machines and training people to use them. But mostly he rides his Harley and catches bucket mouth bass. I wish I had been born smart instead of so damn good looking.w00t

To be honest, I am a slow learner with little or no patience. It's a bad combination. That's how I just wiped Windows7 off the computer I'm using for the CNC project. No biggie. Void and I have been dicking around with this crap since the Sinclair 1000 and the VIC 20. That's a long goddamn time ago. He has kept up with it more than I have but having some background makes it a lot easier. Without it I would have no prayer.

|

9/5/2018 6:29 PM

Crap, I just remembered I said I would look for some of my code I used to control parallel port. I'm old. smile You may or may not need it now but here's a C program that i used to send commands to the parallel port. The timestamp is from 2002. smile


#include
#include
#include
#include

#define base 0x378 /* printer port base address */

int main(int argc, char **argv) {

int value;

if (argc!=2) {
fprintf(stderr, "Error: Wrong number of arguments. This program needs one ar
gument which is number between 0 and 255.\n");
return 1;
}

if (sscanf(argv[1],"%i",&value)!=1) {
fprintf(stderr, "Error: Parameter is not a number.\n");
return 1;
}

if ((value255)) {
fprintf(stderr, "Error: Invalid numeric value. The parameter number must be
between 0 and 255\n");
return 1;
}

if (ioperm(base,1,1)) {
fprintf(stderr, "Error: Couldn't get the port at %x\n", base);
return 1;
}

outb((unsigned char)value, base);
return 0;
}

|

9/5/2018 6:31 PM

And here's one I wrote to control some LEDs off of a parallel port. I believe you have to put resistors in-line. At any rate, you should at least get high and low readings on some of the data pins.


#include
#include
#include
#include

#define base 0x378 /* printer port base address */


int lptout(char **lptval)
{

int value;

if (sscanf(lptval[1],"%i",&value)!=1) {
fprintf(stderr, "Error: Parameter to lptout() is not a number.\n");
return(1);
}

if ((value255)) {
fprintf(stderr, "Error: Invalid numeric value. The parameter to lptout() mus
t be a number between 0 and 255\n");
return(1);
}

if (ioperm(base,1,1)) {
fprintf(stderr, "Error: Couldn't get the port at %x\n", base);
return(1);
}

outb((unsigned char)value, base);
return(0);
}


int nsleep (char **msecs)
{

long long int i;

if (i=atoll(msecs[1])) {
i*=1000;
usleep(i);
} else {
fprintf(stderr, "Error: Invalid time %s\n", msecs[1]);
return(1);
}
return(0);
}

int main(int argc, char **argv)
{

FILE *infile;
char *lights;

while(1) {
if ( argc == 1 ) {
system("clear");
printf("Example: 255/1000 = all lights on for one second\n");
printf("Enter light/time sequence (q to quit):\n");
scanf("%s",lights);
if ( lights[1] == "q" ) {
exit(0);
}
} else {
if (infile=fopen(argv[1],"r")) {
lights=`egrep -v "^#|^$" $1 | tr '\n' ' '`
else
echo "Input file not found!"
exit
fi
fi
for i in $lights
do
l=`echo $i | cut -d'/' -f1`
t=`echo $i | cut -d'/' -f2`
printf "lights=%03d, milliseconds=%04d\n" $l $t
./lptout $l
./nsleep $t
done
./lptout 0
if [ $# -eq 0 ]; then
echo "Press ENTER to run again or \"q\" to quit..."
read pause
if [ "$pause" == "q" ]; then
exit
fi
}
}
}

|

9/5/2018 6:32 PM

And of course all the indentation/formatting is lost posting that on the forum, not that it's needed in C.

|

9/5/2018 6:36 PM
Edited Date/Time: 9/5/2018 6:39 PM

Actually, some of the code is missing in those posts. Actually I have it on my voidmain site here if interested:

http://voidmain.is-a-geek.net/files/lights/

I even wrote a little Perl script that will control the LEDs and play some tunes out of the PC speaker. Christmasy. smile

|

9/5/2018 6:39 PM

XXVoid MainXX wrote:

Crap, I just remembered I said I would look for some of my code I used to control parallel port. I'm old. smile You may or may not need it now but here's a C program that i used to send commands to the parallel port. The timestamp is from 2002. smile


#include
#include
#include
#include

#define base 0x378 /* printer port base address */

int main(int argc, char **argv) {

int value;

if (argc!=2) {
fprintf(stderr, "Error: Wrong number of arguments. This program needs one ar
gument which is number between 0 and 255.\n");
return 1;
}

if (sscanf(argv[1],"%i",&value)!=1) {
fprintf(stderr, "Error: Parameter is not a number.\n");
return 1;
}

if ((value255)) {
fprintf(stderr, "Error: Invalid numeric value. The parameter number must be
between 0 and 255\n");
return 1;
}

if (ioperm(base,1,1)) {
fprintf(stderr, "Error: Couldn't get the port at %x\n", base);
return 1;
}

outb((unsigned char)value, base);
return 0;
}

That base address you are using will not work for me. Ox378 is the standard on board address for lpt1. It' s not the same with an add on board. I have decided to go ahead with the build but I may have to get another parport board. The one I have now uses the PCI expresse slot. I don't think linux likes that. I tried to cheap out. Thanks for the effort though.

|

9/5/2018 7:07 PM
Edited Date/Time: 9/5/2018 7:38 PM

Do you know the make/model of the board? What's the output of the lspci command? I would think it should work although you'll have to use the correct address. I have a USB to parallel (usblp) for my old laser printer that works just fine.

|

9/6/2018 8:08 PM

XXVoid MainXX wrote:

Do you know the make/model of the board? What's the output of the lspci command? I would think it should work although you'll have to use the correct address. I have a USB to parallel (usblp) for my old laser printer that works just fine.

The lspci gives me a e800 base address for the card. At least thats what I think it is. Also it thinks it's a serial port. Windows did too until I installed the drivers. I will post all the info tomorrow and maybe you can decipher it. I ordered another card that was recommended by another linuxcnc user. He had the same problems and the new card worked for him. What seems funny to me is that the card shows up on lspci but there is nothing in the bios to enable. This is an older E machines that never had a parport. I am using the PCIe slot. It also has a regular PCI slot available.

|

9/7/2018 3:54 AM
Edited Date/Time: 9/7/2018 10:27 AM

XXVoid MainXX wrote:

Do you know the make/model of the board? What's the output of the lspci command? I would think it should work although you'll have to use the correct address. I have a USB to parallel (usblp) for my old laser printer that works just fine.

Try again.

|

9/7/2018 10:36 AM

XXVoid MainXX wrote:

Do you know the make/model of the board? What's the output of the lspci command? I would think it should work although you'll have to use the correct address. I have a USB to parallel (usblp) for my old laser printer that works just fine.

borg wrote:

Try again.

03:00.0 Serial controller: Device 1c00:3050 (rev 10) (prog-if 05 [16850])
Subsystem: Device 1c00:3050
Control: I/O+ Mem+ BusMaster- SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR+ FastB2B- DisINTx-
Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- SERR-

|

9/7/2018 10:40 AM

Why does it keep chopping the message in half? This is the other half.
That's weird.


Interrupt: pin A routed to IRQ 19
Region 0: I/O ports at e800 [size=256]
Region 1: Memory at f9ff8000 (32-bit, prefetchable) [size=32K]
Region 2: I/O ports at ec00 [size=4]
Expansion ROM at febf0000 [disabled] [size=32K]
Capabilities:

|

9/8/2018 9:37 AM
Edited Date/Time: 9/8/2018 9:38 AM

If it required special drivers in Windows as well then you are probably on the right rack by getting a supported card. There was a time in the Windows 95 era where it was fashionable to develop cheap hardware where many of the functions that normally would be handled int he hardware was handled in software instead, and they would only provide Windows drivers for it. Luckily I haven't seen that as much lately and it's less often you run into hardware that doesn't work in Linux. Hope the new card works for you!

|

9/9/2018 5:31 AM

XXVoid MainXX wrote:

If it required special drivers in Windows as well then you are probably on the right rack by getting a supported card. There was a time in the Windows 95 era where it was fashionable to develop cheap hardware where many of the functions that normally would be handled int he hardware was handled in software instead, and they would only provide Windows drivers for it. Luckily I haven't seen that as much lately and it's less often you run into hardware that doesn't work in Linux. Hope the new card works for you!

The new card fired right up. It took some serious digging to get to this solution. I basically just stumbled onto the forum post that had the name of a card that worked. Sure seems like there would have been more readily available info on this since so many computers are sold without a parallel port.

|

9/9/2018 9:26 AM

Parallel printer ports are rarely used anymore, all replaced by USB, which is being replaced by wireless/wired network (for printers).

|

9/9/2018 11:04 AM

XXVoid MainXX wrote:

Parallel printer ports are rarely used anymore, all replaced by USB, which is being replaced by wireless/wired network (for printers).

Right but linuxcnc requires a parallel port. Given that they are rarely used and have to be installed, you would think the documentation would be more helpful.

|

9/12/2018 1:50 PM

Yeah, the linuxcnc documentation should include that helpful information, assuming it's an active project that anyone is working on. Also assuming the linuxcnc project is driven by hackers/hobbyists like most other Linux projects and depending on the amount of resources they have available to put into it the documentation can be lacking sometimes unfortunately.

|

9/12/2018 6:18 PM

XXVoid MainXX wrote:

Yeah, the linuxcnc documentation should include that helpful information, assuming it's an active project that anyone is working on. Also assuming the linuxcnc project is driven by hackers/hobbyists like most other Linux projects and depending on the amount of resources they have available to put into it the documentation can be lacking sometimes unfortunately.

That's right. It's free. People are donating their time. I should be more appreciative. I got through it.

|