Having trouble setting up monitoring of simple GPIOs

Posted on
Thu Mar 22, 2018 9:41 am
six50joe offline
Posts: 84
Joined: Apr 07, 2011

Having trouble setting up monitoring of simple GPIOs

I am using a pi having GPIOs connected to simple dry contacts that are normally closed, to reuse a security system installation in my home.

The breakout board I'm using is an Eleduio T-Cobbler. I have verified that the hardware setup is correct, by running a simple python script that monitors the GPIOs connected to various devices (detecting open/closed works).

I'm new to PiBeacon, and not sure which device I should be using for each GPIO, assuming it should be one of:
INPUT-GPIO-max-1-PINs
INPUT-GPIO-max-4-PINs
INPUT-GPIO-max-8-PINs
INPUT-GPIO-max-26-PINs


What is the distinction between these? I was able to get one device to partially work; Indigo was notified when the circuit opened, but when open, updates continually hit the log for that GPIO, oscillating between 0 (open) and 1 (closed) once a second until I close the circuit again.

When I tried adding a new device with same configuration but having a different GPIO PIN selected (my only choice for channel # is 0), both devices' status behave as if they are monitoring the first pin. I think I was using :
Input Type=Open
Count off/on = regular input

I tried different combinations of these and other params, but no joy.

Kind of randomly, at one point after I ran my own test script at one point to verify the hardware setup, the first device behaved the way I wanted and changed its status once to reflect open and close (without the oscillating). After that adding a new device caused everything to stop working.

Advice is greatly appreciated,
Thanks!

Posted on
Thu Mar 22, 2018 10:13 am
kw123 offline
User avatar
Posts: 8333
Joined: May 12, 2013
Location: Dallas, TX

Having trouble setting up monitoring of simple GPIOs

I suggest to only use the one with a single input device. — the others I added but have never really used.

The multiple gpio input Channels combine several GpiOS into one indigo device ( each gpio gets one state. Input_1 input_2 etc. but you can only show 1 in the state column.

Make sure you only use gpios that are ok for input. The rpi has several that have special functions: Onewire dht i2c serial spg.
Good are the ones at the end #20 etc




Sent from my iPhone using Tapatalk

Posted on
Thu Mar 22, 2018 10:26 am
six50joe offline
Posts: 84
Joined: Apr 07, 2011

Re: Having trouble setting up monitoring of simple GPIOs

Thanks much- I wasn't aware of that some GPIOs couldn't be used for my purpose. I had been using so far #18 and #23 with INPUT-GPIO-max-1-PINs. Do you happen to know or have a reference to the definitive list of Pi3 pins that can be used for my purpose?

Posted on
Thu Mar 22, 2018 11:18 am
kw123 offline
User avatar
Posts: 8333
Joined: May 12, 2013
Location: Dallas, TX

Re: Having trouble setting up monitoring of simple GPIOs

GPIO# ok:

left side:
27
22
5
6
13
19
26
right side
12
16
20
21

also suggest:
set GPIO input pull up high in device edit (internal resistor connects input to +3.3V), normal state 1 = connected to ground = switch closed, can be reversed in device edit.
connect switch between ground and gpio. if you want to be extra cautious : connect switch through any small diode to gpio, Cathode ( diode end with ring) to switch, anode to gpio

18 and 23 should be ok to, but I prefer to use the ones at the end ..

for pins see:
https://www.google.de/search?q=raspberry+pi+gpio+list&tbm=isch&source=iu&ictx=1&fir=s4ngeAP9gyjSJM%253A%252C98HBqE8UJyJfXM%252C_&usg=__p7nYYHNd1xjJq81zGD0hw9Sx2aY%3D&sa=X&ved=0ahUKEwj1i8LCtoDaAhWsK5oKHc2CBmEQ9QEIvAEwCg#imgdii=zBu0uKtJAcTTLM:&imgrc=rSvcdzHUUhITmM:


Karl

Posted on
Thu Mar 22, 2018 12:21 pm
six50joe offline
Posts: 84
Joined: Apr 07, 2011

Re: Having trouble setting up monitoring of simple GPIOs

Thank you for the list and advice Karl,
Coincidentally, after your last post I googled a bit and saw that GPIO 18 is actually a CLK pin- this explains the odd oscillating behavior I noticed while trying to get my setup to work!

Posted on
Mon Mar 26, 2018 7:11 am
six50joe offline
Posts: 84
Joined: Apr 07, 2011

Re: Having trouble setting up monitoring of simple GPIOs

A correction to my last post, pin 18 being CLK had nothing to do with the oscillating open/closed readings. Rather, for some reason the correct Indigo device settings for my device were not in sync with the PiBeacon parameters file (to use GPIO.PUD_UP). It was only after I had gone through each part of the device settings and clicked CONFIRM, then save, then restarting the pi that the setting 'took' and it worked as desired.

All set now .

Joe

Posted on
Mon Mar 26, 2018 11:15 am
kw123 offline
User avatar
Posts: 8333
Joined: May 12, 2013
Location: Dallas, TX

Re: Having trouble setting up monitoring of simple GPIOs

Yes “save” helps ;)


Sent from my iPhone using Tapatalk

Posted on
Tue Apr 10, 2018 7:39 am
six50joe offline
Posts: 84
Joined: Apr 07, 2011

Re: Having trouble setting up monitoring of simple GPIOs

Now that my GPIO monitoring works, my next step is to create control pages for the security system. I wish to use raneli's DSC Alarm System device images, which take advantage of selection heuristics. For them to work, the status of my beacon GPIO devices need to be represented as 'open/closed' rather than 'OFF/ON'.

I apologize in advance if there is currently a way to do this in PiBeacon through the configuration and I didn't see it. If not, it's not much trouble for me change the plugin source directly where it's installed on my sever substituting OFF/ON with open/closed, but I'd need to maintain this manually after future plugin updates. Would this be my best option for now?

Posted on
Tue Apr 10, 2018 11:40 am
kw123 offline
User avatar
Posts: 8333
Joined: May 12, 2013
Location: Dallas, TX

Re: Having trouble setting up monitoring of simple GPIOs

you want to replace the state value from ON/OFF to open/close .. upper/lower case?

will check

Karl

Posted on
Tue Apr 10, 2018 11:52 am
kw123 offline
User avatar
Posts: 8333
Joined: May 12, 2013
Location: Dallas, TX

Re: Having trouble setting up monitoring of simple GPIOs

try this one :
https://www.dropbox.com/s/lrz74umqcgwtaff/piBeacon-v-7.82.215.zip?dl=1

in device edit you can now select
regular (numbers =0/1)
ON/off
off/ON
closed/open
open/closed
up/down
down/up
to show in status

for vales: 0/1

not well tested..

Karl


also added some other things (new sensor etc)

Posted on
Thu Apr 12, 2018 4:57 am
six50joe offline
Posts: 84
Joined: Apr 07, 2011

Re: Having trouble setting up monitoring of simple GPIOs

WIth the update, the control page image now changes with the device state as expected. Thanks Karl!

Posted on
Wed Sep 19, 2018 5:04 pm
cuhouse offline
Posts: 144
Joined: Feb 21, 2007
Location: Virginia, USA

Re: Having trouble setting up monitoring of simple GPIOs

Very good thread. I am converting my devices over from Phidgets to piBeacon. A very easy task. This cleared it up for me perfectly.

Karl,

I have debated about asking this after all your help earlier this week. I am trying to get the last two devices moved off the Phidgets board for control of my garage door. I have been using Perry's Cynical Behaviors Garage Door and has been working great and also magically translated to Colorado's HomeKit Bridge.

I ran into a snag with the contact sensor input definitions required. The Cynical Garage Door requires that the states for the sensor be off/on. The upper case ON does not allow the device to be considered a sensor. I banged my head awhile and then read the instructions :shock:

"The door sensor must report off when the garage door is fully closed, and on otherwise."

Is this a possibility to add as an option? So on/off and off/on? I may be able to run it thru a converter plugin in but thought I would ask.

Thank you,
Jody

Indigo 2022.1.2, Big Sur v11.7.1, Dedicated late 2014 Mac Mini, PowerLinc 2413U.

Posted on
Wed Sep 19, 2018 9:11 pm
kw123 offline
User avatar
Posts: 8333
Joined: May 12, 2013
Location: Dallas, TX

Re: Having trouble setting up monitoring of simple GPIOs

i tried to be fancy ON/off looked better..

v 233 now has the on-off option for status


following is now available for all input 0/1 type sensors:
Code: Select all
                    <Option value="x"           >regular 0-1</Option>
                    <Option value="ON-off"      >show 1 as off; 0 as ON</Option>
                    <Option value="off-ON"      >show 1 as ON; 0 as off</Option>
                    <Option value="on-off"      >show 1 as off; 0 as on</Option>
                    <Option value="off-on"      >show 1 as on; 0 as off</Option>
                    <Option value="open-closed" >show 1 as open; 0 as closed</Option>
                    <Option value="closed-open" >show 1 as closed; 0 as open</Option>
                    <Option value="up-down"     >show 1 as up; 0 as down</Option>
                    <Option value="down-up"     >show 1 as down; 0 as up</Option>


Karl

Posted on
Thu Sep 20, 2018 4:34 pm
cuhouse offline
Posts: 144
Joined: Feb 21, 2007
Location: Virginia, USA

Re: Having trouble setting up monitoring of simple GPIOs

Karl,

Thanks for making that change for me and apologize for not getting back right away. Stupid work gets in the way. :wink:

It didn't solve the issue though with the piBeacon inputs showing up as an "open sensor" input in the Cynical Garage Door Opener device. I added another input device in piBeacon as a test and it didn't list that one as an option either. Restarted the Mac Mini too. I have one piBeacon input working through a Persistence Timer in the Timed Devices plugin and that is available as an option. Any on/off Insteon device including the IO Linc is available. Oddly even a piBeacon Output is available to the Garage Door Device. I will try to set the piBeacon garage door contact sensor set up as a virtual device and let you know if that works. Suspect it will.

As always, thanks for such great support!

Jody

Indigo 2022.1.2, Big Sur v11.7.1, Dedicated late 2014 Mac Mini, PowerLinc 2413U.

Posted on
Thu Sep 20, 2018 8:51 pm
kw123 offline
User avatar
Posts: 8333
Joined: May 12, 2013
Location: Dallas, TX

Re: Having trouble setting up monitoring of simple GPIOs

Ok there are indigo defined sensor devices. They have a special state on/off
Input gpio is not one of those as I wanted to have the option for the different states
Open/close on/off. Etc.
I believe that is the issue.

Let me think about that.

Karl




Sent from my iPhone using Tapatalk

Who is online

Users browsing this forum: No registered users and 3 guests

cron