Penta sata on bullseye - can't make oled to work

Hi everyone,

I just got the penta sata hat and I’ve installed omv 6 on Bullseye.
I managed to install librmaa by compiling it and the fan is working fine.

I have now trouble with the OLED screen. I did run
curl -sL https://rock.sh/get-rockpi-penta | sudo -E bash
but as I believe there is only a repo for buster I get some errors.

Moreover I saw on github that Adafruit_SSD1306 is deprecated and we should be using circuit pyhton as stated in the repo and here

So I don’t know why my OLED is not working and I need some help to figure that out. Is it because of a missing conf file or because of the deprecated library.

I’ve got few python skills but I’m a total newbie at circuit and GPIO thingy. Willing to help anyway

Here is the error I get :
python3 oled.py
Traceback (most recent call last):
File “/usr/bin/rockpi-penta/oled.py”, line 28, in
disp = disp_init()
File “/usr/bin/rockpi-penta/oled.py”, line 22, in disp_init
disp = Adafruit_SSD1306.SSD1306_128_32(rst=None, i2c_bus=7)
File “/usr/local/lib/python3.9/dist-packages/Adafruit_SSD1306/SSD1306.py”, line 287, in init
super(SSD1306_128_32, self).init(128, 32, rst, dc, sclk, din, cs,
File “/usr/local/lib/python3.9/dist-packages/Adafruit_SSD1306/SSD1306.py”, line 85, in init
self._gpio = GPIO.get_platform_gpio()
File “/usr/local/lib/python3.9/dist-packages/Adafruit_GPIO/GPIO.py”, line 426, in get_platform_gpio
raise RuntimeError(‘Could not determine platform.’)
RuntimeError: Could not determine platform.

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
      File "/usr/bin/rockpi-penta/oled.py", line 32, in <module>
        disp = disp_init()
      File "/usr/bin/rockpi-penta/oled.py", line 22, in disp_init
        disp = Adafruit_SSD1306.SSD1306_128_32(rst=None, i2c_bus=7)
      File "/usr/local/lib/python3.9/dist-packages/Adafruit_SSD1306/SSD1306.py", line 287, in __init__
        super(SSD1306_128_32, self).__init__(128, 32, rst, dc, sclk, din, cs,
      File "/usr/local/lib/python3.9/dist-packages/Adafruit_SSD1306/SSD1306.py", line 85, in __init__
        self._gpio = GPIO.get_platform_gpio()
      File "/usr/local/lib/python3.9/dist-packages/Adafruit_GPIO/GPIO.py", line 426, in get_platform_gpio
        raise RuntimeError('Could not determine platform.')
    RuntimeError: Could not determine platform.

Hello, please have a try:

sudo pip3 uninstall Adafruit_GPIO
curl -sL https://rock.sh/get-rockpi-penta | sudo -E bash

Also, please tell me the printing of the following command:

python3 -c 'import mraa;print(mraa.getPlatformName())'

And here come’s MAGIC Setq. It’s just all working fine.
The output : ROCK Pi 4
Thanks a lot for your help.
BTW, your script could not find libmraa but as I did compile it before, it still works.

How were you able to get this work without Radax’s repo for radxarockpi4b-rk-u-boot-latest & rockpi4-dtbo?

I was under the impression if you’re using the penta hat. You’re stuck with Buster.

@Fred_Tep how did you manage to run fan?
I am also on armbian bullseye and my oled works but my fan not.
I am struggling for weeks. :frowning:

Sorry for the super late answer.
Try to modify /usr/bin/rockpi-sata/fan.py ; comment the first and add the second
#gpio = pigpio.pi(host=host)
gpio = pigpio.pi(‘localhost’,8888)
Hope it helps