Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 7503

Troubleshooting • RPi.GPIO Failed to add edge detection on Pi3 New OS

$
0
0
I ran across this on a Pi 3 with an updated OS (Debian GNU/Linux 12 (bookworm), Linux 6.6.31+rpt-rpi-v8, arm64). The runtime error occurs on

Code:

GPIO.setup(BtnPin, GPIO.IN, pull_up_down=GPIO.PUD_UP)
for any value of BtnPin (using general GPIO pins).

According to the forums this is an issue on Pi 4 or Pi 5, but I'm getting it on Pi3.

I replaced python3-rpi.gpio with python3-rpi-lgpio, and this fixes the issue but creates a new one: I can't stop then restart the app because I then get:

Code:

lgpio.error: 'GPIO not allocated'
The code does GPIO.cleanup() on keyboard interrupt, but apparently doesn't deallocate the GPIO. If I reboot it works until the next time I stop and start the code.

I would prefer to go back to using the original RPi.GPIO library since I'm using it everywhere..

Is the solution not to update the OS on the old Pi 3? Or is there a fix?

Thanks in advance.

Statistics: Posted by DaveSemm — Sun Aug 11, 2024 9:01 am — Replies 0 — Views 26



Viewing all articles
Browse latest Browse all 7503

Trending Articles