Deep sleep, manual and interval wakeup possible?

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
mcdroemmel
New user
Posts: 6
Joined: 11 Mar 2017, 10:41

Deep sleep, manual and interval wakeup possible?

#1 Post by mcdroemmel » 20 Feb 2018, 22:55

Hello together,

i want to build a window alarm based on battery based Esp (d1 mini) with a magnetic switch connected to gpio.
using espeasy i configured the d1 mini to wakeup when magnets switch is disconnected (window is opened) and send a mqtt message to openhab. This works fine so far.
But this scenario only wakes up the d1 mini when the magnetic switch is released, an alarm is triggered.
But i also want the esp to send vca-information as a information about battery and as a keep-alive of the sensor in defined time values.
I looks to me, that i can use manual wakeup (by my magnetic switch for triggering my alarm) OR use time based deep sleep intervals.
Does anybody now how to use manual wakeup by gpio AND time based deep sleep intervals for doing some additional logic, like sending vcc-value or a keep-alive by mqtt.

kind regards
McD

TD-er
Core team member
Posts: 8738
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Deep sleep, manual and interval wakeup possible?

#2 Post by TD-er » 21 Feb 2018, 00:18

Just an idea on the side... When you're using it next to a window, could you also add a small solar panel to recharge the battery and then don't need the deep sleep anymore?

User avatar
grovkillen
Core team member
Posts: 3621
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: Deep sleep, manual and interval wakeup possible?

#3 Post by grovkillen » 21 Feb 2018, 03:21

My friend has been experimenting with a 7555 chip and has been able to get pulse cycles of 55 minutes pretty much perfectly. Will make a guide for it when he got it all down.
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you :idea: :idea: :idea:

lassiko
New user
Posts: 8
Joined: 31 Mar 2017, 15:40

Re: Deep sleep, manual and interval wakeup possible?

#4 Post by lassiko » 24 May 2018, 23:05

Are there any solution for this available yet?

I am building a sensor that reports when water tank is coming to full and deep sleep is needed to keep battery alive long time (several months).
Anyhow, i need to know that sensor is still alive, so i would like to report the battery voltage to controller, maximum 1h 11m.

So, can i wakeup manually, when water level switch is triggered, and same time automatically send battery status out with maximum sleep time?

Thanks!

gert3d
New user
Posts: 8
Joined: 12 Nov 2017, 21:46

Re: Deep sleep, manual and interval wakeup possible?

#5 Post by gert3d » 26 May 2018, 22:00

ESP wakes up from deep sleep by the connection of GPIO15 to Reset - GPIO15 goes low when deep sleep ends.
You can also wake up the ESP manually by driving Reset low some other way.

lassiko
New user
Posts: 8
Joined: 31 Mar 2017, 15:40

Re: Deep sleep, manual and interval wakeup possible?

#6 Post by lassiko » 06 Jun 2018, 08:43

gert3d wrote: 26 May 2018, 22:00 ESP wakes up from deep sleep by the connection of GPIO15 to Reset - GPIO15 goes low when deep sleep ends.
You can also wake up the ESP manually by driving Reset low some other way.
hmm. i did not got this working. I know there are lots of information about this available, but maybe you could help me a bit further here?
I want to esp sleep maximum possible time, which is +1hour. After that, it should send battery voltage info to my controller, and goes back to sleep. This i can do of course with max sleep time and GPIO16 connected to RST. Anyhow, during the deep sleep (with sleep time set to maximum) GPIO15 to RST does not wake ESP up. Am i missing something here? Do i need a pull-up resistor between GPIO15 and RST or something else?

OR, is it possible to read e.g. GPIO15 state (or some other pin) after waking up from deep sleep? That would work as well for me. So if during the deep sleep, state of pin has changed from 0 to 1, and then it sends information to my controller of it?

Thanks!

gert3d
New user
Posts: 8
Joined: 12 Nov 2017, 21:46

Re: Deep sleep, manual and interval wakeup possible?

#7 Post by gert3d » 06 Jun 2018, 11:10

> This i can do of course with max sleep time and GPIO16 ?? connected to RST.

I guess you mean GPIO15.
I am doing excactly the same to find out what batteries I should use (NiMh) for maximum service, no pull-up resistor needed.
Did you try shorter wake-up periods? Make sure all your code is in the setup() and nothing in the loop().

lassiko
New user
Posts: 8
Joined: 31 Mar 2017, 15:40

Re: Deep sleep, manual and interval wakeup possible?

#8 Post by lassiko » 06 Jun 2018, 19:30

I am using ESP easy on my Wemos D1 mini.. i have not modified code manually. Sleep time is set from ESP easy UI directly.
https://www.letscontrolit.com/wiki/index.php/SleepMode "The ESP8266 can be set to deep sleep. You need to connect GPIO-16 with the RST pin to make this work."

It can be set to sleep until manually woken up: "If you specify a Sleep Delay of 0, you will have to wake the device yourself by pulling RST to GND."
But this way i do not receive battery voltage information every while and then.

gert3d
New user
Posts: 8
Joined: 12 Nov 2017, 21:46

Re: Deep sleep, manual and interval wakeup possible?

#9 Post by gert3d » 07 Jun 2018, 00:11

So there is no wake-up possibility in ESPeasy after let's say 1 minute?
Try to connect GPIO15 to RST, since that pin goes low after the deep sleep timer ends.

lassiko
New user
Posts: 8
Joined: 31 Mar 2017, 15:40

Re: Deep sleep, manual and interval wakeup possible?

#10 Post by lassiko » 07 Jun 2018, 07:31

Espeasy can be set to deepsleep time what you wish, 60seconds is also OK. I need to study this bit more, but RST -> GND wakes it up manually, even you have sleeptime set e.g. to 30mins when GPIO16 is connected to RST.

Overall it seems that there's no one way to do this.. just need to find the best way for my project.

Post Reply

Who is online

Users browsing this forum: No registered users and 19 guests