Chat freely about anything...

User avatar
By Rohit Mathur
#71120 Hello fellas,

I have been working on a home automation project lately which has finally been completed. I have a few questions related to the stability of ESP8266. At first, i would like to introduce you all to the basic working of my project.

I am using a Raspberry Pi 3 which is running Node-Red and it's Mosca palette as MQTT broker. Three ESP8266 are connected to a relay and one ESP is connected to a DHT11 temperature sensor. Everything is working fine but sometimes the ESP disconnects from the WiFi, sometimes from the MQTT broker. Another problem which I am facing is when I recycle the power to ESP module, it doesn't run the program. The Serial Monitor stays blank. However, when I remove the GPIO2 pin from the relay and then power up the ESP and after powering up I connect the pin back to the relay. Everything works fine. Sometimes it starts throwing a fatal exception(0) and soft wdt reset even though I have a watchdog timer in my program.

Vcc --> 3.3V
CH_PD --> 3.3V
TXD --> TXD (Arduino)
RXD --> RXD(Arduino)
GPIO0 -->GND (while uploading the program)/ 3.3V
GND --> GND

I am going to install this system in my home. So, I am expecting some safety tips as well. Also, I was looking out for some methods to supply power to the ESP for a long-term, for which I found ac to dc converter, the perfect solution. Any advice would be highly appreciable
Attachments
(2.3 KiB) Downloaded 636 times
User avatar
By martinayotte
#71144
philbowles wrote:GPIO2 must be pulled up at power-on (and GPIO0 low) for the sketch to run

Not true ! With GPIO0 to LOW, it will be in Upload mode, not Execute mode !
Be careful when providing such answers, you will confuse newbies ...
User avatar
By rudy
#71150 The ESP8266 is not very forgiving if you feed it poor power. Power issues can drive you crazy if you are trying to hunt down the cause if you believed it was a code issue.

I think that when the ESP8266 modules were designed the thought was that they would be implemented into properly designed systems with adequate power and signal conditioning. And that is far from the case generally when it comes to the hobbyist market. The ESP8266 is touted as a low power chip. And that is true under some conditions. But there are other operating states where it needs a lot of current. (self calibration for one)

Later revisions of some modules included more capacitance internally to help with the power issues. They are better, but care still is required if you want stability and reliability.
User avatar
By Rohit Mathur
#71212 @philbowles - I face fatal exception (0) error every time on nodemcu v1.0 even on example sketches like HelloServer and in the case of ESP-01, only on reboot. Watchdog timer was not for the solution of fatal exception problem, it was for soft wdt reset error.

ets Jan 8 2013,rst cause:4,boot mode:(1,7)
Soft wdt reset


The boot mode used to shuffle on every upload. It was resolved somehow with a watchdog timer(wdtFeed) but not completely. It still shows that error sometimes on reboot as well as just after uploading the sketch. The ESP reconnects to MQTT broker but not to the WiFi. Do I have to restart ESP every time the router gets disconnected?

Someone suggested me the whole if-else around if(i==1000). It recovered from soft wdt error after adding wdtFeed and the if-else just after that. What does this whole function do? I didn't get it properly in your last comment. Sorry for the stupid questions so far, I'm just 14 years old. So I am a bit short on brains.
Attachments
nodemcu-helloServer.png