Dies ist eine alte Version des Dokuments!
Inhaltsverzeichnis
vzlogger Installation (en)
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)
- libmosquitto-dev (for MQTT)
- libunistring-dev (due to problem Ubuntu 18.04)
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 libmosquitto-dev libunistring-dev dh-autoreconf
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 libunistring-dev dh-autoreconf
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.
Daemon
At this point a daemon-service should be prepared to run vzlogger in backgroung. Details down below.
Update
If a update is necessary follow these steps:
sudo systemctl stop vzlogger cd vzlogger git pull ./install.sh vzlogger sudo systemctl start vzlogger
The based SML Library may (before) updated by:
cd vzlogger/libs/libsml git pull cd ../.. ./install.sh libsml
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:
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
if you are having trouble building with libsml, instead of just „cmake ..“, use:
cmake .. -DSML_HOME=/path/to/libsml
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 ..
Daemon
At this point a daemon-service should be prepared to run vzlogger in backgroung. Details down below.
Update vzlogger
If a update is necessary follow these steps:
cd vzlogger git pull cd build cmake -DBUILD_TEST=off .. make sudo systemctl stop vzlogger sudo make install sudo systemctl start vzlogger
Systemd start script
Systemd is used to install and execute services in background (daemon).
The installscript asks you for installing the systemd unit file for you. If your computer uses systemd (Debian-Jessie) you may answer yes.
If you want to copy and edit it by yourself you find a template under: ./etc/vzlogger.service
sudo cp ./etc/vzlogger.service /etc/systemd/system/vzlogger.service
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
Special hints
debian package
a debian package can be generated using:
cpack -G DEB
Cross compiling
cmake -DCMAKE_TOOLCHAIN_FILE=/path/to/toolchainfile /path/to/vzlogger_sources