ebaauw / homebridge-rpi

Homebridge plugin for Raspberry Pi.
Apache License 2.0
311 stars 19 forks source link

Pulse not working #123

Closed jdk2021 closed 2 years ago

jdk2021 commented 2 years ago

I have a switch setup with a pulse set to 20. When I use the switch in HomeKit, the GPIO initiates but stays on. Can you point me to why it wouldn't reverse after 20ms?

ebaauw commented 2 years ago

Please capture and attach a debug log file, see https://github.com/ebaauw/homebridge-hue/wiki/FAQ#homebridge. I need to see the Homebridge startup and turning on the switch.

jdk2021 commented 2 years ago

Debug.pdf

Thanks for the quick response. I restarted Homebridge and then activated the switch, it stays on until I turn it off

ebaauw commented 2 years ago

Please, in future, just attach a text file - no PDF, RTF, Word or some other unholy format.

Config looks fine, and as far as I can tell, Homebridge RPi is doing what it's supposed to do. However, after the (successful) WRITE to set the GPIO high, Homebridge RPi should have received a notification from pigpiod that the GPIO is now high. The receipt of that notification starts the pulse timer (so that the GPIO is also reset when someone else has set it). So that explains why the pulse setting doesn't do anything.

I have no clue why Homebridge RPi doesn't receive the notification; I haven't seen that before. Can you please check that there are two connections from Homebridge RPi to pigpiod (one for sending the commands and one for receiving the notifications). On the mac:

sudo netstat -n | grep 8888

On the Pi:

sudo netstat -Wpn | grep 8888

The Pi B rev 2.0 is an old model, but afaik it should work. What version of Raspberry Pi OS are you running on it? Is that the full or the lite version? Did you install the pigpio package yourself, or was it bundled with Raspberry Pi OS? What version of pigpio are you running? On the Pi:

cat /etc/os-release
pigpiod -v
apt list pigpio

Have you tried another GPIO pin? If you set or clear the pin yourself, do you see a notification in the Homebridge log (and does Homebridge reflect the new state)? On the Pi:

pigs w 23 1

to set and

pigs w 23 0

to clear the GPIO.

jdk2021 commented 2 years ago

Here is the info you asked about the software

PRETTY_NAME="Raspbian GNU/Linux 11 (bullseye)" NAME="Raspbian GNU/Linux" VERSION_ID="11" VERSION="11 (bullseye)" VERSION_CODENAME=bullseye ID=raspbian ID_LIKE=debian HOME_URL="http://www.raspbian.org/" SUPPORT_URL="http://www.raspbian.org/RaspbianForums" BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs" 79 Listing... Done pigpio/stable,now 1.79-1+rpt1 armhf [installed] N: There is 1 additional version. Please use the '-a' switch to see it

When I try changing the state on the Pi, It does not reflect the state change in Homebridge

ebaauw commented 2 years ago

Hm, those are the same versions as I have. Did you check the network connections? Do you have a firewall on the Pi? What are the firewall settings on the mac?

jdk2021 commented 2 years ago

I checked the network and it was fine. I don’t have a firewall on the PI and I will have to check my mac. Here is something interesting, I did a complete reinstall of Homebridge and the PI OS. Followed your directions and it started working!!! Then I shutdown the PI to attach some wires to the GPIO pins and it stopped working. Not sure why a simple shutdown or reboot would make it stop working.

From: Erik Baauw @.> Date: Friday, January 7, 2022 at 4:20 PM To: ebaauw/homebridge-rpi @.> Cc: jdk2021 @.>, Author @.> Subject: Re: [ebaauw/homebridge-rpi] Pulse not working (Issue #123)

Hm, those are the same versions as I have. Did you check the network connections? Do you have a firewall on the Pi? What are the firewall settings on the mac?

— Reply to this email directly, view it on GitHubhttps://github.com/ebaauw/homebridge-rpi/issues/123#issuecomment-1007783934, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AXAHGQVE5TX3EWKNPJS625TUU5RLZANCNFSM5KQ7WISQ. Triage notifications on the go with GitHub Mobile for iOShttps://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Androidhttps://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub. You are receiving this because you authored the thread.Message ID: @.***>

ebaauw commented 2 years ago

Not sure why a simple shutdown or reboot would make it stop working.

Most likely, something is started differently on reboot than it was before. No clue what that something would be...

jdk2021 commented 2 years ago

Any ideas to what I could look for? Am I just SOL on this working correctly?

From: Erik Baauw @.> Date: Saturday, January 22, 2022 at 12:11 PM To: ebaauw/homebridge-rpi @.> Cc: jdk2021 @.>, Author @.> Subject: Re: [ebaauw/homebridge-rpi] Pulse not working (Issue #123)

Not sure why a simple shutdown or reboot would make it stop working.

Most likely, something is started differently on reboot than it was before. No clue what that something would be...

— Reply to this email directly, view it on GitHubhttps://github.com/ebaauw/homebridge-rpi/issues/123#issuecomment-1019326143, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AXAHGQRDLVVLEHFS62FALT3UXLXMBANCNFSM5KQ7WISQ. Triage notifications on the go with GitHub Mobile for iOShttps://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Androidhttps://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub. You are receiving this because you authored the thread.Message ID: @.***>

ebaauw commented 2 years ago

Check the network connections with netstat, as I suggested above. Check syslog and dmesg for errors.