change s0 detection
parent
cfb31f5738
commit
9204ad80f5
|
@ -27,14 +27,14 @@ while True:
|
||||||
if len(revcount) > 0:
|
if len(revcount) > 0:
|
||||||
rc=revcount[:]
|
rc=revcount[:]
|
||||||
for i in rc:
|
for i in rc:
|
||||||
json_out={"time": timestamp,"device": devicename,"payload":{"S0":{"timestamp": timestamp,"sensor":"S0","i2c":0,"value":1}}}
|
json_out={"time": i,"device": devicename,"payload":{"S0":{"timestamp": i,"sensor":"S0","i2c":0,"value":1}}}
|
||||||
try:
|
try:
|
||||||
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
||||||
except:
|
except:
|
||||||
print("{}: could not connect to database".format(time.time()))
|
print("{}: could not connect to database".format(time.time()))
|
||||||
else:
|
else:
|
||||||
try:
|
try:
|
||||||
s.connect(("banana", 24048))
|
s.connect(("banana", 24049))
|
||||||
except:
|
except:
|
||||||
print("{}: could not connect to database".format(time.time()))
|
print("{}: could not connect to database".format(time.time()))
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in New Issue