Pi5 Penta HAT on PI 5 - 2 installation issues - HAT OLED

Followed all steps according to wiki
with PI Imager clean installation
then https://docs.radxa.com/en/accessories/penta-sata-hat/sata-hat-top-board last step
sudo apt install -y ./rockpi-penta-v0.2.deb
shows errormessage

WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. 
It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
Created symlink /etc/systemd/system/multi-user.target.wants/rockpi-penta.service → /lib/systemd/system/rockpi-penta.service.
N: Download is performed unsandboxed as root as file '/home/pi/rockpi-penta-v0.2.deb' couldn't be accessed by user '_apt'. - pkgAcquire::Run (13: Permission denied)

OLED does not show any (welcome) message
sudo systemctl restart rockpi-penta.service
journactl states

Jul 20 10:15:35 pi5 systemd[1]: Started rockpi-penta.service - Rockpi SATA Hat.
Jul 20 10:15:35 pi5 sudo[3351]: pam_unix(sudo:session): session closed for user root
Jul 20 10:15:35 pi5 python3[3355]: Traceback (most recent call last):
Jul 20 10:15:35 pi5 python3[3355]:   File "/usr/bin/rockpi-penta/main.py", line 10, in <module>
Jul 20 10:15:35 pi5 python3[3355]:     import oled
Jul 20 10:15:35 pi5 python3[3355]:   File "/usr/bin/rockpi-penta/oled.py", line 33, in <module>
Jul 20 10:15:35 pi5 python3[3355]:     disp = disp_init()
Jul 20 10:15:35 pi5 python3[3355]:            ^^^^^^^^^^^
Jul 20 10:15:35 pi5 python3[3355]:   File "/usr/bin/rockpi-penta/oled.py", line 27, in disp_init
Jul 20 10:15:35 pi5 python3[3355]:     disp = adafruit_ssd1306.SSD1306_I2C(128, 32, i2c, reset=digitalio.DigitalInOut(RESET))
Jul 20 10:15:35 pi5 python3[3355]:                                                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Jul 20 10:15:35 pi5 python3[3355]:   File "/usr/local/lib/python3.11/dist-packages/digitalio.py", line 193, in __init__
Jul 20 10:15:35 pi5 python3[3355]:     self.direction = Direction.INPUT
Jul 20 10:15:35 pi5 python3[3355]:     ^^^^^^^^^^^^^^
Jul 20 10:15:35 pi5 python3[3355]:   File "/usr/local/lib/python3.11/dist-packages/digitalio.py", line 223, in direction
Jul 20 10:15:35 pi5 python3[3355]:     self._pin.init(mode=Pin.IN)
Jul 20 10:15:35 pi5 python3[3355]:   File "/usr/local/lib/python3.11/dist-packages/adafruit_blinka/microcontroller/bcm283x/pin.py", line 40, in init
Jul 20 10:15:35 pi5 python3[3355]:     GPIO.setup(self.id, GPIO.IN)
Jul 20 10:15:35 pi5 python3[3355]: RuntimeError: Cannot determine SOC peripheral base address

Please support how to fix.

Regards
Michael

Disclaimer:
The modifications in this article are based on my experiences and if you find them useful to use you do so at your own risk.

The HATs OLED on Pi5 is working great (with fan and key) and no more journalctl messages after replacing that lines in oled.py.

original oled.py

RESET = getattr(board.pin, os.environ['OLED_RESET'])
i2c = busio.I2C(getattr(board.pin, os.environ['SCL']), getattr(board.pin, os.environ['SDA']))
disp = adafruit_ssd1306.SSD1306_I2C(128, 32, i2c, reset=digitalio.DigitalInOut(RESET))

modified oled.py (seems there is an issue with os.version() reading values of env/rpi5.env)

RESET = getattr(board.pin, 'D23')
i2c = busio.I2C(getattr(board.pin, 'SCL'), getattr(board.pin, 'SDA'))
disp = adafruit_ssd1306.SSD1306_I2C(128, 32, i2c, reset=None)

Regards
Michael

1 Like