vzlogger

chris.6n

Member
Moin zusammen,

hat schon mal einer vzlogger zum laufen bekommen?
Meine Idee war ein Raspberry Pi mit vzlogger zu bestücken. Dann könnte ich meinen Stromzähler auslesen.
Bis jetzt habe ich aber noch keinen erfolgreichen versuch im Netz gefunden.


Gruß
Chris
 
Hat einer einer Idee?

Code:
root@pibsd:~/vzlogger # make
/usr/local/bin/cmake -S/root/vzlogger -B/root/vzlogger --check-build-system CMakeFiles/Makefile.cmake 0
CMake Deprecation Warning at CMakeLists.txt:3 (cmake_minimum_required):
  Compatibility with CMake < 2.8.12 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.


Compiling for target ''
-- using clang compiler Clang
-- FindSml check
-- Could NOT find PkgConfig (missing: PKG_CONFIG_EXECUTABLE)
-- SML_HOME env is not set, setting it to /usr/local
-- Looking for sml in /usr/local
-- FindMBus check
-- Could NOT find PkgConfig (missing: PKG_CONFIG_EXECUTABLE)
-- Looking for libmbus in
-- FindMicrohttpd check
-- Could NOT find PkgConfig (missing: PKG_CONFIG_EXECUTABLE)
-- MICROHTTPD_HOME env is not set, setting it to /usr/local
-- Looking for microhttpd in /usr/local
-- search for libmosquitto returned /usr/local/lib/libmosquitto.so and /usr/local/include
-- libmosquitto found at /usr/local/lib/libmosquitto.so
-- FindJson check
-- Could NOT find PkgConfig (missing: PKG_CONFIG_EXECUTABLE)
-- JSON_HOME env is not set, setting it to /usr/local
-- Looking for json in /usr/local
Json-c search: '/usr/local/include;/usr/local/include;/usr/local/include;/usr/include'
Json-c found: '/usr/local/include'
-- FindGnuTls check
-- Could NOT find PkgConfig (missing: PKG_CONFIG_EXECUTABLE)
-- ==> N ''
-- GNUTLS_HOME env is not set, setting it to /usr/local
-- Looking for gnutls in /usr/local
==> GNUTLS_LIBRARIES=''
-- Could NOT find GNUTLS (missing: GNUTLS_LIBRARIES)

        ***** Configuration parameters *****
             prefix: /usr/local
             json: -L/usr/local/lib/libjson-c.a;-lrt -I/usr/local/include
             sml:  -L/usr/local/lib/libsml.a;-lrt -I/usr/local/include
             microhttpd: -L/usr/local/lib/libmicrohttpd.a;-lrt -I/usr/local/include
             mqtt: -L/usr/local/lib/libmosquitto.so -I/usr/local/include
-- Configuring done
-- Generating done
-- Build files have been written to: /root/vzlogger
/usr/local/bin/cmake -E cmake_progress_start /root/vzlogger/CMakeFiles /root/vzlogger//CMakeFiles/progress.marks
make  -f CMakeFiles/Makefile2 all
make  -f src/CMakeFiles/vz.dir/build.make src/CMakeFiles/vz.dir/depend
cd /root/vzlogger && /usr/local/bin/cmake -E cmake_depends "Unix Makefiles" /root/vzlogger /root/vzlogger/src /root/vzlogger /root/vzlogger/src /root/vzlogger/src/CMakeFiles/vz.dir/DependInfo.cmake --color=
make  -f src/CMakeFiles/vz.dir/build.make src/CMakeFiles/vz.dir/build
[  2%] Building CXX object src/CMakeFiles/vz.dir/Channel.cpp.o
cd /root/vzlogger/src && /usr/bin/c++ -DHAVE_CONFIG_HPP -I/usr/local/include -I/root/vzlogger -I/root/vzlogger/include -W -Wall -Wextra -Werror -Wno-parentheses -Wno-unused-parameter -Wno-unused-variable -Wno-constant-logical-operand -Wno-deprecated -Wno-deprecated-declarations -std=c++11   -g3 -MD -MT src/CMakeFiles/vz.dir/Channel.cpp.o -MF CMakeFiles/vz.dir/Channel.cpp.o.d -o CMakeFiles/vz.dir/Channel.cpp.o -c /root/vzlogger/src/Channel.cpp
In file included from /root/vzlogger/src/Channel.cpp:33:
In file included from /root/vzlogger/include/common.h:15:
/root/vzlogger/include/shared_ptr.hpp:36:10: fatal error: 'tr1/memory' file not found
#include <tr1/memory>
         ^~~~~~~~~~~~
