Fix service deployment

This commit is contained in:
Odd Stråbø 2024-01-03 11:28:33 +01:00
parent b4e8258de1
commit 1890036b6c
3 changed files with 6 additions and 3 deletions

View file

@ -1,3 +1,5 @@
#!/bin/bash #!/bin/bash
rsync --exclude=.git --exclude='packet format.java' --exclude-from=.gitignore -ravC . pi@solarpi:ble rsync --exclude=.git --exclude='packet format.java' --exclude-from=.gitignore -ravC . pi@solarpi:ble
ssh pi@solarpi 'systemctl --user daemon-reload; systemctl --user restart solarmppt' ssh pi@solarpi './ble-venv/bin/pip install -r ble/requirements.txt'
ssh pi@solarpi 'ln -fs $(pwd)/ble/solarmppt.service ~/.config/systemd/user/solarmppt.service'
ssh pi@solarpi 'loginctl enable-linger; systemctl --user daemon-reload; systemctl --user restart solarmppt'

View file

@ -4,5 +4,6 @@ bluepy
libscrc libscrc
paho-mqtt paho-mqtt
pyserial pyserial
graypy
types-PyYAML types-PyYAML

View file

@ -4,8 +4,8 @@ Description=Daemon for bridging a Serial SRNE MPPT charge controller to MQTT
[Service] [Service]
Type=exec Type=exec
Restart=on-failure Restart=on-failure
StandardOutput=append:/home/pi/z_solar_systemd.log #StandardOutput=append:/home/pi/z_solar_systemd.log
StandardError=append:/home/pi/z_solar_systemd.log #StandardError=append:/home/pi/z_solar_systemd_err.log
WorkingDirectory=/home/pi/ WorkingDirectory=/home/pi/
Environment=PYTHONPATH=/home/pi/ble/ Environment=PYTHONPATH=/home/pi/ble/
ExecStart=/home/pi/ble-venv/bin/python -m srnemqtt ExecStart=/home/pi/ble-venv/bin/python -m srnemqtt