I'm trying to get the D1 mini to return operation after ESP.deepsleep()
. The code below compiles and gives the expected output for the first run. Five seconds after the announcement that that the device is going to sleep, there is a brief flash on the on board LED and I get a string of garbage on the serial monitor. Ideas for things to try would be appreciated.
// Testing d1 mini deep sleep
// D0 and RST are connected
/* platformio.ini:
[env:d1_mini]
platform = espressif8266
board = d1_mini
framework = arduino
monitor_speed = 115200
*/
#include <Arduino.h>
void blink();
void setup() {
Serial.begin(115200);
pinMode(D0, WAKEUP_PULLUP);
pinMode(LED_BUILTIN, OUTPUT);
}
void loop() {
blink();
delay(1000);
Serial.println("Going for some deep sleep");
ESP.deepSleep(5e6); // 5e6 is 5 seconds
}
void blink() {
digitalWrite(LED_BUILTIN, LOW);
delay(500);
digitalWrite(LED_BUILTIN, HIGH);
delay(500);
}
As you can guess I'm running this with platformio. The output on the serial monitor is:
stefan@Cameron ~/.../Projects/Deep sleep $ platformio device monitor --baud 115200
--- Miniterm on /dev/ttyUSB0 115200,8,N,1 ---
--- Quit: Ctrl+C | Menu: Ctrl+T | Help: Ctrl+T followed by Ctrl+H ---
Going for some deep sleep
sl␀l��|␀�l�|␂␌␌␄�␄l�␌c|ǃ␃�␛�r�cd�c��gg�doo���␌cpp��$sd{d␛�{��o�c�gbx␀�
There is a blink of the LED on the first run, nothing there either after the apparent reset.