Linux will not recognize my BOB no matter WHAT I try to do

  • tommylight
  • tommylight's Avatar
  • Away
  • Moderator
  • Moderator
More
16 Jun 2021 22:40 #212231 by tommylight
Beagle, i really admire your persistence, but if this is the topic with 4 different PC's and several add on boards/built in ports not working, it is a user error on all cases fuelled by repeating the same steps (wrong ones) over and over again in the setup/stepconf/hal files.
Also, i never ever got a port not found and have a port working, but that was always with RTAI kernel.
And before anyone goes OFF, i do this every day, i have over 15 PC/laptops at all times, i run machines every day, done over 60 parallel port controlled machines, have several add ons in use (always NetMos/MosChip), so please DON'T!
The following user(s) said Thank You: BeagleBrainz

Please Log in or Create an account to join the conversation.

  • BeagleBrainz
  • BeagleBrainz's Avatar
  • Visitor
  • Visitor
16 Jun 2021 23:00 #212235 by BeagleBrainz
Just to be clear I on 2.8.1 not a development build. I had to go through hal_port.c to see what was going on.

With regards to a Parallel Port being reserved, it is only reserved, claimed is the parlance used by the code & docs, when another app has asked for it to be claimed. The port can either be claimed for exclusive or non-exclusive use.

