I have an ESP8266 code which is working well. There are no such issues. I just want that code to be re-written in such a way that it works efficiently and is more reliable in terms of stability. I am facing some minor issues like it get's disconnected from the wifi sometimes. On recycling power, the program doesn't run until and unless GPIO2 is disconnected from the relay. Sometimes it start throwing fatal exception(0). Sometimes it says wdt reset.