Deep Sleep Button Setup

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
makefu
New user
Posts: 1
Joined: 14 Apr 2018, 23:01

Deep Sleep Button Setup

#1 Post by makefu » 14 Apr 2018, 23:21

Hello,

for a project of mine i wanted to add a esp8266 to a "bullshit" button which should trigger an event (http) on every reset. The Button connects RST to GND. Then, for like 30 seconds the the LED should blink.

This is what i came up with with the espeasy rules engine:

Code: Select all

# dummy device "dummy" with "counter"(1) and "end"(2)
# led on gpio5

On WiFi#Connected do
  TaskValueSet,2,2,0
  timerSet,1,1
  # or notify 1
  SendToHTTP 192.168.8.2,80,/cgi-bin/suspend
endon


On Rules#Timer=1 do
  if [dummy#counter]=0
    TaskValueSet,2,1,1
  else
   TaskValueSet,2,1,0
  endif
  gpio,5,[dummy#counter]
  TaskValueSet,2,2,[dummy#end]+1

  if [dummy#end]!=60
   timerSet,1,1
  else
    deepSleep,0
  endif
endon
Everything works correctly but for some reason it is not possible to deepSleep an infinite time (until reset is pressed again) via deepSleep,0 command. without the second `else` and no deepSleep command the "will go to sleep after 30 seconds" builtin is also not triggered anymore and i cannot figure out what the problem is.

When i set

Code: Select all

deepSleep,5
but do not connect the pin to RST then esp will be somewhat half asleep and use a whopping 0.1mah which quickly drains the batteries.

Anybody had similar issues or found a workaround?

Post Reply

Who is online

Users browsing this forum: No registered users and 115 guests