No if the kernel has no record of a particular hardware port/address belonging to a parallel port there is no way of knowing if it is in use by another device driver or free to use.
Now, this may not be a real life example but a typo could cause it, a port/address used by the disk subsystem or ethernet subsystem was specified. I suspect nothing good would happen.
Just grabbing a port/address is not a polite way of doing things, either by a user space application or another driver.
That is not my scheme, that is how it works with PCI\PCIe cards that have a PCI ID match to parport_pc. After loading the udev loads parport_pc driver the udev infrastructure loads ppdev to create the device file. This is also what happens with on board parallel ports. The only difference bu adding a file to /etc/modprobe.d/ is that we forcing this behaviour.
If the parport_pc driver was modified with the PCI ID of cards known to work, but not in the current driver, the udev infrastructure would do this as per normal.
Maybe hal_port could do what what parport_pc does when it loads. It writes then reads back a byte to the DATA & CTR ports, if if gets the same byte on the read the port exists if it doesn't there is essentially nothing physically there.
This can be seen thus.
53318.586647] parport 0xe800 (WARNING): CTR: wrote 0x0c, read 0xff
[53318.586652] parport 0xe800 (WARNING): DATA: wrote 0xaa, read 0xff
[53318.586652] parport 0xe800: You gave this address, but there is probably no parallel port there!
[53318.586662] parport0: PC-style at 0xe800, irq 12 [PCSPP,TRISTATE

With a malformed conf file in /etc/modprobe this is the message you get.
libkmod: ERROR ../libkmod/libkmod-config.c:656 kmod_config_parse: /etc/modprobe.d/Linux_parport.conf line 1: ignoring bad line starting with 'blah'

Even tho the file is called asla_base.conf parameters for any module can be put in there. It just makes things a little easier to maintain if you group things logically.

Please Log in or Create an account to join the conversation.

  • BeagleBrainz
  • BeagleBrainz's Avatar
  • Visitor
  • Visitor
16 Jun 2021 23:08 - 16 Jun 2021 23:29 #212236 by BeagleBrainz

Beagle, i really admire your persistence, but if this is the topic with 4 different PC's and several add on boards/built in ports not working, it is a user error on all cases fuelled by repeating the same steps (wrong ones) over and over again in the setup/stepconf/hal files.
Also, i never ever got a port not found and have a port working, but that was always with RTAI kernel.
And before anyone goes OFF, i do this every day, i have over 15 PC/laptops at all times, i run machines every day, done over 60 parallel port controlled machines, have several add ons in use (always NetMos/MosChip), so please DON'T!


Sorry, I neglected this from the first couple of edits. Thanks for those words tommy. Just a little explanation from diving into into kernel & Linuxcnc code.

If the NETMOS chips PCI ID matches one of the PCI IDs known to the parport_pc kernel module you wont get that message. Each driver contains a list of supported PCI IDs, that's how the kernel\udev system knows which driver to load when it discovers a piece of hardware. USB is similar as well, it matches a driver & device via the ID.

I can bet that if you were to run lspci -vnn you would see the driver associated with that card is parport_pc. ppdev would also load and create an entry in /dev/.
There would also be an entry in /proc/sys/dev/parport/ such as parport0 (assuming one PP) which also would contain the base address of the parallel port in /proc/sys/dev/parport/parport0/base-addr

That logic would also dictate that you could use either
loadrt hal_parport cfg="base addr out"
or
loadrt hal_parport cfg="0 out"

Supported Oxford semi card.
forum.linuxcnc.org/18-computer/42826-par...hread?start=0#211997

Unsupported MOS Chip card, from my research it's the subsystem id that is causing the expected drivers not to load.
forum.linuxcnc.org/18-computer/42826-par...hread?start=0#212168

A supported combo Serial\Parallel card should also have parport_serial loaded as well.

For any one who wants some info on the driver PCI ID relationship:
wiki.archlinux.org/title/Modalias
Last edit: 16 Jun 2021 23:29 by BeagleBrainz.

Please Log in or Create an account to join the conversation.

More
17 Jun 2021 00:15 #212241 by phillc54

Also, i never ever got a port not found and have a port working, but that was always with RTAI kernel.


I get that error with a MosChip card yet it works fine on a parport config. It won't talk to a 7i90 though. ¯\_(ツ)_/¯

Please Log in or Create an account to join the conversation.

  • tommylight
  • tommylight's Avatar
  • Away
  • Moderator
  • Moderator
More
17 Jun 2021 10:47 #212267 by tommylight
Most probably not set in EPP mode, or whatever is required. No idea how to set that, but lspci shows the supported modes.

Please Log in or Create an account to join the conversation.

More
23 Jun 2021 23:20 #212770 by Kidkasual1
Hello all. I hope you all had a great Father's Day weekend. We just got back from 5 days of camping. I hope everyone else had some great family time, as well.

You are correct, Mr Beagle. I did have the folder in the directory named Linux_parport.conf. I have changed the name of the folder to "parport setup" and have left the file within it named Linux_parport.conf. I have retried the command in the terminal, but I do not get the same script that you showed in your post. This is what I am getting in the command terminal now:

kidkasual@Mill:~$ sudo cp Linux_parport.conf /etc/modprobe.d
[sudo] password for kidkasual:
cp: cannot stat 'Linux_parport.conf': No such file or directory
kidkasual@Mill:~$


I am not understanding why I get different outputs than you do when I use the same command inputs that you do. What am I STILL doing wrong with this code???

Please Log in or Create an account to join the conversation.

More
24 Jun 2021 01:15 #212775 by arvidb
The message tells you why it doesn't work: "'Linux_parport.conf': No such file or directory"!

It can't copy the file if it isn't where you specify it to be. If you have a directory named "parport setup" in your current directory, and your Linux_parport.conf is in it, then tell cp where to find the file:

kidkasual@Mill:~$ sudo cp parport\ setup/Linux_parport.conf /etc/modprobe.d/

(Note that you need to "escape" the space in the directory name with a backslash or the computer will get confused. It's a perfect opportunity to try tab completion! Type 'sudo cp parport' and then press tab, and the '\ setup' part should fill in by itself, unless you have several files/directories that start with parport so that it's ambigous which one you want. Hmm, unless sudo messes things up... well, you can try! :))

Please Log in or Create an account to join the conversation.

  • BeagleBrainz
  • BeagleBrainz's Avatar
  • Visitor
  • Visitor
24 Jun 2021 10:10 #212808 by BeagleBrainz

Hello all. I hope you all had a great Father's Day weekend. We just got back from 5 days of camping. I hope everyone else had some great family time, as well.

