Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 8044

MicroPython • Re: Accept hanging on Pico W python

$
0
0
The post on here was mainly in case anyone in future read the thread and wondered what the conclusion was.
It seems that you've found that out, but not mentioned it here: "I think I have found part of the reason for the problem - the AP I have been using ..."

To verify that it's not MicroPython, I ran your code on a Pico W called from Damien's test client. It's been running flawlessly with wait times approaching an hour:

Code:

send request<html><body>1609459552</body></html>sleep 2send request<html><body>1609459554</body></html>sleep 3send request<html><body>1609459558</body></html> ...sleep 711send request<html><body>1609461693</body></html>sleep 1066send request<html><body>1609462759</body></html>sleep 1599send request<html><body>1609465539</body></html>sleep 2398send request<html><body>1609467937</body></html>sleep 3597send request<html><body>1609472079</body></html>
Those with sharp eyes may notice that the last two timestamps are 4142 seconds apart rather than 3597. I don't know whether my computer requested late (it may have slept) or the Pico W had 9 minutes' nap. Either way, it didn't fall off the network, and I'll keep it running until the 5395 sleep is over.

MicroPython can't fix problems caused by an unreliable router. My router has no special activity timeout set, but it has lots of other clients connecting. Thus Damien's suggestion is a good one: "Also, maybe try on a more noisy/busy AP, because it could be that the additional traffic is keeping the Pico W awake, and in your tests with a dedicated AP there is no additional traffic and that's why you see the issue."

If you must run this on a dedicated AP, maybe use/modify something like µPing to ping the gateway every couple of minutes to keep the connection alive

Statistics: Posted by scruss — Sat Sep 21, 2024 10:58 pm



Viewing all articles
Browse latest Browse all 8044

Trending Articles