Commit b910c30656c1452d9bc14096cddbfe97356caee6
1 parent
cab273d9
MAJ Script Python
Showing
2 changed files
with
9 additions
and
6 deletions
Show diff stats
site/fichiersRPI/Rpi_to_server.py
... | ... | @@ -24,8 +24,9 @@ num_capteur = int(os.path.abspath(".")[-3]) |
24 | 24 | ser = serial.Serial("/dev/ttyACM0", 9600, timeout=1) |
25 | 25 | value = ser.readline() |
26 | 26 | |
27 | -while (value in ['\r', '', '\n', "b''"]): | |
27 | +while (ser.inWaiting()==0): | |
28 | 28 | value = ser.readline() |
29 | + | |
29 | 30 | data = str(float(value[0:4])) |
30 | 31 | |
31 | 32 | params = {"ip_address": ip_address, "numero": num_capteur, "data": data, "date": date} | ... | ... |
site/fichiersRPI/script.sh