1. Restart nodemcu - normal behaviour
2. Restart router - automatically reconnect
When I connect it with usb for debugging wifi is working fine. That's why debugging is difficult.
If this issue is related to power then restarting router should not fix this.
I am using task scheduler library in my code, nodemcu is powered by an adaptor 5V 2A, using 10 led ws2812b, 3 relay 5v.