#Thanks I think maybe it was a memory
1 messages · Page 1 of 1 (latest)
Hey jazzmasta25, that's a good find with gc.collect(). I hope it solves your issue. One problem I had with using WiFi and CircuitPython in a long running application is that I tried to recover from errors as I was used to doing in server code. Things seemed to be working fine when I tested it, but then I took it to a different network and the device was very unreliable. It turns out that recovery code was of very little use, just reset the entire controller (as recommended at learn.adafruit.com):
try:
# Any code that uses the network here
except Exception as e:
print("Network Error:\n", str(e))
print("Resetting microcontroller in 10 seconds")
time.sleep(10)
microcontroller.reset()
Described behavior sounds weird, collect should happen on the background automatically, every once in a while (unless you disabled it for some reason)