3

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?

Peter Paul Kiefer
  • 1,883
  • 8
  • 10
RobT
  • 41
  • 3
  • Do you happened to have anything connect to reset pin, for example, from the USB-TTL serial adaptor? 2) Try to use CH_PD instead of RESET pin to see if it works? For CH_PD, it will depends on whether you have ESP-01 or ESP-01S (which already has a pull resistor on CH_PD).
  • – hcheung Sep 22 '20 at 03:22
  • 1
    while(!Serial) { } does nothing on esp. why do you have Serial.setTimeout(2000);? let the esp start completely before going to sleep. I guess it is still in process of autoconnecting to last remembered AP. – Juraj Sep 22 '20 at 05:33
  • @hcheung The board is an ESP-01, not an ESP-01S. I'm programming it with a simple USB-TTL flasher also sold by Inland, plugged into the USB port of my Macbook. When the board is plugged into the flasher the RST pin is pulled up to 3v3 by a 12K resistor. So I should try connecting GPIO 16 or CH_PD instead of RST and see what happens? – RobT Sep 22 '20 at 05:54
  • @Juraj Good question! I"m not sure, I copied the code since I'm not quite sure what I'm doing. I commented out the lines with while(!Serial)... and Serial.setTimout.... and the result didn't change. As I mentioned, I can run the exact same sketch on several ESP8266 Nodemcu boards and it works fine, so I figured the problem wasn't with the software. – RobT Sep 22 '20 at 05:57
  • I need to amend one thing: I said "after 15 seconds it wakes up by a reset, but ....". This isn't totally clear. As an experiment, I ran the sketch on a nodemcu board (where it works perfectly), but I did NOT connect GPIO 16 to RST with the jumper. The result is exactly the same it goes to sleep, then after 15 seconds prints ets Jan 8 2013,rst cause:2, boot mode:(3,6), and nothing else, and then hangs. In other words the ESP-01 board is behaving exactly as if GPIO 16 is NOT connected to RST. – RobT Sep 22 '20 at 05:59
  • on esp-01 io 16 is not connected to reset – Juraj Sep 22 '20 at 10:57
  • @juraj I'm not sure what you mean. Do you mean that GPIO 16 is not connected by default to reset on the ESP-01 board, or do you mean that it shouldn't be connected? It clearly is not connected by default. According to the ESP8266 data sheet GPIO 16 needs to be connected to reset in order to enable wake up from deep sleep. My objective is to get the chip to wake up from deep sleep. – RobT Sep 22 '20 at 15:40
  • it is not connected. you can wire it if you can solder to the chip's leg. it must be connected to reset out from deep-sleep. it is a workaround for an error in the basic bootloader of the esp8266. this bootloader can't be updated and it hangs on internal wake-up. – Juraj Sep 22 '20 at 15:47
  • @juraj That makes sense that it's a workaround for an error. You would think when the chip was first being designed that it could have been made to wake up from deep sleep without having to make an external connection. – RobT Sep 22 '20 at 21:36