Paging Void. Linux questions

borg
Posts
5751
Joined
12/7/2009
Location
Long Beach, CA US
Edited Date/Time 9/12/2018 6:22pm
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
|
ToolMaker
Posts
6119
Joined
11/19/2011
Location
Escondido, CA US
Fantasy
762nd
8/28/2018 9:17pm
Are you going to use stepper motors? 34 or 23 frame size
How big will your router be?
borg
Posts
5751
Joined
12/7/2009
Location
Long Beach, CA US
8/29/2018 5:26am
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.
borg
Posts
5751
Joined
12/7/2009
Location
Long Beach, CA US
8/30/2018 7:51pm
Never mind. I figured it out.

The Shop

JAFO92
Posts
4257
Joined
3/21/2016
Location
BFE, TX US
8/31/2018 9:09am
The drunk penguin is late again..... Whistling


1
borg
Posts
5751
Joined
12/7/2009
Location
Long Beach, CA US
9/1/2018 10:37am
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.
1
XXVoid MainXX
Posts
7733
Joined
5/25/2012
Location
Schenectady, NY US
9/1/2018 6:22pm
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.
borg
Posts
5751
Joined
12/7/2009
Location
Long Beach, CA US
9/2/2018 5:22am
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.
borg
Posts
5751
Joined
12/7/2009
Location
Long Beach, CA US
9/2/2018 1:53pm
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.
1
XXVoid MainXX
Posts
7733
Joined
5/25/2012
Location
Schenectady, NY US
9/2/2018 2:08pm
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.
plowboy
Posts
11631
Joined
1/3/2010
Location
Norwich, KS US
9/2/2018 3:12pm Edited Date/Time 9/2/2018 3:13pm
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.Woohoo
borg
Posts
5751
Joined
12/7/2009
Location
Long Beach, CA US
9/2/2018 6:34pm
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...
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.Woohoo
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.
XXVoid MainXX
Posts
7733
Joined
5/25/2012
Location
Schenectady, NY US
9/5/2018 6:29pm
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

[code]
#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;
}

[/code]
XXVoid MainXX
Posts
7733
Joined
5/25/2012
Location
Schenectady, NY US
9/5/2018 6:31pm
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.

[code]
#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
}
}
}

[/code]
XXVoid MainXX
Posts
7733
Joined
5/25/2012
Location
Schenectady, NY US
9/5/2018 6:32pm
And of course all the indentation/formatting is lost posting that on the forum, not that it's needed in C.
XXVoid MainXX
Posts
7733
Joined
5/25/2012
Location
Schenectady, NY US
9/5/2018 6:36pm Edited Date/Time 9/5/2018 6:39pm
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
borg
Posts
5751
Joined
12/7/2009
Location
Long Beach, CA US
9/5/2018 6:39pm
Crap, I just remembered I said I would look for some of my code I used to control parallel port. I'm old. :) You may or...
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

[code]
#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;
}

[/code]
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.
XXVoid MainXX
Posts
7733
Joined
5/25/2012
Location
Schenectady, NY US
9/5/2018 7:07pm Edited Date/Time 9/5/2018 7:38pm
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
Posts
5751
Joined
12/7/2009
Location
Long Beach, CA US
9/6/2018 8:08pm
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...
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.
borg
Posts
5751
Joined
12/7/2009
Location
Long Beach, CA US
9/7/2018 3:54am Edited Date/Time 9/7/2018 10:27am
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...
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.
borg
Posts
5751
Joined
12/7/2009
Location
Long Beach, CA US
9/7/2018 10:36am
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...
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-
borg
Posts
5751
Joined
12/7/2009
Location
Long Beach, CA US
9/7/2018 10:40am
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:
XXVoid MainXX
Posts
7733
Joined
5/25/2012
Location
Schenectady, NY US
9/8/2018 9:37am Edited Date/Time 9/8/2018 9:38am
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!
borg
Posts
5751
Joined
12/7/2009
Location
Long Beach, CA US
9/9/2018 5:31am
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...
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.
XXVoid MainXX
Posts
7733
Joined
5/25/2012
Location
Schenectady, NY US
9/9/2018 9:26am
Parallel printer ports are rarely used anymore, all replaced by USB, which is being replaced by wireless/wired network (for printers).
borg
Posts
5751
Joined
12/7/2009
Location
Long Beach, CA US
9/9/2018 11:04am
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.
XXVoid MainXX
Posts
7733
Joined
5/25/2012
Location
Schenectady, NY US
9/12/2018 1:50pm
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.
borg
Posts
5751
Joined
12/7/2009
Location
Long Beach, CA US
9/12/2018 6:18pm
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...
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.
1
borg
Posts
5751
Joined
12/7/2009
Location
Long Beach, CA US
9/12/2018 6:22pm
BTW, Linuxcnc is a great program. I'm glad I went that route instead of Mach3 which is windows based. CNC needs the cleanest working environment it can get.
1

Post a reply to: Paging Void. Linux questions

The Latest