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