1 error generated.
*** Error code 1

Stop.
make[2]: stopped in /root/vzlogger
*** Error code 1

Stop.
make[1]: stopped in /root/vzlogger
*** Error code 1

Stop.
make: stopped in /root/vzlogger
root@pibsd:~/vzlogger #
 
Also ich kenne jetzt das Programm nicht, kompiliere aber öfter mal Software und weiß deshalb evtl. um einige Fallstricke und mögliche Lösungen die man da machen kann.

hat schon mal einer vzlogger zum laufen bekommen?
Wäre nett, wenn Du gleich verlinken würdest welches Projekt gemeint ist, damit man sich das nicht erst raussuchen muss.
Ich rate jetzt einfach mal, das es sich um das hier handelt -> https://github.com/volkszaehler/vzlogger

Die haben auch ein Wiki, weleches sich zu Kompilierung auslässt und u.a. die Vorraussetzungen nennt:
https://wiki.volkszaehler.org/software/controller/vzlogger/installation_cpp-version
Sind die denn überhaupt erfüllt? Also sind beispielsweise die entsprechenden Libs installiert?
Wie bist Du überhaupt die Kompilierung angegangen? Was waren die Schritte vor dem make?
 
Cooles Projekt! Hab neulich nen neuen Smart-Zähler bekommen, mal schauen ob ich Kompilierung unter Linux hinkriege.
 
Hallo zusammen,

sorry, das ich das Projekt nicht benannt hatte. Ist der Volkszaehler https://github.com/volkszaehler/vzlogger
Unter Debian habe ich es schon seit mehreren Jahren am laufen.

So, ich habe jetzt noch pkgconf-1.8.0_1,1 installiert und bin ein bisschen weiter gekommen.
Ich bin jetzt nicht der C++ Profi aber wird hier eine andere C++ Lib verwendet?

@midnight : Was soll ich da machen?


Code:
root@pibsd:~/vzlogger # make
/usr/local/bin/cmake -S/root/vzlogger -B/root/vzlogger --check-build-system CMakeFiles/Makefile.cmake 0
CMake Deprecation Warning at CMakeLists.txt:3 (cmake_minimum_required):
  Compatibility with CMake < 2.8.12 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.


