while True:
rx = s.recv(64)
time.sleep_ms(10)
if rx:
time.sleep_ms(10)
rxStr = str(rx).split("'")
index = int(rxStr[1])
try:
i2c.writeto(56, 255-index)
except Exception as error:
print("i2c",error)
startTime = time.ticks_ms()
s.setblocking(True)
time.sleep_ms(10)
try:
s.send("ack")
except Exception as error:
print("send ",error)
time.sleep_ms(10)
s.setblocking(False)
print(time.ticks_ms()-startTime)
wdt.feed()
@jcaron thanks for your response. The problem is in the s.send(). I added the setblocking() statements around the statement along with putting it in its own try/except but they are still resetting at least 12-16 times a day. Is there any thing else you think I should check? Gateway setting? I'm using a Multitech Conduit gateway that's running node-red.
Thanks again