I2c OLED Screen

Our Prototype and Design students are make cases for all of our R Pis for the 3DprinterOS Client. They picked a cool mini desktop like case. It has a i2c OLED screen on the front of the case to display different information.
I have been fallowing the tutorial here https://www.the-diy-life.com/diy-raspberry-pi-4-desktop-case-with-oled-stats-display/ but it is for raspbian OS and I am having a heck of a time trying to get it to work on Arch Linux.

Does anyone have any suggestions on the easiest way to get these little screens to work on the 3dprinterOS clients? Any help would be great. I am not a Linux expert.

Greetings.

Here are a list

  1. Update your image and install with following command:
    sudo pacman -Syu && sudo pacman -S cronie i2c-tools lm_sensors git python-pip
  2. Follow this guide to enable i2c on archlinuxarm
    Configure the bootloader to enable the i2c hardware by appending to /boot/config.txt : dtparam=i2c_arm=on

Configure the i2c-dev and i2c-bcm2708 (if not blacklisted for the camera) modules to be loaded at boot in /etc/modules-load.d/raspberrypi.conf: i2c-dev i2c-bcm2708
Reboot the Raspberry Pi and issue the following command to get the hardware address: i2cdetect -y 1
Now instantiate the device. Change the hardware address to the address found in the previous step with ‘0x’ as prefix (e.g. 0x48) and choose a device name:
echo >/sys/class/i2c-adapter/i2c-1/new_device
Check dmesg for a new entry: i2c-1: new_device: Instantiated device ds1621 at 0x48
Finally, read the sensor output: sensors

  1. Install screen relaited packages and download examples:
    sudo pip install --upgrade pip setuptools wheel
    sudo pip install Adafruit_BBIO Adafruit-SSD1306
    git clone https://github.com/adafruit/Adafruit_Python_SSD1306.git

  2. Check the display info script and copy it to home directory
    python Adafruit_Python_SSD1306/examples/stats.py
    cp Adafruit_Python_SSD1306/examples/stats.py ~/

  3. Setup script autostart
    sudo crontab -e
    then paste following
    @reboot python /home/pi/stats.py &
    then press in series : q
    note that: “:” in the line above is not a punctuation, but a part of the commend

Hope that this’ll help.

1 Like

Awesome! thanks for the help. I will give this a try and give an update. For this part @reboot python /home/pi/stats.py & so i put /home/pi/stats.py or do I point that at the location of the stats.py file if it is in a different location?

Sorry, for the late update.
This needs to be a real absolute location where your stats.py file

1 Like

Thanks for your Help!

1 Like