-
Notifications
You must be signed in to change notification settings - Fork 398
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
🐛 | bookworm/kernel 6.6 GPIO: Failed to add edge detection #2313
Comments
Hi, currently there is no immediate solution, other then using bullseye. The linked discussion suggests swapping the pirc lib, so you could try this by uninstalling the old one and install from the linked repo. But we need to look into it, cause at least the buttons should work in v3. |
Here is what I did: Use system lgpio (because the version on pypi is too old):
Configure Jukebox gpio.yaml to use LGPIO for buttons: pin_factory:
# Default is RPi.GPIO, which can't handle buttons on kernel 6.6+ anymore:
type: lgpio.LGPIOFactory Replace PIRC522 by PIRC522-gpiozero:
You could also try to replace the broken RPi.GPIO by the following shim. I haven't tested it though. It might still need the above lgpio changes, but it should make the other changes redundant: |
@hoffie Thanks, I can confirm that your instructions work, my rfc 522 reader works again 🎉 ! |
I wonder if it would make sense to create a |
I tend to the lgpio and the rc522 gpiozero solution, because I think while the shim might be the most non-intrusive solution right now I'm not sure, if this will work as a long term solution. Don't know what others think here? @hoffie, did you make a PR to the rc522, so this fix may be included? |
Not yet, because the changes seemed a bit too fundamental. I'll try to find some time in the coming days. |
Real life always comes first ;) |
So I can confirm @hoffie second solution by simple uninstalling python package rpi-gpio and instlling rpi-lgpio instead via pip to make rfid reader rc522 work again with latest linux kernel 6.6.28 on Raspbian Bookworm with RPI4:
Maybe the best option would be always using rpi-lgpio package moving forward? |
Right now I think using the shim Only question to @pabera or @AlvinSchiller: I would like to use a RPi.GPIO uninstall command to make it more robust, where would be a good place in the installation scripts? |
For v2 this could be done right before the apt installation. |
Hello, I'm now trying to install it on a bookworm, and rfid works after I've replaced With two issues that I'm not sure why it's happening:
Same setup worked on raspberry 1 with previous version of raspberry os (so all gpio buttons & rfid reader), but now I've changed it with raspberry 3B+ and installed also 64 bit OS. I know you're mentioning, that we should use 32 bit version, but since all other things are working on 64 bit os, I don't see why this should not. For installation on 64 bit i removed checks in install script and it (mostly) worked. Any ideas would be appreciated. |
Can you post your gpio.yaml (assuming you use V3) and the logs?
Ntags don't work at the moment. See #2373 |
Are you sure that the NTAGs also worked with the previous setup? That wouldn't match our observation. |
Now I'm not sure anymore :) It definitely worked on v2, but when I've installed v3 I'm no longer sure, since on raspi 1 it never worked nicely (web interface didnt respond well) and I assumed, this was due to lack of power on raspi1. So afterwards it was never fully in use, until I've now stated playing around with raspi3. |
Sure:
Here's also app.log: |
I think the changed factory is not needed if you only swapped the libs. Can you try with the "old"/original? |
Tried. Same result. Should I also try to replace libs as suggested in first comment? #2313 (comment) |
No, as your reader works.... |
Is there anything else I could provide, just to get some ideas what's going on? Or any direction in which I could be looking. One thing I forgot to metion is, that I've did an install directly from |
Did you activate GPIO in jukebox.yaml? Line 106:
|
Oh. 🙈 Of course, this was the reason. Thanks for this, this was a very obvious mistake. So with this out of the way, I can confirm v3 is working as it should on raspberian 64bit bookworm (raspberry 3B+), so I guess this limitation could be removed from setup, right? |
Cool! Thanks for trying 64 bit Bookworm. So we will figure out how to handle 64bit in the future. |
I just took another stab at this on a pi zero w (armv6l) and the I tested installing I'm going to see if I can get this working within the proper venv using symlinks + the shim and will update here with my results. Update: confirmed that creating symlinks for lgpio from the system python library into the project venv was enough to be able to install rpi-lgpio. So, right now, for armv6l platform on bookworm, this workaround should be helpful: systemctl --user stop jukebox-daemon
cd; source RPi-Jukebox-RFID/.venv/bin/activate
pip uninstall rpi-gpio
ln -s /usr/lib/python3/dist-packages/lgpio.py /home/pi/RPi-Jukebox-RFID/.venv/lib/python3.11/site-packages/lgpio.py
ln -s /usr/lib/python3/dist-packages/lgpio-0.2.2.0.egg-info/ /home/pi/RPi-Jukebox-RFID/.venv/lib/python3.11/site-packages/lgpio-0.2.2.0.egg-info
ln -s /usr/lib/python3/dist-packages/_lgpio.cpython-311-arm-linux-gnueabihf.so /home/pi/RPi-Jukebox-RFID/.venv/lib/python3.11/site-packages/_lgpio.cpython-311-arm-linux-gnueabihf.so
pip install rpi-lgpio
deactivate
systemctl --user start jukebox-daemon |
I am using Debian GNU/Linux 12 (bookworm) on Raspberry Pi 5, I had cloned the branch pi-rc522-gpiozero and ran the setup.py in it. I have uninstall rpi-gpio and install rpi-lgpio. I connected the RC522 module to the pi and ran the example code. Nothing happens, no card is detected. Pi5 is 64bits. |
Hello, i stumbled accross the issue as well on my RP4 running 32bit First i thought my wiring is wrong, so i followed a tiny tutorial (https://www.youtube.com/watch?v=evRuZRxvPFI) from there i tested these two scripts. |
Hello, I made a testfile that get my reader working. RPi-Jukebox-RFID/src/jukebox/components/rfid/hardware/rc522_spi/rc522_spi.py |
Version
3.5.2
Branch
future/main
OS
RPI OS bookworm lite - 32bit
Pi model
3 B+
Hardware
What happened?
After a fresh install of RPI OS bookworm lite, 32-bit with latest
future/main
, the GPIO buttons and the RFID reader stopped working (They worked before with the same configuration on an older 2.x installation on RPI OS bullseye).I saw this discussion thread which confirms this issue, but I wanted to create a dedicated issue for it, to not bloat the discussion topic too much since it covers also other issues of a bookworm/future/main installation.
I can see this relevant log entry:
In the discussion Sharing tips for future3 on bookworm/kernel 6.6 and upstreaming fixes #2295 @hoffie pointed out possible ways forward but I am missing concrete instructions know how to actually fix this issue on my current installation. Any help welcome, thanks already !
Logs
app.log
errors.log
INSTALL-1710188086.log
Configuration
rfid.yaml.txt
jukebox.yaml.txt
gpio.yaml.txt
More info
No response
The text was updated successfully, but these errors were encountered: