Commit b910c30656c1452d9bc14096cddbfe97356caee6

Authored by grouille
1 parent cab273d9

MAJ Script Python

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
... ... @@ -3,8 +3,10 @@
3 3 echo $$ > /var/run/script.pid
4 4  
5 5 ./load.sh
6   -while true
7   -do
8   - sleep 5
9   - python3 Rpi_to_server.py
10   -done
  6 +python3 Rpi_to_server.py
  7 +
  8 +#while true
  9 +#do
  10 +# sleep 5
  11 +# python3 Rpi_to_server.py
  12 +#done
... ...