Nodemcu(esp8266) is constantly reseting

I guess rst cause:4 is a watchdog timer issue. Check this out: