|
|
|
@ -63,6 +63,8 @@ def create_database():
|
|
|
|
|
def update_database(line):
|
|
|
|
|
update_values = []
|
|
|
|
|
for name, _, _ in STORED_VALUES:
|
|
|
|
|
if line[name] == None:
|
|
|
|
|
return
|
|
|
|
|
update_values += ["%f" % float(line[name])]
|
|
|
|
|
|
|
|
|
|
now = time.time()
|
|
|
|
@ -115,7 +117,15 @@ def upload_graphs():
|
|
|
|
|
print("Unexpected error while uploading:", sys.exc_info()[1])
|
|
|
|
|
|
|
|
|
|
def main():
|
|
|
|
|
pass
|
|
|
|
|
ser = serial.Serial(SERIAL, BAUD_RATE, timeout=10.0)
|
|
|
|
|
|
|
|
|
|
while True:
|
|
|
|
|
line = ser.readline().decode('ascii')
|
|
|
|
|
print(line)
|
|
|
|
|
if len(line) > 0:
|
|
|
|
|
parsed = parse_line(line)
|
|
|
|
|
update_database(parsed)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
|