[vz-dev] vzlogger 0.4.0?

Ralf G. R. Bergs Ralf+VolksZaehler at bergs.biz
Tue Dec 9 21:48:21 CET 2014


Hi Andreas.

On 2014-12-09 16:01 , Andreas Götz wrote:
>
>> Any further advice how to "force" vzlogger to include and enable the
>> microhttpd code when I compile it on the RPi?
> In general it is helpful to tell us what you _did_ try instead of us guessing what else you might do.
I wanted to send the pastebin URL, but it had expired. I think I set it
to one week since I hadn't expected I needed it after that time still... :-(

I can still remember that you could see that

>  Also an error or problem description is a good idea.
>
> Looking at https://github.com/volkszaehler/vzlogger/blob/master/src/vzlogger.cpp I'm sure you have LOCAL_SUPPORT enabled?
>
Yes, I had that enabled.

On 2014-12-09 17:25 , Andreas Götz wrote:
> Ps.: cmake -DENABLE_LOCAL könnte funktionieren, nicht getestet.
>
I tried that as well, but to no avail. :-(

I've now tried to repeat what I did:
> pi at rpi ~/work/vzlogger $ cmake -DENABLE_LOCAL=on
> Compiling for target ''
> -- checking if -Wno-ignored-qualifiers works
> -- FindSml check
> -- checking for module 'sml>=0.9'
> --   package 'sml>=0.9' not found
> -- SML_HOME is not empty: "/home/pi/work/libsml/sml"
> -- Looking for sml in /home/pi/work/libsml/sml
> -- FindMicrohttpd check
> -- checking for module 'libmicrohttpd-dev>=0.9'
> --   package 'libmicrohttpd-dev>=0.9' not found
> -- MICROHTTPD_HOME env is not set, setting it to /usr/local
> -- Looking for microhttpd in /usr
> -- FindJson check
> -- JSON_HOME env is not set, setting it to /usr/local
> -- Looking for json in /usr/local
> Jsoon search:
> '/usr/local/include;/usr/local/include;/usr/local/include;/usr/include'
> -- FindCURL check
> -- ==> ''
> -- CURL_HOME env is not set, setting it to /usr/local
> -- Looking for curl in /usr/local
> ==>
> CURL_LIBRARIES='/usr/lib/arm-linux-gnueabihf/libcurl.a;/usr/lib/arm-linux-gnueabihf/libidn.a;/usr/lib/arm-linux-gnueabihf/libssh2.a;/usr/lib/arm-linux-gnueabihf/liblber.a;/usr/lib/arm-linux-gnueabihf/libldap.a;/usr/lib/arm-linux-gnueabihf/librt.a;-lgssapi_krb5;-lkrb5;-lk5crypto;/usr/lib/arm-linux-gnueabihf/libcom_err.a;/usr/lib/arm-linux-gnueabihf/libssl.a;/usr/lib/arm-linux-gnueabihf/libcrypto.a;/usr/lib/arm-linux-gnueabihf/librtmp.a;/usr/lib/arm-linux-gnueabihf/libz.a;/usr/lib/arm-linux-gnueabihf/libgnutls.a'
> -- FindGnuTls check
> -- ==> ''
> -- GNUTLS_HOME env is not set, setting it to /usr/local
> -- Looking for gnutls in /usr/local
> ==>
> GNUTLS_LIBRARIES='/usr/lib/arm-linux-gnueabihf/libgnutls.a;/lib/arm-linux-gnueabihf/libgcrypt.a;/usr/lib/arm-linux-gnueabihf/libgpg-error.a;/usr/lib/arm-linux-gnueabihf/libtasn1.a;/usr/lib/arm-linux-gnueabihf/libz.a;-lp11-kit;-lsasl2;/lib/arm-linux-gnueabihf/libgcrypt.a'
>
>         ***** Configuration parameters *****
>              prefix: /usr/local
>              json: -L/usr/lib/arm-linux-gnueabihf/libjson.a;-lrt
> -I/usr/include
>              sml:  -L/home/pi/work/libsml/sml/lib/libsml.a;-lrt
> -I/home/pi/work/libsml/sml/include
>              microhttpd:
> -L/usr/lib/arm-linux-gnueabihf/libmicrohttpd.a;-lrt -I/usr/include
> -- Configuring done
> -- Generating done
> -- Build files have been written to: /home/pi/work/vzlogger
The static library for microhttpd exists at the location specified above:
> /usr/lib/arm-linux-gnueabihf/libmicrohttpd.a
I've now recompiled everything, here's the new output:
> http://pastebin.com/y6vPBvF9
As you can see the microhttpd library is actually linked into the
vzlogger binary:
> /usr/bin/c++    -W -Wall -Wextra -Werror -Wnon-virtual-dtor
> -Wno-system-headers -Winit-self -Wmissing-include-dirs -Wno-pragmas
> -Wredundant-decls -Wno-unused-parameter -std=c++0x -fpermissive
> -Wno-ignored-qualifiers    CMakeFiles/vzlogger.dir/vzlogger.cpp.o
> CMakeFiles/vzlogger.dir/ltqnorm.cpp.o
> CMakeFiles/vzlogger.dir/Meter.cpp.o  -o vzlogger -rdynamic
> protocols/libproto.a libvz.a api/libvz-api.a -Wl,-Bstatic -ljson
> -Wl,-Bdynamic -lrt /home/pi/work/libsml/sml/lib/libsml.a -lrt
> -Wl,-Bstatic -lmicrohttpd -Wl,-Bdynamic -lrt -lgcrypt -lpthread -lm
> -luuid -ldl -Wl,-Bstatic -lcurl -lidn -lssh2 -llber -lldap -lrt
> -Wl,-Bdynamic -lgssapi_krb5 -lkrb5 -lk5crypto -Wl,-Bstatic -lcom_err
> -lssl -lcrypto -lrtmp -lz -lgnutls -lgnutls -lgcrypt -lgpg-error
> -ltasn1 -lz -Wl,-Bdynamic -lp11-kit -lsasl2 -Wl,-Bstatic -lgcrypt
> -Wl,-Bdynamic /home/pi/work/libsml/sml/lib/libsml.a -Wl,-Bstatic
> -lmicrohttpd -Wl,-Bdynamic -lgcrypt -lpthread -lm -luuid -ldl
> -Wl,-Bstatic -lcurl -lidn -lssh2 -llber -lldap -lrt -Wl,-Bdynamic
> -lgssapi_krb5 -lkrb5 -lk5crypto -Wl,-Bstatic -lcom_err -lssl -lcrypto
> -lrtmp -lz -lgnutls -lgcrypt -lgpg-error -ltasn1 -Wl,-Bdynamic
> -lp11-kit -lsasl2 -Wl,-Bstatic -lz -lgnutls -lgcrypt -lgpg-error
> -ltasn1 -Wl,-Bdynamic -lp11-kit -lsasl2
I checked by manually including "-lfoobar" that the c++ compiler
actually barfs out if it can't find a library specified on the command
line -- this is indeed the case, so the c++ compiler must have found
-lmicrohttpd when the above command line was executed.

Doing a "strings" on the vzlogger binary also seems to suggest that the
microhttpd code is not included -- I can't find any of some
characteristic strings in the microhttpd.a file

I've now done it the brutal way, and finally succeeded: I explicitly
#define'd  LOCAL_SUPPORT in the .cpp file and recompiled vzlogger again
-- and finally microhttpd is enabled:
> vzlogger 4231 vzlogger    5u  IPv4  13104      0t0  TCP *:http-alt
> (LISTEN)
The following now works:
> $ curl http://rpi:8080/
> { "version": "0.3.9", "generator": "vzlogger", "data": [ { "uuid":
> "72b84f00-78cf-11e4-828e-b5e03ccbd224", "last": 1418158003.977436,
> "interval": 15, "protocol": "sml" }, { "uuid":
> "442811a0-7882-11e4-8cbb-4fd2114e6edc", "last": 1418158003.977476,
> "interval": 15, "protocol": "sml" }, { "uuid":
> "8d571aa0-7882-11e4-9755-1fd3ed3c5076", "last": 1418158003.977484,
> "interval": 15, "protocol": "sml" }, { "uuid":
> "9468cfb0-7882-11e4-8021-c54e0227b4a7", "last": 1418158003.977492,
> "interval": 15, "protocol": "sml" }, { "uuid":
> "d0bfd3e0-7882-11e4-8eb8-c32561418f40", "last": 1418158003.977467,
> "interval": 15, "protocol": "sml" } ] }
Now I can use Cacti to visualize the data so that I have everything in
one place...

Maybe this helps people who have the same issue as I had...

KR,

Ralf




More information about the volkszaehler-dev mailing list