-->
Page 1 of 2

ESP8266 hang

PostPosted: Thu Jul 23, 2020 1:40 pm
by Tosho Yankov
Hello ,
i have several devices in my home based on ESP8266 (NodeMCU, ESP-01) and all of them have same problem.
They just hand time to time and have to be power off - power on to start again. This happen on every 2-3 days, which is not okay, because I not sure is my sensors work or not. Can you help me how to troubleshoot and solve this problem.

Re: ESP8266 hang

PostPosted: Fri Jul 24, 2020 2:05 am
by pangolin
It is very difficult to make an ESP8266 actually "hang", they usually reboot when there is a serious problem, so whatever is doing it should be easy to spot, especially as it is a regular thing.

Obviosuly we would need to see the entire code of tke sketch they are running to offer any futher help, otherwise all you wil get is guesswork.

Re: ESP8266 hang

PostPosted: Fri Jul 24, 2020 6:31 am
by Tosho Yankov
There is several of them:
1. It is simple ESP-01 with DHT22 sensor

https://codeshare.io/5ojM6Y

And other one is NodeMCU+BME280sensor:

https://codeshare.io/21jQB7

Both of them work for 2-3 days and hang. There is ping to them , but no data exchange or send.

Re: ESP8266 hang

PostPosted: Sat Jul 25, 2020 3:19 pm
by pangolin
You need to explain what you mean by "hang". If you can ping them, they are not "hanging". Some error message output or wireshark trace would help.

One possible problem is that you only ever connect and start the server once in setup. If the wifi connection breaks, or you switch off your router then the server will time out and no longer be able to reply until you reboot the chip and go through the server.begin() again.