Periodic wakeup

Updated on 13 October 2022
dev board WeMos D1 Mini
chip ESP8266
features wakeup periodic
This tutorial is more than 1 year old. If the steps below do not work, then please check the latest versions and the documentations of the individual tools used.

Before starting

Dependancies

Ensure the following dependancies are downloaded and available:

Pre-requisites

Try these simpler or similar examples:

Buy the components

Code

Download code wakeup-periodically.ino
#include <ESP8266WiFi.h>

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

  while(!Serial) { }

  Serial.println("\nI'm awake !!");
  Serial.println("Doing the task...");
  Serial.println("Going into deep sleep for 10s...");

  ESP.deepSleep(10e6);
}

void loop() {
}

Makefile

BOARD?=esp8266com:esp8266:d1_mini
PORT?=/dev/cu.wchusbserial1410
BUILD=build
# Arduino CLI version 0.14.0 is used.

.PHONY: default lint all flash clean

default: lint all flash clean

lint:
	cpplint --extensions=ino --filter=-legal/copyright *.ino

all:
	arduino-cli compile --fqbn $(BOARD) --output-dir $(BUILD) ./

flash:
	arduino-cli upload --fqbn $(BOARD) --port $(PORT) --input-dir $(BUILD)

clean:
	rm -r build

Arduino IDE settings

Ensure the following IDE settings before flashing.

Periodic wakeup Arduino IDE settings

Description

Wake up periodically after a specified time. Short RST and GPIO012 on ESP (or D6 on WeMos).