Chat freely about anything...

User avatar
By a8ree
#53800 Hi,

I'm trying to recreate a project from Hackster.io which is to create an IFTTT Smart Button

https://www.hackster.io/noelportugal/if ... ton-e11841

I'm finding that there is a 6 second delay when pressing the button.

Currently I am powering from the USB. Could this be my issue or does anyone have any suggestions to why it isn't working as it should?

Incidentally, when the unit powers on for the first time, it performs a call to IFTTT which happens without delay
User avatar
By techiesms
#54230 I have made the same button but using ESP-12e. It is very simple to make IoT button using ESP-12e as compared to ESP8266. And quick responsive too.

watch out the tutorial video on how to make that. Hope it helps.

https://www.youtube.com/watch?v=TLdPTEeJMq8

For more projects related to ESP8266 and ESP-12e, visit my website,
http://www.techiesms.com
User avatar
By Terraformer
#57615 Hi,

I build one of these myself with an ESP-01. I'm powering it with 2 AA rechargeable batteries at 2.6V and WiFi is connected in less than a second. From button-press to http-post less than 3 seconds pass, mostly reliable. Sometimes it cannot connect to wifi in less than 5 seconds and is switching itself off.

However, I have some strange behavior in regards to energy consumption. When I connect the power supply the first time and the device has yet not been started via button press, it consumes 1.7 mA. When pressing the button, it consumes approx. 80 mA till it's finish posting. After that it consumes 15 µA--I put it into deep sleep to avoid wasting energy in case the button is still pressed.
First question: Why is the ESP consuming 1.7 mA although EN is not connected and LOW, respectively? As stated before: After the first button press all is fine, it consumes less than 15 µA.
Second question: If the button is pressed for a long time (say 10 seconds) and, consequently, powering the ESP-01 longer than it needs to do its http-post, it won't "wake up" by another button press no matter how long I wait. The code looks like that:
Code: Select allpinMode(2,OUTPUT);
digitalWrite(2,HIGH);  // keep ESP active
connectWifi();
postHttp();

digitalWrite(2,LOW);  // power off ESP

// sleep forever in case external power is still applied and powering the ESP despite PIN 2.
while (true) {ESP.deepSleep(0, WAKE_RF_DEFAULT);}

What am I missing here? I thought that as soon as the external power supply is off, and therefor, EN/CH_PD is LOW, the ESP will power off. However it seems to deep sleep forever.
I searched the datasheet and the SDK document but I'm not sure what it means. Figure 3 (page 28) suggests, that EN/CH_PD is only relevant on startup. However,
OFF: CHIP_PD pin is low. The RTC is disabled. All registers are cleared.
is stated on page 27.

I appreciate any help.
Thanks & best.
User avatar
By martinayotte
#57617 deepSleep has nothing to do with CH_PD, since CH_PD is really a complete power down, and as your mentioned from specs, it also disable RTC, preventing any future WakeUp.
The deepSleep mechanism is between GPIO16 and RES, when RTC reach it wake up time, it bring GPIO16 to LOW, therefore producing a reset.
BTW, beware that when connecting GPIO to RES directly, it will prevent any other external reset to work, so better link them with some low value resistor such 470R or 1K.