modifiche servizio e messaggi log
This commit is contained in:
@@ -221,7 +221,7 @@ def onMessage(cli, userdata, msg):
|
|||||||
elif "EXIT" in msg:
|
elif "EXIT" in msg:
|
||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
LOGGER.error("Messaggio MQTT sconosciuto")
|
LOGGER.error(f"Messaggio MQTT sconosciuto: {msg}")
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def onConnect(cli, userdata, flags, rc):
|
def onConnect(cli, userdata, flags, rc):
|
||||||
@@ -331,7 +331,7 @@ if __name__ == '__main__':
|
|||||||
# for y in tempSamples[x] for z in tempSamples[x][y]])
|
# for y in tempSamples[x] for z in tempSamples[x][y]])
|
||||||
firstCap = False
|
firstCap = False
|
||||||
firstTS = time.time()
|
firstTS = time.time()
|
||||||
LOGGER.info(f'Inizio cattura TS: {datetime.fromtimestamp(firstTS).strftime("%c")}')
|
LOGGER.warning(f'Inizio cattura: {datetime.fromtimestamp(firstTS).strftime("%c")}')
|
||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
for ax in tempSamples:
|
for ax in tempSamples:
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[Unit]
|
[Unit]
|
||||||
Description=Nasoscopio - Letture Movimento Assi Materia-CL
|
Description=Nasoscopio - Letture Movimento Assi Materia-CL
|
||||||
Requires=network.target mosquitto.service docker.service
|
Requires=network.target mosquitto.service docker.service sshtunnel.service
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
RestartSec=15s
|
RestartSec=15s
|
||||||
|
|||||||
16
NasoScope/sshtunnel.service
Normal file
16
NasoScope/sshtunnel.service
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
[Unit]
|
||||||
|
Description=SSH Tunnel - Letture Movimento Assi Materia-CL
|
||||||
|
Requires=network.target mosquitto.service docker.service
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
RestartSec=15s
|
||||||
|
Type=simple
|
||||||
|
User=root
|
||||||
|
Group=root
|
||||||
|
WorkingDirectory=/root/NasoScopio/NasoScope/
|
||||||
|
ExecStart=/usr/bin/autossh -Nf -M 0 -L 8080:192.168.0.1:8080 cnc@192.168.30.51
|
||||||
|
PIDFile=/run/sshtunnel.pid
|
||||||
|
Restart=always
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
||||||
Reference in New Issue
Block a user