geeekpi / cm4routerboard

Raspberry Pi Computer Module 4 internet extand board firmware and config files
MIT License
14 stars 1 forks source link

OLED display requires tweaks before it will function #3

Open geerlingguy opened 2 years ago

geerlingguy commented 2 years ago

With a fresh image of openwrt-bcm27xx-bcm2711-rpi-4-ext4-with_oled096_factory.img.gz, the OLED display is blank. If I visit the OLED configuration page inside LuCI, I see "OLED NOT RUNNING".

I had to follow the steps from this comment (https://github.com/NateLol/luci-app-oled/issues/10#issuecomment-922245476) to get it working:

  1. Add the following to /boot/config.txt under [All]: dtoverlay=i2c-gpio,i2c_gpio_sda=2,i2c_gpio_scl=3,i2c_gpio_delay_us=2,bus=1
  2. Run chmod 755 /etc/init.d/oled
  3. Reboot
  4. Go to the OLED settings page, check 'Enable', and click Save & Apply

And now I can see display output on the OLED display.

Is this supposed to work out of the box? And if so, should the default be 'Enabled' in OpenWRT's interface, too?

nicolas314 commented 2 years ago

Default image has /dev/i2c-1 but /usr/bin/oled is compiled with /dev/i2c-0. Adding a symbolic link works. To make it persistent, easiest is to add to the start() function in /etc/init.d/oled: ln -s /dev/i2c-1 /dev/i2c-0

daleking commented 10 months ago

See here: https://github.com/NateLol/luci-app-oled/issues/10#issuecomment-1873114563 to use the hardware i2c driver not the bit-banged gpio driver to save a bit of system cpu time.