Pulled up GPIO is always 0 on boot [SOLVED]

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
grhhm
Normal user
Posts: 29
Joined: 23 Oct 2016, 20:15

Pulled up GPIO is always 0 on boot [SOLVED]

#1 Post by grhhm » 23 Mar 2018, 20:53

Guys, please, help with inconsistent input IO state.

ESP-12E has GPIO5 pulled up internally (from Device setting) and externally 50kOhm resistor.
The GPIO5 is defined in devices as waround, value name act_low. The rule is:

Code: Select all

on System#boot do
  publish,shm/%sysname%/status,wakeup
  notify 1
  if waround#act_low=0
   publish,shm/%sysname%/status,skip_poweroff
  else
   publish,shm/%sysname%/status,poweroff
   GPIO,12,0
  endif
endon
I wanted the ESP doing this or that on boot in dependency of GPIO5 state. However, it's always recognized 0 in spite of pullups.
If I ground it after boot completed and release the ground then the state changes to 1 as expected initially.

That's the heck?
Tried to move to GPIO 4, 13, 14 - the same behavior.
Version ESPEasy v2.0-20180304b.
Last edited by grhhm on 24 Mar 2018, 13:01, edited 1 time in total.

User avatar
budman1758
Normal user
Posts: 301
Joined: 15 Apr 2017, 05:13
Location: Riverside CA USA

Re: Pulled up GPIO is always 0 on boot

#2 Post by budman1758 » 24 Mar 2018, 00:05

On the hardware page what setting do you have for GPIO boot state?
"The glass is twice as big as it needs to be".

Oxyandy
Normal user
Posts: 95
Joined: 09 Mar 2018, 08:45

Re: Pulled up GPIO is always 0 on boot

#3 Post by Oxyandy » 24 Mar 2018, 00:38

I'm still learning but shouldn't
if waround#act_low=0
be
if [waround#act_low]=0
??

User avatar
budman1758
Normal user
Posts: 301
Joined: 15 Apr 2017, 05:13
Location: Riverside CA USA

Re: Pulled up GPIO is always 0 on boot

#4 Post by budman1758 » 24 Mar 2018, 00:52

Oxyandy wrote: 24 Mar 2018, 00:38 I'm still learning but shouldn't
if waround#act_low=0
be
if [waround#act_low]=0
??
Yes, I believe that you are correct.
"The glass is twice as big as it needs to be".

Oxyandy
Normal user
Posts: 95
Joined: 09 Mar 2018, 08:45

Re: Pulled up GPIO is always 0 on boot

#5 Post by Oxyandy » 24 Mar 2018, 01:09

I am using the latest Mega releases & the rules do not work reliably at all, I am running OnClock every 15 minutes..
Forced to be that often to test failures........

OnClock to turn relay on, before timer stops - A switch is triggered which stops timer cycle early, switch returns to it's original position awaiting next cycle..
Doesn't sound like much, but after many, many hours, being completely critical of myself, trying everything, watching, reading, reading, reading, logging loads of data, different (recent) firmwares etc etc
I have achieved nothing in the way of reliability, but I do look 15 years older :?

grhhm
Normal user
Posts: 29
Joined: 23 Oct 2016, 20:15

Re: Pulled up GPIO is always 0 on boot

#6 Post by grhhm » 24 Mar 2018, 13:00

budman1758 wrote: 24 Mar 2018, 00:05 On the hardware page what setting do you have for GPIO boot state?
Tried to enable and disable "Boot state" - same result :(
Oxyandy wrote: 24 Mar 2018, 00:38 I'm still learning but shouldn't
if waround#act_low=0
be
if [waround#act_low]=0
??
Bingo! Solved. Works. thank you very much!

Hehe... I already forked, cloned, loaded to PIO, compiled and started burying into the code to search the error. Lots time saved. I'd be like to help back.

Oxyandy
Normal user
Posts: 95
Joined: 09 Mar 2018, 08:45

Re: Pulled up GPIO is always 0 on boot [SOLVED]

#7 Post by Oxyandy » 24 Mar 2018, 23:09

That is cool, I have some coding experience too, but I deliberately took a step back from that a few year ago, likely rusty now..
Don't we all love steep learning curves, I always love a challenge, but sometime get lost in them, noticed very much so by those around me :lol:
I have Git Hub Desktop & Atom and really like the way everything syncs up..
Delving into the source is an option, but one so far I have avoided - 're-inventing the wheel' maybe ?
Here is a dairy if you will - about my experience.. What I am seeing as I attempt my task.
viewtopic.php?f=4&t=5007&start=10
Would be very interested in what you find, please share your experience
Cheers
Andy

User avatar
grovkillen
Core team member
Posts: 3621
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: Pulled up GPIO is always 0 on boot [SOLVED]

#8 Post by grovkillen » 24 Mar 2018, 23:27

Just as a note, I use the same float switches in my pump solution presented here (some older version of ESP Easy is used though).

But I would use these float switches if I where to do it again. The ones I have today are not 100% reliable. The problem I see with the current switches is that they might not pull the reed with the magnet. The switch I linked to is better designed and the magnet will be fixated better since it's attached to the switch with hinges.
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you :idea: :idea: :idea:

Oxyandy
Normal user
Posts: 95
Joined: 09 Mar 2018, 08:45

Re: Pulled up GPIO is always 0 on boot [SOLVED]

#9 Post by Oxyandy » 24 Mar 2018, 23:49

Yes, they are the exact same switches as I 'currently' use, I will put an order in for different switches from China
I was thinking some which are actually micro-switch based and can even handle enough current to directly switch the pump..
I would use the micro switch based float switches in NC, set at a higher position, it's function a fail-safe to stop an overflow.
An overflow means I need to restore the fluid level, then the nutrients, correct EC & pH (not yet automated) - ( One task 'successfully' at a time )
I will order a few other varieties of float switches too just to have in my toolbox.
My end goal is to have something which doesn't glitch out ever & if it does, there are other protections in-place.

Really nice project !!, similar to mine in many ways, thanks for sharing

Post Reply

Who is online

Users browsing this forum: Google [Bot] and 38 guests