Skip to content

OLED Status Display (Optional)

Daniel Markstedt edited this page Oct 29, 2021 · 25 revisions

Table of Contents

Overview

You can optionally attach an OLED display to monitor the status of RaSCSI. This can be especially useful when running "headless" (without a monitor). The RaSCSI board (akuker version) has the I2C bus available on a header, as well as 3.3v power and ground.

Currently the following OLEDs are supported:

If you're using a different OLED, make sure that it will run at 3.3v. Some only work with 5v controllers (such as the Arduino)

For example, here is the display when RaSCSI is configured with two devices on SCSI ID 1 and 6. This shows when there is no CD-ROM in the virtual drive.

By executing the following command, the ISO image will on the display...

  rasctl -i 6 -c insert -f /home/pi/marathon.iso

How to install

Hardware install

Ensure that your display matches the pinout on the RaSCSI board:

Pin Signal
1 5v (not used)
2 Ground
3 3.3v
4 I2C Clock (SCL)
5 I2C Data (SDA)
Note: Pin 1 is the furthest away from the Raspberry Pi GPIO header.

Important: The Raspberry Pi I2C bus is designed to operate at 3.3v levels. Do not use a 5v OLED and expect it to work!

You will need to solder a pin header on your OLED board (if it didn't come with one). Then, plug it into J4 on the RaSCSI board.

If you're really brave, you could solder the OLED board directly to the RaSCSI board.

Software Install

You can use the easyinstall.sh script to automatically install the OLED Display software.

Below follows the manual steps to install it.

  • Install required packages
  sudo apt install python3-pip python3-pil python3-venv libjpeg-dev libpng-dev libopenjp2-7-dev i2c-tools -y
  • Enable i2c
  sudo raspi-config
  Select 3 “Interfacing Options”
  Highlight the “I2C” option and activate “<Select>”
  reboot
  • Verify your screen is connected
  i2cdetect -y 1
  you should see your module at address 0x3c; if not check your cabling:
       0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
  00:          -- -- -- -- -- -- -- -- -- -- -- -- --
  10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
  20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
  30: -- -- -- -- -- -- -- -- -- -- -- -- 3c -- -- --
  40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
  50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
  60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
  70: -- -- -- -- -- -- -- -- 
  • Install python libraries
  sudo pip3 install adafruit-circuitpython-ssd1306
  • Clone the RaSCSI git repository (if you haven't already)
  git clone https://github.com/akuker/RASCSI.git 
  • Copy the python script to /usr/local/bin and make it executable
  sudo cp ~/RASCSI/src/oled_monitor/rascsi_oled_monitor.py /usr/local/bin/
  sudo chmod +x /usr/local/bin/rascsi_oled_monitor.py
  • Try running it to verify it works. (You will need the OLED connected and RaSCSI running for this to work)
  rascsi_oled_monitor.py

Create a systemd service to automatically run

Create a systemd service description file using the following command:

 sudo nano /etc/systemd/system/monitor_rascsi.service

Then add the following contents:

[Unit]
Description=Monitor RaSCSI service
After=network.target rascsi.service

[Service]
Type=simple
Restart=always
ExecStart=/usr/local/bin/rascsi_oled_monitor.py

[Install]
WantedBy=multi-user.target

After you've created the monitor_rascsi.service file, you'll need to enable it with the following command:

 sudo systemctl enable monitor_rascsi.service

Note: If you modify the monitor_rascsi.service file later, you will need to run "sudo systemctl daemon-reload"

You can start the service (without rebooting) using the following command:

 sudo systemctl start monitor_rascsi.service

When you run 'systemctl status monitor_rascsi.service', it should be reported that the RaSCSI Monitor is Loaded and Active:

  pi@rascsi:~/RASCSI/src/oled_monitor $ sudo systemctl status monitor_rascsi.service 
  ● monitor_rascsi.service - Monitor RaSCSI service
     Loaded: loaded (/etc/systemd/system/monitor_rascsi.service; enabled; vendor preset: enabled)
     Active: active (running) since Fri 2020-07-10 12:21:08 CDT; 3s ago 
   Main PID: 14017 (rascsi_oled_mon)
      Tasks: 1 (limit: 4915)
     Memory: 5.5M
     CGroup: /system.slice/monitor_rascsi.service
              14017 /usr/bin/python /usr/local/bin/rascsi_oled_monitor.py
  Jul 10 12:21:08 rascsi systemd[1]: Started Monitor RaSCSI service.

Additional Details

Clone this wiki locally