OLED Monitor: use venv and leverage start script in systemd service (#347)

* Add start script for oled monitor

* systemd service definition for oled monitor

* Remove superfluous file

* Bump library versions to avoid erroring out

* Revert mistaken changes

* Revert mistaken changes
This commit is contained in:
Daniel Markstedt 2021-10-19 18:01:32 -07:00 committed by GitHub
parent e10a99c24c
commit cbe3642054
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 26 additions and 14 deletions

View File

@ -0,0 +1,14 @@
[Unit]
Description=Monitor RaSCSI service
After=network.target rascsi.service
[Service]
Type=simple
Restart=always
ExecStart=/home/pi/RASCSI/src/oled_monitor/start.sh
StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=RASCSIMON
[Install]
WantedBy=multi-user.target

View File

@ -1,15 +1,15 @@
Adafruit-Blinka==6.3.2
adafruit-circuitpython-busdevice==5.0.6
adafruit-circuitpython-framebuf==1.4.6
adafruit-circuitpython-ssd1306==2.11.1
Adafruit-PlatformDetect==3.2.0
Adafruit-PureIO==1.1.8
Pillow==8.3.2
Adafruit-Blinka==6.15.0
adafruit-circuitpython-busdevice==5.1.0
adafruit-circuitpython-framebuf==1.4.7
adafruit-circuitpython-ssd1306==2.12.2
Adafruit-PlatformDetect==3.13.0
Adafruit-PureIO==1.1.9
Pillow==8.4.0
pkg-resources==0.0.0
pyftdi==0.52.9
pyftdi==0.53.3
pyserial==3.5
pyusb==1.1.1
rpi-ws281x==4.2.5
pyusb==1.2.1
rpi-ws281x==4.3.0
RPi.GPIO==0.7.0
sysv-ipc==1.1.0
protobuf==3.17.3

View File

@ -2,7 +2,7 @@
set -e
# set -x # Uncomment to Debug
cd $(dirname $0)
cd "$(dirname "$0")"
# verify packages installed
ERROR=0
if ! command -v dpkg -l i2c-tools &> /dev/null ; then
@ -31,7 +31,6 @@ if ! dpkg -l libpng-dev &> /dev/null; then
echo "Run 'sudo apt install libpng-dev' to fix."
ERROR=1
fi
# Dep to build Pollow
if ! python3 -m venv --help &> /dev/null ; then
echo "venv could not be found"
echo "Run 'sudo apt install python3-venv' to fix."
@ -53,6 +52,7 @@ if ! test -e venv; then
echo "Activating venv"
source venv/bin/activate
echo "Installing requirements.txt"
pip install wheel
pip install -r requirements.txt
git rev-parse HEAD > current
fi
@ -65,8 +65,6 @@ if ! test -e current; then
else
if [ "$(cat current)" != "$(git rev-parse HEAD)" ]; then
echo "New version detected, updating requirements.txt"
echo " This may take some time..."
pip install wheel
pip install -r requirements.txt
git rev-parse HEAD > current
fi