WeMos D1 R1 ESP8266 deepsleep mode not working w/o resetting

I am trying to get my WeMos D1 R1 to go into deep sleep, wake up after 1 minute, do a task and then repeat. After running the code below, nothing happens at first unless I physically push the reset button. Then, the setup code and loop code runs properly. How do I get the WeMos to run the code w/o resetting the first time?

I have checked that the D2 and RESET connection is fine.

// D2 -> RESET
void setup() {
  Serial.begin(115200);
  delay(5000);
  Serial.println();
  Serial.println("Start device in normal mode!");
  pinMode(D2, WAKEUP_PULLUP);
}
 
void loop() {
  Serial.println("I'm awake, but I'm going into deep sleep mode for 60 seconds");
  ESP.deepSleep(60e6);
}

It should be D0, I don't think it will work with any other pin.

I never needed to set the mode of pin D0 to get the Wemos to wake.

I use a resistor between D0 and RST, I generally used 510R, but the exact value is not important, probably anything from 330R to 1K is fine.

I've just tried changing it to D0. Doesn't work, won't connect to the ESP8266. Only D2 works.

What do you mean? What won't connect to the esp?

In post #1 you said it didn't work. Isn't that why you posted the question here?

I meant that connecting to every other pin except D2 gives this error: "esptool.FatalError: Failed to connect to ESP8266: Invalid head of packet (0x73)".
The code won't have error with connecting to D2, but won't run unless pushing RESET button first.

Maybe you should share your schematic so we can see what is connected to which pins of the Wemos.

Here is my code & circuit. I have around 5 of these circuits running perfectly for 7 years:

According to this Stackexchange comment Can't get deep sleep to work on Wemos D1 ESP8266 - Arduino Stack Exchange the GPIO16 pin on the WeMos D1 R1 is D2, versus D0 on the Mini.

I don't have a schematic program so here is a photo

1K resistor in between D2 and RESET pins.

I tried with & without the resistor and taking out & leaving in the pinMode(D2, WAKEUP_PULLUP):

  1. With resistor & taking out pinmode - code runs once only. After resetting WeMos physically, it runs only once again.

  2. With resistor & leaving in pinmode - code runs once only. After resetting physically, it runs only once again.

  3. No resistor & taking out pinmode - code does not run until reset, after which it loops as intended.

  4. No resistor & leaving in pinmode - code does not run until reset, after which it loops as intended.



@victorialoh I beg your pardon. D2 is GPIO16 on the D1 R1, versus D0 on the Mini.

I looked for a schematic for the D1 R1 but could not find one, even on the Lolin/Wemos website. I was hoping that would help explain what was going on here.

At least you have a working solution, albeit you need to press reset to get the cycle to start.

Where did you find a wemos D1 R1? At the bottom of a cardboard box in a store room, I suspect. The D1 R1 and D1 R2 were not successful products for Lolin/Wemos, compared to the D1 Mini, which was quite a big hit for them, before every other Chinese manufacturer started cloning the D1 Mini.

Thanks for your help.

I was asked to resurrect someone's else old project, so yeah, basically out of someone's storeroom.

Hi,
I am also having problems with a Wemos D1 mini with the deep-sleep.
I already have about 3 projects running on Wemos D1 mini and using deep-sleep with no problem, but this board seems to be broken :frowning:

I have a test code, since this board in giving me headaches.
The test code, just lights up a LED for 5 seconds, then enters sleep for 10 seconds.
I ran this code on two boards: Wemos D1 mini clone and (I hope so) an original Wemos D1 mini v2.3.0.
The problem with the clone is that: wakeup from deep sleep works, but it has a HUUUGE power consumption during both idle (about 230mA) and deep sleep (about 200mA).
The problem with the original one is that has an expected power consumption (14mA during idle and 0.05mA durind deep-sleep), but it never wakes!!!
Here are the boards with a logic analyzer on GPIO16 (D0) and GPIO2 (D4):

Clone:

Original:

The clone has no signal on D4, but this might be expected, since D4 is the built-in LED and the clone has no LED. But, at least the internal RTC triggers the expected LOW-pulse on D0 and wakes the ESP8266.
The original, seems like it tries to wakeup, since it lights up the built-in LED, but there is no LOW-pulse signal on D0 :frowning:
More, on the multimeter, is shows 14mA during bootup, then 0.05mA during deep-sleep, then again 14mA after it should have woken up. And it continues to consume 14mA, like it is running, but actually is doing NOTHING.
Also, the serial actually shows something when it should wakeup, but nothing more:

17:00:48.456 -> Entering deep-sleep in:
17:00:48.456 -> 5
17:00:49.425 -> 4
17:00:50.428 -> 3
17:00:51.427 -> 2
17:00:52.426 -> 1
17:00:53.428 -> Sleeping 10 seconds!
17:01:03.496 -> ��G�Y�

Is my board just broken and I can throw it away, or am I missing something?

Thanks!

That's just not right. Normal mode should be around 80mA and deep sleep around 200uA. Chuck it! (By which I mean recycle it responsibly)

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.