Just wanted to show my $3,50 OLED-display

Hi,

I just installed an OLED-display on my feeding computer, maybe this is also interesting for other feeders. These cheap OLED displays are available from AliExpress and other chinese shops, they cost around $3,50 to $4 and are available in yellow/blue (top part is yellow, bottom is blue) or white. The display is tiny and has only 128x64 pixels, but sending data is very simple. The OLED is able to display TTF-fonts, lines, circles, squares etc. and also images. No soldering is necessary, just 4 female2female breadboard-wires.

I use the OLED-display on my Odroid C1+, it just sticks on the USB port with some velcro:

http://i.imgur.com/aoAPBpyh.jpg
This is #15218


Just search for “OLED I2C” on Aliexpress/Banggood/DX.

I use this Library: https://github.com/rm-hull/ssd1306.

Klaus

Looks like you have a different way to power your PI as well. Very interesting!

Cheers!
LitterBug

Oh wait! That's not a Pi either!

Nifty! Care to share the code on how you got the stats displayed? I’d love to set this up, and I’m sure I’m not alone.

Not the nicest code, but it works. This is the part to actually send data to the OLED:

fivelines.py:


#!/usr/bin/env python

import sys

from oled.device import ssd1306, sh1106
from oled.render import canvas
from PIL import ImageFont

font = ImageFont.load_default()
device = ssd1306(port=1, address=0x3C)

with canvas(device) as draw:
    x = 2
    top = 0

    font = ImageFont.truetype('/opt/ssd1306/examples/alert.ttf', 12)

    draw.text((x, top+0),    sys.argv[1], font=font, fill=255)
    draw.text((x, top+13),   sys.argv[2], font=font, fill=255)
    draw.text((x, top+26),   sys.argv[3], font=font, fill=255)
    draw.text((x, top+39),   sys.argv[4], font=font, fill=255)
    draw.text((x, top+52),   sys.argv[5], font=font, fill=255)

You can simply output data by executing “./fivelines.py line1 line2 line3 line4 line5” and you will get five lines on the display. I wrote a Bash-script (don’t like Python, it’s easier to collect the data with bash) to call fivelines.py:

oled.pl


#!/bin/bash

aircraftjson=/run/dump1090-mutability/aircraft.json
hexdbdaily=/usr/share/dump1090-mutability/dbicao24/hexdb-`date +%Y%m%d`.txt
icaocount=/usr/share/dump1090-mutability/dbicao24/icaocount.txt
tempjson=/tmp/pretty.json

# Line 1
line1="`date +'%d.%m.%Y - %H:%M:%S'`"

# Line 2
icaocount=`cat $icaocount`
seentoday="`wc -l $hexdbdaily | cut -d ' ' -f 1`" 

# Line 3
cat $aircraftjson | json_pp -f json -t dumper -json_opt pretty > $tempjson

acmes=`cat $tempjson | grep "messages" | wc -l`
accat=`cat $tempjson | grep "category" | wc -l`
acpos=`cat $tempjson | grep "seen_pos" | wc -l`

# Line 4
up=`uptime | sed -E 's/^^,]*up *//; s/, *:digit:]]* users.*//; s/min/minutes/; s/(:digit:]]+):0?(:digit:]]+)/\1 hrs, \2 min/'`

# Line 5
cpu=`top -bn1 | grep "Cpu(s)" |            sed "s/.*, *\([0-9.]*\)%* id.*/\1/" |            awk '{print 100 - $1"%"}'`

/usr/share/dump1090-mutability/dbicao24/fivelines.py "$line1" "$seentoday A/C Today ($icaocount)" "$acmes/$accat/$acpos A/C Now" "Up: $up" "CPU: $cpu"

This is just to get an idea how it works, the stuff for line 2 won’t work on your system.

Of course you can play with number of lines and font-size:

Klaus

Hi Klaus,
Very nice little display , great functionality.
Like the neat scripting too.

Regards,
Mike.

