Web server eventually blocks with Android Chrome #17916
Replies: 5 comments 4 replies
-
Hi
|
Beta Was this translation helpful? Give feedback.
-
I would suggest to use a tool such as fiddler or HTTP Toolkit to run as a reverse proxy, to intercept and allow you to log, inspect the http(s) traffic to narrow down the likely cause. I have used fiddler (classic) extensively in the past to be able to grok otherwise unexplainable behaviour of servers &/clients. You can even use it to repro/replay traffic. 'Cause running a 7-day wood burning test is intriguing, but perhaps not efficiënt |
Beta Was this translation helpful? Give feedback.
-
I'm running: Using a second R-Pi Pico-W (192.168.1.210), with no sensors connected to GPIO, I've now managed to reproduce my issue in a new script which I've copied here: I ran this headless and after ~24 hours after I accessed the web page from my Android phone I got "This site can't be reached". Here is screen grab from PC Brave browser with F12 showing no response headers. ![]() I'll connect the Pico back to my PC and see what prints in the Thonny terminal next time it hangs. |
Beta Was this translation helpful? Give feedback.
-
Ok..
|
Beta Was this translation helpful? Give feedback.
-
Reproduced again on my test Pico by restarting my phone! Web server is hung and I've CTRL+C in Thonny at the REPL. What analysis can I make? I suspect its run out of sockets: >>> import gc
>>> gc.collect()
>>> print("Free:", gc.mem_free())
Free: 142384
>>> import usocket as socket
>>> s=socket.socket()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
OSError: [Errno 12] ENOMEM |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I’ve a firewood kiln project that uses a Raspberry Pi Pico-W, coupled with two temperature + humidity sensors, controlling relays for fans and heaters. The control strategy is stable and runs continuously ~7 days.
I added a simple web interface to monitor conditions inside the kiln, and also allow parameter changes during running (e.g. change target temps). Recently I swapped to Microdot.
The Pico-W is connected to my home WiFi and I access the web page from an eth wired PC using Brave browser. I also have a simple script running on my Synology NAS which uses httplib2 to poll the kiln every 10 seconds for logging purposes (
h.request("http://192.168.1.94/json")
). This works well and is stable over the ~7 day run.Now my observation and reason for posting here!
My Android phone running Chrome browser is connected to the same home WiFi. If I access the Pico-W web server it will work ok, but after a period of time (minutes, hours) eventually the Pico-W web server stops responding (connection timeout). At the same time my browser on PC and NAS script also cannot connect.
Sometime the connection restores (maybe one hour later) but usually not and I must hard reset the Pico-W to restore web access. During the web server timeout the control strategy continues running as its under its own thread.
I believe the way Chrome on Android is making/holding open connections/sockets is somehow causing my web server on Pico-W to block.
I do not believe it’s a Microdot issue as it was evident before I switched (actually, I switched in an attempt to try and fix my issue!). Posting here for tips on how to start debugging please. How to monitor number of sockets. Maybe sense when the web server is blocked and restart the thread?
Beta Was this translation helpful? Give feedback.
All reactions