Domoticz - Home Automation

=================================================================
Domoticz

#https://releases.domoticz.com/releases/release/domoticz_linux_armv7l.tgz
#apt-get install make gcc g++ libssl-dev git libcurl4-gnutls-dev libusb-dev python3-dev zlib1g-dev libcereal-dev liblua5.3-dev uthash-dev


=================================================================
BUILDING from the SOURCE
=================================================================
https://www.domoticz.com/wiki/Build_Domoticz_from_source

apt-get install make gcc g++ libssl-dev git libcurl4-gnutls-dev libusb-dev python3-dev zlib1g-dev libcereal-dev liblua5.3-dev uthash-dev

apt remove --purge --auto-remove cmake
#Go to the official CMake site and download the latest source: http://www.cmake.org/download
#The following will assume version 3.19.3 is the latest version
#wget https://github.com/Kitware/CMake/releases/download/v3.19.3/cmake-3.19.3.tar.gz
wget https://github.com/Kitware/CMake/releases/download/v3.19.6/cmake-3.19.6.tar.gz
tar -xzvf cmake-3.19.6.tar.gz
rm cmake-3.19.6.tar.gz
cd cmake-3.19.6
./bootstrap
make
make install
cd ..
rm -Rf cmake-3.19.6
#Verify you are on the correct version with
cmake --version

apt remove --purge --auto-remove libboost-dev libboost-thread-dev libboost-system-dev libboost-atomic-dev libboost-regex-dev libboost-chrono-dev

mkdir boost
cd boost
wget https://dl.bintray.com/boostorg/release/1.75.0/source/boost_1_75_0.tar.gz
tar xfz boost_1_75_0.tar.gz --checkpoint=.100
cd boost_1_75_0/
./bootstrap.sh
./b2 stage threading=multi link=static --with-thread --with-system
./b2 install threading=multi link=static --with-thread --with-system
cd ../../
rm -Rf boost/
cat /usr/local/include/boost/version.hpp | grep "BOOST_LIB_VERSION" | grep -v defined | cut -d" " -f2-3


##Optional ZWave
#git clone https://github.com/OpenZWave/open-zwave open-zwave-read-only
#cd open-zwave-read-only
#git pull
#make
#make install


#For the first time, you need to checkout the source from GitHub onto your system:
git clone https://github.com/domoticz/domoticz.git dev-domoticz

#Building Domoticz:
#Change to the Domoticz directory, refresh the source and and start building
cd dev-domoticz
git pull
cmake -DCMAKE_BUILD_TYPE=Release CMakeLists.txt
make

#cp domoticz.sh /etc/init.d
#chmod +x /etc/init.d/domoticz.sh
#update-rc.d domoticz.sh defaults


groupadd -g 8080 domoticz
useradd -u 8080 -g domoticz -c "Domoticz user" -d /usr/local/domoticz domoticz
usermod -a -G domoticz www-data

mv dev-domoticz /usr/local/
cd /usr/local
mv dev-domoticz domoticz
chown -R domoticz:domoticz domoticz

cd /usr/local/domoticz
chmod +x domoticz.sh

vi domoticz.sh
DESC="Domoticz Unix4Life Home Automation System"
NAME=domoticz
#USERNAME=pi
USERNAME=domoticz
PIDFILE=/var/run/$NAME.pid
touch $PIDFILE
chown domoticz $PIDFILE
#DAEMON=/home/$USERNAME/domoticz/$NAME
DAEMON=/usr/local/domoticz/$NAME
DAEMON_ARGS="-daemon"
#DAEMON_ARGS="$DAEMON_ARGS -daemonname $NAME -pidfile $PIDFILE"
DAEMON_ARGS="$DAEMON_ARGS -www 8080"
#DAEMON_ARGS="$DAEMON_ARGS -webroot domoticz"
#DAEMON_ARGS="$DAEMON_ARGS -sslwww 443"
DAEMON_ARGS="$DAEMON_ARGS -sslwww 0"
#DAEMON_ARGS="$DAEMON_ARGS -log /tmp/domoticz.txt"
#DAEMON_ARGS="$DAEMON_ARGS -syslog"
do_start()
{
start-stop-daemon --chuid $USERNAME --start --quiet --pidfile $PIDFILE --exec $DAEMON --test > /dev/null \
|| return 1
start-stop-daemon --chuid $USERNAME --start --quiet --pidfile $PIDFILE --exec $DAEMON -- \
$DAEMON_ARGS \
|| return 2
}

 

vi /lib/systemd/system/domoticz.service
[Unit]
Description=Domoticz
After=var-run.mount nss-lookup.target network.target local-fs.target time-sync.target
[Service]
Type=forking
TimeoutSec=5min
IgnoreSIGPIPE=no
KillMode=process
GuessMainPID=no
RemainAfterExit=yes
SuccessExitStatus=5 6
# Domotics installation Directory
WorkingDirectory=/usr/local/domoticz
#User=domoticz
#Group=domoticz
ExecStart=/usr/local/domoticz/domoticz.sh start
ExecStop=/usr/local/domoticz/domoticz.sh stop
Restart=on-failure
SyslogIdentifier=Domoticz
[Install]
WantedBy=multi-user.target


systemctl daemon-reload
systemctl enable domoticz
systemctl start domoticz

 

What do you think or any questions?

Send us feedback!

Enter the sum of the numbers.

Menu

  If you like my website, feel free to donate via the Paypal button... A small amount for a cup of coffee is enough ;-) Thank you!