- Fri Jul 10, 2015 4:29 pm
#22956
Wifi.mode has a tendency to persist, even after you've flashed new code. In the current release, if you've ever connected to an AP, the ESP will retain the SSID and try to log you in unless you explicitly set Wifi.mode. So, setting
may ease your problem, but I don't think it will totally solve it.
How are you powering your ESP? One of the most common causes of WDT resets is insufficient current. It's tricky, because the chip will run fine until it tries to transmit, then it'll choke when it needs (for instance) 250mA and your power supply can only provide 200mA.
Your code runs fine for me, for many minutes, even when my ESP connects to my AP. But I'm running it from a 1A power supply through a regulator.
If you're using your PC's USB port (or, worse yet, the 3V output from a serial converter) you may find that you don't have enough juice.