You are correct, Mr Beagle. I did have the folder in the directory named Linux_parport.conf. I have changed the name of the folder to "parport setup" and have left the file within it named Linux_parport.conf. I have retried the command in the terminal, but I do not get the same script that you showed in your post. This is what I am getting in the command terminal now:

kidkasual@Mill:~$ sudo cp Linux_parport.conf /etc/modprobe.d
[sudo] password for kidkasual:
cp: cannot stat 'Linux_parport.conf': No such file or directory
kidkasual@Mill:~$


I am not understanding why I get different outputs than you do when I use the same command inputs that you do. What am I STILL doing wrong with this code???


If you are not in the directory your are running the the cp command from you need to give the full path to the file, this also includes the file name.

I have a directory called foo & file called bar and need to copy that to tmp.

cp -r ~/foo /tmp

will copy the directory foo to tmp and the file bar.txt

Before the command /tmp has no contents
After the command /tmp will have a new directory called foo with a file called bar.txt in the foo directory.

cp ~/foo/bar.xt /tmp

Will only copy the file contained in the directory called bar.txt that is in the foo directory.
After the command /tmp will have a new file called bar.txt in the /tmp directory.

Read this article:
www.cyberciti.biz/faq/copy-command/

if you have space in the directory or file name you can use this form.

cp "file name with spaces.txt" "/tmp/dir with spaces"

Please Log in or Create an account to join the conversation.

More
25 Jun 2021 01:54 #212866 by Kidkasual1
Ok, so I was able to copy the Linux_parport.conf file into the modprobe/d. directory using the line of code that arvidb suggested. Thank you, arvidb. And thank you for the explanation. That is probably more helpful than just giving a line of code and saying, "Just type this". I will read the other suggested materials as I have time and can fit it in. Thank you, Mr. Beagle.

So, I can navigate to the new file in the modprobe/d. directory and can open and view the new file that was just added, and the information appears to be correct according to the directions in that other string pointed to by Mr. Beagle. I then changed my parallel port back to "0" as suggested in the other string, and tried to start the Axis GUI. I was given the white debug screen saying that parallel port 0 can not be found, so I went back into the Stepconf Wizard and changed the port address back to e010 and again tried starting the Axis GUI. The GUI opened, but I got the apparently incorrect and spurious "Linux parallel port @57360 cannot be found" error message again. I changed the address to 0xe010 in the Stepconf Wizard, but still got the same erroneous error message in the GUI screen. From reading the comments in this post where others were able to X out of that error and then control their machine, I figured I would give it a go. When I X out of the error and try to jog my machine, I have still have no control and no motion. The steppers are powered on and are locked up, but I have no control over them, just like before.


And it's funny that you have a folder and file name foo and bar, Mr. Beagle. I have one of those too, expect my folder is called FU and my file BAR. It's where I am keeping all of my everything from this troubleshoot....... Tongue-in-cheek wink wink... :)

Please Log in or Create an account to join the conversation.

  • BeagleBrainz
  • BeagleBrainz's Avatar
  • Visitor
  • Visitor
25 Jun 2021 04:15 - 25 Jun 2021 04:17 #212870 by BeagleBrainz
Contrary to a previous post i have to see this one out.

Beware this is a long post and worth scrolling thru, even the sections that have their own little scroll windows.
Let's start with the basics of what I have found in my research of Parallel Ports and Linux in general. Unfortunately I can't seem to find my cache of parallel port cards.

For this explanation a kernel module in Linux jargon is equivalent to a driver in Windows jargon.

To use a parallel port in Linux there are 3 modules at play.

1. parport - this provides the basic functions
2. parport_pc - this provides additional function for the parallel port on a PC platform
3. ppdev - a simple description is that it creates the device file under dev.

For a supported parallel port, a supported parallel port is one that has a PCI ID that matches those that parport_pc knows about. Examples of these are ports built into the motherboard.


The first module that is loaded by udev (this is responsible for loading kernel modules for add in cards and usb devices) is parport_pc, during the loading of this module parport is loaded as well as parport_pc depends on code in parport. This is common that one kernel module requires the code of another.
Upon recognising a PP card udev will load parport_pc as well as parport.
parport_pc will then try to find info relating to the card.

