Install Domoticz in Centos 7

On various Hardware and OS systems: pi / windows / routers / nas, etc

Moderator: leecollings

Post Reply
jokkemokke
Posts: 2
Joined: Sunday 03 May 2015 10:05
Target OS: -
Domoticz version:
Contact:

Install Domoticz in Centos 7

Post by jokkemokke »

Hi

After request I will share my guide how to install Domoticz on Centos 7 64 bit.

The guide is based on this post: viewtopic.php?f=17&t=2131 but with a few modifications (Some things from the original guide were not working for me. I think because I use 64 bit Centos and the original guide was based on 32 bit Centos).

1) Download source code:

git clone https://github.com/domoticz/domoticz.git domoticz-code

Domoticz source should now be at /usr/src/domoticz-code

2) Install with yum :

yum install cmake
yum install boost
yum install gcc
yum install libusb
yum install libcurl
yum install gcc-c++
yum install sqlite-devel
yum install boost-devel
yum install zlib-devel
yum install curl-devel
yum install boost-static
yum install libstdc++-static libstdc++-static.i686

3) Copy all boost libraries into /usr/lib/lib

md /usr/lib/lib
cd /usr/lib64/
cp libbost*.* /usr/lib/lib/

4) Modify CMakeLists.txt

Add just after unset(Boost_LIBRARY_DIRS CACHE) :

set(Boost_NO_BOOST_CMAKE ON)

5) Modify smtpclient/SMTPClient.cpp

Comment these lines :

// curl_easy_setopt(curl, CURLOPT_MAIL_FROM, m_From.c_str());
// curl_easy_setopt(curl, CURLOPT_MAIL_RCPT, slist1);

6) Modify main/SQLHelper.cpp

Comment these lignes (two lignes in code) :

// sqlite3_wal_checkpoint(m_dbase, NULL);


7) Cmake

delete CMakeCache.txt

cmake -DCMAKE_BUILD_TYPE=Release CMakeLists.txt

8) Make

make

9) Install binaries

cd /usr/src/domoticz

md /usr/local/domoticz

cp domoticz /usr/local/domoticz
cp -r scripts /usr/local/domoticz
cp -r www /usr/local/domoticz

10) Copy domoticz.sh to /etc/init.d

rename domoticz.sh to domoticz

11) Modify /etc/init.d/domoticz

Code: Select all


    #! /bin/sh
    ### BEGIN INIT INFO
    # Provides:          domoticz
    # Required-Start:    $network $remote_fs $syslog
    # Required-Stop:     $network $remote_fs $syslog
    # Default-Start:     2 3 4 5
    # Default-Stop:      0 1 6
    # Short-Description: Home Automation System
    # Description:       This daemon will start the Domoticz Home Automation System
    ### END INIT INFO

    # Source function library.
    . /etc/rc.d/init.d/functions

    PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin
    DESC="Domoticz Home Automation System"
    NAME=domoticz
    USERNAME=domoticz
    DAEMON=/usr/local/domoticz/$NAME
    #DAEMON_ARGS="-daemon -www 8080 -log /tmp/domoticz.txt"
    #DAEMON_ARGS="-daemon -www 8080 -syslog"
    DAEMON_ARGS="-daemon -www 8080 -log /var/log/domoticz.log"

    STOP_TIMEOUT=10
    pidfile=/var/run/$NAME.pid
    lockfile=/var/lock/subsys/$NAME}

    # Exit if the package is not installed
    [ -x "$DAEMON" ] || exit 0

    #
    # Function that starts the daemon/service
    #
    do_start()
    {
            echo -n $"Starting $NAME : "
            daemon --pidfile=$pidfile $DAEMON $DAEMON_ARGS
            RETVAL=$?
            echo
            [ $RETVAL = 0 ] && touch ${lockfile}
            return $RETVAL
    }

    #
    # Function that stops the daemon/service
    #
    do_stop()
    {
       echo -n $"Stopping $NAME : "
       killproc -p ${pidfile} -d ${STOP_TIMEOUT} $DAEMON
       RETVAL=$?
       echo
       [ $RETVAL = 0 ] && rm -f ${lockfile} ${pidfile}
    }

    case "$1" in
      start)
       do_start
            ;;
      stop)
            do_stop
            ;;
      status)
            status -p ${pidfile} DAEMON
       RETVAL=$?
            ;;
      restart)
            do_stop
            do_start
            ;;
      *)
            echo "Usage: service domoticz {start|stop|status|restart}" >&2
            exit 3
            ;;
    esac

    :


