KraigM / homebridge-gpio-garagedoor

RPi GPIO based Garage Door plugin for Homebridge
22 stars 11 forks source link

doorSwitchPin on off when restart raspberry pi or restart homebridge #10

Open toshibochan opened 7 years ago

toshibochan commented 7 years ago

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

fastenspy commented 7 years ago

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

nremme commented 7 years ago

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?

thewhitestig commented 7 years ago

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 commented 7 years ago

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

DennisDeKoster commented 6 years ago

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)

Cirrostratuss commented 6 years ago

@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?

thewhitestig commented 6 years ago

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

Cirrostratuss commented 6 years ago

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

rinoronie commented 6 years ago

what can I modify?

dingleberry77 commented 5 years ago

Did anyone fix this issue in subsequent builds?

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

junicello commented 5 years ago

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

iamjonas commented 5 years ago

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?