homebridge-gpio-garagedoor icon indicating copy to clipboard operation
homebridge-gpio-garagedoor copied to clipboard

doorSwitchPin on off when restart raspberry pi or restart homebridge

Open toshibochan opened this issue 8 years ago • 12 comments

doorSwitchPin on off when restart raspberry pi or restart homebridge. any one having this problem?

toshibochan avatar Jan 01 '17 08:01 toshibochan

look the bottom of this page: http://www.iculture.nl/nieuws/stappenplan-homekit-siri-raspberry-pi-homebridge/ SEE: Homebridge automatisch starten na een reboot

fastenspy avatar Jan 03 '17 21:01 fastenspy

Having a similar issue - when homebridge restarts (either on pi restart or service restart), it triggers the door switch pin and causes the door to automatically open. Is there a way to prevent this from happening?

nremme avatar Jul 12 '17 19:07 nremme

I think the root cause is issue#9; doorSwitchPin is 1 when plugin is running but during boot up it's 0. This triggers the garage door if you hook up your relay as Normally Closed.

thewhitestig avatar Oct 17 '17 02:10 thewhitestig

I have a hack for this, see my comment in Issue#9.

thewhitestig avatar Oct 20 '17 01:10 thewhitestig

I found this at another garagedoor plugin, maybe it is helpful. I haven't tried it myself yet though...

IMPORTANT NOTE ON PIN SELECTION

When the Raspberry Pi reboots GPIO pins are reset to their default state. This can cause your garage door to open without you issuing a command. Please make sure you pick the correct pins so that you don't accidentally have your garage door opening after a power loss.

The following pins are pulled HIGH (they output a 3.3 volt signal) on reboot:

GPIO0/2 GPIO1/3 GPIO4 GPIO7 GPIO8 GPIO14 is configured as a Serial Transmit line, so avoid choosing that pin.

All other pins are pulled LOW (they have a 0 volt signal, same as GND).

If your relay triggers when the GPIO pin goes LOW, then pick a pin that starts out HIGH on reboot. If your relay triggers with the GPIO PIN goes HIGH then pick a GPIO pin that starts out LOW on reboot.

(information comes from https://www.raspberrypi.org/forums/viewtopic.php?f=44&t=24491)

DennisDeKoster avatar Oct 22 '17 09:10 DennisDeKoster

@DennisDeKoster I tried both GPIO 2 and 3 and also GPIO 24 and 25, so HIGH and LOW. It made no difference when rebooting the pi, it still triggered the door to open. If you check the gpio allreadall regardless of where its connected, the pi will change the OUT to LOW but my guess it toggles a high on bootup. I've tried doing a boot up script etc with no joy.

@thewhitestig suggested editing the switchPort.ts but didint give the path to it, where is the file located?

Cirrostratuss avatar Jan 01 '18 22:01 Cirrostratuss

Everything is in lib/... you can modify your local js files: /usr/local/lib/node_modules/homebridge-gpio-garagedoor/lib $ ls DoorSensorPort.js GPIOGarageDoorAccessory.js Runtime.js DoorStateExtension.js GPIOPort.js SwitchPort.js

thewhitestig avatar Jan 02 '18 03:01 thewhitestig

Outstanding!! Thank you!!! It worked woohooo!!

Cirrostratuss avatar Jan 03 '18 00:01 Cirrostratuss

what can I modify?

rinoronie avatar Apr 19 '18 19:04 rinoronie

Did anyone fix this issue in subsequent builds?

@cirrostratuss can you share what you did/edited to fix this?

dingleberry77 avatar Sep 07 '19 13:09 dingleberry77

Did anyone fix this issue in subsequent builds?

@Cirrostratuss can you share what you did/edited to fix this?

I tried contacting @KraigM but no response. Maybe we should consider spawning a copy and getting this done. I am new to GitHub but willing to learn.

I posted code changes here that I have working in my setup

https://github.com/KraigM/homebridge-gpio-garagedoor/issues/9#issuecomment-505621090

junicello avatar Sep 22 '19 18:09 junicello

Modified the code myself, but the notifications for open and closed are sent three time, e.g [open, closed open] are the sensor to sensitive or is it the script?

iamjonas avatar Sep 24 '19 09:09 iamjonas