12) Create user domoticz

useradd domoticks

13) Start service

service domoticz start

14) Test

http://127.0.0.1:8080
kshesq
Posts: 12
Joined: Tuesday 05 January 2016 9:50
Target OS: Linux
Domoticz version: 2021.1
Location: Haarlem
Contact:

Re: Install Domoticz in Centos 7

Post by kshesq »

Hi, i am trying to compile the source (on centos 6.7 x64) according to this page:

but when I run:
cmake -DCMAKE_BUILD_TYPE=Release CMakeLists.txt

I get this message;

CMake Error at CMakeLists.txt:145 (MATH):
math cannot parse the expression: "+2107": syntax error, unexpected
exp_PLUS, expecting exp_OPENPARENT or exp_NUMBER (1)

Can someone help me fix this?

TIA
Kim
marcelr
Posts: 42
Joined: Friday 22 May 2015 21:10
Target OS: Linux
Domoticz version: svn 2470
Location: Ehv, NL
Contact:

Re: Install Domoticz in Centos 7

Post by marcelr »

Hi, i am trying to compile the source (on centos 6.7 x64) according to this page:

but when I run:
cmake -DCMAKE_BUILD_TYPE=Release CMakeLists.txt

I get this message;

CMake Error at CMakeLists.txt:145 (MATH):
math cannot parse the expression: "+2107": syntax error, unexpected
exp_PLUS, expecting exp_OPENPARENT or exp_NUMBER (1)
I bumped into the same issue, still working on it.

The error arises from the previous line in the cmake file:

Code: Select all

Gitversion_GET_REVISION(. ProjectRevision)
This renders ProjectRevision empty, so there's nothing to add 2107 to in the next line.
In turn, the Gitversion macro tries to find data in .git, which doesn't exist. This lead to the following error:

Code: Select all

fatal: Not a git repository (or any of the parent directories): .git
So, I think the downloaded and extracted zip file does not contain all information required to build properly.

Most likely, some of the build tools on CentOS6 are too old to use for Domoticz. Since I find that quite unacceptable, I will keep trying to get it to work with a bit of patching.


grtz,

marcelr
marcelr
Posts: 42
Joined: Friday 22 May 2015 21:10
Target OS: Linux
Domoticz version: svn 2470
Location: Ehv, NL
Contact:

Re: Install Domoticz in Centos 7

Post by marcelr »

Quick update:

On CentOS6, git is too old, it does not support the option "--count".
I downloaded the git sources for fedora 17, built and installed git (version 2.7.0). This one works, but then you get errors in the boost libraries (missing members). Needs upgrading too.

grtz,

marcelr
kshesq
Posts: 12
Joined: Tuesday 05 January 2016 9:50
Target OS: Linux
Domoticz version: 2021.1
Location: Haarlem
Contact:

Re: Install Domoticz in Centos 7

Post by kshesq »

Hi Marcel, yeah you need boost 1.6 http://www.domoticz.com/forum/viewtopic.php?f=6&p=66001

i got domoticz to work on centos 6, just without a version number. i changed the version line to this "MATH(EXPR ProjectRevision "2107")"
now domoticz compiles and the version is 2107 :)
Bobbie
Posts: 4
Joined: Friday 26 August 2016 15:03
Target OS: Linux
Domoticz version:
Contact:

Re: Install Domoticz in Centos 7

Post by Bobbie »

I'm Using ClearOS which is based on Centos 7.
I'm also trying to install Domoticz on my server according this page but after the
cmake -DCMAKE_BUILD_TYPE=Release CMakeLists.txt
I got this output and not able to finish the install.

