So you're a Noob? Post your questions here until you graduate! Don't be shy.

User avatar
By btidey
#88457 If you are using a real switch as a test to simulate your input then when it is open then nothing is connected to the EN pin and it is left floating.

This means that the EN does not have a determinate state. As it is a very high input impedance then it is likely that the capacitance will retain the previous voltage for a while., e.g. a high from when the switch was last closed.

What you need is that when the switch is closed 3.3V is fed to EN and when it is open then the EN signal sees a good 0V. So what you need to do is put a resistor (e.g 100K) on the EN side of the switch to 0V so that when the switch is opened then the EN signal will get pulled to 0V fairly quickly.
User avatar
By schufti
#88459
Code: Select allinstead of           5V                      try this       5V
                      |                                      |
                      R                                      R
                      |                                      |
                      +-- SW----o EN                         +------+-----o EN
                      |                                      |      |
                      R                                      R      SW
                      |                                      |      |
                     GND                                    GND    GND



User avatar
By ezcGman
#88465 I'm really, really starting to get super frustrated, as I steal you guys so much time and it is not working...

None of these two methods worked. With @schuftis method, The ESP won't even boot. It just blinks once and that's it. I guess because of the constant 3V3 on EN? I don't know...

And @btidey: What you mean with "So what you need to do is put a resistor (e.g 100K) on the EN side of the switch to 0V so that when the switch is opened then the EN signal will get pulled to 0V fairly quickly." is what I attached (doorbell_v2.png)? :( That also doesn't work unfortunately, zero reaction.

So no matter if I choose what I initially drawn (just with the connection behind the 1st resistor ;) ) nor what @btidey suggests triggers ZERO reaction on the ESP... I'm also attaching my code, maybe you spot an issue (of course only if you want! I bet I blocked your time enough already... I'm sorry!).

Maybe, it is just my test setup and in the real setup it just works... I will give it a try...
The real setup is a doorbell / doorphone: http://www.deh0511.de/twinbus/.
See "doorbell_v1.png" attached.
I'm connecting to the Pin 4 (EXT) and Pin 3 (GND). Whenever somebody rings the door, there is 5V on Pin 4. And that's what I'm basically trying to simulate with my switch.

My current setup is is also attached. It's pretty simple: In code put GPIO 4 PULLUP, and I'm using the 5V on door ring to switch a transistor that will pull the GPIO4 to GND. That perfectly works fine. Only issue as I posted: The ESP8266 runs forever / endless loop, eating battery...

I'm really out of ideas what I'm doing wrong and why I can't get it to work... I'm just hoping for a code issue or something :D

Thanks so much again! Also thanks if you still try to help me ;)
You do not have the required permissions to view the files attached to this post.
User avatar
By btidey
#88475 EN must be kept high 3.3V all the time the ESP8266 is running. As soon as it goes low the ESP8266 will instantly stop.

So if you are pushing the switch and releasing it then that is not going to work. The ESP8266 will start up but will stop as soon as you release the switch.

EN must be kept high long enough for the ESP8266 to complete its actions and then go into deep sleep.

You can simulate this by keeping the switch pressed fo rthe several seconds needed for this, but the real solution, as I mentioned, is to use a GPIO to hold the EN high as soon as the software starts via a schottky diode until the software completes its actions.

EN_feedback.jpg
You do not have the required permissions to view the files attached to this post.