Fixed: OUTPUT-GPIO-1-ON/off only works when inverted

Posted on
Sun Feb 20, 2022 11:30 am
Hackencrash offline
User avatar
Posts: 251
Joined: Dec 16, 2015
Location: UK

Fixed: OUTPUT-GPIO-1-ON/off only works when inverted

The OUTPUT-GPIO-1-ON/off piBeacon Model parameter when setting a new device only appears to turn on and off a given GPIO pin if "OUTPUT type" is set to invert.

This, I believe, may have been a problem for some time as I have only just got around to diagnosing the problem since weeks back when it first appeared.

I have tried setting "OUTPUT type" back to normal again and the problem breaks again. I have also tried creating a new OUTPUT-GPIO-1 device on a different GPIO and the issue is the same - only able to switch on and off when the "OUTPUT type" is set to invert, otherwise it is always 0, and then only able to be set to 1 using the gpio command on the rPi itself.
Last edited by Hackencrash on Fri Feb 25, 2022 4:39 pm, edited 2 times in total.

Posted on
Sun Feb 20, 2022 3:30 pm
kw123 offline
User avatar
Posts: 8363
Joined: May 12, 2013
Location: Dallas, TX

Re: OUTPUT-GPIO-1-ON/off only works when inverted

should be fixed in v .548, just posted

Posted on
Mon Feb 21, 2022 9:15 am
Hackencrash offline
User avatar
Posts: 251
Joined: Dec 16, 2015
Location: UK

Re: OUTPUT-GPIO-1-ON/off only works when inverted

Hi Karl,

I've tried .548 but it is still exhibiting the same issue I'm afraid.

It only does anything when set to "set OUTPUT invers" (perhaps should read: set OUTPUT inverts). When set to "set OUTPUT normal" it stays on 0 whether on or off.

Posted on
Mon Feb 21, 2022 2:27 pm
kw123 offline
User avatar
Posts: 8363
Joined: May 12, 2013
Location: Dallas, TX

Re: OUTPUT-GPIO-1-ON/off only works when inverted

yes you are right: I fixed the wrong (old) program.
The process is not anymore in the program execCommands.py (called from receiveCommands) but IN receiveCommands in threads
That saves ~0.8 secs of execution delay

I did that last summer and I did not remember any more :oops:


Will post the fix later today

Karl

Posted on
Tue Feb 22, 2022 7:48 am
Hackencrash offline
User avatar
Posts: 251
Joined: Dec 16, 2015
Location: UK

Re: OUTPUT-GPIO-1-ON/off only works when inverted

Hi Karl - just tried v550 and it's still the same (and still says invers and not inverts)

Posted on
Thu Feb 24, 2022 11:58 am
kw123 offline
User avatar
Posts: 8363
Joined: May 12, 2013
Location: Dallas, TX

Re: OUTPUT-GPIO-1-ON/off only works when inverted

I tried mine and it works.
Could you post a screen shot of the device edit screen


Sent from my iPhone using Tapatalk

Posted on
Thu Feb 24, 2022 4:32 pm
kw123 offline
User avatar
Posts: 8363
Joined: May 12, 2013
Location: Dallas, TX

Re: OUTPUT-GPIO-1-ON/off only works when inverted

and re invers vs inverted ..

the function is
inverse to xx
inverted

as I have "inverse" everywhere and hard coded in states and programs I hesitate to change that one

Karl

Posted on
Fri Feb 25, 2022 8:31 am
Hackencrash offline
User avatar
Posts: 251
Joined: Dec 16, 2015
Location: UK

Re: OUTPUT-GPIO-1-ON/off only works when inverted

Aww, you could at least put an 'e' on the end of invers :D

Please see screenshot - the device On/Off output is always 0 unless set to inverse, Here you can see the device is on yet physical pin 37 is shown as 0. It is also 0 when off.

Always0.png
Always0.png (287.56 KiB) Viewed 2704 times

Posted on
Fri Feb 25, 2022 11:19 am
kw123 offline
User avatar
Posts: 8363
Joined: May 12, 2013
Location: Dallas, TX

Re: OUTPUT-GPIO-1-ON/off only works when inverted