Below the output with errors and Make is not possible. I update Boost already to 1.61

What do I wrong?.

[root@server domoticz]# cmake -DCMAKE_BUILD_TYPE=Release CMakeLists.txt
-- The C compiler identification is GNU 4.8.5
-- The CXX compiler identification is GNU 4.8.5
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Using builtin Mosquitto library
-- Could NOT find OpenSSL, try to set the path to OpenSSL root folder in the system variable OPENSSL_ROOT_DIR (missing: OPENSSL_LIBRARIES OPENSSL_INCLUDE_DIR)
-- Failed to find openssl include files (ssl.h), no TLS support
-- Failed to find the openssl library, no TLS support
-- Compiling Revision #5559
-- Boost version: 1.61.0
-- Found the following Boost libraries:
-- thread
-- date_time
-- system
-- Linking against boost static libraries
-- Found ZLIB: /usr/lib64/libz.so (found version "1.2.7")
-- ZLIB libraries found at: /usr/lib64/libz.so
-- ZLIB includes found at: /usr/include
-- Found CURL: /usr/lib64/libcurl.so (found version "7.29.0")
-- Curl libraries found at: /usr/lib64/libcurl.so
-- Curl includes found at: /usr/include
-- Could NOT find LIBUSB (missing: LIBUSB_LIBRARIES LIBUSB_INCLUDE_DIR)
-- ==== LibUSB not found, support for TE923/Voltcraft disabled!
-- Could NOT find OpenSSL, try to set the path to OpenSSL root folder in the system variable OPENSSL_ROOT_DIR (missing: OPENSSL_LIBRARIES OPENSSL_INCLUDE_DIR)
CMake Error at CMakeLists.txt:478 (message):
Failed to find openssl include files (ssl.h), no HTTPS support


CMake Error at CMakeLists.txt:481 (message):
Failed to find the openssl library, no HTTPS support