Compiling for target ''
-- using clang compiler Clang
-- FindSml check
-- Found PkgConfig: /usr/local/bin/pkg-config (found version "1.8.0")
-- Checking for module 'sml>=1.0'
--   Package 'sml', required by 'virtual:world', not found
-- SML_HOME env is not set, setting it to /usr/local
-- Looking for sml in /usr/local
-- FindMBus check
-- Checking for module 'libmbus>=0.8.0'
--   Package 'libmbus', required by 'virtual:world', not found
-- Looking for libmbus in
-- FindMicrohttpd check
-- Checking for module 'microhttpd>=0.9'
--   Package 'microhttpd', required by 'virtual:world', not found
-- MICROHTTPD_HOME env is not set, setting it to /usr/local
-- Looking for microhttpd in /usr/local
-- search for libmosquitto returned /usr/local/lib/libmosquitto.so and /usr/local/include
-- libmosquitto found at /usr/local/lib/libmosquitto.so
-- FindJson check
-- Checking for module 'json-c>=0.12'
--   Found json-c, version 0.16
-- JSON_HOME env is not set, setting it to /usr/local
-- Looking for json in /usr/local
Json-c search: '/usr/local/include;/usr/local/include;/usr/local/include;/usr/include'
Json-c found: '/usr/local/include'
-- FindGnuTls check
-- Checking for module 'gnutls>=2.8'
--   Found gnutls, version 3.7.8
-- ==> ''
-- GNUTLS_HOME env is not set, setting it to /usr/local
-- Looking for gnutls in /usr/local
==> GNUTLS_LIBRARIES='-lgnutls;/usr/local/lib/libgmp.a;-lunistring;/usr/local/lib/libnettle.a;/usr/local/lib/libhogweed.a;/usr/local/lib/libgmp.a;/usr/local/lib/libnettle.a;/usr/local/lib/libtasn1.a;/usr/local/lib/libidn2.a;-lunistring;-lp11-kit;/usr/lib/libz.a;-lsasl2;-lgcrypt'
-- Found GNUTLS: -lgnutls;/usr/local/lib/libgmp.a;-lunistring;/usr/local/lib/libnettle.a;/usr/local/lib/libhogweed.a;/usr/local/lib/libgmp.a;/usr/local/lib/libnettle.a;/usr/local/lib/libtasn1.a;/usr/local/lib/libidn2.a;-lunistring;-lp11-kit;/usr/lib/libz.a;-lsasl2;-lgcrypt 

        ***** Configuration parameters *****
             prefix: /usr/local
             json: -L/usr/local/lib/libjson-c.a;-lrt -I/usr/local/include
             sml:  -L/usr/local/lib/libsml.a;-lrt -I/usr/local/include
             microhttpd: -L/usr/local/lib/libmicrohttpd.a;-lrt -I/usr/local/include
             mqtt: -L/usr/local/lib/libmosquitto.so -I/usr/local/include
-- Configuring done
-- Generating done
-- Build files have been written to: /root/vzlogger
/usr/local/bin/cmake -E cmake_progress_start /root/vzlogger/CMakeFiles /root/vzlogger//CMakeFiles/progress.marks
make  -f CMakeFiles/Makefile2 all
make  -f src/CMakeFiles/vz.dir/build.make src/CMakeFiles/vz.dir/depend
cd /root/vzlogger && /usr/local/bin/cmake -E cmake_depends "Unix Makefiles" /root/vzlogger /root/vzlogger/src /root/vzlogger /root/vzlogger/src /root/vzlogger/src/CMakeFiles/vz.dir/DependInfo.cmake --color=
make  -f src/CMakeFiles/vz.dir/build.make src/CMakeFiles/vz.dir/build
[  2%] Building CXX object src/CMakeFiles/vz.dir/Channel.cpp.o
cd /root/vzlogger/src && /usr/bin/c++ -DHAVE_CONFIG_HPP -I/usr/local/include -I/root/vzlogger -I/root/vzlogger/include -W -Wall -Wextra -Werror -Wno-parentheses -Wno-unused-parameter -Wno-unused-variable -Wno-constant-logical-operand -Wno-deprecated -Wno-deprecated-declarations -std=c++11   -g3 -MD -MT src/CMakeFiles/vz.dir/Channel.cpp.o -MF CMakeFiles/vz.dir/Channel.cpp.o.d -o CMakeFiles/vz.dir/Channel.cpp.o -c /root/vzlogger/src/Channel.cpp
In file included from /root/vzlogger/src/Channel.cpp:33:
In file included from /root/vzlogger/include/common.h:15:
/root/vzlogger/include/shared_ptr.hpp:36:10: fatal error: 'tr1/memory' file not found
#include <tr1/memory>
         ^~~~~~~~~~~~
1 error generated.
*** Error code 1

Stop.
make[2]: stopped in /root/vzlogger
*** Error code 1

Stop.
make[1]: stopped in /root/vzlogger
*** Error code 1

Stop.
make: stopped in /root/vzlogger
root@pibsd:~/vzlogger #
root@pibsd:~/vzlogger # pkg search libstdc++
pkg: sqlite error while executing iterator in file pkgdb_iterator.c:1110: Invalid regex

