This commit is contained in:
2021-02-26 12:14:40 +01:00
parent 88f9f183bd
commit 476458303b
5 changed files with 8 additions and 6 deletions

View File

@@ -3,7 +3,7 @@
"logFile": "/home/briq/logs/nasoscopio-grande.log",
"logFormat": "%(asctime)s|%(levelname)-7s|%(funcName)-10s|%(lineno)-3d: %(message)-50s",
"logTimeFormat": "%m-%d %H:%M:%S",
"URL": "http://localhost:8880",
"URL": "http://localhost:8080",
"samplePeriod": 10,
"loopPeriod": 0.5,
"recordTime": 3600,

View File

@@ -3,7 +3,7 @@
"logFile": "/home/briq/logs/nasoscopio-piccola.log",
"logFormat": "%(asctime)s|%(levelname)-7s|%(funcName)-10s|%(lineno)-3d: %(message)-50s",
"logTimeFormat": "%m-%d %H:%M:%S",
"URL": "http://localhost:8881",
"URL": "http://localhost:8081",
"samplePeriod": 10,
"loopPeriod": 0.5,
"recordTime": 3600,

View File

@@ -341,7 +341,7 @@ if __name__ == '__main__':
for idx,rec in enumerate(tempSamples[ax][reg]):
tempSamples[ax][reg][idx]=(tempSamples[ax][reg][idx][templates.SAM_TS],
tempSamples[ax][reg][idx][templates.SAM_VAL])
if not settings["sendMqtt"]:
if settings["sendMqtt"]:
if tempSamples[ax][reg][idx][templates.SAM_TS] > settings["recordTime"]:
samples[ax][reg] = samples[ax][reg][-(len(samples)-len(tempSamples)):]
if bufferFull < 1:
@@ -356,7 +356,7 @@ if __name__ == '__main__':
samples[ax][reg]+=tempSamples[ax][reg]
else:
sendSamples(tempSamples)
else:
elif settings['sendInflux']:
influxMeas = list()
for idx,record in enumerate(tempSamples[ax][reg]):
ts = tempSamples[ax][reg][idx][templates.SAM_TS]+firstTS*1000000
@@ -376,6 +376,8 @@ if __name__ == '__main__':
LOGGER.error(f'Impossibile scrivere nel database: {e}')
LOGGER.error(f'TS da controllo: {datetime.fromtimestamp(ts).strftime("%d/%m/%y_%H:%M:%S,%f")}')
stat='STOP'
else:
pass
pass
pass
pass

View File

@@ -7,7 +7,7 @@ RestartSec=15s
Type=simple
User=briq
Group=briq
WorkingDirectory=/root/NasoScopio/NasoScope/
WorkingDirectory=/home/briq/NasoScopio/
ExecStart=/usr/bin/python3 nasomain.py config-grande.json
PIDFile=/run/nasoscopio-grande.pid
Restart=always

View File

@@ -7,7 +7,7 @@ RestartSec=15s
Type=simple
User=briq
Group=briq
WorkingDirectory=/home/briq/Nasoscopio/
WorkingDirectory=/home/briq/NasoScopio/
ExecStart=/usr/bin/python3 nasomain.py config-piccola.json
PIDFile=/run/nasoscopio-piccola.pid
Restart=always