RPI4 Raspbian 64 bit & LinuxCNC
- rodw
- Away
- Platinum Member
- Posts: 10711
- Thank you received: 3533
Andy as you noted in the GitHub issue, the solution is to use gpiod and rewrite Linuxcnc to use it. In fact it probably should have been used with Linuxcnc 2.8 as the addition of gpiod to the kernel was done before the release of Debuan Buster.
This is now superceded as its in the 2.9 documents now.
Please refer to this link instead. linuxcnc.org/docs/2.9/html/getting-start...etting-linuxcnc.html
Following this recipe I have LinuxCNC running on a Pi.
However, this install does not appear to have access to the GPIO.
On Raspbian there is a file /dev/gpiomem but that isn't created on a normal Bookworm installation.
The hal_pi_gpio module uses this to access the gpio, and won't load without it.
Please Log in or Create an account to join the conversation.
- andypugh
- Offline
- Moderator
- Posts: 23537
- Thank you received: 4852
I have a problem with a new pi4b.
hal_pi_gpio refuses to load. It states Revision 7 is not supported.
Is there a solution for this?
Yes, but I don't know how to get the fix to you, unless you can build LinuxCNC from source?
If you can, then check out the andypugh/hal_pi_gpio branch and compile it. (I am working on it right now, currently adding missing docs)
Please Log in or Create an account to join the conversation.
- rodw
- Away
- Platinum Member
- Posts: 10711
- Thank you received: 3533
Andy, I think your branch is on the wrong track. I don't think you should be parsing config filesIf you can, then check out the andypugh/hal_pi_gpio branch and compile it. (I am working on it right now, currently adding missing docs)
Instead you should be using the gpiod.h API functions.
git.kernel.org/pub/scm/libs/libgpiod/lib...tree/include/gpiod.h
there are some examples here.
git.kernel.org/pub/scm/libs/libgpiod/libgpiod.git/tree/examples
Please Log in or Create an account to join the conversation.
- andypugh
- Offline
- Moderator
- Posts: 23537
- Thank you received: 4852
Yes, maybe someone should re-write the entire driver but there is no guarantee that gpiod is fast enough, and it's a bigger job than the simple bug-fix that I picked up from the issues list.
It would also be good to pick up the "reset" fixes that were posted here a while back too.
But, first, lets just make it work on the current Pi models then look at major re-writes later.
Please Log in or Create an account to join the conversation.
- elovalvo
- Offline
- Elite Member
- Posts: 199
- Thank you received: 125
I have a problem with a new pi4b.
hal_pi_gpio refuses to load. It states Revision 7 is not supported.
Is there a solution for this?
forum.linuxcnc.org/24-hal-components/495...by-hal-pi-gio#275572
Please Log in or Create an account to join the conversation.
- elovalvo
- Offline
- Elite Member
- Posts: 199
- Thank you received: 125
Some additional information:
I installed xrdp on the RPi.
The ifconfig terminal command outputs 3 sections; etho, lo and wlan0.
The eth0 section contains this line:
inet 192.168.0.111 netmask 255.255.255.0 broadcast 192.168.0.255
On my Windows machine I opened the Remote Desktop application, entered “192.168.0.111” in the PC name field, with username linuxcnc and password cnc.
But when I connect I only see a blue greenish empty screen.
After a couple of minutes it shows a "Connection Log" (first photo), when I click the Ok button it opens the "Login to raspberrypi" window (second photo), but entering my username/password brings me back to the empty screen for a couple of minutes, until the "Connection Log" window appears again.
Rather than using the Windows Remote Desktop, I prefer to use MobaXterm
mobaxterm.mobatek.net/
Please Log in or Create an account to join the conversation.
- itsme
- Offline
- Senior Member
- Posts: 78
- Thank you received: 21
I was able to resolve the issue with a workaround proposed by elovalvo in the other topic...
I have a problem with a new pi4b.
hal_pi_gpio refuses to load. It states Revision 7 is not supported.
Is there a solution for this?
forum.linuxcnc.org/24-hal-components/495...by-hal-pi-gio#275572
Please Log in or Create an account to join the conversation.
- techroo
- Offline
- New Member
- Posts: 2
- Thank you received: 0
Im trying to modify a small milling machine to CNC using LinuxCnc and Rtelligent EtherCat Closed loop stepper drivers.
New to Linux and i am finding it out the hard way trying to get ethercat to work on my raspi 4B.
I tried following the Installation notes by Hakan ( forum.linuxcnc.org/ethercat/42048-notes-...at-on-raspberry-pi-4) but version 2.8.1 does not boot with the "start4.elf is not compatible. This board requires newer software" error.
It then tried the 2.9.0 image posted by elovalvo on page 16 of this thread. This one booted no problem.
The problem is the dkms_build failing and me not knowing what exactly goes wong.
If there is anyone who can spare an image of 2.9.0 with ethercat installed im really interested.
Please Log in or Create an account to join the conversation.
- rodw
- Away
- Platinum Member
- Posts: 10711
- Thank you received: 3533
There is an ethercat Deb for that
Can you follow these instructions I did here
forum.linuxcnc.org/ethercat/45336-etherc...step-by-step?start=0
Where I said Create an ethercat sources file can you change Debian_12 to Raspbian_11
Everything else should work.
Note this method has only been updated on 10 August (3 days ago) following final release of Deb files by the iGh EtherCAT team to their mainline repositories. Using it to run on a Pi is untested but from what I see, it should work.
Please report back on the thread I linked to with your feedback. Once its confirmed working, I will update the instructions.
Note in the instructions, there is a link to my git repo with a xml file for the rtelligent stepper drives you can use. There is also a hal file too.
Note that ethercat is very advanced and adds an order of complexity to a Linuxcnc config. Then to add a raspberry Pi into the mix adds a whole new level of complexity and likely disappointment into the mix.
Please Log in or Create an account to join the conversation.
- techroo
- Offline
- New Member
- Posts: 2
- Thank you received: 0
I am beginning to see the complexity of trying to use a pi and ethercat together.
I am running into trouble with the Raspbian_11 repositories only containing the armhf packages, not the arm64 ones. Debian_12 does have these but runs into libc6 version dependency issues.
I added deb debian12 repo to try and grab compatible versions but run into more dependency issues.
For now i will do my install on a spare PC.
Please Log in or Create an account to join the conversation.