[SOLVED] Read state of a GPIO
Moderators: grovkillen, Stuntteam, TD-er
[SOLVED] Read state of a GPIO
Hi,
I need to read the state of a GPIO (where I attached a relay) in order to print its status in the oled display.
I tried everything, but couldn't find a solution.
The only way I managed to get the value was defining the relay GPIO as an input switch but the unit crashes after a few on/off cycles.
And probably it's correct as the relay is not an input switch.
I tried assigning a dummy device with a rule coming from OPENHAB. But of course it could go out of sync if the relay is activated outside from openhab.
I am stuck.
So, basically, I need to be able to display the relay status on the display reading the GPIO status, but cannot do it.
Any ideas?
I need to read the state of a GPIO (where I attached a relay) in order to print its status in the oled display.
I tried everything, but couldn't find a solution.
The only way I managed to get the value was defining the relay GPIO as an input switch but the unit crashes after a few on/off cycles.
And probably it's correct as the relay is not an input switch.
I tried assigning a dummy device with a rule coming from OPENHAB. But of course it could go out of sync if the relay is activated outside from openhab.
I am stuck.
So, basically, I need to be able to display the relay status on the display reading the GPIO status, but cannot do it.
Any ideas?
Last edited by leel1967l on 04 Feb 2018, 00:34, edited 1 time in total.
- grovkillen
- Core team member
- Posts: 3621
- Joined: 19 Jan 2017, 12:56
- Location: Hudiksvall, Sweden
- Contact:
Re: Read state of a GPIO
I use the switch device to monitor the relay state, have been for a year. No problem what so ever. Why wouldn't it work, it's only a high/low signal.
Please give us all your settings and rules. You can (if you're on Windows) use my webdumper app to do that.
Please give us all your settings and rules. You can (if you're on Windows) use my webdumper app to do that.
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
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you
Re: Read state of a GPIO
Which version of the firmware are you using?
I am on MEGA dev13
I am on MEGA dev13
Last edited by leel1967l on 01 Feb 2018, 22:43, edited 1 time in total.
Re: Read state of a GPIO
Which version of the firmware are you using?grovkillen wrote: ↑01 Feb 2018, 22:33 I use the switch device to monitor the relay state, have been for a year. No problem what so ever. Why wouldn't it work, it's only a high/low signal.
Please give us all your settings and rules. You can (if you're on Windows) use my webdumper app to do that.
I am on MEGA dev13
Re: Read state of a GPIO
There are lots of issues fixed since then, please test on a newer version.
Re: Read state of a GPIO
ok.
You mean "mega-20180130" or "V2-20180130"?
But for my curiosity, which version are you using?
With R147 I was able to define an input switch connected to a relay and it was working. Moving to V2 it started crashing.
Re: Read state of a GPIO
Hi,grovkillen wrote: ↑01 Feb 2018, 22:33 I use the switch device to monitor the relay state, have been for a year. No problem what so ever. Why wouldn't it work, it's only a high/low signal.
Please give us all your settings and rules. You can (if you're on Windows) use my webdumper app to do that.
which version of ESP Easy are you using with relay and switch input?
(Nice app webdumper by the way!)
- grovkillen
- Core team member
- Posts: 3621
- Joined: 19 Jan 2017, 12:56
- Location: Hudiksvall, Sweden
- Contact:
Re: Read state of a GPIO
I use the latest v2.0 found on Github.
But you said that r147 was working ok, and that it started to cause problem when you updated to v2.0? Could you please make sure that the switch device for the relay is set to "switch" and not "dimmer". The update can cause problem with switch devices because of the added functionality.
Thanks for the feedback on my webdumper app
But you said that r147 was working ok, and that it started to cause problem when you updated to v2.0? Could you please make sure that the switch device for the relay is set to "switch" and not "dimmer". The update can cause problem with switch devices because of the added functionality.
Thanks for the feedback on my webdumper app
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
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you
Re: Read state of a GPIO
Hi,grovkillen wrote: ↑02 Feb 2018, 05:58 I use the latest v2.0 found on Github.
But you said that r147 was working ok, and that it started to cause problem when you updated to v2.0? Could you please make sure that the switch device for the relay is set to "switch" and not "dimmer". The update can cause problem with switch devices because of the added functionality.
Thanks for the feedback on my webdumper app
I tested latest version on Github and there seem to be no more crashes.
Will test for few more days, but I believe that the issue is solved.
thanks
- grovkillen
- Core team member
- Posts: 3621
- Joined: 19 Jan 2017, 12:56
- Location: Hudiksvall, Sweden
- Contact:
Re: Read state of a GPIO
Great
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
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you
Re: Read state of a GPIO
Try to write a rule like this [name # value] in the display setting.
I am sorry I am a language invalid and I use a translator
Re: Read state of a GPIO
Hello. My issue is very similar to yours. , Do you tried to write a rule like that in the display setting? Did it work?
My post:
viewtopic.php?f=6&t=4957&start=10
Who is online
Users browsing this forum: Bing [Bot] and 121 guests