root@pibsd:~/vzlogger # pkg search libstdc
libstdc++_stldoc_4.2.2-20071101_1 GNU libstdc++ API documentation
root@pibsd:~/vzlogger #
 
Boost habe ich mir angeschaut. Da komme ich auf keinen grünen Zweig.
Das übersteigt meine C++ Kenntnisse.

Okay war ein Versuch.... Ich Danke euch.

Gruß
Chris
 
Boost habe ich mir angeschaut. Da komme ich auf keinen grünen Zweig.
Im Prinzip brauchst Du es ja nur zu installieren via pkg install boost-libs
Wobei ich gar nicht weiß, ob allein das in Deinem Fall hilfreich (oder gar notwendig) ist. Denn TR1 gehört mittlerweise zum offiziellen Standard und ist deshalb auch i.d.R. in den StandardLibs enthalten.

@midnight hat ja auf die Dokumentation verlinkt.
Ich würde ja mal in die Datei /root/vzlogger/include/shared_ptr.hpp gehen und in Zeile 36 (wird ja auch in der Fehlermeldung genannt) von
C++:
#include <tr1/memory>
zu:
C++:
#include <memory>
ändern.

Das übersteigt meine C++ Kenntnisse.
Dafür sind eher Editor-Kenntnisse gefragt. ;-)
 
Okay, über den ersten Fehler bin ich drüber weg.
Jetzt kommen weitere:


Code:
In file included from /root/vzlogger/src/Channel.cpp:33:
In file included from /root/vzlogger/include/common.h:15:
/root/vzlogger/include/shared_ptr.hpp:43:14: error: no member named 'tr1' in namespace 'std'
using ::std::tr1::enable_shared_from_this;
      ~~~~~~~^
/root/vzlogger/include/shared_ptr.hpp:44:14: error: no member named 'tr1' in namespace 'std'
using ::std::tr1::shared_ptr;
      ~~~~~~~^
In file included from /root/vzlogger/src/Channel.cpp:35:
In file included from /root/vzlogger/include/Channel.hpp:32:
In file included from /root/vzlogger/include/Buffer.hpp:35:
/root/vzlogger/include/Reading.hpp:44:10: error: no template named 'shared_ptr' in namespace 'vz'; did you mean 'std::shared_ptr'?
        typedef vz::shared_ptr<ReadingIdentifier> Ptr;
                ^~~~~~~~~~~~~~
                std::shared_ptr                                                                                                                                           
/usr/include/c++/v1/__memory/shared_ptr.h:422:59: note: 'std::shared_ptr' declared here
class _LIBCPP_SHARED_PTR_TRIVIAL_ABI _LIBCPP_TEMPLATE_VIS shared_ptr
                                                          ^
In file included from /root/vzlogger/src/Channel.cpp:35:
In file included from /root/vzlogger/include/Channel.hpp:32:
In file included from /root/vzlogger/include/Buffer.hpp:35:
/root/vzlogger/include/Reading.hpp:71:10: error: no template named 'shared_ptr' in namespace 'vz'; did you mean 'std::shared_ptr'?
        typedef vz::shared_ptr<ObisIdentifier> Ptr;
                ^~~~~~~~~~~~~~
                std::shared_ptr                                                                                                                                           
/usr/include/c++/v1/__memory/shared_ptr.h:422:59: note: 'std::shared_ptr' declared here
class _LIBCPP_SHARED_PTR_TRIVIAL_ABI _LIBCPP_TEMPLATE_VIS shared_ptr
                                                          ^
In file included from /root/vzlogger/src/Channel.cpp:35:
In file included from /root/vzlogger/include/Channel.hpp:32:
In file included from /root/vzlogger/include/Buffer.hpp:35:
/root/vzlogger/include/Reading.hpp:166:10: error: no template named 'shared_ptr' in namespace 'vz'; did you mean 'std::shared_ptr'?
        typedef vz::shared_ptr<Reading> Ptr;
                ^~~~~~~~~~~~~~
                std::shared_ptr
