fix delay
This commit is contained in:
parent
758daa4675
commit
248b50c76c
|
@ -13,7 +13,7 @@ import requests
|
|||
import serial
|
||||
from influxdb import InfluxDBClient
|
||||
|
||||
# Nombre de secondes entre deux transmission des mesures
|
||||
# Nombre de trames entre deux transmission des mesures (0 = nodelay)
|
||||
DELAY_MESURE = 10
|
||||
|
||||
# clés à utiliser - les autres ne seront pas transmises
|
||||
|
@ -114,7 +114,10 @@ def main():
|
|||
delaycounter = DELAY_MESURE
|
||||
while True:
|
||||
while delaycounter < DELAY_MESURE:
|
||||
ser.read_until(b'\x03')
|
||||
logging.debug(delaycounter)
|
||||
line = ser.readline()
|
||||
while b'\x02' not in line: # recherche du caractère de début de trame
|
||||
line = ser.readline()
|
||||
delaycounter+=1
|
||||
line = ser.readline()
|
||||
logging.debug(line)
|
||||
|
|
Loading…
Reference in a new issue