Input toggles output in Raspberry

Sam
Posts: 34
Joined: Mon Aug 22, 2016 5:51 am

Re: Input toggles output in Raspberry

Post by Sam »

Here is the result..

The file is from the Indigo Mac.. did a menu send xxxx "all programs .." to the RPIs but no luck

Code: Select all

pi@raspberrypi:~/pibeacon $ tail -F temp/messageSend
master:  {"program":"master","i2c":[],"ipAddress":"192.168.10.21","pi":"10","temp":"48.3"}
w capital F
tail: temp/messageSend: filen avhuggen
OUTPUTgpio:      {"outputs":{"OUTPUTgpio-1-ONoff":{"17624462":{"actualGpioValue":"high"}}},"program":"OUTPUTgpio","i                                                                                                                         pAddress":"192.168.10.21","pi":"10","ts":{"tz":"CEST","time":1544467141.2}}
^C

Code: Select all

pi@raspberrypi:~/pibeacon $ ps -ef | grep .py
nobody     323     1  0 14:05 ?        00:00:00 /usr/sbin/thd --triggers /etc/triggerhappy/triggers.d/ --socket /run/thd.socket --user nobody --deviceglob /dev/input/event*
root     19302     1  0 19:37 pts/0    00:00:00 python master.py
root     19625     1  0 19:37 pts/0    00:00:00 /usr/bin/python /home/pi/pibeacon/copyToTemp.py
root     19698     1  0 19:37 pts/0    00:00:01 /usr/bin/python /home/pi/pibeacon/OUTPUTgpio.py
root     19742     1  0 19:37 pts/0    00:00:00 /usr/bin/python /home/pi/pibeacon/receiveGPIOcommands.py 9999
pi       20758 16846  0 19:40 pts/0    00:00:00 grep --color=auto .py
pi@raspberrypi:~/pibeacon $
User avatar
kw123
Posts: 8705
Joined: Sun May 12, 2013 4:44 pm
Location: Dallas, TX
Contact:

Re: Input toggles output in Raspberry

Post by kw123 »

could you do


0. do a edit RPi and save

1. go to rpi

2. set inverse on indigo
cat parameters, check for "outType": "1" if that changes

if it does not change then the send to RPi is not working

if it does change do
tail -F temp/messageSend
and set output on/off in indigo

then change to inverse
and do
tail -F temp/messageSend
and set output on/off in indigo

check if it changes

Code: Select all

OUTPUTgpio:  {"outputs":{"OUTPUTgpio-1-ONoff":{"1964742022":{"actualGpioValue":"low"}}},"program":"OUTPUTgpio","ipAddress":"192.168.1.198","pi":"0","ts":"tz":"CDT","time":1544467348.85}}
==> actualGpioValue":"low" or "high"


Karl
Sam
Posts: 34
Joined: Mon Aug 22, 2016 5:51 am

Re: Input toggles output in Raspberry

Post by Sam »

It changes fine..

Code: Select all

pi@raspberrypi:~/pibeacon $ tail -F temp/messageSend
OUTPUTgpio:      {"outputs":{"OUTPUTgpio-1-ONoff":{"17624462":{"actualGpioValue":"low"}}},"program":"OUTPUTgpio","ipAddress":"192.168.10.21","pi":"10","ts":{"tz":"CEST","time":1544470039.38}}

pi@raspberrypi:~/pibeacon $ tail -F temp/messageSend
OUTPUTgpio:      {"outputs":{"OUTPUTgpio-1-ONoff":{"17624462":{"actualGpioValue":"high"}}},"program":"OUTPUTgpio","ipAddress":"192.168.10.21","pi":"10","ts":{"tz":"CEST","time":1544470158.17}}

pi@raspberrypi:~/pibeacon $ tail -F temp/messageSend
OUTPUTgpio:      {"outputs":{"OUTPUTgpio-1-ONoff":{"17624462":{"actualGpioValue":"high"}}},"program":"OUTPUTgpio","ipAddress":"192.168.10.21","pi":"10","ts":{"tz":"CEST","time":1544470248.48}}

pi@raspberrypi:~/pibeacon $ tail -F temp/messageSend
OUTPUTgpio:      {"outputs":{"OUTPUTgpio-1-ONoff":{"17624462":{"actualGpioValue":"low"}}},"program":"OUTPUTgpio","ipAddress":"192.168.10.21","pi":"10","ts":{"tz":"CEST","time":1544470387.83}}