/usr/include/c++/v1/__memory/shared_ptr.h:422:59: note: 'std::shared_ptr' declared here
class _LIBCPP_SHARED_PTR_TRIVIAL_ABI _LIBCPP_TEMPLATE_VIS shared_ptr
                                                          ^
In file included from /root/vzlogger/src/Channel.cpp:35:
In file included from /root/vzlogger/include/Channel.hpp:32:
/root/vzlogger/include/Buffer.hpp:40:10: error: no template named 'shared_ptr' in namespace 'vz'; did you mean 'std::shared_ptr'?
        typedef vz::shared_ptr<Buffer> Ptr;
                ^~~~~~~~~~~~~~
                std::shared_ptr
/usr/include/c++/v1/__memory/shared_ptr.h:422:59: note: 'std::shared_ptr' declared here
class _LIBCPP_SHARED_PTR_TRIVIAL_ABI _LIBCPP_TEMPLATE_VIS shared_ptr
                                                          ^
In file included from /root/vzlogger/src/Channel.cpp:35:
/root/vzlogger/include/Channel.hpp:41:10: error: no template named 'shared_ptr' in namespace 'vz'; did you mean 'std::shared_ptr'?
        typedef vz::shared_ptr<Channel> Ptr;
                ^~~~~~~~~~~~~~
                std::shared_ptr
/usr/include/c++/v1/__memory/shared_ptr.h:422:59: note: 'std::shared_ptr' declared here
class _LIBCPP_SHARED_PTR_TRIVIAL_ABI _LIBCPP_TEMPLATE_VIS shared_ptr
                                                          ^
7 errors generated.
*** Error code 1

Stop.
make[2]: stopped in /root/vzlogger
*** Error code 1

Stop.
make[1]: stopped in /root/vzlogger
*** Error code 1

Stop.
make: stopped in /root/vzlogger
 
Okay, über den ersten Fehler bin ich drüber weg.
Bevor ich da überhaupt ein Blick drauf werfe, beantworte doch erst mal die noch ausstehenden Fragen/Punkte.
Sonst muss ich davon ausgehen, das Deine Frage nicht wirklich ernst gemeint ist und dann würde ich dann ungern Zeit drin investieren.
 
Wenn ich das nicht ernst meine, dann würde ich hier nicht schreiben.
Also die Änderung des Include brachte Erfolg und über diesen Punkt bin ich drüber weg.
Das Paket boost-libs habe ich auch installiert.
Alles was gefehlt hat hatte ich installiert.
 
Du solltest endlich mal beschreiben, wie Du für den Build vorgegangen bist und was Du genau installiert hast.
Denn einfach nur make eintippen wirds ja wohl kaum gewesen sein.

Das Paket boost-libs habe ich auch installiert.
Das war unter anderem ne Info die bisher gefehlt hat.

Wenn ich das nicht ernst meine, dann würde ich hier nicht schreiben.
Bei Deinen knappest möglichen Ausführungen hier bekommt man aber nicht gerade den Eindruck, als wärst Du sonderlich hinter einer Lösung her (wer nicht bereit ist Zeit in eine Fehler- und Setupbeschreibung zu investieren, warum sollte der dann bereit sein in eine Lösung zu investieren?).
Das quasi aufgaben in Posting #9 unterstützt den Eindruck noch.

Ist ja auch nicht weiter wild. Evtl. hast Du ja auch Deine Anfrage in der Hoffnung gestellt, das es nur ne Kleinigkeit ist und das mit irgendwo nur ne Kleinigkeit konfigurieren muss und dann ist alles gut. Das kann ich Stand jetzt aber nicht versprechen. Evtl. wird da mehr Arbeit auf Dich zukommen. Die Frage ist, ob Du bereit dafür bist. Nicht das ich dann dazu was schreibe und dann kommt nur ein lapidares "Öhm nöö. Ist mir zu stressig. Ich lass es".
Ist ja auch ne Frage der Fairness Gegenüber der Hilfegebenden hier. Die helfen gern aber die haben natürlich auch wenig Lust ein Posting "for nothing" zu schreiben. Ist doch verständlich, oder nicht?
 
