This tutorial explains how to install the driver and custom python script for the Andino IO board on the Raspberry Pi. This is a prerequisite for using Node-Red to print messages on the screen. For documentation on the Node-Red nodes, refer to Andino IO / Raspberry Pi: OLED display control nodes (Adafruit SSD1306)


First, without root privileges, navigate to your home directory

cd ~

If you have not yet installed git on your raspberry pi, install it.

sudo apt-get install -y git

Afterwards, make sure that all other nessecary tools are installed:

sudo apt-get install -y python-dev python3-dev
sudo apt-get install -y python-imaging python-smbus i2c-tools
sudo apt-get install -y python-setuptools

Now download the Adafruit SSD1306 driver zip from GitHub:

git clone https://github.com/adafruit/Adafruit_Python_SSD1306.git

Rename the directory to something easier to recognize:

mv Adafruit_Python_SSD1306/ oled/

Run the install script

sudo python ./oled/setup.py install

The driver is now installed.

After having installed the Adafruit driver, navigate to the newly created directory and download the AndinoOLED python script

cd ~/oled/examples

Download using wget

wget https://raw.githubusercontent.com/andino-systems/Andino/master/Andino-Common/src/NodeRed/AndinoOLED/python/v0_3/andinooled.py

Make sure the script is executable

chmod 755 andinooled.py

The script can now be run by running

python andinooled.py

To start the script on boot, first edit the rc.local file

sudo nano /etc/rc.local

Right before exit 0, add the following line

/home/pi/display-scripts.sh

Press Ctrl + O to save and Ctrl + X to exit. Then, create the new script in the pi home directory

nano /home/pi/display-scripts.sh

Add the following content in the file:

#!/bin/bash

pkill python
# check the OLED
cd /home/pi/oled/examples/
/usr/bin/python andinooled.py &

Save and quit, then make sure the script is executable

chmod 755 /home/pi/display-scripts.sh