2

When using the deep sleep functionality on several ESP-01 boards, the boards require two resets in order to wake up properly (regardless of whether the resets are done by manually bridging the rst pin or by soldering a wire to do it from an interrupt). The boards do wake up and print some text automatically, but they do not run their firmware/code.

#include <ESP8266WiFi.h>
void setup() {
    Serial.begin(74880);
    Serial.print("\n--------------STARTING----------------\n");

    //pinMode(LED_BUILTIN, OUTPUT);     // Initialize the LED_BUILTIN pin as an output
    //digitalWrite(LED_BUILTIN, HIGH);  // Turn the LED off (gpio @ high= off)

    delay(500);
    ESP.deepSleep(2000000, WAKE_RF_DEFAULT );
}

void loop() {
}

I have not been able to just wake the board and run the code like most examples on the web intend to work, so I suppose the problem is not with this code.

On a successful wake up, the serial output looks like this:

 ets Jan  8 2013,rst cause:2, boot mode:(3,6)
load 0x4010f000, len 3456, room 16 
tail 0
chksum 0x84
csum 0x84
va5432625
~ld

--------------STARTING---------------

After the first reset, the board does indeed wake up, but it does not run it's code. It only prints this

 ets Jan  8 2013,rst cause:2, boot mode:(3,6)

And then hangs there. After another reset, it successfully runs it's code.

This issue persists across all the esp 01 boards i own, and i have tried pulling UP and DOWN almost every combination of pins recommended. The line that is printed in the fauly cases does indeed say it is booting in the right mode, but still the code does not run, nor mine nor the one that runs before mine

5
  • Had you tried ESP.deepSleep(2000000); instead of ESP.deepSleepInstant(2000000, WAKE_RF_DEFAULT ); ? – fabianoriccardi Jun 27 '20 at 15:33
  • @fabiuz7 yes, i tried deepSleepInstant to test if it had any different results from deepSleep, with no effect – sassoPera Jun 27 '20 at 15:36
  • Are you using this board ? It seems not exposing the pin 16, required to make the deep sleep working. mouser.it/ProductDetail/SparkFun/… – fabianoriccardi Jun 27 '20 at 15:46
  • I've tested your code on a Wemos D1 mini and it works as expected – fabianoriccardi Jun 27 '20 at 15:48
  • @fabiuz7 pin16 is actually needed to wake the chip from deepsleep. I mentioned in my post that i have the issue when resetting manually as well as from an interrupt. For example, if i don't connect pin16 i have to manually reset twice. If i connect that pin16 to the rst pin, i still have to reset manually once. – sassoPera Jun 27 '20 at 16:02
1

What sasso is describing is classic Deep Sleep Zombie mode. There's someone else here with ESP-01 boards with the same issue. I'd bet you got your boards in blister packs from Inland. I didn't see any ESP-01 boards from Inland at my local computer store, only ESP-01S, and that one works with Deep Sleep just fine. I only bought the one for a test. I believe it's the Flash chip, but we haven't proven that yet. I have plenty of Winbond flash in case I find a board that goes zombie, and can prove or disprove my theory. I have 8 different types of boards and modules, and all come out of Deep Sleep correctly.

edit: If the pic at Ali is correct, the Puya Flash shouldn't be causing an issue, presuming it's real and not a clone. Half the time the pics are only 'representative examples' of what they ship. The ESP8266 Arduino core has supported Puya for a while now. Also, on sober reflection the Inland package I bought said ESP-01S, and it's actually an ESP-01 (false advertising). I looked closer and didn't see the pull-up resistors. :-(

If you're powering it from that USB programmer board, it should work. If you have a separate 3.3V supply, I'd be suspicious of the supply. The current spikes as the ESP is booting will cause many switching supplies to drop below 2V briefly, and the ESP goes insane. Without having a zombie in front of me, I'm at a loss to go a lot further as my 'scope leads aren't that long.

3
  • Thank you very much for answering, the fact that almost no one ever aknowledged this problem around the net was driving me crazy. I got 8 boards from aliexpress from china, none of them works after deep sleep. I recentrly tried ordering a couple more to see if it was an hardware issue or not. Let me know if you need any info on the boards i got – sassoPera Dec 16 '20 at 10:31
  • Do you have the ali link, or a very good photo of the top of the board so that I can read the ID on the Flash chip? I suspect it says T25S80 (supposedly Bright Moon Semi) which you can also get by doing Serial.println(ESP.getFlashChipId(), HEX); after you've started the serial port. I get 14605E with what I think is a Bright Moon chip, although the manufacturer ID doesn't match their datasheet. – Krazy OldGuy Dec 19 '20 at 18:54
  • aliexpress.com/item/… this is where i got them, the ESP-01S variety – sassoPera Dec 20 '20 at 0:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.