Zuletzt bearbeitet:
Hallo zusammen,

so heute habe ich wieder Zeit.

Ist doch verständlich, oder nicht?
Klar, dass kann ich verstehen und würde ich auch nicht anders machen.

Doch wie schon gesagt, bin ich nicht der C++ Profi und es ist nur mein Hobby.
Meine Brötchen verdiene ich mit REXX und PIPE im z/OS Umfeld. Also kein C++ und deshalb auch
ein paar vielleicht unbeholfene Fragen.

Hier die Pakete, die ich installiert habe:

Code:
     2  5:42    pkg install pkgconf-1.8.0_1,1
    14  6:22    pkg install libsml-0.1.1_1
    20  6:36    pkg install git-2.39.1
    22  6:38    pkg install cmake-3.24.3
    37  7:20    pkg install json-c-0.16
    40  7:22    pkg install libmicrohttpd-0.9.75
    43  7:24    pkg install mosquitto-2.0.13
    46  7:27    pkg install p5-PkgConfig-0.25026
    49  7:28    pkg install libgcrypt-1.9.4_1
    66  6:22    pkg install libsml-0.1.1_1
    74  6:38    pkg install cmake-3.24.3
   101  7:28    pkg install libgcrypt-1.9.4_1
   110  5:42    pkg install pkgconf-1.8.0_1,1
   144  6:06    pkg install boost-all-1.80.0

Ansonsten bin ich nach der Vorgabe vorgegangen:

cmake -DBUILD_TEST=off
make

Viel mehr ist auch nicht im install.sh Script nicht drin.

Hier die Vorgabe:


Tools​


  • git
  • cmake
  • pkg-config
  • subversion (für Tests mit googlemock)

Erforderliche Libraries​


  • libjson-c-dev
  • libcurl4-openssl-dev
  • libgnutls28-dev
  • libgcrypt
  • libsasl2-dev
  • libuuid1
  • libsml (für sml meters)
  • libmicrohttpd-dev >= 0.4.6 (for builtin „local“ webserver)
  • libltdl >=0.8.0 (for OMS) ===> wurde nicht installiert
  • libleptonica-dev (for OCR) ===> wurde nicht installiert
  • libmosquitto-dev (for MQTT)
  • libunistring-dev (wegen Problem mit Ubuntu 18.04)


Gruß
Chris
 
Ok. Was ich auf Anhieb sehe ist, das Du Dich offenbar aus dem quarterly-Repository bedienst (das ist der Default bei FreeBSD). Kann man machen, hat aber unter Umständen nicht die neusten Version der installierten Libraries.
Ob das hier zum Problem wird, kann ich so nicht sagen. Ich würde es zunächst verneinen. Aber kann evtl. doch noch mal interessant werden.

Der zweitere und wichtigere Punkt der mir auffällt ist, das das verlinkte Wiki nahe legt den gcc (GNU Compiler Collection) als Compiler zu verwenden. Da würde ich mich dran halten. Das sollte dann auch das TR1-Problem fixen.

Im Repository finden sich unterschiedlichste gcc-Versionen. Die Bezeichnung ist immer gcc+Nummer also z.B.:
gcc12
Kann man dann auch installieren mit
pkg install gcc12
(oder was auch immer bei Dir verfügbar ist; mach dazu einfach mal ein pkg search gcc)

Dann musst Du cmake nur noch anweisen auch gcc zu verwenden, in dem Du den Aufruf ergänzt zu:
cmake -DBUILD_TEST=off -D CMAKE_C_COMPILER=gcc -D CMAKE_CXX_COMPILER=g++

Hab im jetzigen Augenblick leider gerade keine Zeit. Aber das hilft evtl. schon etwas weiter.
 
Zurück
Oben