Minor changes to data ingestion pipeline

This commit is contained in:
Kelvin Ly 2023-05-16 12:22:13 -04:00
parent ea2bc8b96b
commit dcef35b3b2
2 changed files with 4 additions and 2 deletions

View File

@ -11,7 +11,7 @@ SERIAL_PATH = "/dev/ttyUSB0"
SERIAL_BAUD = 115200
SAMPLE_PERIOD = 0.2
DECIMATION_RATE = 10
DECIMATION_RATE = 5
is_mock = os.environ['MOCK']
if is_mock:
@ -167,7 +167,6 @@ try:
humidity = float(parts[0])
temp = float(parts[1])
volts = float(parts[2])
print(humidity, temp, volts)
if first_sample:
humidifier_history[:] = humidity
first_sample = False
@ -188,6 +187,7 @@ try:
humidifier.toggle(s)
if frame_num == 0:
print(humidity, temp, volts)
update = {
"data": {
"time": int(now*1000),

View File

@ -13,7 +13,9 @@ async def connect_stdin_stdout():
async def pipe_loop(reader, writer):
while True:
#res = await reader.readline()
res = await reader.read(1024)
#res = await reader.readchunk()
if not res:
break
writer.write(res)