Notifications
Clear all
BugOverflow
1
Posty
1
Users
0
Reactions
1,184
Widok
0
08/07/2021 9:52 pm
Topic starter
manual restarting is working well
1 Answer
0
09/07/2021 10:21 pm
Topic starter
We have to delay domoticz boot (systemd or init.d).
(first option) systemd (add OnBootSec)
howto edit: nano /etc/systemd/system/domoticz.service
[Unit] Description=domoticz_service [Timer] OnBootSec=30sec [Service] ExecStartPre=/home/pi/domoticz_scripts/ports.sh ExecStart=/home/pi/domoticz/domoticz -www 8080 -sslwww 443 WorkingDirectory=/home/pi/domoticz ExecStartPre=setcap 'cap_net_bind_service=+ep' /home/pi/domoticz/domoticz Restart=on-failure RestartSec=1m [Install] WantedBy=multi-user.target
(second option) init.d (add sleep)
howto edit: nano /etc/init.d/domoticz.sh
sleep 30 PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin DESC="Domoticz Home Automation System" NAME=domoticz
don't forget about port configuration (ExecStart [systemd])
content of /home/pi/domoticz_scripts/ports.sh
(motionsensor SB-469 PARADOX / no normally open)
#! /bin/sh gpio export 22 in gpio edge 22 both gpio export 27 in gpio edge 27 both gpio export 17 in gpio edge 17 both sh -c "echo '1' >> /sys/class/gpio/gpio22/active_low" sh -c "echo '1' >> /sys/class/gpio/gpio27/active_low" sh -c "echo '1' >> /sys/class/gpio/gpio17/active_low" sh -c "echo '0' >> /sys/class/gpio/gpio22/active_low" sh -c "echo '0' >> /sys/class/gpio/gpio27/active_low" sh -c "echo '0' >> /sys/class/gpio/gpio17/active_low" sh -c "echo '1' >> /sys/class/gpio/gpio22/active_low" sh -c "echo '1' >> /sys/class/gpio/gpio27/active_low" sh -c "echo '1' >> /sys/class/gpio/gpio17/active_low"