Install.txt

From Domoticz
Jump to: navigation, search

Prerequisites

Windows

Ubuntu / Raspberry Pi (wheezy)

sudo apt-get install build-essential -y
sudo apt-get install cmake libboost-dev libboost-thread-dev libboost-system-dev libsqlite3-dev subversion curl libcurl4-openssl-dev libusb-dev zlib1g-dev libssl-dev git

Debian stretch

sudo apt-get install build-essential -y
sudo apt-get install cmake libboost1.61-dev libboost-system1.61-dev libboost-thread1.61-dev libsqlite3-dev subversion curl libcurl4-openssl-dev libusb-dev zlib1g-dev libssl-dev git

Raspberry Pi (Arch Linux)

sudo pacman -S gcc cmake subversion boost sqlite make curl libusb zlib1g-dev

Debian (Mac OS)

See Mac_OSX

Synology

Make sure the device is bootstrapped

Install some packages

ipkg install gcc
ipkg install make
ipkg install optware-devel (dont worry about the wget-ssl error)
ipkg install boost-dev
ipkg install boost-thread
ipkg install boost-system
ipkg install boost-date-time
ipkg install libcurl-dev
ipkg install libusb
ipkg install zlib1g-dev

Install cmake

(Take a coffee while doing the bootstrap and make commands)

wget http://www.cmake.org/files/v2.8/cmake-2.8.10.tar.gz
tar xvf cmake-2.8.10.tar.gz
cd cmake-2.8.10
./bootstrap
make
make install
cd ..
rm -R cmake-2.8.10
rm cmake-2.8.10.tar.gz


Fix known pthread problem

1. backup the pthread libraries found in /opt/arm-none-linux-gnueabi/lib/:

mkdir /opt/arm-none-linux-gnueabi/lib_disabled
mv /opt/arm-none-linux-gnueabi/lib/libpthread* /opt/arm-none-linux-gnueabi/lib_disabled

2. Copy the pthread libraries found in /opt/lib

cp /lib/libpthread.so.0 /opt/arm-none-linux-gnueabi/lib/
cd /opt/arm-none-linux-gnueabi/lib/
ln -s libpthread.so.0 libpthread.so
ln -s libpthread.so.0 libpthread-2.5.so

3.

cp /opt/lib/libboost_* /lib

Verify http://forum.synology.com/enu/viewtopic.php?p=185512#p185512 to check your /root/.profile

4. Install the FTDI and usb drivers

For a tutorial on a DS212+ see: http://sirloon.net/installing-usb-serial-modules-on-nas-synology-ds212

Basic installation:

insmod usbserial.kp
insmod ftdi_sio.ko
mknod /dev/usb/ttyUSB0 c 188 0

Plug your USB RFXtrx transceiver, verify it is found with

dmesg

You should see messages about it and an assigned usb device (in my case /dev/usb/ttyUSB0). Go back to root folder for the next steps: cd

OpenZWave

OpenZWave is required for example to use an Aeon USB V2 ZWave adapter.

Install libudev-dev

We assume the specific dependencies for your system have been installed. sudo apt-get install libudev-dev

Compile OpenZWave

git clone https://github.com/OpenZWave/open-zwave.git
ln -s open-zwave-read-only open-zwave
cd open-zwave
make
cd ..

Update OpenZWave

cd open-zwave
git pull
make clean
make
cd ..

Installation

Get the source code and compile with:

git clone https://github.com/domoticz/domoticz.git domoticz
cd domoticz
git pull
cmake -DCMAKE_BUILD_TYPE=Release .

Note 1: For recent Debian version, these options may be required for compilation to succeed: -DBOOST_LIBRARYDIR=/usr/lib/x86_64-linux-gnu -DBoost_USE_MULTITHREADED=OFF

Note 2: If you got undefined reference to boost::atomics::detail::lockpool::get_lock_for(void const volatile*)' linker error, append -lboost_atomic at the end of ./CMakeFiles/domoticz.dir/link.txt

Note 3: If you face runtime issues please use cmake -DCMAKE_BUILD_TYPE=Debug . to recompile and review logs for troubleshooting

make

Note: Compiling on the Raspberry Pi will take about 45 minutes

You should now have the binary application, you can start it with

./domoticz

For additional parameters type:

sudo ./domoticz -h

Upgrading

To Update to a newer version:

  • stop the application (control-c), or stop the startup script (see below) with /etc/init.d/domoticz.sh stop
  • Execute

cd /home/pi/domoticz (or where you installed domoticz)
git pull
make

  • start domoticz

If you have installed the Unix startup script (see below), you can also update with the provided script:

./updatedomo

How to start domoticz at boot (Unix only)

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

Edit the startup script, esp. point DAEMON to the installation folder:

sudo nano /etc/init.d/domoticz.sh
DAEMON=/home/pi/domoticz/domoticz

If you want to use another web interface port change:

OPTIONS="-www 8080"

You can now start/stop domoticz with:

sudo /etc/init.d/domoticz.sh start sudo /etc/init.d/domoticz.sh stop

To check if domoticz is running:

sudo /etc/init.d/domoticz.sh status

If your system supports it you can also issue:

sudo service domoticz.sh start
sudo service domoticz.sh stop
sudo service domoticz.sh status