Dies ist eine alte Version des Dokuments!
Inhaltsverzeichnis
vzlogger Installation
Repository
Our repository: https://github.com/volkszaehler/vzlogger
Actually vzlogger and some of the libraries are only provided by sourcecode. They have to be compiled before use. Select a working directory your user has writing permissions. For example the home directory:
cd ~
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 libleptonica-dev sudo apt-get install libjson-c-dev #if unable to locate package libjson-c-dev see below
Build by script
Vzlogger provides a shell script for download, build and install of the modules issued only as sourcecode.
git clone https://github.com/volkszaehler/vzlogger.git cd vzlogger ./install.sh
The script supports also build of one single module. See the comments in the script for details.
Update
sudo systemctl stop vzlogger #only works after creating the systemd start script, see below cd vzlogger git pull ./install.sh vzlogger sudo systemctl start vzlogger #only works after creating the systemd start script, see below
Build by hand
In cases the script does not fit the conditions.
Building libjson
The best case is building libjson from source, which is simple too:
sudo apt-get install dh-autoreconf git clone -b json-c-0.12 https://github.com/json-c/json-c cd json-c sh autogen.sh ./configure make sudo make install
Go back to your starting directory:
cd ..
Building libsml
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 mkdir build cd build 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 #only works after creating the systemd start script, see below cd vzlogger git pull cd build cmake .. make sudo make install cd ../.. sudo systemctl start vzlogger #only works after creating the systemd start script, see below
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