Update label generation, websocket listen mode

This commit is contained in:
2024-05-14 17:33:47 -05:00
parent 33af359a86
commit 24d959da71
8 changed files with 2157 additions and 11 deletions

6
run.py
View File

@@ -422,7 +422,7 @@ def setup_server(pool, manager):
if sensor_ready is False:
fprint("waiting for " + "Sensor Initialization" + " to complete...", sendqueue=to_server_queue)
global mbconn
mbconn = ModbusClient(host="192.168.1.20", port=502, auto_open=True, auto_close=True)
mbconn = ModbusClient(host="192.168.1.20", port=502, auto_open=True, auto_close=False)
get_sensors()
fprint("Sensors initialized.", sendqueue=to_server_queue)
@@ -461,7 +461,7 @@ def get_sensors():
global sensors
oldsens = sensors
#print("Reading sensors")
#mbconn.open()
# mbconn.open()
"""
port 1: 256
port 2: 272
@@ -490,7 +490,7 @@ def get_sensors():
return -1
sensors = out
#fprint("Values: " + str(sensors))
#mbconn.close()
mbconn.close()
for x in range(len(oldsens)):
if oldsens[x] == 0 and out[x] == 1:
# cable newly detected on tray