Dies ist eine alte Version des Dokuments!
Inhaltsverzeichnis
vzlogger Installation
Repository
Our repository: https://github.com/volkszaehler/vzlogger
Building from Source
Prerequisites for compiling vzlogger
Please note that a full configured vzlogger requires besides gcc (4.7 or higher) and glibc, these libraries to compile successfully:
Tools
- git (package: git-core)
- cmake
- pkg-config
- subversion (for tests using googlemock)
required Libraries
- libjson >= 0.11 (>= 0.9 before https://github.com/volkszaehler/vzlogger/pull/106)
- libcurl3 >= 7.19
- libgnutls-dev
- libgcrypt
- libsasl2-dev
- libuuid1
- libsml (for sml meters)
- libmicrohttpd-dev >= 0.4.6 (for builtin „local“ webserver)
- libltdl >=0.8.0 (for OMS)
- libleptonica-dev (for OCR)
debian packages
On Debian-Jessie based distributios, most of these dependencies can easily be installed with: (as root, consider running „apt-get update“ first)
sudo apt-get install build-essential git-core cmake pkg-config subversion libcurl4-openssl-dev libgnutls28-dev libsasl2-dev uuid-dev libtool libssl-dev libgcrypt20-dev libmicrohttpd-dev libltdl-dev libjson-c-dev libleptonica-dev
For Debian Wheezy:
sudo apt-get install build-essential git-core cmake pkg-config subversion libcurl3-dev libgnutls-dev libsasl2-dev uuid-dev libtool libmicrohttpd-dev libcurl4-openssl-dev libssl-dev libltdl-dev sudo apt-get install libjson-c-dev # see below
Building libjson
The best case is building libjson from source, which is simple too:
sudo apt-get install dh-autoreconf sudo git clone -b json-c-0.12 https://github.com/json-c/json-c cd json-c sudo sh autogen.sh sudo ./configure sudo make sudo make install
Go back to your starting directory:
cd ..
Building libsml
sudo git clone https://github.com/volkszaehler/libsml.git cd libsml sudo make
Note that libsml does not include a 'make install' target.
You can manually install it into your system by copying the following files and directories
sudo cp sml/lib/libsml.* /usr/lib/ sudo cp -R sml/include/* /usr/include/ sudo cp sml.pc /usr/lib/pkgconfig/
Go back to your starting directory:
cd ..
Building vzlogger
git clone https://github.com/volkszaehler/vzlogger.git cd vzlogger cmake . make sudo make install
Go back to your starting directory:
cd ..
Building OMS
OMS requires openssl and libmbus >=0.8.0 from e.g. https://github.com/rscada/libmbus.git (installation is easy:)
git clone https://github.com/rscada/libmbus.git cd libmbus sudo ./build.sh sudo make install
Go back to your starting directory:
cd ..
Update vzlogger
sudo systemctl stop vzlogger cd vzlogger git pull cmake . make sudo make install cd ~ sudo systemctl start vzlogger
if you are having trouble building with libsml, instead of just „cmake .“, use:
cmake . -DSML_HOME=/path/to/libsml
a debian package can be generated using:
cpack -G DEB
Cross compiling
cmake -DCMAKE_TOOLCHAIN_FILE=/path/to/toolchainfile /path/to/vzlogger_sources
systemd start script
If your computer uses systemd (Debian-Jessie) then follow these steps to add vzlogger as a new service:
Create a file vzlogger.service in /etc/systemd/system/ and fill it with these lines
[Unit] Description=vzlogger After=syslog.target network.target After=mysql.service ntp.service [Service] ExecStart=/usr/local/bin/vzlogger -c /etc/vzlogger.conf ExecReload=/bin/kill -HUP $MAINPID StandardOutput=null [Install] WantedBy=multi-user.target
You can start, stop or verify vzloggers status using the common systemctl command:
~]# sudo systemctl start vzlogger ~]# systemctl status vzlogger ~]# sudo systemctl stop vzlogger
If you are satisfied and want to have vzlogger permanently startet as a service everytime your machine boots, just enable it:
~]# sudo systemctl enable vzlogger