-- ==== OpenZWave not found, support disabled!
-- ==== WiringPi include file (wiringPi.h) not found. GPIO support disabled.
-- ==== (Please follow http://wiringpi.com/download-and-install/ if you want to use GPIO.)
-- Not found telldus-core (telldus-core.h), not adding tellstick support
/usr/bin/c++ ;-O3;-DNDEBUG;-I/usr/src/domoticz/main;-I/usr/local/include;-I/usr/include;-I/usr/include;;-DBUILTIN_MQTT -x c++-header -o /usr/src/domoticz/stdafx.h.gch/.c++ /usr/src/domoticz/main/stdafx.h
-- Using static libgcc/libstdc++
-- Check if the system is big endian
-- Searching 16 bit integer
-- Looking for sys/types.h
-- Looking for sys/types.h - found
-- Looking for stdint.h
-- Looking for stdint.h - found
-- Looking for stddef.h
-- Looking for stddef.h - found
-- Check size of unsigned short
-- Check size of unsigned short - done
-- Using unsigned short
-- Check if the system is big endian - little endian
-- Configuring incomplete, errors occurred!
[root@server domoticz]# make
make: *** No targets specified and no makefile found. Stop.
[root@server domoticz]#

Thanks a lot
B
lowgrey
Posts: 1
Joined: Sunday 22 May 2016 6:25
Target OS: Linux
Domoticz version:
Contact:

Re: Install Domoticz in Centos 7

Post by lowgrey »

I'm having the same problem on an Intel Atom running Debian 8 Server.

lowgrey@debian:~/domoticz.new$ cmake -DCMAKE_BUILD_TYPE=Release CMakeLists.txt
-- The C compiler identification is GNU 4.9.2
-- The CXX compiler identification is GNU 4.9.2
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Using builtin Mosquitto library
CMake Error at /usr/share/cmake-3.0/Modules/FindOpenSSL.cmake:293 (list):
list GET given empty list
Call Stack (most recent call first):
MQTT/CMakeLists.txt:13 (find_package)


CMake Error at /usr/share/cmake-3.0/Modules/FindOpenSSL.cmake:294 (list):
list GET given empty list
Call Stack (most recent call first):
MQTT/CMakeLists.txt:13 (find_package)


CMake Error at /usr/share/cmake-3.0/Modules/FindOpenSSL.cmake:296 (list):
list GET given empty list
Call Stack (most recent call first):
MQTT/CMakeLists.txt:13 (find_package)


CMake Error at /usr/share/cmake-3.0/Modules/FindOpenSSL.cmake:298 (list):
list GET given empty list
Call Stack (most recent call first):
MQTT/CMakeLists.txt:13 (find_package)


-- Found OpenSSL: /usr/lib/x86_64-linux-gnu/libssl.so;/usr/lib/x86_64-linux-gnu/libcr
ypto.so (found version ".0.0`")
-- Looking for execinfo.h
-- Looking for execinfo.h - found
-- Compiling Revision #5562
-- Boost version: 1.61.0
-- Found the following Boost libraries:
-- thread
-- date_time
-- system
-- Linking against boost static libraries
-- Found ZLIB: /usr/lib/x86_64-linux-gnu/libz.so (found version "1.2.8")
-- ZLIB libraries found at: /usr/lib/x86_64-linux-gnu/libz.so
-- ZLIB includes found at: /usr/include
-- Found CURL: /usr/lib/x86_64-linux-gnu/libcurl.so (found version "7.38.0")
-- Curl libraries found at: /usr/lib/x86_64-linux-gnu/libcurl.so
-- Curl includes found at: /usr/include
-- Found LIBUSB: /usr/lib/x86_64-linux-gnu/libusb.so
-- LIBUSB found at: /usr/lib/x86_64-linux-gnu/libusb.so
CMake Error at /usr/share/cmake-3.0/Modules/FindOpenSSL.cmake:293 (list):
list GET given empty list
Call Stack (most recent call first):
CMakeLists.txt:481 (find_package)


CMake Error at /usr/share/cmake-3.0/Modules/FindOpenSSL.cmake:294 (list):
list GET given empty list
Call Stack (most recent call first):
CMakeLists.txt:481 (find_package)


CMake Error at /usr/share/cmake-3.0/Modules/FindOpenSSL.cmake:296 (list):
list GET given empty list
Call Stack (most recent call first):
CMakeLists.txt:481 (find_package)


CMake Error at /usr/share/cmake-3.0/Modules/FindOpenSSL.cmake:298 (list):
list GET given empty list
Call Stack (most recent call first):
CMakeLists.txt:481 (find_package)


-- ==== OpenZWave not found, support disabled!
-- ==== WiringPi include file (wiringPi.h) not found. GPIO support disabled.
-- ==== (Please follow http://wiringpi.com/download-and-install/ if you want to use G
PIO.)
-- Not found telldus-core (telldus-core.h), not adding tellstick support
/usr/bin/c++ ;-O3;-DNDEBUG;-I/home/lowgrey/domoticz.new/main;-I/usr/local/include;-I
/usr/include;-I/usr/include;-I/usr/include;;-DBUILTIN_MQTT;-DHAVE_EXECINFO_H;-DWITH_L
IBUSB;-DWWW_ENABLE_SSL -x c++-header -o /home/lowgrey/domoticz.new/stdafx.h.gch/.c++
/home/lowgrey/domoticz.new/main/stdafx.h
-- Using static libgcc/libstdc++
-- Check if the system is big endian
-- Searching 16 bit integer
-- Looking for sys/types.h
-- Looking for sys/types.h - found
-- Looking for stdint.h
-- Looking for stdint.h - found
-- Looking for stddef.h
-- Looking for stddef.h - found
-- Check size of unsigned short
-- Check size of unsigned short - done
-- Using unsigned short
-- Check if the system is big endian - little endian
-- Configuring incomplete, errors occurred!
See also "/home/lowgrey/domoticz.new/CMakeFiles/CMakeOutput.log".
See also "/home/lowgrey/domoticz.new/CMakeFiles/CMakeError.log".
lowgrey@debian:~/domoticz.new$
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest