nodemcu / nodemcu-devkit-v1.0

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

HTML server down after a while (STA mode)

magoblin opened this issue · comments

Hello!
I have my first ESP8266 module (NodeMCU 1.0) and I was able to make a HTML server on AP and STA mode.
So the next level was keep the server in STA mode working as much as possible on my home network so whenever I need the data acquired by a temperature and humidity sensor (I2C) I could connect by any device and get it on the browser.
It works great, but then I noticed that after a while the server did not answer my requests, ene the ping did not have answer from the ESP. As soon as I reset the board I get the webpage right away.
At this point I have not any clue about what happens but then I wondering if the ESP or WI-FI module was on a kind of “sleep mode”.
The loop works fine since I included a routine that shows the parameters (temperature and humidity) whenever I push the “flash” button on an Oled display. It works perfect so included a routine to reconnect the module to my network.
So I left the board connected to a 5V phone charger (1amp) overnight and after 30 minutes all works fine but on the middle of the night I try to retrieves the data and again the HTML server was not available. I push the button and the browser shows me the data.
The router is stable, the IP of the ESP does not matter if is assigned by the router or I set it out manually.
I guess something is going to sleep without I instructed to do so.
Anybody has experienced the same issue?
I have googled it and I found some very old forum but with no conclusion. They made a workaround with “thiker” function.
Please tour comments, ideas and if someone found the reason and have a solution....even better!!!