ESP deep sleep

Put it at the end of your send uptime function so it goes to sleep after it has finished doing whatever it needs to do. In this case send temp and humidity to virtual pins.

As for breaking the deepsleep, I suggest you Reed up a bit on this. An Internet search of “esp8266 deepsleep” will probably get a lot of results. Basically reseting the board wakes it up. You can do this though the automatic trigger on gpio16 by the deepsleep function, by grounding the reset pin or a power cycle.

Many thanks for your answer.
You wrote

Put it at the end of your send uptime function so it goes to sleep after it has finished doing whatever it needs to do. In this case send temp and humidity to virtual pins.

Does it mean this part will be never ran (because I understand after deepsleep, code is going to be run from the beginning)?

void loop()
{
  Blynk.run();
  timer.run();
}

loop () will run.

After booting from deepsleep it will load from setup (). I have seen examples that ran very simple code that was all placed in the setup function ending with a deepsleep.

Search the community and online. The answers you seek are already there and can be found with little effort.

1 Like