I have found a number of other posts from people with the same problem but I can't find an answer.
I have a small batch of ESP-01 boards, sold by Inland, and I wish to use deep sleep mode on them.
I soldered a small copper wire from pin 8 (i.e. GPIO 16) to RST. On one board I soldered it directly, on another I soldered pin 8 and RST to two sides of a 2 pin header so I could use jumper in case I wanted to disconnet GPIO 16 from RST.
I am flashing the following simple code (using Arduino IDE 1.8.12), which is about the simplest test of the deep sleep mode that I can think of.
void setup() { Serial.begin(74880); Serial.setTimeout(2000); while(!Serial) { } Serial.println( "I'm awake, but I'm going into deep sleep mode for 15 seconds"); ESP.deepSleep(15e6); } void loop() { } On starting the serial monitor shows
ets Jan 8 2013,rst cause:2, boot mode:(3,6) load 0x4010f000, len 3664, room 16 tail 0 chksum 0xee csum 0xee v39c79d9b ~ld I'm awake, but I'm going into deep sleep mode for 15 seconds After 15 seconds the serial monitor shows
ets Jan 8 2013,rst cause:2, boot mode:(3,6) and nothing else. After that the thing hangs and nothing further happens.
So, it appears that the setup runs, the serial monitor prints the message, the mc goes into deep sleep, after 15 seconds it wakes up by a reset, but doesn't go through set up again, hence doesn't print the message or go back sleep.
Here are some comments. The problem has nothing to do with Wifi, MQTT etc, I have tried many fancy sketches using all of these, I have same problem no matter what, the above sketched is my distillation to the simplest demonstration of the deep sleep problem.
I have flashed the program with Arduino IDE, Platform IO, and esptool.py from a command line. It doesn't make a difference.
There may be a problem with my soldering job, but I'm pretty good at soldering and SMD rework, and I have repeated the job on a number of these ESP-01 modules, inspected and tested with multimeter, etc. all with the same outcome.
I don't see a problem with my code or IDE, I have a batch of Lolin Nodemcu boards, and this sketch works perfectly on all of those. In that case I simply connect GPIO 16 to RST with a jumper wire, the program prints the message, sleeps for 15s, wakes up, prints it again, goes back to sleep for 15s more, etc. etc.
Are these just bad boards? I have read some things that say the flash chips might be lousy, and if I replace those it might help? I'm tempted to trash these boards and buy some D1 mini's, but I've seen a number of posts from people who say they've had the same problem with D1 minis. If the board is the problem, are there any recommendations for manufacturers or vendors that sell better quality?
while(!Serial) { }does nothing on esp. why do you haveSerial.setTimeout(2000);? let the esp start completely before going to sleep. I guess it is still in process of autoconnecting to last remembered AP.