Problem with GPIO16 (D0) in ESP-12E

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
Jufo
Normal user
Posts: 36
Joined: 12 Mar 2017, 13:47

Problem with GPIO16 (D0) in ESP-12E

#1 Post by Jufo » 12 Mar 2017, 14:12

Hi,

I have a problem I connected the switch to GPIO14 1 and 2 to GPIO16.
The first works fine, the second (GPIO16) physically works well, but ESP disconnects from the WiFi network, no access to the web interface, just restart helps.
Everything works fine when the first button is pressed (GPIO14, Inversed, state 1), then the 2 button also works correctly (GPIO14, Inversed, state 1). But when deactivate the first (GPIO14), activation of a second (GPIO16) causes problems, just restart helps.

Please help because I already have a ready-made PCB.
Connect button is done in the mode pull-up.

Image
Image
Image
Image
Image
Rules:

Code: Select all

on System#Boot do
   gpio,12,1
   gpio,13,1
endon

on SwitchAOn do
   gpio 12,0
   inputswitchstate 14,1
endon

on SwitchAOff do
   gpio 12,1
   inputswitchstate 14,0
endon
on SwitchBOn do
   gpio 13,0
   inputswitchstate 16,1
endon

on SwitchBOff do
   gpio 13,1
   inputswitchstate 16,0
endon

on SwitchA#switch do
   if [SwitchA#switch]=1
      event SwitchAOn
   else
      event SwitchAOff
   endif
endon

on SwitchB#switch do
   if [SwitchB#switch]=1
      event SwitchBOn
   else
      event SwitchBOff
   endif
endon
Thank you very much for your support
Best Regards Robert

Shardan
Normal user
Posts: 1156
Joined: 03 Sep 2016, 23:27
Location: Bielefeld / Germany

Re: Problem with GPIO16 (D0) in ESP-12E

#2 Post by Shardan » 14 Mar 2017, 20:02

Hello,

uhhhhm... GPIO 16 might be a bad choice as it has an additional function hardcoded inside the ESP chip.
It is used to wake up the ESP from deep sleep mode.
I use GPIO16 as output only.

First check: Is the "Sleep Mode" box checked in the ESPEasy "config" tab? It should not be checked.
Then check the "hardware" Tab, the GPIO16 (D0) should be set to "default".

If that does not help i could do a quick testing with a test board if there is a problem with that.
If i can make it work with a simple reading out of the switches there might be a problem with the rules.

Regards
Shardan
Regards
Shardan

Jufo
Normal user
Posts: 36
Joined: 12 Mar 2017, 13:47

Re: Problem with GPIO16 (D0) in ESP-12E

#3 Post by Jufo » 14 Mar 2017, 22:18

Shardan wrote: 14 Mar 2017, 20:02 First check: Is the "Sleep Mode" box checked in the ESPEasy "config" tab? It should not be checked.
Then check the "hardware" Tab, the GPIO16 (D0) should be set to "default".
Yes, I checked is correctly (unchecked Sleep Mode, and GPIO16 (D0) is set to default)
Shardan wrote: 14 Mar 2017, 20:02 If that does not help i could do a quick testing with a test board if there is a problem with that.
If i can make it work with a simple reading out of the switches there might be a problem with the rules.
Thank you very much for help

Shardan
Normal user
Posts: 1156
Joined: 03 Sep 2016, 23:27
Location: Bielefeld / Germany

Re: Problem with GPIO16 (D0) in ESP-12E

#4 Post by Shardan » 15 Mar 2017, 20:35

Hello Jufo,

As promised I did a quick check with a nodeMCU (ESP-12E with Programming adapter) on a breadboard.
Hardware is same as you did, just i hadn't placed the capacitor on the breadboard.

For me the GPIO16 runs as every other GPIO.
I used the following settings:
Delay: 0 (See below)
IDX: 123
1st GPIO: GPIO 16
Pull up: no (unchecked, you're using a resistor externally)
Inversed: unchecked
Switch type: Switch
Switch Button Type: Normal Switch
Send boot state: unchecked
Send data: checked.

If you use a "Switch Button Type: Push Button Active Low" remember:
This setting "toggles"! First pressing switches on, second pressing switches off.
I did not check your rules if that's the wanted beahaviour

If you set a delay time != 0 the ESPEasy repeats reading with the set up intervall and sends state.
So if you set delay to "1", a 1 or 0 state is sent every second - this may irritate your rules.


You may do the following steps to check your setup:

*** Very Important: If you do changes in the device setup, do a reboot, restart the ESP! ***

First, connect your programming cable or adapter to the serial port.
Then use the Arduino IDE or the ESPlorer (free software, set speed to 115200!) for monitoring the output from the ESP.
Save your rules settings to a textfile on the computer (just copy and paste works fine) and delete all rules from the ESP.
Reset the ESP
Check with the monitoring if you see a "State 0" or a "State 1" in the monitoring if the button is released / pressed.
That should work at least, otherwise something is wrong with your wiring.

If that works you may re-check your rules if something is wrong there.

Regards
Shardan
Regards
Shardan

Jufo
Normal user
Posts: 36
Joined: 12 Mar 2017, 13:47

Re: Problem with GPIO16 (D0) in ESP-12E

#5 Post by Jufo » 15 Mar 2017, 22:50

Problem solved, small changes to the PCB:
GPIO-14 = Switch
GPIO-16 = Relay (only working out!)
GPIO-13 = SwitchB
GPIO-12 = RelayB

Best Regards
Robert

Post Reply

Who is online

Users browsing this forum: No registered users and 34 guests