Greetings !
Yet another bash at getting this OLED to work. Things “seem” to be moving forward, hopefully.
Being new to Linux (30 years of Windoze and 10 of Apples) code seems quite daunting at first, but thanks to the Interweb, it looks as if I am getting somewhere.
I couldn’t get my head around MichaIng’s post and couldn’t figure it out, but then from “buesche” post I chased info on the systemd service thingy, and found some information on the Raspberry website I quote :
“NOTE: on Jessie, Stretch and Buster (which use systemd), rc.local has drawbacks: not all programs will run reliably, because not all services may be available when rc.local runs.
See systemd for another way to have a command or program run when Raspberry Pi boots.”
Obviously this is a learning curve for me, so this is what I did, please correct if I am doing things wrong (I’m all ears from the pros) :
From a fresh eMMC flash (DietPi_NanoPiNEO2Black-ARMv8-Buster.img)
copy NanoHatOLED.tar.gz to /home folder via cp (from another machine onto the eMMC)
ssh into dietpi
run dietpi-config
install 130 + 16 + 17
root@DietPi:~# python --version
Python 2.7.16
root@DietPi:~# cd /etc
root@DietPi:~# ls
an rc.local file is present
root@DietPi:~# cd /home
root@DietPi:~# cd NanoHatOLED
root@DietPi:~# run ./install.sh
root@DietPi:~# python --version
Python 2.7.16
#still same Python version 2.7.16 and has not been updated via install.sh
root@DietPi:~# sudo nano oled.service
copy buesche’s code to oled.service
[Unit]
Description=NanoHAT OLED
#[Service]
#Type=oneshot
#RemainAfterExit=yes
#ExecStart=/usr/local/bin/oled-start
#[Install]
#WantedBy=multi-user.target
root@DietPi:~# sudo cp oled.service /etc/systemd/system/oled.service
root@DietPi:~# sudo reboot
after reboot
root@DietPi:~# sudo systemctl start oled.service
root@DietPi:~# sudo systemctl status oled.service
● oled.service - NanoHAT OLED
Loaded: loaded (/etc/systemd/system/oled.service; disabled; vendor preset: en
abled)
Active: active (exited) since Mon 2020-03-30 11:11:34 BST; 15s ago
Process: 982 ExecStart=/usr/local/bin/oled-start (code=exited, status=0/SUCCES
S)
Main PID: 982 (code=exited, status=0/SUCCESS)
Tasks: 5 (limit: 1023)
Memory: 17.9M
CGroup: /system.slice/oled.service
├─985 ./NanoHatOLED
├─988 sh -c cd /home/NanoHatOLED/BakeBit/Software/Python && python3 b
akebit_nanohat_oled.py 2>&1 | tee /tmp/nanoled-python.log
├─991 python3 bakebit_nanohat_oled.py
└─992 tee /tmp/nanoled-python.log
Mar 30 11:11:34 DietPi systemd[1]: Starting NanoHAT OLED…
Mar 30 11:11:34 DietPi systemd[1]: Started NanoHAT OLED.
The service seems to be starting without any problems, and HTOP shows a NanoHatOLED service runnning, but still no OLED , Grrrr !

Any ideas would be greatly appreciated, in NOOB language if possible ;.)