Now one thing I have found strange on one machine ppdev will load after parport_pc and on another it needs loading manually.

Anyways I'm loading parport_pc for a card that doesn't exist on my system and whose address is not actually connected to another piece of harware.
Please scroll thru this and the others.
rmurphy@ThinkStation-S20:~$ ls -la /dev/par*
ls: cannot access '/dev/par*': No such file or directory
rmurphy@ThinkStation-S20:~$ dmesg
rmurphy@ThinkStation-S20:~$ sudo modprobe parport_pc io=0xe100 irq=10 
rmurphy@ThinkStation-S20:~$ dmesg
[1229652.337394] parport 0xe100 (WARNING): CTR: wrote 0x0c, read 0xff
[1229652.337398] parport 0xe100 (WARNING): DATA: wrote 0xaa, read 0xff
[1229652.337399] parport 0xe100: You gave this address, but there is probably no parallel port there!
[1229652.337412] parport0: PC-style at 0xe100, irq 10 [PCSPP,TRISTATE]
[1229652.342398] ppdev: user-space parallel port driver
rmurphy@ThinkStation-S20:~$ ls -la /dev/par*
crw-rw-r-- 1 root lp 99, 0 Jun 25 13:47 /dev/parport0

As you can see before loading the kernel modules I did not have an entry in /dev for a parallel port, afterwards I do. The presence of this entry is required by hal_parport.

