Forum

Domoticz doesn't st...
 
Notifications
Clear all

Domoticz doesn't start at boot

   RSS

0
Topic starter

manual restarting is working well

This topic was modified 3 tygodnie temu by mrmucha
1 Answer
0
Topic starter

We have to delay domoticz boot (systemd or init.d).

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

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"
This post was modified 3 tygodnie temu 2 times by mrmucha

Odpowiedź

Author Name

Author Email

Your question *

 
Preview 0 Revisions Saved
Share: