long running webserver not reachable

All ESP8266 boards running MicroPython.
Official boards are the Adafruit Huzzah and Feather boards.
Target audience: MicroPython users with an ESP8266 board.
Post Reply
jedie
Posts: 252
Joined: Fri Jan 29, 2016 12:32 pm
Contact:

long running webserver not reachable

Post by jedie » Mon Nov 25, 2019 8:02 am

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?

kevinkk525
Posts: 969
Joined: Sat Feb 03, 2018 7:02 pm

Re: long running webserver not reachable

Post by kevinkk525 » Mon Nov 25, 2019 8:08 am

You can try:

Code: Select all

import esp
            esp.sleep_type(0)
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.
Kevin Köck
Micropython Smarthome Firmware (with Home-Assistant integration): https://github.com/kevinkk525/pysmartnode

jedie
Posts: 252
Joined: Fri Jan 29, 2016 12:32 pm
Contact:

Re: long running webserver not reachable

Post by jedie » Mon Nov 25, 2019 10:46 am

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?


bitninja
Posts: 165
Joined: Thu Sep 15, 2016 4:09 pm
Location: Spring, Texas

Related Question

Post by bitninja » Thu Nov 28, 2019 9:38 am

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.

kevinkk525
Posts: 969
Joined: Sat Feb 03, 2018 7:02 pm

Re: long running webserver not reachable

Post by kevinkk525 » Thu Nov 28, 2019 10:45 am

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



Post Reply