I have a problem to run a webserver on SonOff S20 (ESP8266EX) -> https://github.com/jedie/micropython-sonoff-webswitch
I used the official esp8266-20190529-v1.11.bin firmware.
I start with a simple socket.socket() webserver see e.g.: https://github.com/jedie/micropython-so ... ain.py#L86
Now i use asyncio.start_server() e.g.: https://github.com/jedie/micropython-so ... ch.py#L154
In both cases: The long running webserver is not reachable at some point. I still see the IP connected. But the server is not responding.
I implement a own watchdog that will reconnect to WiFi station if disconnected.
Anyone a tip what it might be?
Another question: How can I implement a watchdog that monitors the correct functioning of the webserver?
long running webserver not reachable
-
- Posts: 969
- Joined: Sat Feb 03, 2018 7:02 pm
Re: long running webserver not reachable
You can try:
In our mqtt tests the esp8266 did quite poorly when the wifi signal was weak but this improved the stability a lot.
Of course it could be the case that you have a completely different problem like your webserver crashing, but I can't say anything about that.
Code: Select all
import esp
esp.sleep_type(0)
Of course it could be the case that you have a completely different problem like your webserver crashing, but I can't say anything about that.
Kevin Köck
Micropython Smarthome Firmware (with Home-Assistant integration): https://github.com/kevinkk525/pysmartnode
Micropython Smarthome Firmware (with Home-Assistant integration): https://github.com/kevinkk525/pysmartnode
Re: long running webserver not reachable
Thanks. I tested esp.sleep_type(0) but without success.
I monitored the output via shell: My watchdog is running and it is still connected to WiFi station.
I think the actual web server must have stopped at some point.
The question is: How can I test if the server is still running?
I monitored the output via shell: My watchdog is running and it is still connected to WiFi station.
I think the actual web server must have stopped at some point.
The question is: How can I test if the server is still running?
Related Question
Is the sleep_type() setting persistent like the connection and debug settings?
ie. You only need to execute the commands once and the ESP8266 remembers the value even after a reboot.
ie. You only need to execute the commands once and the ESP8266 remembers the value even after a reboot.
-
- Posts: 969
- Joined: Sat Feb 03, 2018 7:02 pm
Re: long running webserver not reachable
No you have to set it every time as it falls back to its default value.
Kevin Köck
Micropython Smarthome Firmware (with Home-Assistant integration): https://github.com/kevinkk525/pysmartnode
Micropython Smarthome Firmware (with Home-Assistant integration): https://github.com/kevinkk525/pysmartnode
Re: long running webserver not reachable
Think i found a way to "watchdog" the web server:
Feed the watchdog from main asyncio loop. If the loop stops: web server stopped.
See: https://github.com/jedie/micropython-so ... c6190528c2
Feed the watchdog from main asyncio loop. If the loop stops: web server stopped.
See: https://github.com/jedie/micropython-so ... c6190528c2