Hello all,
I have built a 24v wireless siren with 2 raspberry pi zeros communicating over wifi.
I have a relay on the second pi using gpio pin 17 switching on a 24v siren.
I have a 24v signal from a line controller turning a relay on to a gpio pin 26 on the first pi.
The problem I am having is the siren stops working after a day or 2.
I have to power cycle to get it to work again.
I have tried a couple different python codes.
I do have them setup with static ip addresses.
Parts list:
2 – Raspberry Pi zero
1 – 5v Relay Module by Inland
1 – Solid State Relay (SSM1D26BD)
1 – TP-LINK AC1200 Wireless Daul Band Router (Model: Archer C50)
Below is the current code I am using:
from gpiozero import LED, Button
from gpiozero.pins.pigpio import PiGPIOFactory
from signal import pause
from signal import pause
import time
slavePI = PiGPIOFactory(host=‘192.168.0.20’)
siren = LED(17, pin_factory=slavePI)
relayON = Button(26, pull_up=False)
siren.source = relayON.values
pause()
Below is the code I first wrote:
from gpiozero import LED, Button
from gpiozero.pins.pigpio import PiGPIOFactory
from time import sleep
from signal import pause
import time
factory = PiGPIOFactory(host=‘192.168.0.20’)
siren = LED(17, pin_factory=factory)
voltage = Button(2)
voltage.when_pressed = siren.on
voltage.when_released = siren.off
pause()
I get the same result with both codes.
The siren stops working after a day or 2.
The temporary fix I came up with is to auto reboot the pi’s every 6 hours using:
sudo crontab –e
and adding this to that file
0 7 * * * /sbin/shutdown -r now
0 13 * * * /sbin/shutdown -r now
0 19 * * * /sbin/shutdown -r now
0 1 * * * /sbin/shutdown -r now
Please help me out here
Thank you
Kyle Eul