adafruit / Raspberry-Pi-Installer-Scripts

381 stars 160 forks source link

blinkatest.py fails on Pi 5 #323

Closed mikeysklar closed 1 month ago

mikeysklar commented 1 month ago

Script Command

GPIO has changed on the Pi 5. Currently Bookworm 64-bit Lite fails to run blinkatest.py with the following error. 

$ python3 blinkatest.py
Hello, blinka!
Traceback (most recent call last):
  File "/home/pi/blinkatest.py", line 8, in
    pin = digitalio.DigitalInOut(board.D4)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/pi/env/lib/python3.11/site-packages/digitalio.py", line 193, in __init__
    self.direction = Direction.INPUT
    ^^^^^^^^^^^^^^
  File "/home/pi/env/lib/python3.11/site-packages/digitalio.py", line 223, in direction
    self._pin.init(mode=Pin.IN)
  File "/home/pi/env/lib/python3.11/site-packages/adafruit_blinka/microcontroller/bcm283x/pin.py", line 40, in init
    GPIO.setup(self.id, GPIO.IN)
RuntimeError: Cannot determine SOC peripheral base address

This resolves it.

sudo apt remove python3-rpi.gpio
pip3 install rpi-lgpio
$ python3 ./blinkatest.py
Hello, blinka!
Digital IO ok!
I2C ok!
SPI ok!
done!

I'll look into a PR for raspi-blinka.py used to setup the blinka env.



### Operating System

64-bit Lite Bookworm

### Hardware

Pi 5

### Behavior

.

### Description

.

### Additional information

Based on [forum issue](https://forums.adafruit.com/viewtopic.php?t=213519) from @bonclay. 
ladyada commented 1 month ago

ok yah can you open a PR for me to review please 🙏 and tag me in a comment

mikeysklar commented 1 month ago

will do.

On Fri, Sep 20, 2024 at 8:55 AM ladyada @.***> wrote:

ok yah can you open a PR for me to review please 🙏 and tag me in a comment

— Reply to this email directly, view it on GitHub https://github.com/adafruit/Raspberry-Pi-Installer-Scripts/issues/323#issuecomment-2364042053, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAPFI5FV6Y3V6M6GRML54VTZXRAPXAVCNFSM6AAAAABOQS5E7KVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGNRUGA2DEMBVGM . You are receiving this because you authored the thread.Message ID: @.***>

mikeysklar commented 1 month ago

PR# 324 tested on Pi4 and Pi5. Getting a clean blinkatest.py after running raspi-blinka.py on both models. Running Bookworm 64-bit Lite.