Compare commits

..

2 commits

Author SHA1 Message Date
pi 779153122f mod 2025-02-22 15:14:36 +01:00
pi 2ca0de44db mod 2025-02-22 14:18:23 +01:00
4 changed files with 8 additions and 2 deletions

3
.gitignore vendored
View file

@ -1,3 +1,4 @@
venv/**
*.log
.idea/**
.idea/**
*.log.gz

View file

@ -73,7 +73,7 @@ def on_log(client, obj, level, string):
# but note that the client id must be unique on the broker. Leaving the client
# id parameter empty will generate a random id for you.
client_id = 'mqtt-client-solaria'
client_id = 'mqtt-client-pimirror2'
mqttc = mqtt.Client(mqtt.CallbackAPIVersion.VERSION2, client_id)
mqttc.on_message = on_message

View file

@ -4,6 +4,7 @@ echo
echo "$(date '+%Y%m%d%H%M%S'): restarting run-on-pi" >> /home/pi/mqtt-halt-pack/app.log
killall run-on-pi.sh
ps aux | grep "python client/client.py" | grep -v grep | tr -s ' ' | cut -d ' ' -f 2 | xargs kill
nohup /home/pi/mqtt-halt-pack/run-on-pi.sh >> /home/pi/mqtt-halt-pack/app.log 2>&1 &

View file

@ -7,6 +7,10 @@ counter=0
max_counter=120
max_restart_counter=20
echo "$(date '+%Y%m%d%H%M%S'): Starting and waitintg 15s "
sleep 15
echo "$(date '+%Y%m%d%H%M%S'): checking connectivity"
while [ $(ping -q -w 3 -c 1 192.168.31.5 > /dev/null && echo 1 || echo 0) -eq 0 ]; do