Starting Linuxcnc with PP 0x378 (which doesn't exist) (Ignore the latency messages)
rmurphy@ThinkStation-S20:~$ linuxcnc
LINUXCNC - 2.8.1
Machine configuration directory is '/home/rmurphy/linuxcnc/configs/by_interface.parport.stepper-1'
Machine configuration file is 'stepper_mm.ini'
Starting LinuxCNC...
Found file(lib): /usr/share/linuxcnc/hallib/core_stepper.hal
Note: Using POSIX realtime
Found file(REL): ./standard_pinout.hal
config string '0x0378'
Linux parallel port @888 not found
Linux parallel port @888 not found

note: MAXV     max: 30.480 units/sec 1828.800 units/min
note: LJOG     max: 30.480 units/sec 1828.800 units/min
note: LJOG default: 0.424 units/sec 25.440 units/min
note: jog_order='XYZ'
note: jog_invert=set([])
Unexpected realtime delay on task 0 with period 50000
This Message will only display once per session.
Run the Latency Test and resolve before continuing.

Unexpected realtime delay on task 0 with period 50000
This Message will only display once per session.
Run the Latency Test and resolve before continuing.
Shutting down and cleaning up LinuxCNC...
task: 952 cycles, min=0.000059, max=0.012031, avg=0.009910, 0 latency excursions (> 10x expected cycle time of 0.010000s)
Note: Using POSIX realtime

Changing the address to 0xe100 (The fake parallel port)
rmurphy@ThinkStation-S20:~$ linuxcnc
LINUXCNC - 2.8.1
Machine configuration directory is '/home/rmurphy/linuxcnc/configs/by_interface.parport.stepper-1'
Machine configuration file is 'stepper_mm.ini'
Starting LinuxCNC...
Found file(lib): /usr/share/linuxcnc/hallib/core_stepper.hal
Note: Using POSIX realtime
Found file(REL): ./standard_pinout.hal
config string '0xe100'
Unexpected realtime delay on task 0 with period 50000
This Message will only display once per session.
Run the Latency Test and resolve before continuing.
Unexpected realtime delay on task 0 with period 50000
This Message will only display once per session.
Run the Latency Test and resolve before continuing.

note: MAXV     max: 30.480 units/sec 1828.800 units/min
note: LJOG     max: 30.480 units/sec 1828.800 units/min
note: LJOG default: 0.424 units/sec 25.440 units/min
note: jog_order='XYZ'
note: jog_invert=set([])
Shutting down and cleaning up LinuxCNC...
task: 686 cycles, min=0.000049, max=0.011708, avg=0.009851, 0 latency excursions (> 10x expected cycle time of 0.010000s)
Note: Using POSIX realtime

Changing to cfg="0" (The fake parallel port)
rmurphy@ThinkStation-S20:~$ linuxcnc
LINUXCNC - 2.8.1
Machine configuration directory is '/home/rmurphy/linuxcnc/configs/by_interface.parport.stepper-1'
Machine configuration file is 'stepper_mm.ini'
Starting LinuxCNC...
Found file(lib): /usr/share/linuxcnc/hallib/core_stepper.hal
Note: Using POSIX realtime
Found file(REL): ./standard_pinout.hal
config string '0'
note: MAXV     max: 30.480 units/sec 1828.800 units/min
note: LJOG     max: 30.480 units/sec 1828.800 units/min
note: LJOG default: 0.424 units/sec 25.440 units/min
note: jog_order='XYZ'
note: jog_invert=set([])
Shutting down and cleaning up LinuxCNC...
task: 552 cycles, min=0.000056, max=0.011721, avg=0.009801, 0 latency excursions (> 10x expected cycle time of 0.010000s)
Note: Using POSIX realtime

Removing the kernel module parport_pc results in no entry under /dev
rmurphy@ThinkStation-S20:~$ sudo modprobe -r parport_pc
rmurphy@ThinkStation-S20:~$ ls /dev/par*
ls: cannot access '/dev/par*': No such file or directory

Trying again with cfg="0xe100"
rmurphy@ThinkStation-S20:~$ linuxcnc
LINUXCNC - 2.8.1
Machine configuration directory is '/home/rmurphy/linuxcnc/configs/by_interface.parport.stepper-1'
Machine configuration file is 'stepper_mm.ini'
Starting LinuxCNC...
Found file(lib): /usr/share/linuxcnc/hallib/core_stepper.hal
Note: Using POSIX realtime
Found file(REL): ./standard_pinout.hal
config string '0xe100'
Linux parallel port @57600 not found
Linux parallel port @57600 not found

note: MAXV     max: 30.480 units/sec 1828.800 units/min
note: LJOG     max: 30.480 units/sec 1828.800 units/min
note: LJOG default: 0.424 units/sec 25.440 units/min
note: jog_order='XYZ'
note: jog_invert=set([])
Unexpected realtime delay on task 0 with period 50000
This Message will only display once per session.
Run the Latency Test and resolve before continuing.

Unexpected realtime delay on task 0 with period 50000
This Message will only display once per session.
Run the Latency Test and resolve before continuing.
Shutting down and cleaning up LinuxCNC...
task: 508 cycles, min=0.000051, max=0.012483, avg=0.009782, 0 latency excursions (> 10x expected cycle time of 0.010000s)
Note: Using POSIX realtime

Note that once /dev/parport0 does not exist there are issues. As this is used by hal_parport to retrieve information regarding the parallel port and, crucially to claim exclusive use of that port. This would stop some thinking there was a printer or other device connected and trying to print, which would cause all sorts of issues.

Now, any entries in /etc/modprobe.d/ will not take affect until you reboot.

But we can emulate this behaviour by not having an entry in /etc/modprobe.d/ and loading the modules are selves.

Loading parport_pc requires usually 2 arguments the address and the irq (tho you can get away without the irq argument).

Now before we discuss how to implement this I want you to be sure of what I have explained and if not, ask any questions you may have.
After that we will attempt to load the modules via the command line and try the parallel port tester. Yes I know you have had the parallel port tester work and then Linuxcnc not, which is strange as running a linuxcnc config and the parallel port tester both use hal_parport.
Just for completeness would you be bale to post your current (as of today .ini & .hal files) ?
Last edit: 25 Jun 2021 04:17 by BeagleBrainz.

Please Log in or Create an account to join the conversation.

Moderators: PCWjmelson
Time to create page: 0.130 seconds
Powered by Kunena Forum