gpio14 esp12f always value 0 ??

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
bledad
Normal user
Posts: 86
Joined: 23 Nov 2020, 10:57
Location: France

gpio14 esp12f always value 0 ??

#1 Post by bledad » 13 Oct 2023, 10:01

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

User avatar
Ath
Normal user
Posts: 3522
Joined: 10 Jun 2018, 12:06
Location: NL

Re: gpio14 esp12f always value 0 ??

#2 Post by Ath » 13 Oct 2023, 10:02

In your actual command sent, did you replace the period (.) by a comma (,)?
/Ton (PayPal.me)

bledad
Normal user
Posts: 86
Joined: 23 Nov 2020, 10:57
Location: France

Re: gpio14 esp12f always value 0 ??

#3 Post by bledad » 13 Oct 2023, 10:36

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 )

User avatar
Ath
Normal user
Posts: 3522
Joined: 10 Jun 2018, 12:06
Location: NL

Re: gpio14 esp12f always value 0 ??

#4 Post by Ath » 13 Oct 2023, 12:04

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?
/Ton (PayPal.me)

bledad
Normal user
Posts: 86
Joined: 23 Nov 2020, 10:57
Location: France

Re: gpio14 esp12f always value 0 ??

#5 Post by bledad » 13 Oct 2023, 14:13

it's coming from the relay module
with relay with opto it's good
5vrelaymodulelabelled.jpg
5vrelaymodulelabelled.jpg (196.73 KiB) Viewed 1789 times

TD-er
Core team member
Posts: 8756
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: gpio14 esp12f always value 0 ??

#6 Post by TD-er » 13 Oct 2023, 14:52

So the optocoupler along with some current limiting resistor was acting as a pull-up.

User avatar
Ath
Normal user
Posts: 3522
Joined: 10 Jun 2018, 12:06
Location: NL

Re: gpio14 esp12f always value 0 ??

#7 Post by Ath » 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.

Does it work as expected if nothing is connected to the GPIO?
/Ton (PayPal.me)

User avatar
chromo23
Normal user
Posts: 827
Joined: 10 Sep 2020, 16:02
Location: germany

Re: gpio14 esp12f always value 0 ??

#8 Post by chromo23 » 13 Oct 2023, 18:19

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

bledad
Normal user
Posts: 86
Joined: 23 Nov 2020, 10:57
Location: France

Re: gpio14 esp12f always value 0 ??

#9 Post by bledad » 16 Oct 2023, 14:53

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?

User avatar
Ath
Normal user
Posts: 3522
Joined: 10 Jun 2018, 12:06
Location: NL

Re: gpio14 esp12f always value 0 ??

#10 Post by Ath » 16 Oct 2023, 15:12

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)
/Ton (PayPal.me)

bledad
Normal user
Posts: 86
Joined: 23 Nov 2020, 10:57
Location: France

Re: gpio14 esp12f always value 0 ??

#11 Post by bledad » 16 Oct 2023, 15:17

yes i've tryed debonce and interval = 0

TD-er
Core team member
Posts: 8756
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: gpio14 esp12f always value 0 ??

#12 Post by TD-er » 16 Oct 2023, 15:47

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.

User avatar
Ath
Normal user
Posts: 3522
Joined: 10 Jun 2018, 12:06
Location: NL

Re: gpio14 esp12f always value 0 ??

#13 Post by Ath » 16 Oct 2023, 15:50

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...
/Ton (PayPal.me)

bledad
Normal user
Posts: 86
Joined: 23 Nov 2020, 10:57
Location: France

Re: gpio14 esp12f always value 0 ??

#14 Post by bledad » 16 Oct 2023, 16:44

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

User avatar
Ath
Normal user
Posts: 3522
Joined: 10 Jun 2018, 12:06
Location: NL

Re: gpio14 esp12f always value 0 ??

#15 Post by Ath » 16 Oct 2023, 16:45

Some of those days..., and, look at the calendar, it's a Monday... :shock: :lol:
/Ton (PayPal.me)

bledad
Normal user
Posts: 86
Joined: 23 Nov 2020, 10:57
Location: France

Re: gpio14 esp12f always value 0 ??

#16 Post by bledad » 16 Oct 2023, 16:51

:D ;)

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 36 guests