Did you actually measure the voltage on the pin?


Sent from my iPhone using Tapatalk

Posted on
Fri Feb 25, 2022 11:37 am
Hackencrash offline
User avatar
Posts: 251
Joined: Dec 16, 2015
Location: UK

Re: OUTPUT-GPIO-1-ON/off only works when inverted

Hi Karl,

I don't need to measure the pin voltage, I use a Python app to read its value.

The GPIO utility shown in the screenshot always stays on 0 unless the device is set to invers when I switch the device on and off. For now, to get around the problem before you fix it, I have modified my Python app to read this value the other way around and have set the device to invers. I could have just left it at that but I though I'd highlight the issue to you so that others do not run into the same problem using this piBeacon device type.

Note that this was working previously for about 2 years.

Put simply:
set OUTPUT invers = OK
set OUTPUT normal = FAIL (always 0)
Last edited by Hackencrash on Fri Feb 25, 2022 11:53 am, edited 1 time in total.

Posted on
Fri Feb 25, 2022 11:53 am
kw123 offline
User avatar
Posts: 8363
Joined: May 12, 2013
Location: Dallas, TX

Re: OUTPUT-GPIO-1-ON/off only works when inverted

I don’t understand, mine works fine.

I will post a version w some debug info on the rpi

Karl


Sent from my iPhone using Tapatalk

Posted on
Fri Feb 25, 2022 12:27 pm
Hackencrash offline
User avatar
Posts: 251
Joined: Dec 16, 2015
Location: UK

Re: OUTPUT-GPIO-1-ON/off only works when inverted

As an FYI, the piBeacon plugin option Set GPIO pin on rPi to HIGH-LOW option does not work either when the device is set to normal. Only works when set to invers; and when set to invers, setting the pin to LOW sets it to 1 which took me by surprise. I would have expected the ON/OFF to inverse the 0/1, but not the HIGH/LOW setting, but I'm not that bothered :D

Posted on
Fri Feb 25, 2022 12:44 pm
kw123 offline
User avatar
Posts: 8363
Joined: May 12, 2013
Location: Dallas, TX

Re: OUTPUT-GPIO-1-ON/off only works when inverted

please try v 7.139.552

then set debug on for the rpi you want to check

the ssh pi@...

tail -f /var/log/pibeacon

there you should see somethuing like this :
Code: Select all

25-19:43:58 receiveCommands execCMDS             L:367  Lv:20 1645814638.30 next command: {u'restoreAfterBoot': u'0', u'startAtDateTime': 0, u'pin': u'21', u'inverseGPIO': False, u'devId': 1742808216, u'command': u'up', u'device': u'OUTPUTgpio-1-ONoff'}
25-19:43:58 receiveCommands setGPIO              L:228  Lv:20 1645814638.31 setGPIO pin=21; set output to 1
25-19:43:58 piBeaconUtils   setLogLevel          L:65   Lv:10 cBY:receiveCommands      setting debuglevel to on
...
25-19:43:59 piBeaconUtils   echoToMessageSend    L:2208 Lv:10 cBY:receiveCommands       msg send --- {"outputs":{"OUTPUTgpio-1-ONoff":{"1742808216":{"actualGpioValue":"high"}}},"program":"receiveCommands","ipAddress":"192.168.1.25","pi":"5","ts":{"tz":"CEST","time":1645814639.35}}

Posted on
Fri Feb 25, 2022 4:38 pm
Hackencrash offline
User avatar
Posts: 251
Joined: Dec 16, 2015
Location: UK

Re: OUTPUT-GPIO-1-ON/off only works when inverted

Thanks Karl.

I installed from v7.139.550 straight to v7.139.553 and it worked straight away after it had installed. I've subsequently rebooted everything again and everything seems stable.

Thank you !!! :D

Posted on
Fri Feb 25, 2022 4:42 pm
kw123 offline
User avatar
Posts: 8363
Joined: May 12, 2013
Location: Dallas, TX

Re: Fixed: OUTPUT-GPIO-1-ON/off only works when inverted

it might have been that the push of the new py programs to the RPI did not work and the old py programs were still running.

but anyway thanks for the feedback

Karl

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 7 guests

cron