diff --git a/C/ssd1306.service b/C/ssd1306.service new file mode 100644 index 0000000..46378e3 --- /dev/null +++ b/C/ssd1306.service @@ -0,0 +1,16 @@ +# Install: +# +# sudo systemctl link /home/pi/U6143_ssd1306/C/ssd1306.service +# sudo systemctl enable ssd1306 +# sudo systemctl start ssd1306 + +[Unit] +Description=UCTRONICS ssd1306 OLED display +After=network.target + +[Service] +Type=simple +ExecStart=/home/pi/U6143_ssd1306/C/display + +[Install] +WantedBy=multi-user.target diff --git a/README.md b/README.md index ed6a950..ef1922b 100644 --- a/README.md +++ b/README.md @@ -36,6 +36,13 @@ sudo ./display & ``` - reboot your system +## Add automatic systemd start to systemd +```bash +sudo systemctl link /home/pi/U6143_ssd1306/C/ssd1306.service +sudo systemctl enable ssd1306.service +sudo systemctl start ssd1306.service +``` + ## For older 0.91 inch lcd without mcu - For the older version lcd without mcu controller, you can use python demo - Install the dependent library files @@ -49,13 +56,3 @@ sudo apt-get install python3-pil cd /home/pi/U6143_ssd1306/python sudo python3 ssd1306_stats.py ``` - - - - - - - - - - diff --git a/python/ssd1306_stats.service b/python/ssd1306_stats.service new file mode 100644 index 0000000..74ab496 --- /dev/null +++ b/python/ssd1306_stats.service @@ -0,0 +1,16 @@ +# Install: +# +# sudo systemctl link /home/pi/U6143_ssd1306/python/ssd1306_stats.service +# sudo systemctl enable ssd1306_stats +# sudo systemctl start ssd1306_stats + +[Unit] +Description=UCTRONICS ssd1306 OLED display +After=network.target + +[Service] +Type=simple +ExecStart=/usr/bin/python3 /home/pi/U6143_ssd1306/python/ssd1306_stats.py + +[Install] +WantedBy=multi-user.target