Wemos D1 mini Pro DeepSleep Fail

Hi guys,
I'm experiencing an issue when trying to use the deep sleep function on my Wemos D1 mini Pro board (ESP8266). At first I run my original code with the deepsleep implemented, to read sensor data every 15 minutes and sent it through the Blink App.

The code works as intented, but board is going into the deepsleep and never wakes up!

I´ve written new simplified code, just to test the deepsleep function. The deepsleep is set to 30 seconds. There is a "Woke up" and "Going into DeepSleep" message, and nothing else.

I should also point out that I did connect the D0 pin to RST after uploading the code.

This is a second board of mine, which has the same "Waking up" problem.

I hope you guys are kind to help or consult me.
Thanks!

The Code:

void setup() {
  Serial.begin(74880); 

 for (int i = 0; i < 1000; i++) {
    delay(10);
    yield();
  }

  Serial.println();

  Serial.println("Woke up");

  Serial.println("Going into sleep");

  ESP.deepSleep(30e6);
}

void loop() {}

The Serial Monitor output:

21:29:25.272 -> Woke up
21:29:25.272 -> Going into sleep
21:29:54.786 ->
21:29:54.825 -> ets Jan 8 2013,rst cause:2, boot mode:(3,6)
21:29:54.825 ->

Just for chuckles, remove this code and see what happens.

I just tried your sketch with a few modifications and it works. I will post the code and the board selection as I don't have your EXACT board

void setup() {
  Serial.begin(115200); 
    while (!Serial && (millis() < 5000))
    ;  // Wait up to 5 secs for Serial to be ready
  if (!Serial) {
    // publish not ready somewhere like MQTT
  } else {
    Serial.println(" ");
    Serial.println("Serial READY");
    Serial.println(" ");
  }
}

void loop() {
  Serial.println("Woke up");
  Serial.println("Going into sleep");
  ESP.deepSleep(5e6);
  Serial.println("Should never see");
}

OUTPUT

Should use the default baud rate of the ESP8266 to avoid those strange characters.
Serial.begin(74880);
Leo..

@lev4k The OP had it set to that. I was not aware. Here is the more readable successful output. Thanks for the lesson.

Hi,
just ran your code, but with 30s of deepsleep, and it doesnt seem to work as intended.

Here is the new Serial Monitor output:
06:41:42.116 -> ets Jan 8 2013,rst cause:2, boot mode:(3,6)
06:41:42.154 ->
06:43:14.820 ->
06:43:14.820 -> ets Jan 8 2013,rst cause:2, boot mode:(3,6)
06:43:14.859 ->

There isnt even the first "Serial READY" or "Woke up" message. Logner delay at the beginning seem to solve the problem (10s as in my original code).

Also, in my first test with your code, I forgot the D0 to RST Wire, and the board still send a message after 30s of "deepsleep":

06:50:00.644 -> ets Jan 8 2013,rst cause:5, boot mode:(3,6)
06:50:00.644 ->
06:50:00.644 -> ets_main.c

This does not make much sense to me.

Thank you for your time!

I changed mine to also be 30e6 and it works fine.
I complete the upload, attach pin D0 to RST, press reset, and the board reboots every 30 secs. If yours does not do that then maybe the board is bad.

Just FYI, here is some output. Note cause is 2 which is the RST pin, if I remove the jumper, I get a cause 5 which means the Deep Sleep Wakeup happened BUT the code does NOT restart now. I will add a ESP.restart(); after the deepsleep to see if it executes without the RST pin tied to D0. It does NOT. Double check your board type, there are quite a few different WEMOS types. Mine is marked on the board as D1 MINI, the can is a 12F, My board was auto selected as Mini Pro.

Hi,
I still find its behavior strange.
I´ve just tried it on a completely new board, didnt even solder any pins to it.
Almost the same happens while using your code, so this shouldnt be a hardware problem (unless all of them are faulty).

Here is the message I get, after uploading the code, pushing the button on the board and connecting D0 to RST:

15:56:46.266 -> Serial READY
15:56:46.266 ->
15:56:46.266 -> Woke up
15:56:46.266 -> Going into sleep
15:57:15.596 ->
15:57:15.596 -> ets Jan 8 2013,rst cause:2, boot mode:(3,6)
15:57:15.596 ->

And what is wrong with that?

This message does not cycle after the "restart". I only get it once.
It seems to wake up, but doesnt do anything after...

And you have the jumper on RST to D0?

Yes, just after uploading I connect D0 to RST

What board is auto selected?

Wemos D1 mini Pro, there is no problem with uploading the code.

Also, the board works just fine, it connects to the wifi, and can read all sensor data I need, but the DeepSleep function is just not there.

Do you have any other 8266 that is not a Wemos you can try? Based on the evidence the most likely reason for your issue is bad/fake boards. Where were they purchased?

How attached are you to the Wemos, how about a more modern board that is smaller, uses less power in any mode, and has unique start up after sleep features? Not sure if that feature is usefull to you but I don't know anything about your project.

I dont own any other ESP8266 except my Wemos boards.

One was bought from AliExpress, and the other from Amazon. I wouldn't rule out that they are both clones.

I would like the board to work, because I made a custom pcb mysefl, and im not sure if other Wifi boards would be interchangeable.

I have two genuine D1 Mini modules purchased from the Lolin store on Aliexpress, and a clone D1 Mini Pro purchased from Banggood. What code are you testing? Is it the code in post #3?

Also, can someone explain why the hardware and software watchdogs don't trigger during this process?