Skip to content

OLED Status Display (Optional)

akuker edited this page Jul 10, 2020 · 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

  • Install python libraries
  sudo python -m pip install --upgrade pip setuptools wheel
  sudo pip install Adafruit-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: (Make sure to remove any extra spaces from copy/paste)

 [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 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