One question..

The status in Indigos custom states never shows "on" when actualGpioValue is "high" regardless of whether I set the output type as normal or inverse. Is it supposed to work so?


OUTOUT normal
actualGpioValue=high --> status=off
actualGpioValue=low --> status=on

OUTPUT inverse
actualGpioValue=high --> status=off
actualGpioValue=low --> status=on

/Sam
User avatar
kw123
Posts: 8705
Joined: Sun May 12, 2013 4:44 pm
Location: Dallas, TX
Contact:

Input toggles output in Raspberry

Post by kw123 »

What device type do you use ?

Could you delete and recreate. Not a dimmer but an on/off relay device.


Sent from my iPhone using Tapatalk
Sam
Posts: 34
Joined: Mon Aug 22, 2016 5:51 am

Re: Input toggles output in Raspberry

Post by Sam »

I use OUTPUT-GPIO-1-ON/off . I have tested to delete and recreate it but with the same result.

/Sam
User avatar
kw123
Posts: 8705
Joined: Sun May 12, 2013 4:44 pm
Location: Dallas, TX
Contact:

Re: Input toggles output in Raspberry

Post by kw123 »

I am now following the up/down high/low through each step and have cleaned up some programming.. many places to look...

this is roughly the flow
action --> get dev defs --> send to RPI -> receive at RPI --> set GPIO --> send "actual value" back to plugin --> receive in plugin --> put into dev/state

will post a new version later today ..

Karl
will have this
Screen Shot 2018-12-10 at 17.40.05.png
Screen Shot 2018-12-10 at 17.40.05.png (29.85 KiB) Viewed 6563 times
User avatar
kw123
Posts: 8705
Joined: Sun May 12, 2013 4:44 pm
Location: Dallas, TX
Contact:

Re: Input toggles output in Raspberry

Post by kw123 »

Sam
could you try this version:
https://www.dropbox.com/s/88hxonsxvzgpo ... 0.zip?dl=1
?
you need to edit the GPIO device and save it. Then the device states will be populated.

Karl
Sam
Posts: 34
Joined: Mon Aug 22, 2016 5:51 am

Re: Input toggles output in Raspberry

Post by Sam »

In the new version, everything works perfect. I have tried normal / inverse output and everything looks good.
Thank you so much for all your help and all your work and for a very good plugin.

/Sam
User avatar
kw123
Posts: 8705
Joined: Sun May 12, 2013 4:44 pm
Location: Dallas, TX
Contact:

Re: Input toggles output in Raspberry

Post by kw123 »

Sam

is now published on the indigo store.
Version # one higher -- only cosmetic changes beyond yours

again thanks for testing


Karl
Sam
Posts: 34
Joined: Mon Aug 22, 2016 5:51 am

Re: Input toggles output in Raspberry

Post by Sam »

Hi Karl,
I would like some help to send one pulse to an output when an input becomes high (Action for UP). For example, high for 5 seconds.
It is possible?

/Sam
Attachments
Input_Output.jpg
Input_Output.jpg (67.29 KiB) Viewed 6098 times
User avatar
kw123
Posts: 8705
Joined: Sun May 12, 2013 4:44 pm
Location: Dallas, TX
Contact:

Re: Input toggles output in Raspberry

Post by kw123 »

you can insert a sleep xx:

Code: Select all

gpio -g write 21 1;sleep 5;gpio -g write 21 0
for gpio21 (still need to add the mode ... stuff infront)

Karl
User avatar
kw123
Posts: 8705
Joined: Sun May 12, 2013 4:44 pm
Location: Dallas, TX
Contact:

Re: Input toggles output in Raspberry

Post by kw123 »

ps

you can do
ssh pi@xxxx
then try any command = play with them, see what works..

Code: Select all

gpio -g mode 18  out;gpio -g write 18 1; sleep 3 ; gpio-g write 18 0
if you like it, copy that whole line w/o the new line and paste into the command field action up / down ... in indigo device edit.

Karl

psps: here the manual for the gpio commands:
http://wiringpi.com/the-gpio-utility/
Sam
Posts: 34
Joined: Mon Aug 22, 2016 5:51 am

Re: Input toggles output in Raspberry

Post by Sam »

Hi,
Nice.. Thanks a lot!

/Sam
Post Reply

Return to “piBeacon”