Hallo Klaus, woher hast du dein Display gekauft? Aliepress? Oder woher

gruß Rainer

AliExpress (“Schneller Ali”)

gut dann werde ich mich da wohl mal anmelden müssen :wink:
Lieferzeit?

4 bis 5 Wochen, manchmal schneller, manchmal langsamer.

Wenn es schnell gehen soll, für 13,- € gibt das auch bei Amazon mit Prime Versand (http://goo.gl/MxavD2).

Danke dir :wink:

Very cool! Thanks for sharing. I will have to buy one now 8)

Hey thanks for sharing the code! Gonna give it a shot soon. You’re the man!


Very Cool!

I was trying to get the “seen today” you have set up working, I found your code for logging the ICAO to a database. I figure I can set up something to rotate the DB file and then just count the rows in today’s file - but I’m not there yet. perhaps soon.

IDK if you found the same thing, but it seemed like a significant amount of RF noise was coming from the i2c wires. Wrapping them in foil tape sure seemed to help.

I guess as my first post on the forum i should say hi first:
Hi
Anyway:

I was partway into trying to/adding OLED to my ADS-B Pi when i found this thread.
I did finally manage it though.

My aim was a little different and much less useful than showing the stats on screen…

It is effectively a super tiny radar screen!

The plot on the left shows planes relative to the location of the receiver. (Updated once a second) This is scalable so a larger or smaller area can be shown on the screen.
On the right, at the bottom, the number of planes on the screen and the total number of planes are shown.
Top right provides info about close-by planes. Unfortunately due to the time of day (and lack of planes) you can’t see the full functionality; when a plane is close-by, it displays the name of the flight and the distance from the receiver.

Finally, I would like to a huge thanks to those who have posted code, this was my introduction into python programming and having code to (butcher) use as a basis for this project was super helpful!

Edit: Re-scaled image, Apologies to anyone who got the unscaled image version!

Very nice!

In the meanwhile I implemented lirc (infrared control) to my setup, luckily the Odroid C1 I’m using has a build in IR sensor. I use an old TV remote to switch between different “screens” on the OLED and to reboot or halt the system.

Thanks for the ideas sesom!

Last night I got the screen working and the remote. I just need to figure out how to suppress output from the remote to the command line when a remote button bound to say KEY_1 is pressed. I also need to work on data to display. Was getting late only got the current aircraft count showing at the moment along with system information from the driver examples. Once I get the data gathering and display formatting done I will be sure to share what I come up with for those interested.

Update:
Could be cleaner I am sure but my Python skills are a bit rusty…
I will try to add more as I come up with them.

Display the current total of aircraft seen and how many are currently reporting positions as reported by dump1090-mutability via the aircraft.json file.
github.com/jprochazka/adsb-rece … sitions.py

https://www.swiftbyte.com/misc/current_total-aircraft_with-positions.png

So how do I get the OLED display to work?

I’ve performed the latest update with…


cd ~/adsb-receiver
git fetch --all
git reset --hard origin/master
./install.sh

and I’ve connected my OLED to the GPIO pins.

There must be something else I have to load/install to get the display working.

Thanks,

Hi,
You have entered the commands to update your feeder software/adsb-receiver project only.
Please take a look at post#3 in this thread for instructions sent by Klaus to make the oled screen work.

Pretty cool addition! I’m ordering one as well.
I have breadboard and a few wires laying around so I should be able to hook it up.

So just to confirm, this is fully compatible with any Rasberry Pi type?
(Because on Ali Express it technically says “1Pcs 128X64 OLED LCD LED Display Module For Arduino 0.96”)

I found the display I think you’re ordering. Yes, the module will communicate with any Rpi or Arduino over I2C protocol.
The only issue is what code library is required to communicate with the driver chip on the board. I’d be pretty surprised if it wasn’t the SSD1306 that seems to drive all these boards, but as it’s utterly unspecified by the seller, I can’t confirm.

But yes, the interface will work with the pi. Just can’t confirm the programming detailed herein will be the same. Should be though.