Open caternuson opened 2 weeks ago
I had the same problem. I figured out that this was caused by using the RPi.GPIO package, which does not support Raspberry Pi 5. The strange thing is that I found this bug was already fixed by pull request #856. Reinstalling directly from github by pip install git+https://github.com/adafruit/Adafruit_Blinka.git
fixed the problem for me. Somehow pip install Adafruit_Blinka
got the wrong dependency.
Since it's pulling the pin from bcm283x
, it seems like the detector is not correctly IDing the board as a Pi5.
https://github.com/adafruit/Adafruit_Blinka/blob/b91d3fc70bd1599ea50517a390d18a3fc455fc85/src/digitalio.py#L17-L27
Or something else?
(env) pi@raspberrypi:~ $ python3
Python 3.11.2 (main, Aug 26 2024, 07:20:54) [GCC 12.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import digitalio
>>> digitalio.detector.chip.BCM2XXX
True
>>> digitalio.board_id
'RASPBERRY_PI_5'
>>> digitalio.Pin
<class 'adafruit_blinka.microcontroller.bcm283x.pin.Pin'>
>>>
I had the same problem. I figured out that this was caused by using the RPi.GPIO package, which does not support Raspberry Pi 5. The strange thing is that I found this bug was already fixed by pull request #856. Reinstalling directly from github by
pip install git+https://github.com/adafruit/Adafruit_Blinka.git
fixed the problem for me. Somehowpip install Adafruit_Blinka
got the wrong dependency.
For me RPi.GPIO works out of the box on PI 5, install Blinka or rpi-lgpio breaks the GPIO function
There's a hardwired pip install of RPi.GPIO in the installer script: https://github.com/adafruit/Raspberry-Pi-Installer-Scripts/blob/ad19b39863503ce5edf76cfff1334ccad388c03d/raspi-blinka.py#L95 which may be interfering with the rpi-lgpio install?
https://pypi.org/project/rpi-lgpio/
You cannot install rpi-lgpio and rpi-gpio (aka RPi.GPIO, the library it emulates) at the same time, in the same Python environment. Both packages attempt to install a module named RPi.GPIO and obviously this will not work.
There's a hardwired pip install of RPi.GPIO in the installer script: https://github.com/adafruit/Raspberry-Pi-Installer-Scripts/blob/ad19b39863503ce5edf76cfff1334ccad388c03d/raspi-blinka.py#L95 which may be interfering with the rpi-lgpio install?
https://pypi.org/project/rpi-lgpio/
You cannot install rpi-lgpio and rpi-gpio (aka RPi.GPIO, the library it emulates) at the same time, in the same Python environment. Both packages attempt to install a module named RPi.GPIO and obviously this will not work.
So how to install blinka without rpi-lgpio as RPI.GPIO works out of the box now on PI 5?
Tested above by manually uninstalling RPi.GPIO:
(env) pi@raspberrypi:~ $ pip3 uninstall RPi.GPIO
Found existing installation: RPi.GPIO 0.7.1
Uninstalling RPi.GPIO-0.7.1:
Would remove:
/home/pi/env/lib/python3.11/site-packages/RPi.GPIO-0.7.1.dist-info/*
/home/pi/env/lib/python3.11/site-packages/RPi/*
Proceed (Y/n)? y
Successfully uninstalled RPi.GPIO-0.7.1
And then it works:
(env) pi@raspberrypi:~ $ python3
Python 3.11.2 (main, Aug 26 2024, 07:20:54) [GCC 12.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import board
>>> import digitalio
>>> pin = digitalio.DigitalInOut(board.D4)
>>>
So how to install blinka without rpi-lgpio as RPI.GPIO works out of the box now on PI 5?
@MGPhil You don't. There's an installation issue (and maybe more) that needs to be fixed. Currently investigating and documenting here. This is not a user issue. It needs to be fixed by Adafruit.
@caternuson OK then I wait for the fix, just saying I postet that issue in the adafruit forum and debugged a lot before that post. As I found out RPi.GPIO works out of the box on PI 5 for me and thats why rpi.lgpio which is installed with blinka breaks both.
however happy waiting for you devs to fix that issue, thanks a lot for that great work and great library
Board Name
Pi 5
Steps
Follow the guide for initial setup: https://learn.adafruit.com/circuitpython-on-raspberrypi-linux/installing-circuitpython-on-raspberry-pi and then run the blinkatest.py script.
Description
The installation runs without issue. But when the blinkatest.py script is run, get the following error:
Additional information
Related forum post: https://forums.adafruit.com/viewtopic.php?t=214687