That's good news, that explicit loss of connection can be detected and recovered from. It should also cover moving the Pico W out of range and then back into range.I also tested simply unplugging the wireless router and it worked just fine!
And then it successfully connected.
I presume the Pico W did supply requested data once reconnected ?
I wasn't sure what ...
Code:
async def connect_to_wifi(): wlan = network.WLAN(network.STA_IF) ... async def monitor_wifi(): wlan = network.WLAN(network.STA_IF) ...The two 'wlan' variables should disappear at the end of their respective routines and eventually be garbage collected but I presume some invisible side-effects means what's done to those keeps what's under the hood correctly ticking along.
I agree with your next steps, seeing if you can find a situation where it doesn't respond to data requests where 'isconnected' hasn't indicated a loss of connection, trying to figure out why that is, and whether a different AP exhibits the same issue.
But be wary of that path; finding an AP which doesn't exhibit the problem can often and easily lead to 'so I'll use that' with focus being lost on the original issue.
That's not surprising and I can't blame anyone for wanting to move on with what they are wanting to do rather than getting bogged down and held back with something which doesn't work, the thankless task of trying to figure out why not, when the alternative does.
So have some encouragement and good wishes for holding strong and having fortitude for as long as you can
Statistics: Posted by hippy — Fri Dec 27, 2024 3:34 pm