Install.txt

来自Domoticz
Admin讨论 | 贡献2017年3月21日 (二) 09:05的版本 (创建页面,内容为“=安装前提= ==Windows== * VS2015 (社区版即可) * boost libraries, you probably have to set the correct include/lib folder in the project properties as I did...”)
(差异) ←上一版本 | 最后版本 (差异) | 下一版本→ (差异)

安装前提

Windows

  • VS2015 (社区版即可)
  • boost libraries, you probably have to set the correct include/lib folder in the project properties as I did not bootstrap mine
  • lua (provided in Domoticz sources): just build it (see lua/src/LuaMSVS/LuaMSVS.sln solution)

Ubuntu / 树莓派 (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

树莓派 (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 ..

安装

获取Domoticz源码并编译:

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

升级

升级到新版本:

  • 停止应用程序 (control-c), 或者停止启动脚本/etc/init.d/domoticz.sh stop
  • 然后执行:

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

  • 启动Domoticz

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

./updatedomo

设置开机自动启动Domoticz (Unix only)

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

修改启动脚本,将DAEMON属性改为Domoticz安装目录:

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

如果要使用其它端口供web访问,修改:

OPTIONS="-www 8080"

现在,你可以通过以下命令来启动、停止Domoticz:

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

检查Domoticz运行状态:

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

如果系统支持,你也可以使用以下命令:

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