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);
}
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.
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.
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
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):
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
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: