Page 1 of 1

gpio14 esp12f always value 0 ??

Posted: 13 Oct 2023, 10:01
by bledad
Hello,
i no understand , that i put
gpio14 output low or ouput high or default
or control?cmd=GPIO,14.1
the state value is always 0
i have firmware ESP_Easy_mega_20230930_energy_ESP8266_4M1M

Re: gpio14 esp12f always value 0 ??

Posted: 13 Oct 2023, 10:02
by Ath
In your actual command sent, did you replace the period (.) by a comma (,)?

Re: gpio14 esp12f always value 0 ??

Posted: 13 Oct 2023, 10:36
by bledad
yes sorry for comma , but
when start with power , the gpio is 1
if i do control?cmd=GPIO,14,0
state value is 0
if i do control?cmd=GPIO,14,1
state value is 1 but hardware is 0
and always hardware 0 ( multimeter )

Re: gpio14 esp12f always value 0 ??

Posted: 13 Oct 2023, 12:04
by Ath
What is connected to that GPIO?
Does it have a pull-up or pull-down resistor or some circuit connected, or configured on the Hardware page?

Re: gpio14 esp12f always value 0 ??

Posted: 13 Oct 2023, 14:13
by bledad
it's coming from the relay module
with relay with opto it's good
5vrelaymodulelabelled.jpg
5vrelaymodulelabelled.jpg (196.73 KiB) Viewed 2360 times

Re: gpio14 esp12f always value 0 ??

Posted: 13 Oct 2023, 14:52
by TD-er
So the optocoupler along with some current limiting resistor was acting as a pull-up.

Re: gpio14 esp12f always value 0 ??

Posted: 13 Oct 2023, 15:10
by Ath
The plain relay-module seems to demand ~65 mA of current at 5V to switch the relay, but the ESP can only deliver max. ~20 mA for a high/1 output, so that won't work.

Does it work as expected if nothing is connected to the GPIO?

Re: gpio14 esp12f always value 0 ??

Posted: 13 Oct 2023, 18:19
by chromo23
This module seems to have a transistor rather than a optocoupler if you look closely...

@bledad could you post a picture of your setup?
Ath wrote: 13 Oct 2023, 15:10 The plain relay-module seems to demand ~65 mA of current at 5V to switch the relay, but the ESP can only deliver max. ~20 mA for a high/1 output, so that won't work.
That shouldn´t be an issue. Because of the transistor it will only draw around 2mA i would guess. Also with an optocoupler it wouldn´t be much more

Re: gpio14 esp12f always value 0 ??

Posted: 16 Oct 2023, 14:53
by bledad
thank's but with opto it's good , that's why I'm not going any further

other problem , it's not my day !!!

i've put a push button on GPIO 04 of my esp12
in hardware > Pin mode GPIO-4 (D2) > input pullup
i2c interface none none
in Devices :
Switch input - Switch
name piet
Enabled: checked
Internal PullUp: checked
GPIO ⇄ GPIO-4(D2)
Switch Type: switch
Switch Button Type: push button active low

i put resistor 4.7k +3.3v to gpio4
the gpio4 is a 1
but when put gpio4 0v , the gpio4 always at 1

what did I forget or do wrong?

Re: gpio14 esp12f always value 0 ??

Posted: 16 Oct 2023, 15:12
by Ath
Have you tried setting "De-bounce (ms):" to a value of ca. 100 msec?
What is the Interval? When on the default 60 sec. it can take up to 60 seconds before the Devices list is updated (unless there is another active task with a shorter Interval setting)

Re: gpio14 esp12f always value 0 ??

Posted: 16 Oct 2023, 15:17
by bledad
yes i've tryed debonce and interval = 0

Re: gpio14 esp12f always value 0 ??

Posted: 16 Oct 2023, 15:47
by TD-er
How do you pull GPIO-4 to GND?
Is it via a switch? or using some resistor?
Are you using a long cable?

If you're having a board like the NodeMCU, which also has a button labelled as "boot" or "flash" or you just know it is connected to GPIO-0, then you can also try using that one as a test to see if that's working like you'd expect.
This way you know there isn't anything wrong with how it is all connected, so you can eliminate a few unknowns from your debugging list.

Re: gpio14 esp12f always value 0 ??

Posted: 16 Oct 2023, 15:50
by Ath
bledad wrote: 16 Oct 2023, 15:17 yes i've tryed debonce and interval = 0
Well, if all active tasks have Interval = 0 then the Devices page won't be updated at all, so you might be waiting rather long for a change...

Re: gpio14 esp12f always value 0 ??

Posted: 16 Oct 2023, 16:44
by bledad
I'm so sorry.
when I tell you it's not my day
I made a mistake
not GPIO4 but GPIO5
and now it's ok
thank you

Re: gpio14 esp12f always value 0 ??

Posted: 16 Oct 2023, 16:45
by Ath
Some of those days..., and, look at the calendar, it's a Monday... :shock: :lol:

Re: gpio14 esp12f always value 0 ??

Posted: 16 Oct 2023, 16:51
by bledad
:D ;)