Omega Onion2 OLED Screen Show IP and LAN Name

Introduction: Omega Onion2 OLED Screen Show IP and LAN Name

About: I’m degree in Psychology in 2001, with a thesis in Artificial Intelligence. I’m working on Smart Object, IoT and Interactive Design. I’m developing autonomously my projects. I make autonomously programs in A...

I have an Omega Onion2. I use also the Power Dock. With Power Dock, you can use Onion Omega2 with USB cable or little LiPo Battery. I saw OLED display, but I want I use a normal i2c OLED screen to show the ip and the name of my omega Onion2. The Omega Onion2 have a little screen module. I use this simple i2c OLED screen available on Amazon. The screen is completely supported by the Omega Onion2. I can use it also with the integrated Omega Onion2 console.

The screen can show text or graphic. You can use the Onion Omega2 console to use this with the integrated module. Type the text or put the image on the screen and see appear it on it after a second.

If you want you can install the OLED widget and play with the screen!

Step 1: Recommendations

First of all the steps, you must connect the Omega Onion2 to your LAN and Internet. You can use this tutorial for getting Started with The Omega Onion2.

See the Official Wiki Page:

Step 2: Connect the Screen to the Onion Omega2

I use this little OLED screen available on Amazon. The screen has an i2c connection and a backlight led. You can use this also like a graphic screen.

You can connect the screen to the SDA and SCL Onion's pins. You must connect also the GND pin.

Step 3: Install Python on Omega2

If you want use my Python script, you must install Python on your Omega2.

Python has many dependencies and modules. You must expand the memory of your Omega2. You can For this follow the official wiki: USB storage as Rootfs. (

After this step install Python on Omega Onion2:

opkg update
opkg install python-light

This step install the light version of python. If you want use the full version of Python you must digit:

opkg update
opkg install python

Step 4: Write the Code and Start the Script

I use nano editor for write my program on Onion Omega.


opkg install nano

The first file has the name "". You can type:


After this, in nano editor, you can paste this code:

import datetime
import time
today =
time = (time.strftime("%H:%M:%S"))
print str(today)+"--"+time

The second file is ""


Paste this code in the nano editor

import socket
hostName=socket.gethostname() print 'HostName:' + hostName

The third file is ""


Paste this code in the nano editor:

import socket
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
s.connect(('', 0))
print 'IPaddr:' + s.getsockname()[0] 

The last file is


and paste this code in the nano editor:

oled-exp -c #echo $1 > /root/ticker.txt VAR1=$(python ./ VAR2=$(python ./ VAR3=$(python ./ oled-exp -i oled-exp cursor 0,4 write 'Omega Onion2' oled-exp cursor 3,0 write $VAR1 oled-exp cursor 6,0 write $VAR2 oled-exp cursor 1,0 write $VAR3

Step 5: Type the Stock Command

To run the project you must type .\ in the shell


You can see the

Omega Onion2
Date - Time
Ip Address
Host Name

Now after the start Omega Onion giving you the own ip address and the own hostname.

Microcontroller Contest 2017

Participated in the
Microcontroller Contest 2017

1 Person Made This Project!


  • Pocket-Sized Speed Challenge

    Pocket-Sized Speed Challenge
  • Audio Challenge 2020

    Audio Challenge 2020
  • Maps Challenge

    Maps Challenge



Question 1 year ago on Step 2

Wait... what about VCC?!
Does it work without that?
Draining the datapins somehow?