Comment on RPi Pico "disconnects" after a few minutes to days
drwho@beehaw.org 1 year ago
I had something similar happen in one of my ESP8266 projects (also running MicroPython). What I wound up doing was, every five wall clock minutes (maybe a bit sooner than that, for your case) I had my firmware do a local_networks = wifi.scan()
just to exercise the wifi functionality. If that failed I have the code do gc.collect()
followed by sys.exit(1)
, which causes the 8266 to reboot automatically.
Give that a try.
agressivelyPassive@feddit.de 1 year ago
I’ll give it try!
Do you have any idea, what’s causing the issue? Is it specifically the scanning part that’s relevant here? I’m starting/stopping wifi each minute, so the chip shouldn’t just idle around all the time.
drwho@beehaw.org 1 year ago
No, I don’t. My best informed guess is that the wifi connection’s state machine gets stuck once in a while, it misses a couple of packets, and then sits there doing nothing. So, by kicking it a little it doesn’t get a chance to freeze up.
agressivelyPassive@feddit.de 1 year ago
I “kind of” solved at least parts of the problem by simply not turning wifi off. It’s more stable than before, but not stable as such.