This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
SignalK and SSD1306 OLED
#1
I have just worked a bit to make possible read data from SignalK with signalK API and redirect it to OLED screen.
I didnt want to read directly from I2C bus as already openplotter-i2c-read module does  and it sends to signalK.

It was tested on my orange pi 5 plus with i2c bus =2 (/dev/i2c-2) and SSD 1306 OLED screen (i2c device address should be 0x3C).
This is customized solution only for 3 sensors as temperature/humidity and pressure (example).

Idea is simple:
- read data from signalK through API (info.sh)
- format / filter data and prepare log file to display (info.log -> info2.log)
- oled128x64 reads info2.log file and it sends to OLED screen , next after 30 s, it turns it off (main program: sensors.sh)

To clear OLED display, please use: ./oled128x64clear /dev/i2c-2 command.

oled128x64 and oled128x64clear were rewritten and based on https://forum.armbian.com/topic/3747-sh1...y-library/


Attached Files Image(s)
   

.zip   oled_v2.zip (Size: 22.23 KB / Downloads: 27)
Reply
#2
Second version based on some code found in Python.
This time it is designed for OLED 128x32 display.
Idea is similar:
- read data from signalK through API (info.sh)
- format / filter data and prepare log file to display (info.log -> info2.log)
- oled128x32.py reads info2.log file and it sends the line to OLED screen one by one every 15 s and finally it turns the display off (main program: sensors2.sh)

Based on https://www.waveshare.com/wiki/0.91inch_OLED_Module
Please also go there to download Font.ttf which is needed here. Probably it is possible to get ttf fonts from windows and use it also here changing name in oled128x32.py but not tested.
In the file SSD1306.py please adjust too I2C bus number according to your configuration: -> i2c-2  -> SMBus(2)


Attached Files Image(s)
       

.zip   oled2.zip (Size: 3.06 KB / Downloads: 29)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)