Odroid N2 OLED I2C / SPI driver

There will come dtb-xml what is able to handle such user dtb settings.

1 Like

While there is a solution to this problem planned in the future, A possible solution in the meantime is
to add something like this to your autostart.sh file.

if [ $(cat /storage/.config/boot.hint) == "UPDATE" ]; then
  mount -o remount,rw /flash
  fdtput -t s /flash/dtb.img /soc/cbus@ffd00000/spi@13000/spidev@0 status ā€œokayā€
  fdtput -t s /flash/dtb.img /soc/cbus@ffd00000/spi@13000 status ā€œokay
  mount -o remount,ro /flash
fi

This will make the changes to the dtb after an update for you. You will still need to reboot for the changes to take effect, but this makes it much easier to deal with. Keep in mind that you donā€™t want to add the reboot command to this since that would cause a boot loop.

Thatā€™s an excellent temporary solutionā€¦Iā€™m going to do so. Thanks !

I have a SH1106 OLED 128x64 IIC display that I wanted to try with my ODROID N2, but it seems that the I2C address choice is limited to 0x78 or 0x7A and your addon only has 0x3C or 0x3D. Any means of circumventing this issue ?

@RAMALPHA, Iā€™ll add 0x78 and 0x7A as address options to the add-on. I wont get time to do that until the weekend so in the mean time if you want to test your display then simply edit /lib/settings.py

Change line 46 to read:-
return 0x78

Thanks roidy. I just tried. It works partially. The clock is displayed correctly. But when I watch a video, the screen turns off completely for the duration of the video, but the display with the duration of the video as well as the icons reappear for about a second when I press the STOP button, then back to the clock.
But it does not matter I will receive another compatible model tomorrow. Anyway I think Iā€™ll go for a 128 x 32 which will be easier to fit into the small plastic case.

0x78 and 0x7A are equivalent to 0x3C and 0x3D respectively.
The address with the ā€œhigherā€ value simply includes an extra bit.
The SH1106 differs from the SSD1306, in that itā€™s a 132x64 controller, and requires an X axis offset in order for the image to be displayed on it properly, in addition to a few other differences.
You can look at it as a SH1106 having a sub-set of capabilities of the SSD1306.

Yep it seems 0x78 and 0x7A are in the reserved address space.

Yep the add-on has different display routines for each chipset. The SH1106 needs to have the display page increased as you write data to it where as the SSD1306 you set the column address and the page then write the display data it in one continuous block.

1 Like

Hello

Using this nice driver, works perfectly with the SPI display, the only thing I am missing is that when I change the audio stream it do not updates the display, for instance if I change from a DD stream to a DTS one display keeps displaing DD, is this normal or I am missing something?

Sorry if already answered, I didnā€™t find the info in the thread.

Thanks for the good work

The stream information is only read when the video is first started so changing audio tracks during playback wont update the display, it should be an easy fix to periodically recheck the stream info and update it if the audio track has changed. Iā€™ll look into fixing this :+1:

@pviader These changes have now been added. Audio codec and channel count should update during playback, please grab v0.1.8 from github and test that the changes are working for you.

Wow, thatā€™s fantastic, many thanks, will test ASAP

Unfortunately it fails on start, will check the log tomorrow (now it is quite late in Spain), might be because I am using SSD1309.

Working perfectly here on both SSD1306 I2C and SSD1309 SPI displays.

Donā€™t forget for SPI displays everytime you update CoreELEC you need to reactivate SPI.

mount -o remount,rw /flash
fdtput -t s /flash/dtb.img /soc/cbus@ffd00000/spi@13000/spidev@0 status "okay"
fdtput -t s /flash/dtb.img /soc/cbus@ffd00000/spi@13000 status "okay"
reboot

Indeed, it was coincident with a new CoreELEC version, works perfectly, really sorry for the misslead

1 Like

No problem, glad itā€™s working :+1:

It seems that the update is not automatic to new versions, even if the option is enabled in the configuration menu.

No, add-on updates are only automatic if they are installed from a repo.

I donā€™t have a repo so the add-on can only be updated manually by downloading the new zip from github and installing.

This looks great, roidy!!

I recently started a thread regarding an OLED front panel display, hoping to be able to leverage mpd_oled for a spectrum display:

https://discourse.coreelec.org/t/graphical-front-panel-display/12932

Your information display looks great, though, and would be a fine alternative (if I canā€™t figure out a path for audio data and getting the FFT accomplished).

Three hopefully quick questions for you, roidyā€¦

  • Does the addon support SSD1309-based displays? The github page README only mentions SSD1306 and SH1106, but I see commits mentioning the SSD1309.

  • Is the SSD1309 support for SPI only or would it also work with an I2C device?

  • What exactly are the mechanics of installing a service add-on in Kodi? Would I just place a copy, straight from github in, say, the download directory and (via Kodiā€™s gui) add it from there? If I want to try out changes, can I edit files in place or do I need to re-install the service?

Iā€™m impressed that the addon is solely in Python. Hopefully, I can figure out if all of the requisite (OS level) supporting /dev files are present for the Odroid C2/C4.

Thanks!
Matt

  1. Yes. SSD1306 and SH1106 are only supported using I2C and SSD1309 is only supported using SPI. Mainly because those were the only displays I had at hand to test with.

  2. Yes, SSD1309 support is only SPI. But I2C could probably be added.

  3. Yes, exactly the same as installing any other kind of add-on. Download the zip file from github and in Kodi use the install from zip option. Once installed changes can be made in place, no need to keep reinstalling, however you do need to go to the add-ons info page and disable and re-enable it for the changes to reload.