Update label generation, websocket listen mode
This commit is contained in:
6
run.py
6
run.py
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user