pax_global_header00006660000000000000000000000064146221202720014510gustar00rootroot0000000000000052 comment=0b2440707bc7e5b4bfc4455601bccb6fa0e1c20e vzlogger-0.8.6/000077500000000000000000000000001462212027200133625ustar00rootroot00000000000000vzlogger-0.8.6/.clang-format000066400000000000000000000002011462212027200157260ustar00rootroot00000000000000BasedOnStyle: LLVM ColumnLimit: 100 IndentWidth: 4 TabWidth: 4 UseTab: ForContinuationAndIndentation AlignTrailingComments: true vzlogger-0.8.6/.dockerignore000066400000000000000000000006601462212027200160400ustar00rootroot00000000000000# docker related .dockerignore Dockerfile *~ # Binaries src/vzlogger # directories from install.sh libs/ build*/ # Compiled Object files *.slo *.lo *.o # Compiled Dynamic libraries *.so *.so.* # Compiled Static libraries *.lai *.la *.a # automake Makefile .deps # autoconf autom4te.cache config.status config.log config.h stamp-h1 libtool # Debian packaging debian/config.log # CMake temp files CMakeFiles/ CMakeCache.txt vzlogger-0.8.6/.editorconfig000066400000000000000000000004511462212027200160370ustar00rootroot00000000000000# top-most EditorConfig file root = true # Unix-style newlines with a newline ending every file [*] charset = utf-8 trim_trailing_whitespace = true end_of_line = lf insert_final_newline = true # Tab indentation (no size specified) [Makefile] indent_style = tab [*.{c,h,cpp,hpp}] indent_size = 4vzlogger-0.8.6/.github/000077500000000000000000000000001462212027200147225ustar00rootroot00000000000000vzlogger-0.8.6/.github/workflows/000077500000000000000000000000001462212027200167575ustar00rootroot00000000000000vzlogger-0.8.6/.github/workflows/build+test.yml000066400000000000000000000010561462212027200215560ustar00rootroot00000000000000name: build+test on: [push, pull_request] jobs: build_and_test: runs-on: ubuntu-latest steps: - name: install deps run: sudo apt-get update && sudo apt-get install libjson-c-dev libcurl4-openssl-dev libmicrohttpd-dev libgcrypt20-dev libsasl2-dev libunistring-dev libmosquitto-dev libgmock-dev libgtest-dev - name: build libsml run: git clone https://github.com/volkszaehler/libsml.git ../libsml && cd ../libsml && make - uses: actions/checkout@v2 - run: cmake . -DSML_HOME=../libsml/sml - run: make - run: ctest vzlogger-0.8.6/.github/workflows/check-formatting.yml000066400000000000000000000004261462212027200227310ustar00rootroot00000000000000name: check-formatting on: [push, pull_request] jobs: check-formatting: runs-on: ubuntu-latest steps: - name: install clang-format run: sudo apt-get update && sudo apt-get install clang-format - uses: actions/checkout@v2 - run: ./check-formatting.sh vzlogger-0.8.6/.github/workflows/debuild.yml000066400000000000000000000171651462212027200211240ustar00rootroot00000000000000--- # This is a copy from libsml. The idea is to merge both in the future. It is # however easier to develop this one standalone and later do a diff to see how # a common solution could look like. # Basically this is a fragmented bash script name: Debuild Release 'on': release: types: published env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} PKG: vzlogger KEYSERVER: keyserver.ubuntu.com # Cloudsmith package repository KEYFILE: /usr/share/keyrings/volkszaehler-volkszaehler-org-project-archive-keyring.gpg CLOUDURL: https://dl.cloudsmith.io/public/volkszaehler/volkszaehler-org-project/deb CLOUD_KEY_ID: 21DBDAC56DF44DA1 REPO: volkszaehler/volkszaehler-org-project jobs: debuild: runs-on: ubuntu-latest environment: main steps: - uses: actions/checkout@v4 - name: Set env # Here we are setting a variable from an expression. run: echo "TAG_NAME=${GITHUB_REF##*/}" >> $GITHUB_ENV - name: add cloudsmith repo run: | LISTENTRY="deb [signed-by=$KEYFILE] $CLOUDURL/debian trixie main" echo "$LISTENTRY" | sudo tee -a /etc/apt/sources.list gpg --keyserver $KEYSERVER --recv-key $CLOUD_KEY_ID sudo -E gpg -v --output "$KEYFILE" --export $CLOUD_KEY_ID sudo apt-get update - name: update repo information run: sudo apt-get update - name: install devscripts run: sudo apt-get install equivs devscripts pipx hub - name: install dependencies run: sudo mk-build-deps -ri - name: debuild run: debuild --no-sign - name: import GPG key # A secret passphrase is used because the key is stored on disk where # it may persist while the passphrase is not. run: | echo -e "$SIGNING_KEY" | \ gpg --batch --passphrase "$SIGNING_PASSPHRASE" --import gpg --list-secret-keys env: SIGNING_KEY: ${{ secrets.SIGNING_KEY }} SIGNING_PASSPHRASE: ${{ secrets.SIGNING_PASSPHRASE }} - name: debsign run: | debsign -k"$SIGNING_KEY_ID" -p"gpg --batch --pinentry-mode loopback \ --passphrase $SIGNING_PASSPHRASE" env: SIGNING_PASSPHRASE: ${{ secrets.SIGNING_PASSPHRASE }} # This is not a secret, but we want to have all signing # configuration in one place SIGNING_KEY_ID: ${{ secrets.SIGNING_KEY_ID }} - name: upload as Release run: | set -x assets=() for asset in ../$PKG*.{tar.xz,dsc}; do assets+=("-a" "$asset") done hub release edit "${assets[@]}" -m "$TAG_NAME" "$TAG_NAME" env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: upload to Cloudsmith run: | pipx install cloudsmith-cli VERSION="${GITHUB_REF##*/v}" DESCRIPTION_FILE="../${PKG}_$VERSION.dsc" cloudsmith push deb ${REPO}/debian/any-version "$DESCRIPTION_FILE" \ --sources-file=$(dcmd --orig "$DESCRIPTION_FILE") env: CLOUDSMITH_API_KEY: ${{ secrets.CLOUDSMITH_API_KEY }} pbuilder: needs: debuild strategy: matrix: os: [debian, raspbian] distribution: [trixie, bookworm, bullseye] architecture: [armhf, arm64, amd64] exclude: - os: raspbian architecture: arm64 - os: raspbian architecture: amd64 - os: raspbian distribution: trixie include: - mirrorsite: http://ftp2.de.debian.org/debian/ - mirrorsite: http://mirror.netcologne.de/raspbian/raspbian/ os: raspbian - keyring: debian-archive-keyring - keyring: raspbian-archive-keyring os: raspbian runs-on: ubuntu-latest environment: main env: PBRT: /var/cache/pbuilder steps: - name: update repo information run: sudo apt-get update - name: install archive keyring run: | if [[ ${{ matrix.os }} == raspbian ]]; then wget http://raspbian.raspberrypi.org/raspbian/pool/main/r/raspbian-archive-keyring/raspbian-archive-keyring_20120528.2_all.deb sudo apt-get install ./raspbian-archive-keyring_20120528.2_all.deb else sudo apt-get install debian-archive-keyring fi - name: install pbuilder run: | sudo apt-get install pbuilder mmdebstrap qemu-user-static pipx hub # Needed for the release download - uses: actions/checkout@v4 - name: Set env # Here we are setting a variable from an expression. run: echo "TAG_NAME=${GITHUB_REF##*/}" >> $GITHUB_ENV - name: download source release run: | set -x hub release download "$TAG_NAME" ls -l - name: configure pbuilder run: | echo "MIRRORSITE=${{ matrix.mirrorsite }} HOOKDIR=$PBRT/hooks" | \ sudo tee /root/.pbuilderrc sudo mkdir -p $PBRT/hooks echo "#!/bin/sh apt-get update apt-get -y install gnupg ${{ matrix.keyring }} ca-certificates apt-key adv --keyserver $KEYSERVER --recv-keys $SIGNING_KEY_ID" | \ sudo tee $PBRT/hooks/G70Keys sudo chmod a+x $PBRT/hooks/G70Keys # OTHERMIRRORS can't do signed-by echo "#!/bin/sh LISTENTRY=\"deb [signed-by=$KEYFILE] $CLOUDURL/${{ matrix.os }} ${{ matrix.distribution }} main\" gpg --keyserver $KEYSERVER --recv-key $CLOUD_KEY_ID gpg -v --output '$KEYFILE' --export $CLOUD_KEY_ID echo \"\$LISTENTRY\" >> /etc/apt/sources.list apt-get update" | \ sudo tee $PBRT/hooks/E70Keys sudo chmod a+x $PBRT/hooks/E70Keys env: # This is not a secret, but we want to have all signing # configuration in one place SIGNING_KEY_ID: ${{ secrets.SIGNING_KEY_ID }} - name: create bootstrap run: | sudo pbuilder create --architecture ${{ matrix.architecture }} \ --distribution ${{ matrix.distribution }} \ --basetgz $PBRT/current.tgz \ --debootstrap mmdebstrap \ --debootstrapopts \ --keyring=/usr/share/keyrings/${{ matrix.keyring }}.gpg - name: pbuild ${{ matrix.os }} ${{ matrix.architecture }} ${{ matrix.distribution }} # https://stackoverflow.com/questions/70435286/resource-not-accessible-by-integration-on-github-post-repos-owner-repo-ac run: | VERSION="${GITHUB_REF##*/v}" sudo pbuilder build \ --architecture ${{ matrix.architecture }} \ --basetgz $PBRT/current.tgz ${PKG}_$VERSION.dsc - name: upload as Release run: | set -x if [[ "${{ matrix.distribution }}" != trixie ]]; then exit fi assets=() for asset in $PBRT/result/${PKG}*_${{ matrix.architecture }}.{deb,changes,buildinfo}; do assets+=("-a" "$asset") done hub release edit "${assets[@]}" -m "$TAG_NAME" "$TAG_NAME" env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: upload to Cloudsmith run: | pipx install cloudsmith-cli VERSION="${GITHUB_REF##*/v}" CHANGES_FILE="$PBRT/result/${PKG}_${VERSION}_${{ matrix.architecture }}.changes" for DEB in $(dcmd --deb $CHANGES_FILE); do cloudsmith push deb \ ${REPO}/${{ matrix.os }}/${{ matrix.distribution }} "$DEB" done env: CLOUDSMITH_API_KEY: ${{ secrets.CLOUDSMITH_API_KEY }} vzlogger-0.8.6/.gitignore000066400000000000000000000006051462212027200153530ustar00rootroot00000000000000*~ # Binaries src/vzlogger # directories from install.sh libs/ build*/ # Compiled Object files *.slo *.lo *.o # Compiled Dynamic libraries *.so *.so.* # Compiled Static libraries *.lai *.la *.a # automake Makefile .deps # autoconf autom4te.cache config.status config.log config.h stamp-h1 libtool # Debian packaging debian/config.log # CMake temp files CMakeFiles/ CMakeCache.txt vzlogger-0.8.6/AUTHORS000066400000000000000000000000601462212027200144260ustar00rootroot00000000000000Written by Steffen Vogel vzlogger-0.8.6/CMakeLists.txt000066400000000000000000000271361462212027200161330ustar00rootroot00000000000000# -*- mode: cmake; -*- project(vzlogger) cmake_minimum_required(VERSION 2.6.2 FATAL_ERROR) if(POLICY CMP0011) cmake_policy(SET CMP0011 NEW) endif(POLICY CMP0011) # Supress a warning for if(GTest_FOUND) IF(POLICY CMP0012) CMAKE_POLICY(SET CMP0012 NEW) ENDIF() set(VZLOGGER_MAJOR_VERSION 0) set(VZLOGGER_MINOR_VERSION 8) set(VZLOGGER_SUB_VERSION 6) set(VERSION_SEP "-") set(VZLOGGER_SHORT_VERSION "${VZLOGGER_MAJOR_VERSION}${VERSION_SEP}${VZLOGGER_MINOR_VERSION}") set(VZLOGGER_VERSION "${VZLOGGER_SHORT_VERSION}${VERSION_SEP}${VZLOGGER_SUB_VERSION}") set(VZLOGGER_RPM_VERSION "${VZLOGGER_MAJOR_VERSION}.${VZLOGGER_MINOR_VERSION}.${VZLOGGER_SUB_VERSION}") set(VERSION_DATE "2018-08-04") set(PACKAGE_STRING "${PROJECT_NAME} ${VZLOGGER_RPM_VERSION}") set(VERSION "${VZLOGGER_RPM_VERSION}") set(CMAKE_VERBOSE_MAKEFILE 1) # debug build, on by default ADD_DEFINITIONS(-g3) ########################################################### # Where are the additional libraries installed? Note: provide includes # path here, subsequent checks will resolve everything else set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/modules") # get git sha1 as additional version: include(GetGitRevisionDescription) get_git_head_revision(GIT_REFSPEC GIT_SHA1) git_describe(GIT_SHALONG --always --abbrev=10 --long --all --dirty ) git_get_last_commit_date(GIT_LAST_COMMIT_DATE ) message("Compiling for target '${TARGET}'") if( TARGET ) if( ${TARGET} STREQUAL "ar71xx") include ( OpenWRT ) message("Compiling for ar71xx") set(CMAKE_FIND_LIBRARY_SUFFIXES ".a") set(LINK_FLAGS_RELEASE "-static") endif( ${TARGET} STREQUAL "ar71xx") else( TARGET ) include ( CompilerFlags ) endif( TARGET ) include ( ConfigureMacro ) # options OPTION(ENABLE_SML "enable support for smart messaging language (def=yes)])" On) OPTION(ENABLE_OMS "enable support for OMS (M-Bus) based devices (def=yes)" On) OPTION(ENABLE_LOCAL "enable support for local HTTPd (def=yes)]" On) OPTION(ENABLE_MQTT "enable MQTT client support (def=yes)" On) OPTION(WITH_READER "compile reader to for testing your meters (def=yes)])" On) OPTION(ENABLE_OCR "enable support for OCR image/processing meter (def=off)" OFF) OPTION(ENABLE_OCR_TESSERACT "enable support for OCR text recognition meter (def=off)" OFF) OPTION(METEREXEC_ROOTACCESS "compile MeterExec protocol to use root privileges for script calls (def=no)])" Off) OPTION(BUILD_TEST "build unit tests (def=on)])" On) # find dependencies # libsml if( ENABLE_SML ) include(FindSML) if(SML_FOUND) set(SML_SUPPORT 1) include_directories(${SML_INCLUDE_DIR}) endif(SML_FOUND) endif( ENABLE_SML ) if( ENABLE_OMS ) # find dependencies todo libmbus include(FindMBus) include(FindOpenSSL) if(MBUS_FOUND) set(OMS_SUPPORT 1) include_directories(${MBUS_INCLUDE_DIR}) set(OMS_LIBRARIES ${MBUS_LIBRARY}) elseif(MBUS_FOUND) set(OMS_SUPPORT 0) message( STATUS "libmbus not found. Disabling ENABLE_OMS" ) endif(MBUS_FOUND) endif( ENABLE_OMS ) if(ENABLE_LOCAL) include(FindMicroHttpd) if(MICROHTTPD_FOUND) set(MICROHTTPD_SUPPORT 1) set(LOCAL_SUPPORT 1) endif(MICROHTTPD_FOUND) endif(ENABLE_LOCAL) if(ENABLE_MQTT) find_library(MQTT_LIBRARY mosquitto) find_path(MQTT_INCLUDE_DIR mosquitto.h) message( STATUS "search for libmosquitto returned ${MQTT_LIBRARY} and ${MQTT_INCLUDE_DIR}") if(MQTT_LIBRARY AND MQTT_INCLUDE_DIR) message( STATUS "libmosquitto found at ${MQTT_LIBRARY}") include_directories(${MQTT_INCLUDE_DIR}) else() set(ENABLE_MQTT OFF) message( WARNING "libmosquitto not found. Disabled ENABLE_MQTT. Consider installing libmosquitto-dev package.") endif(MQTT_LIBRARY AND MQTT_INCLUDE_DIR) else() message( STATUS "MQTT support disabled. If wanted use ENABLE_MQTT=On") endif(ENABLE_MQTT) if( ENABLE_OCR OR ENABLE_OCR_TESSERACT ) include(FindLeptonica) if (NOT LEPTONICA_FOUND) message( STATUS "Leptonica not found. Disabling ENABLE_OCR" ) set(ENABLE_OCR false) set(ENABLE_OCR_TESSERACT false) else () message("OCR Meter enabled") # TODO install tesseract # and set include_directories appropriate if (ENABLE_OCR_TESSERACT) set(OCR_LIBRARIES ${LEPTONICA_LIBRARIES} tesseract) set(OCR_TESSERACT_SUPPORT 1) else () set( OCR_LIBRARIES ${LEPTONICA_LIBRARIES}) endif( ENABLE_OCR_TESSERACT) include_directories(${LEPTONICA_INCLUDE_DIRS}) set(OCR_SUPPORT 1) endif( NOT LEPTONICA_FOUND ) endif( ENABLE_OCR OR ENABLE_OCR_TESSERACT ) IF(NOT WIN32) include(FindThreads) ENDIF(NOT WIN32) # libjson include(FindJson) if( NOT JSON_FOUND) message(FATAL_ERROR "libjson-c is required. Install json-c or call cmake -DJSON_HOME=path_to_json_install") endif( NOT JSON_FOUND) include_directories(${JSON_INCLUDE_DIR}) # check for curl IF(WIN32) add_definitions(-DCURL_STATICLIB) include(FindCURL_WIN32) else(WIN32) # add_definitions(-DCURL_STATICLIB) include(FindCURL) include(FindGnutls) include(FindOpenSSL) # needed by MySmartGrid API... endif(WIN32) find_library(LIBUUID uuid) find_library(LIBGCRYPT gcrypt) include_directories(${CMAKE_BINARY_DIR}) include_directories(${CMAKE_SOURCE_DIR}/include) include_directories(${CMAKE_SOURCE_DIR}) add_definitions(-DHAVE_CONFIG_HPP) myconfigure_file( ${CMAKE_CURRENT_SOURCE_DIR}/config.hpp.in ${CMAKE_CURRENT_BINARY_DIR}/config.hpp ) add_subdirectory(src) find_package(Git) if( BUILD_TEST ) set(ENABLE_GOOGLEMOCK TRUE) else() set(ENABLE_GOOGLEMOCK FALSE) endif() #disable unit tests on gcc4.6 (problems with googlemock 1.7) if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") # require at least gcc 4.8 execute_process(COMMAND ${CMAKE_CXX_COMPILER} -dumpversion OUTPUT_VARIABLE GOOGLETEST_GCC_COMPILER_VERSION) # on travis-ci the CMAKE_CXX_COMPILER_VERSION is empty! message(WARNING "Using compiler: ${CMAKE_CXX_COMPILER_VERSION} ${GOOGLETEST_GCC_COMPILER_VERSION}") if (GOOGLETEST_GCC_COMPILER_VERSION VERSION_LESS 4.8) message(WARNING "Disabled googlemock/-test tests due to GCC version < 4.8!") set(ENABLE_GOOGLEMOCK FALSE) endif() endif() # enable unit testing include(CTest) enable_testing() if(ENABLE_GOOGLEMOCK) include(FindGTest) if (NOT GTest_FOUND AND GIT_FOUND) # Download and unpack googletest at configure time configure_file(gtest/CMakeLists.txt.in gtest-download/CMakeLists.txt) execute_process(COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" . RESULT_VARIABLE result WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/gtest-download ) if(result) message(FATAL_ERROR "CMake step for googletest failed: ${result}") endif() execute_process(COMMAND ${CMAKE_COMMAND} --build . RESULT_VARIABLE result WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/gtest-download ) if(result) message(FATAL_ERROR "Build step for googletest failed: ${result}") endif() # Prevent overriding the parent project's compiler/linker # settings on Windows set(gtest_force_shared_crt ON CACHE BOOL "" FORCE) # Add googletest directly to our build. This defines # the gtest and gtest_main targets. add_subdirectory(${CMAKE_CURRENT_BINARY_DIR}/gtest-src ${CMAKE_CURRENT_BINARY_DIR}/gtest-build EXCLUDE_FROM_ALL) # The gtest/gtest_main targets carry header search path # dependencies automatically when using CMake 2.8.11 or # later. Otherwise we have to add them here ourselves. if (CMAKE_VERSION VERSION_LESS 2.8.11) include_directories("${gtest_SOURCE_DIR}/include") include_directories("${gmock_SOURCE_DIR}/include") endif() endif() add_subdirectory(tests) endif() if (ENABLE_GOOGLEMOCK AND NOT GTest_FOUND AND NOT GIT_FOUND) message(WARNING "googletest based unit tests disabled due to missing googletest or git. Please install one of those.") endif(ENABLE_GOOGLEMOCK AND NOT GTest_FOUND AND NOT GIT_FOUND) add_test(NAME vzlogger_unit_tests COMMAND vzlogger_unit_tests) ### print some output for the user message("") message(" ***** Configuration parameters *****") message(" prefix: ${CMAKE_INSTALL_PREFIX}") message(" json: -L${JSON_LIBRARY} -I${JSON_INCLUDE_DIR}") if(SML_FOUND) message(" sml: -L${SML_LIBRARY} -I${SML_INCLUDE_DIR}") else(SML_FOUND) message(" sml: NOT FOUND") endif(SML_FOUND) if(MICROHTTPD_FOUND) message(" microhttpd: -L${MICROHTTPD_LIBRARY} -I${MICROHTTPD_INCLUDE_DIR}") endif(MICROHTTPD_FOUND) if(ENABLE_MQTT) message(" mqtt: -L${MQTT_LIBRARY} -I${MQTT_INCLUDE_DIR}") endif(ENABLE_MQTT) if(METEREXEC_ROOTACCESS) message(" MeterExec: root privileges") endif(METEREXEC_ROOTACCESS) if(MBUS_FOUND) message(" libmbus: -L${MBUS_LIBRARY} -I${MBUS_INCLUDE_DIR}") endif(MBUS_FOUND) if( ENABLE_SML AND NOT SML_FOUND) message(WARNING "libsml was not found. Install libsml or call cmake -DSML_HOME=path_to_sml_install") endif( ENABLE_SML AND NOT SML_FOUND) if( ENABLE_LOCAL AND NOT MICROHTTPD_FOUND ) message(WARNING "microhttpd was not found. Ignored ENABLE_LOCAL! Install microhttpd or call cmake -DMICROHTTPD_HOME=path_to_microhttpd_install") endif( ENABLE_LOCAL AND NOT MICROHTTPD_FOUND ) if( ENABLE_OMS AND NOT OMS_SUPPORT) message(WARNING "oms support not being enabled (libmbus not found)") endif( ENABLE_OMS AND NOT OMS_SUPPORT) # add clean-all target that removes the cached files from cmake as well (see e.g. issue #186) add_custom_target(clean-all COMMAND ${CMAKE_BUILD_TOOL} clean COMMAND ${CMAKE_COMMAND} -P clean-all-cmake.txt ) # CPACK packaging INCLUDE(InstallRequiredSystemLibraries) set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS On) #set(CPACK_SOURCE_GENERATOR "TGZ;TBZ2;PKG") set(CPACK_SOURCE_GENERATOR "TGZ;TBZ2") set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "volkszaehler.org ist ein freies Smart Meter (hier: intelligenter Stromzähler) im Selbstbau.") set(CPACK_PACKAGE_VENDOR "Steffen Vogel") set(CPACK_PACKAGE_CONTACT "Steffen Vogel ") set(CPACK_DEBIAN_PACKAGE_MAINTAINER "Steffen Vogel ") set(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/README.md") set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/COPYING") set(CPACK_PACKAGE_VERSION_MAJOR ${VZLOGGER_MAJOR_VERSION}) set(CPACK_PACKAGE_VERSION_MINOR ${VZLOGGER_MINOR_VERSION}) set(CPACK_PACKAGE_VERSION_PATCH ${VZLOGGER_SUB_VERSION}) set(CPACK_PACKAGE_INSTALL_DIRECTORY "${PROJECT_NAME}-${VZLOGGER_MAJOR_VERSION}.${VZLOGGER_MINOR_VERSION}") set(CPACK_SOURCE_IGNORE_FILES "/CVS/;/.svn/;.swp$;.#;/#;.*~;cscope.*;build.*") IF(WIN32 AND NOT UNIX) set(CPACK_GENERATOR "NSIS") set(CPACK_NSIS_PACKAGE_NAME "Gridlicense Demo Tools") # set(CPACK_PACKAGE_EXECUTABLES "gui4" "Grid License Demo Frontend") set(CPACK_PACKAGE_DEFAULT_LOCATION ${INSTALL_DIR}) # sure there is at least one set of four (4) backlasshes. set(CPACK_NSIS_INSTALLED_ICON_NAME "bin\\vzlogger.exe") set(CPACK_NSIS_DISPLAY_NAME "${CPACK_PACKAGE_INSTALL_DIRECTORY} VZlogger") set(CPACK_NSIS_HELP_LINK "http://volkszaehler.org/") set(CPACK_NSIS_URL_INFO_ABOUT "http://wiki.volkszaehler.org/software/controller/vzlogger") set(CPACK_NSIS_CONTACT "Steffen Vogel ") set(CPACK_NSIS_MODIFY_PATH ON) # set(CPACK_PACKAGE_INSTALL_REGISTRY_KEY "${CMAKE_PROJECT_NAME}-${EWS_VERSION}") # set(CPACK_NSIS_MENU_LINKS "${EWS_WEBSITE}" "Homepage for ${EWS_APP_NAME}") set(CPACK_NSIS_DEFINES " !define MUI_WELCOMEPAGE_TITLE_3LINES 1 !define MUI_FINISHPAGE_TITLE_3LINES 1") else(WIN32 AND NOT UNIX) #set(CPACK_SET_DESTDIR On) set(CPACK_SOURCE_STRIP_FILES "") set(CPACK_GENERATOR "TGZ;TBZ2;TZ;DEB;RPM") set(CPACK_RPM_PACKAGE_RELOCATABLE 1) set(CPACK_SYSTEM_NAME ${CMAKE_HOST_SYSTEM_PROCESSOR}) endif(WIN32 AND NOT UNIX) include(CPack) vzlogger-0.8.6/COPYING000066400000000000000000000773301462212027200144270ustar00rootroot00000000000000 GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 Copyright (C) 2007 Free Software Foundation, Inc. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The GNU General Public License is a free, copyleft license for software and other kinds of works. The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users. We, the Free Software Foundation, use the GNU General Public License for most of our software; it applies also to any other work released this way by its authors. You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things. To protect your rights, we need to prevent others from denying you these rights or asking you to surrender the rights. Therefore, you have certain responsibilities if you distribute copies of the software, or if you modify it: responsibilities to respect the freedom of others. For example, if you distribute copies of such a program, whether gratis or for a fee, you must pass on to the recipients the same freedoms that you received. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. Developers that use the GNU GPL protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License giving you legal permission to copy, distribute and/or modify it. For the developers' and authors' protection, the GPL clearly explains that there is no warranty for this free software. For both users' and authors' sake, the GPL requires that modified versions be marked as changed, so that their problems will not be attributed erroneously to authors of previous versions. Some devices are designed to deny users access to install or run modified versions of the software inside them, although the manufacturer can do so. This is fundamentally incompatible with the aim of protecting users' freedom to change the software. The systematic pattern of such abuse occurs in the area of products for individuals to use, which is precisely where it is most unacceptable. Therefore, we have designed this version of the GPL to prohibit the practice for those products. If such problems arise substantially in other domains, we stand ready to extend this provision to those domains in future versions of the GPL, as needed to protect the freedom of users. Finally, every program is threatened constantly by software patents. States should not allow patents to restrict development and use of software on general-purpose computers, but in those that do, we wish to avoid the special danger that patents applied to a free program could make it effectively proprietary. To prevent this, the GPL assures that patents cannot be used to render the program non-free. The precise terms and conditions for copying, distribution and modification follow. TERMS AND CONDITIONS 0. Definitions. "This License" refers to version 3 of the GNU General Public License. "Copyright" also means copyright-like laws that apply to other kinds of works, such as semiconductor masks. "The Program" refers to any copyrightable work licensed under this License. Each licensee is addressed as "you". "Licensees" and "recipients" may be individuals or organizations. To "modify" a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a "modified version" of the earlier work or a work "based on" the earlier work. A "covered work" means either the unmodified Program or a work based on the Program. To "propagate" a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well. To "convey" a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying. An interactive user interface displays "Appropriate Legal Notices" to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion. 1. Source Code. The "source code" for a work means the preferred form of the work for making modifications to it. "Object code" means any non-source form of a work. A "Standard Interface" means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language. The "System Libraries" of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A "Major Component", in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it. The "Corresponding Source" for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work. The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source. The Corresponding Source for a work in source code form is that same work. 2. Basic Permissions. All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law. You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you. Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary. 3. Protecting Users' Legal Rights From Anti-Circumvention Law. No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures. When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures. 4. Conveying Verbatim Copies. You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program. You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee. 5. Conveying Modified Source Versions. You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions: a) The work must carry prominent notices stating that you modified it, and giving a relevant date. b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to "keep intact all notices". c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it. d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so. A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an "aggregate" if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate. 6. Conveying Non-Source Forms. You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways: a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange. b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge. c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b. d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements. e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d. A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work. A "User Product" is either (1) a "consumer product", which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, "normally used" refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product. "Installation Information" for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made. If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM). The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network. Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying. 7. Additional Terms. "Additional permissions" are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions. When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission. Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms: a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or d) Limiting the use for publicity purposes of names of licensors or authors of the material; or e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors. All other non-permissive additional terms are considered "further restrictions" within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying. If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms. Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way. 8. Termination. You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11). However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation. Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice. Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10. 9. Acceptance Not Required for Having Copies. You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so. 10. Automatic Licensing of Downstream Recipients. Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License. An "entity transaction" is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts. You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it. 11. Patents. A "contributor" is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's "contributor version". A contributor's "essential patent claims" are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, "control" includes the right to grant patent sublicenses in a manner consistent with the requirements of this License. Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version. In the following three paragraphs, a "patent license" is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To "grant" such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party. If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. "Knowingly relying" means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid. If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it. A patent license is "discriminatory" if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007. Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law. 12. No Surrender of Others' Freedom. If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program. 13. Use with the GNU Affero General Public License. Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU Affero General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the special requirements of the GNU Affero General Public License, section 13, concerning interaction through a network will apply to the combination as such. 14. Revised Versions of this License. The Free Software Foundation may publish revised and/or new versions of the GNU General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU General Public License, you may choose any version ever published by the Free Software Foundation. If the Program specifies that a proxy can decide which future versions of the GNU General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program. Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version. 15. Disclaimer of Warranty. THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. Limitation of Liability. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 17. Interpretation of Sections 15 and 16. If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee. END OF TERMS AND CONDITIONS vzlogger-0.8.6/Dashboards/000077500000000000000000000000001462212027200154345ustar00rootroot00000000000000vzlogger-0.8.6/Dashboards/CTestConfigVZlogger.cmake000066400000000000000000000023401462212027200222650ustar00rootroot00000000000000# -*- mode: cmake; -*- ## This file should be placed in the root directory of your project. ## Then modify the CMakeLists.txt file in the root directory of your ## project to incorporate the testing dashboard. ## # The following are required to uses Dart and the Cdash dashboard ## ENABLE_TESTING() ## INCLUDE(CTest) set(CTEST_PROJECT_NAME "vzlogger") set(CTEST_NIGHTLY_START_TIME "04:00:00 GMT") set(ENV{http_proxy} "http://squid.itwm.fhg.de:3128/") set(CTEST_DROP_METHOD "http") set(CTEST_DROP_SITE "cdash.hexabus.de") set(CTEST_DROP_LOCATION "/submit.php?project=${CTEST_PROJECT_NAME}") #set(CTEST_DROP_SITE "pubdoc.itwm.fhg.de") #set(CTEST_DROP_LOCATION "/p/hpc/pspro/cdash/submit.php?project=${CTEST_PROJECT_NAME}") set(CTEST_DROP_SITE_CDASH TRUE) set(CTEST_USE_LAUNCHERS 1) set(KDE_CTEST_DASHBOARD_DIR "/tmp/msgrid") set(CTEST_PACKAGE_SITE "packages.mysmartgrid.de") #SET (CTEST_TRIGGER_SITE "http:///cgi-bin/Submit-CMake-TestingResults.pl") #SET (VALGRIND_COMMAND_OPTIONS "-q --tool=memcheck --leak-check=full --show-reachable=yes --workaround-gcc296-bugs=yes --num-callers=50") #SET (CTEST_EXPERIMENTAL_COVERAGE_EXCLUDE ".*test_.*") site_name(CTEST_SITE) set(GIT_UPDATE_OPTIONS "pull") set(_projectNameDir "${CTEST_PROJECT_NAME}") vzlogger-0.8.6/Dashboards/KDECTestNightly.cmake000066400000000000000000000325531462212027200213530ustar00rootroot00000000000000# -*- mode: cmake; -*- # This file provides macros which make running Nightly builds easier, # see KDE/kdelibs/KDELibsNightly.cmake or kdesupport/automoc/Automoc4Nightly.cmake # as example. # It can be used completely independent from KDE, the "KDE_" prefix is just to # show that the macros and variables or not ctest-builtin ones, but coming # from this script. # # # Beside the variables and macros this script provides, it also does one more thing, # it converts command line arguments into ctest (cmake) variables. # CMake has the option -D to set variables, which ctest is currently missing. # But there is a work around, invoke ctest like this: # $ ctest -S myscript.cmake,VAR1=foo,VAR2=bar # # By including this (KDECTestNightly.cmake) script, the variables VAR1 will be # set to "foo" and VAR2 to "bar" respectively. This works for any number of variables. # Processing lists (which have semicolons) may have issues. # # # KDECTestNightly.cmake uses the following variables, which you may want to set # before calling any macros from this file: # # KDE_CTEST_BUILD_SUFFIX - this string will be appended to CMAKE_SYSTEM_NAME to # when setting CTEST_BUILD_NAME. # # KDE_CTEST_VCS - set it to "svn" (for KDE) or "cvs". # Send me a mail (or even better a patch) if you need support for git. # # KDE_CTEST_VCS_REPOSITORY - set this to the VCS repository of the project, e.g. # "https://svn.kde.org/home/kde/trunk/KDE/kdelibs" for kdelibs. # # KDE_CTEST_VCS_PATH - the path inside the repository. This can be empty for svn, # but you have to set it for cvs. # # KDE_CTEST_AVOID_SPACES - by default, the source directory for the Nightly build # will contains spaces ("src dir/") and also the build # directory. If this breaks the compilation of your software, # either fix your software, or set KDE_CTEST_AVOID_SPACES # to TRUE. # # KDE_CTEST_DASHBOARD_DIR - by default, all dashboards will be under $HOME/Dashboards/. # By setting KDE_CTEST_DASHBOARD_DIR to another location this # can be modified. # # KDE_CTEST_PARALLEL_LEVEL - number of jobs to run in parallel, e.g. for make -jX. # # # The following macros are provided: # # KDE_CTEST_SETUP() - This macro does most of the work you would otherwise # have to do manually. # It sets up the following variables: # CTEST_BUILD_NAME - unchanged if already set, otherwise set to CMAKE_SYSTEM_NAME, with # KDE_CTEST_BUILD_SUFFIX appended (if set) # CTEST_BINARY_DIRECTORY - unchanged if already set, otherwise set to $HOME/Dashboards//build dir-${CTEST_BUILD_NAME}/ # Set KDE_CTEST_AVOID_SPACES to TRUE to avoid the space in the path # CTEST_CMAKE_GENERATOR - unchanged if already set, otherwise set to "Unix Makefiles" on UNIX, the # Windows part still needs some work # CTEST_SOURCE_DIRECTORY - unchanged if already set, otherwise set to $HOME/Dashboards//src dir/ # Set KDE_CTEST_AVOID_SPACES to TRUE to avoid the space in the path # CTEST_SITE, CTEST_BUILD_COMMAND, CTEST_CHECKOUT_COMMAND, CTEST_UPDATE_COMMAND # CTEST_USE_LAUNCHERS - this is set to TRUE if it has not been already set to TRUE or FALSE by the caller. # # KDE_CTEST_INSTALL() - Installs the project in the given directory. # should always be ${CTEST_BINARY_DIRECTORY}. # # KDE_CTEST_WRITE_INITIAL_CACHE( [var1 var2 ... varN] ) - Writes an initial # CMakeCache.txt to the directory (which should always # be ${CTEST_BINARY_DIRECTORY}). This CMakeCache.txt will contain # the listed variables and their values. If any of the variables # have not been set, they won't be written into this cache. # This is the only way to get predefined values to variables # during the CMake run, as e.g. CMAKE_INSTALL_PREFIX. # # # Alex # Copyright (c) 2009 Alexander Neundorf, # Redistribution and use is allowed according to the terms of the BSD license. # For details see the accompanying COPYING-CMAKE-SCRIPTS file. ########################################################### # generic code ########################################################### cmake_minimum_required(VERSION 2.6) if(POLICY CMP0011) cmake_policy(SET CMP0011 NEW) endif(POLICY CMP0011) # transform ctest script arguments of the form script.ctest,var1=value1,var2=value2 # to variables with the respective names set to the respective values string(REPLACE "," ";" scriptArgs "${CTEST_SCRIPT_ARG}") foreach(currentVar ${scriptArgs}) if ("${currentVar}" MATCHES "^([^=]+)=(.+)$" ) set("${CMAKE_MATCH_1}" "${CMAKE_MATCH_2}") endif ("${currentVar}" MATCHES "^([^=]+)=(.+)$" ) endforeach(currentVar ${scriptArgs}) function(KDE_CTEST_WRITE_INITIAL_CACHE _dir) if(NOT EXISTS "${_dir}") file(MAKE_DIRECTORY "${_dir}") endif(NOT EXISTS "${_dir}") file(WRITE "${_dir}/CMakeCache.txt" "# CMakeCache.txt created by KDE_CTEST_WRITE_INITIAL_CACHE() macro\n" ) # By default, also check for the CTEST_USE_LAUNCHERS variable: foreach(currentArg ${ARGN} CTEST_USE_LAUNCHERS) if(DEFINED ${currentArg}) file(APPEND "${_dir}/CMakeCache.txt" "${currentArg}:STRING=${${currentArg}}\n\n") endif(DEFINED ${currentArg}) endforeach(currentArg ${ARGN} CTEST_USE_LAUNCHERS) endfunction(KDE_CTEST_WRITE_INITIAL_CACHE) function(KDE_CTEST_INSTALL _dir) if(EXISTS ${_dir}) if (EXISTS ${_dir}/cmake_install.cmake) execute_process(COMMAND ${CMAKE_COMMAND} -P ${_dir}/cmake_install.cmake) else (EXISTS ${_dir}/cmake_install.cmake) message("Nothing found to install in ${_dir}") endif (EXISTS ${_dir}/cmake_install.cmake) else(EXISTS ${_dir}) message("KDE_CTEST_INSTALL(): directory ${_dir} does not exist") endif(EXISTS ${_dir}) endfunction(KDE_CTEST_INSTALL _dir) macro(KDE_CTEST_SETUP) include(CMakeDetermineSystem) if(CMAKE_HOST_UNIX) include(Platform/UnixPaths) endif(CMAKE_HOST_UNIX) if(CMAKE_HOST_WIN32) include(Platform/WindowsPaths) endif(CMAKE_HOST_WIN32) # Figure out which generator to use: if(NOT DEFINED CTEST_CMAKE_GENERATOR) if(CMAKE_HOST_UNIX) # on any UNIX, use the plain "Unix Makefiles" generator for now: set(CTEST_CMAKE_GENERATOR "Unix Makefiles" ) endif(CMAKE_HOST_UNIX) if(CMAKE_HOST_WIN32) # Under Windows, if cl.exe is in the path, generate nmake makefiles, # otherwise mingw. find_program(_KDECTEST_CL_EXE NAMES cl) if(_KDECTEST_CL_EXE) set(CTEST_CMAKE_GENERATOR "NMake Makefiles" ) else(_KDECTEST_CL_EXE) set(CTEST_CMAKE_GENERATOR "MinGW Makefiles" ) endif(_KDECTEST_CL_EXE) endif(CMAKE_HOST_WIN32) endif(NOT DEFINED CTEST_CMAKE_GENERATOR) site_name(CTEST_SITE) if(KDE_CTEST_BUILD_SUFFIX) set(KDE_CTEST_BUILD_SUFFIX "-${KDE_CTEST_BUILD_SUFFIX}") endif(KDE_CTEST_BUILD_SUFFIX) if(NOT CTEST_BUILD_NAME) set(CTEST_BUILD_NAME ${CMAKE_SYSTEM_NAME}-CMake-${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}.${CMAKE_PATCH_VERSION}${KDE_CTEST_BUILD_SUFFIX}) endif(NOT CTEST_BUILD_NAME) if("${CTEST_CMAKE_GENERATOR}" MATCHES Makefile) if("${CTEST_CMAKE_GENERATOR}" MATCHES NMake) find_program(MAKE_EXECUTABLE NAMES nmake) else("${CTEST_CMAKE_GENERATOR}" MATCHES NMake) find_program(MAKE_EXECUTABLE NAMES gmake make) endif("${CTEST_CMAKE_GENERATOR}" MATCHES NMake) set(CTEST_BUILD_COMMAND "${MAKE_EXECUTABLE}" ) if("${KDE_CTEST_PARALLEL_LEVEL}" GREATER 1) set(CTEST_BUILD_FLAGS -j${KDE_CTEST_PARALLEL_LEVEL}) endif("${KDE_CTEST_PARALLEL_LEVEL}" GREATER 1) else("${CTEST_CMAKE_GENERATOR}" MATCHES Makefile) if(NOT DEFINED CTEST_BUILD_COMMAND) message(FATAL_ERROR "CTEST_CMAKE_GENERATOR is set to \"${CTEST_CMAKE_GENERATOR}\", but CTEST_BUILD_COMMAND has not been set") endif(NOT DEFINED CTEST_BUILD_COMMAND) endif("${CTEST_CMAKE_GENERATOR}" MATCHES Makefile) # By default set CTEST_USE_LAUNCHERS to TRUE if it has not been set by the caller. # This gives much better error/warnings parsing. if(NOT DEFINED CTEST_USE_LAUNCHERS) set(CTEST_USE_LAUNCHERS TRUE) endif(NOT DEFINED CTEST_USE_LAUNCHERS) # VCS support step 1: figure out which system to use, find the tool, # and get CTestConfig.cmake from the VCS, so we know the project name and # the nightly start time: string(TOLOWER ${KDE_CTEST_VCS} _ctest_vcs) set(_have_vcs FALSE) if ("${_ctest_vcs}" STREQUAL svn) find_program(SVN_EXECUTABLE NAMES svn) if (NOT SVN_EXECUTABLE) message(FATAL_ERROR "Error: KDE_CTEST_VCS is svn, but could not find svn executable") endif (NOT SVN_EXECUTABLE) set(_have_vcs TRUE) endif ("${_ctest_vcs}" STREQUAL svn) if ("${_ctest_vcs}" STREQUAL cvs) find_program(CVS_EXECUTABLE NAMES cvs cvsnt) if (NOT CVS_EXECUTABLE) message(FATAL_ERROR "Error: KDE_CTEST_VCS is cvs, but could not find cvs or cvsnt executable") endif (NOT CVS_EXECUTABLE) set(_have_vcs TRUE) endif ("${_ctest_vcs}" STREQUAL cvs) if ("${_ctest_vcs}" STREQUAL git) find_program(CTEST_GIT_COMMAND git) if (NOT CTEST_GIT_COMMAND) message(FATAL_ERROR "Error: KDE_CTEST_VCS is git, but could not find git executable") endif (NOT CTEST_GIT_COMMAND) set(_have_vcs TRUE) endif ("${_ctest_vcs}" STREQUAL git) if(NOT _have_vcs) message(FATAL_ERROR "Error: KDE_CTEST_VCS is \"${KDE_CTEST_VCS}\", which is currently not supported") endif(NOT _have_vcs) ############# set up CTEST_SOURCE_DIRECTORY and CTEST_BINARY_DIRECTORY ############# if(NOT DEFINED KDE_CTEST_DASHBOARD_DIR) if(WIN32) set(KDE_CTEST_DASHBOARD_DIR "$ENV{USERPROFILE}/Dashboards" ) else(WIN32) set(KDE_CTEST_DASHBOARD_DIR "$ENV{HOME}/Dashboards" ) endif(WIN32) endif(NOT DEFINED KDE_CTEST_DASHBOARD_DIR) #### Now that we have the VCS, get the CTestConfig.cmake file from it string(REGEX REPLACE "[ /:\\.]" "_" _tmpDir ${KDE_CTEST_VCS_REPOSITORY}) set(_tmpDir "${KDE_CTEST_DASHBOARD_DIR}/tmp/${_tmpDir}") message("_tmpDir is ${_tmpDir}") file(MAKE_DIRECTORY "${_tmpDir}") if ("${_ctest_vcs}" STREQUAL svn) execute_process(COMMAND ${SVN_EXECUTABLE} export ${KDE_CTEST_VCS_REPOSITORY}/CTestConfig.cmake WORKING_DIRECTORY "${_tmpDir}") endif ("${_ctest_vcs}" STREQUAL svn) if ("${_ctest_vcs}" STREQUAL cvs) execute_process(COMMAND "${CVS_EXECUTABLE} -d ${KDE_CTEST_VCS_REPOSITORY} co -d \"${_tmpDir}\" ${KDE_CTEST_VCS_PATH}/CTestConfig.cmake" WORKING_DIRECTORY "${_tmpDir}") endif ("${_ctest_vcs}" STREQUAL cvs) if ("${_ctest_vcs}" STREQUAL git) # Two example git clone and corresponding gitweb addresses: #http://anongit.kde.org/automoc #http://gitweb.kde.org/automoc.git/blob_plain/HEAD:/CTestConfig.cmake #http://gitweb.kde.org/gitweb?p=automoc.git;a=blob_plain;f=CTestConfig.cmake;hb=HEAD #http://cmake.org/cmake.git #http://cmake.org/gitweb?p=cmake.git;a=blob_plain;f=CTestConfig.cmake;hb=HEAD if("${KDE_CTEST_VCS_REPOSITORY}" MATCHES ".+/([^/]+)(\\.git)?$") set(_gitProject ${CMAKE_MATCH_1}) else() message(FATAL_ERROR "Could not extract git repository name from ${KDE_CTEST_VCS_REPOSITORY}") endif() set(fullGitwebUrl "${KDE_CTEST_GITWEB_URL}/gitweb?p=${_gitProject}.git;a=blob_plain;f=CTestConfig.cmake;hb=HEAD") file(DOWNLOAD "${fullGitwebUrl}" ${_tmpDir}/CTestConfig.cmake TIMEOUT 60 STATUS _downloadResult) message("Downloading -${fullGitwebUrl}-") # A bit ugly, but git doesn't (AFAIK) support checking out single files # execute_process(COMMAND ${CTEST_GIT_COMMAND} clone ${KDE_CTEST_VCS_REPOSITORY} "${_tmpDir}" # WORKING_DIRECTORY "${_tmpDir}") endif ("${_ctest_vcs}" STREQUAL git) include("${_tmpDir}/CTestConfig.cmake") file(REMOVE_RECURSE "${_tmpDir}") # Now that we included CTestConfig.cmake, we have the project name and nightly start time if(KDE_CTEST_AVOID_SPACES) string(REGEX REPLACE " " "" _projectNameDir "${CTEST_PROJECT_NAME}") set(_srcDir "srcdir") set(_buildDir "builddir") else(KDE_CTEST_AVOID_SPACES) set(_projectNameDir "${CTEST_PROJECT_NAME}") set(_srcDir "src dir") set(_buildDir "build dir") endif(KDE_CTEST_AVOID_SPACES) if(NOT DEFINED CTEST_SOURCE_DIRECTORY) set(CTEST_SOURCE_DIRECTORY "${KDE_CTEST_DASHBOARD_DIR}/${_projectNameDir}/${_srcDir}" ) endif(NOT DEFINED CTEST_SOURCE_DIRECTORY) if(NOT DEFINED CTEST_BINARY_DIRECTORY) set(CTEST_BINARY_DIRECTORY "${KDE_CTEST_DASHBOARD_DIR}/${_projectNameDir}/${_buildDir}-${CTEST_BUILD_NAME}" ) endif(NOT DEFINED CTEST_BINARY_DIRECTORY) ############### set up VCS support ################### # VCS support step 2: set up the update and checkout commands # only set this if there is no checkout yet set(CTEST_CHECKOUT_COMMAND) if ("${_ctest_vcs}" STREQUAL svn) set(CTEST_UPDATE_COMMAND ${SVN_EXECUTABLE}) if(NOT EXISTS "${CTEST_SOURCE_DIRECTORY}/.svn/entries") # concatenate VCS_REPOSITORY and VCS_PATH, and remove trailing slashes: string(REGEX REPLACE "/+$" "" _KDE_CTEST_SVN_URL "${KDE_CTEST_VCS_REPOSITORY}/${KDE_CTEST_VCS_PATH}") set(CTEST_CHECKOUT_COMMAND "${SVN_EXECUTABLE} co ${_KDE_CTEST_SVN_URL} \"${CTEST_SOURCE_DIRECTORY}\"") # set(CTEST_CHECKOUT_COMMAND "${SVN_EXECUTABLE} co ${KDE_CTEST_VCS_REPOSITORY}/${KDE_CTEST_VCS_PATH} \"${CTEST_SOURCE_DIRECTORY}\"") endif(NOT EXISTS "${CTEST_SOURCE_DIRECTORY}/.svn/entries") endif ("${_ctest_vcs}" STREQUAL svn) if ("${_ctest_vcs}" STREQUAL cvs) set(CTEST_UPDATE_COMMAND ${CVS_EXECUTABLE}) if(NOT EXISTS "${CTEST_SOURCE_DIRECTORY}/CVS/Entries") get_filename_component(_srcSubdir "${CTEST_SOURCE_DIRECTORY}" NAME) set(CTEST_CHECKOUT_COMMAND "${CVS_EXECUTABLE} -d ${KDE_CTEST_VCS_REPOSITORY} co -d \"${_srcSubdir}\" ${KDE_CTEST_VCS_PATH}") endif(NOT EXISTS "${CTEST_SOURCE_DIRECTORY}/CVS/Entries") endif ("${_ctest_vcs}" STREQUAL cvs) if ("${_ctest_vcs}" STREQUAL git) set(CTEST_UPDATE_COMMAND ${GIT_EXECUTABLE}) if(NOT EXISTS "${CTEST_SOURCE_DIRECTORY}/.git/HEAD") set(CTEST_CHECKOUT_COMMAND "${CTEST_GIT_COMMAND} clone ${KDE_CTEST_VCS_REPOSITORY} \"${CTEST_SOURCE_DIRECTORY}\"") SET(UPDATE_COMMAND "${GITCOMMAND}") SET(UPDATE_OPTIONS "${GIT_UPDATE_OPTIONS}") endif(NOT EXISTS "${CTEST_SOURCE_DIRECTORY}/.git/HEAD") endif ("${_ctest_vcs}" STREQUAL git) endmacro(KDE_CTEST_SETUP) vzlogger-0.8.6/Dashboards/Tools.cmake000066400000000000000000000124101462212027200175340ustar00rootroot00000000000000# -*- mode: cmake; -*- # generic support code, provides the kde_ctest_setup() macro, which sets up everything required: get_filename_component(_currentDir "${CMAKE_CURRENT_LIST_FILE}" PATH) include( "${_currentDir}/KDECTestNightly.cmake") macro(my_ctest_setup) set(_git_default_branch "c++-port") # init branch to checkout if( NOT _git_branch ) set(_git_branch ${_git_default_branch}) endif( NOT _git_branch ) # initialisation target architectur if(NOT TARGET_ARCH) message("=1======> Setup Arch: ${TARGET_ARCH}") set(CTEST_BUILD_ARCH "linux") else(NOT TARGET_ARCH) message("=2======> Setup Arch: ${TARGET_ARCH}") set(CTEST_BUILD_ARCH ${TARGET_ARCH}) if(${TARGET_ARCH} MATCHES "ar71xx") message("=3======> Setup Arch: ${TARGET_ARCH}") set(CMAKE_TOOLCHAIN_FILE /usr/local/OpenWrt-SDK-ar71xx-for-Linux-x86_64-gcc-4.3.3+cs_uClibc-0.9.30.1/staging_dir/host/Modules/Toolchain-OpenWRT.cmake) else(${TARGET_ARCH} MATCHES "ar71xx") set(CMAKE_TOOLCHAIN_FILE "CMAKE_TOOLCHAIN_FILE-NO_FOUND") endif(${TARGET_ARCH} MATCHES "ar71xx") endif(NOT TARGET_ARCH) # initialisation compiler if( NOT compiler ) set(COMPILER_ID "gcc") else( NOT compiler ) if( ${compiler} STREQUAL "clang" ) find_program( CLANG_CC clang ) find_program( CLANG_CXX clang++ ) if( ${CLANG_CC} STREQUAL "CLANG_CC-NOTFOUND" OR ${CLANG_CXX} STREQUAL "CLANG_CC-NOTFOUND") message(FATAL_ERROR "clang compiler not found. stopping here.") else( ${CLANG_CC} STREQUAL "CLANG_CC-NOTFOUND" OR ${CLANG_CXX} STREQUAL "CLANG_CC-NOTFOUND") set(ENV{CC} ${CLANG_CC}) set(ENV{CXX} ${CLANG_CXX}) set(COMPILER_ID "clang") endif( ${CLANG_CC} STREQUAL "CLANG_CC-NOTFOUND" OR ${CLANG_CXX} STREQUAL "CLANG_CC-NOTFOUND") else( ${compiler} STREQUAL "clang" ) message(FATAL_ERROR "Error. Compiler '${compiler}' not found. Stopping here.") endif( ${compiler} STREQUAL "clang" ) endif( NOT compiler ) # init branch to checkout if( NOT CTEST_PUSH_PACKAGES ) set(CTEST_PUSH_PACKAGES 0) endif( NOT CTEST_PUSH_PACKAGES ) # setup CTEST_BUILD_NAME if( ${_git_branch} STREQUAL ${_git_default_branch} ) set(CTEST_BUILD_NAME "${CTEST_BUILD_ARCH}-${COMPILER_ID}-default") else( ${_git_branch} STREQUAL ${_git_default_branch} ) set(CTEST_BUILD_NAME "${CTEST_BUILD_ARCH}-${COMPILER_ID}-default-${_git_branch}") endif( ${_git_branch} STREQUAL ${_git_default_branch} ) set(_projectNameDir "${CTEST_PROJECT_NAME}") set(_srcDir "srcdir") set(_buildDir "builddir") set(GIT_UPDATE_OPTIONS "pull") endmacro() # # # function(create_project_xml) set(projectFile "${CTEST_BINARY_DIRECTORY}/Project.xml") file(WRITE ${projectFile} "") foreach(subproject ${CTEST_PROJECT_SUBPROJECTS}) file(APPEND ${projectFile} " ") endforeach() file(APPEND ${projectFile} " ") ctest_submit(FILES "${CTEST_BINARY_DIRECTORY}/Project.xml") endfunction() # # # macro(configure_ctest_config _CTEST_VCS_REPOSITORY configfile) string(REGEX REPLACE "[ /:\\.]" "_" _tmpDir ${_CTEST_VCS_REPOSITORY}) set(_tmpDir "${_CTEST_DASHBOARD_DIR}/tmp/${_tmpDir}") configure_file(${configfile} ${_tmpDir}/CTestConfig.cmake COPYONLY) set(ctest_config ${_tmpDir}/CTestConfig.cmake) endmacro() # # # function(FindOS OS_NAME OS_VERSION) set(_LinuxReleaseFiles redhat-release SuSE-release lsb-release ) foreach(releasefile ${_LinuxReleaseFiles}) if(EXISTS "/etc/${releasefile}" ) file(READ "/etc/${releasefile}" _data ) if( ${releasefile} MATCHES "redhat-release" ) ReadRelease_redhat(${_data})# OS_NAME OS_VERSION) elseif( ${releasefile} MATCHES "SuSE-release" ) ReadRelease_SuSE(${_data})# OS_NAME OS_VERSION) elseif( ${releasefile} MATCHES "lsb-release" ) ReadRelease_lsb(${_data})# OS_NAME OS_VERSION) endif( ${releasefile} MATCHES "redhat-release" ) endif(EXISTS "/etc/${releasefile}" ) endforeach() #message(" OS_NAME : ${OS_NAME}") #message(" OS_VERSION: ${OS_VERSION}") set(OS_NAME ${OS_NAME} PARENT_SCOPE) set(OS_VERSION ${OS_VERSION} PARENT_SCOPE) endfunction(FindOS) macro(ReadRelease_redhat _data OS_NAME OS_VERSION) # CentOS release 5.5 (Final) set(OS_NAME "CentOS") set(OS_NAME "Fedora") endmacro() macro(ReadRelease_SuSE _data OS_NAME OS_VERSION) # openSUSE 11.1 (x86_64) # VERSION = 11.1 set(OS_NAME "openSUSE") string(REGEX REPLACE "VERSION=\"(.*)\"" "\\1" OS_VERSION ${_data}) endmacro() macro(ReadRelease_lsb _data) # DISTRIB_ID=Ubuntu # DISTRIB_RELEASE=10.04 # DISTRIB_CODENAME=lucid # DISTRIB_DESCRIPTION="Ubuntu 10.04.4 LTS" string(REGEX MATCH "DISTRIB_ID=[a-zA-Z0-9]+" _dummy ${_data}) string(REGEX REPLACE "DISTRIB_ID=(.*)" "\\1" OS_NAME ${_dummy}) string(REGEX MATCH "DISTRIB_RELEASE=[a-zA-Z0-9.]+" _dummy ${_data}) string(REGEX REPLACE "DISTRIB_RELEASE=(.*)" "\\1" OS_VERSION ${_dummy}) #message(" OS_NAME : ${OS_NAME}") #message(" OS_VERSION: ${OS_VERSION}") endmacro() MARK_AS_ADVANCED( OS_NAME OS_VERSION ) function(ctest_push_files packageDir distFile) set(_export_host "192.168.9.63") execute_process( COMMAND scp -p ${distFile} ${_export_host}:packages WORKING_DIRECTORY ${packageDir} ) endfunction(ctest_push_files) vzlogger-0.8.6/Dashboards/VZLoggerCoverage.cmake000066400000000000000000000061051462212027200216130ustar00rootroot00000000000000# -*- mode: cmake; -*- # Todo # * git update # * cd openwrt # * svn co openwrt.... # * modify feeds.conf # * feeds update # * feeds install set(ENV{https_proxy} "http://squid.itwm.fhg.de:3128/") include(Tools.cmake) my_ctest_setup() include(CTestConfigVZlogger.cmake) # set(_ctest_type "Nightly") # set(_ctest_type "Continuous") set(_ctest_type "Coverage") set(URL "https://github.com/mysmartgrid/vzlogger.git") set(CTEST_BASE_DIRECTORY "${KDE_CTEST_DASHBOARD_DIR}/${_projectNameDir}/${_ctest_type}") set(CTEST_SOURCE_DIRECTORY "${CTEST_BASE_DIRECTORY}/${_srcDir}-${_git_branch}" ) set(CTEST_BINARY_DIRECTORY "${CTEST_BASE_DIRECTORY}/${_buildDir}-${CTEST_BUILD_NAME}") set(CTEST_INSTALL_DIRECTORY "${CTEST_BASE_DIRECTORY}/install-${CTEST_BUILD_NAME}") set(KDE_CTEST_VCS "git") set(KDE_CTEST_VCS_REPOSITORY ${URL}) set(CMAKE_INSTALL_PREFIX "/usr") set(CTEST_CMAKE_GENERATOR "Unix Makefiles") configure_ctest_config(${KDE_CTEST_VCS_REPOSITORY} "CTestConfigVZlogger.cmake") kde_ctest_setup() FindOS(OS_NAME OS_VERSION) set(ctest_config ${CTEST_BASE_DIRECTORY}/CTestConfig.cmake) ####################################################################### ctest_empty_binary_directory(${CTEST_BINARY_DIRECTORY}) find_program(CTEST_GIT_COMMAND NAMES git) set(CTEST_UPDATE_TYPE git) set(CTEST_UPDATE_COMMAND ${CTEST_GIT_COMMAND}) if(NOT EXISTS "${CTEST_SOURCE_DIRECTORY}/.git/HEAD") set(CTEST_CHECKOUT_COMMAND "${CTEST_GIT_COMMAND} clone ${URL} ${CTEST_SOURCE_DIRECTORY}") endif(NOT EXISTS "${CTEST_SOURCE_DIRECTORY}/.git/HEAD") ctest_start(${_ctest_type}) ctest_update(SOURCE ${CTEST_SOURCE_DIRECTORY}) ctest_submit(PARTS Update) execute_process( COMMAND ${CTEST_GIT_COMMAND} checkout ${_git_branch} WORKING_DIRECTORY ${CTEST_SOURCE_DIRECTORY} ) # to get CTEST_PROJECT_SUBPROJECTS definition: set(ENABLE_CODECOVERAGE 1) set(CMAKE_BUILD_TYPE Profile) set(CMAKE_ADDITIONAL_PATH ${CTEST_INSTALL_DIRECTORY}) if(CMAKE_TOOLCHAIN_FILE) kde_ctest_write_initial_cache("${CTEST_BINARY_DIRECTORY}" CMAKE_TOOLCHAIN_FILE CMAKE_INSTALL_PREFIX CMAKE_ADDITIONAL_PATH ENABLE_CODECOVERAGE CMAKE_BUILD_TYPE ) else(CMAKE_TOOLCHAIN_FILE) kde_ctest_write_initial_cache("${CTEST_BINARY_DIRECTORY}" CMAKE_ADDITIONAL_PATH ENABLE_CODECOVERAGE CMAKE_BUILD_TYPE ) endif(CMAKE_TOOLCHAIN_FILE) ctest_configure(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE resultConfigure) message("====> Configure: ${resultConfigure}") if( STAGING_DIR) include(${CTEST_BINARY_DIRECTORY}/CMakeCache.txt) set(ENV{STAGING_DIR} ${OPENWRT_STAGING_DIR}) endif( STAGING_DIR) ctest_build(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE build_res) message("====> BUILD: ${build_res}") # do codecoverage now ctest_coverage(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) message(STATUS "===> ctest_coverage: res='${res}'") # do codecoverage now ctest_memcheck(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) message(STATUS "===> ctest_memcheck: res='${res}'") ctest_test(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE test_res) message("====> TESTS: ${test_res}") ctest_submit(RETURN_VALUE res) message("DONE") vzlogger-0.8.6/Dashboards/VZLoggerNightly.cmake000066400000000000000000000077441462212027200215100ustar00rootroot00000000000000# -*- mode: cmake; -*- # Todo # * git update # * cd openwrt # * svn co openwrt.... # * modify feeds.conf # * feeds update # * feeds install set(ENV{https_proxy} "http://squid.itwm.fhg.de:3128/") include(Tools.cmake) my_ctest_setup() include(CTestConfigVZlogger.cmake) set(_ctest_type "Nightly") # set(_ctest_type "Continuous") # set(_ctest_type "Coverage") set(URL "https://github.com/mysmartgrid/vzlogger.git") set(CTEST_BASE_DIRECTORY "${KDE_CTEST_DASHBOARD_DIR}/${_projectNameDir}/${_ctest_type}") set(CTEST_SOURCE_DIRECTORY "${CTEST_BASE_DIRECTORY}/${_srcDir}-${_git_branch}" ) set(CTEST_BINARY_DIRECTORY "${CTEST_BASE_DIRECTORY}/${_buildDir}-${CTEST_BUILD_NAME}") set(CTEST_INSTALL_DIRECTORY "${CTEST_BASE_DIRECTORY}/install-${CTEST_BUILD_NAME}") set(KDE_CTEST_VCS "git") set(KDE_CTEST_VCS_REPOSITORY ${URL}) set(CMAKE_INSTALL_PREFIX "/usr") set(CTEST_CMAKE_GENERATOR "Unix Makefiles") configure_ctest_config(${KDE_CTEST_VCS_REPOSITORY} "CTestConfigVZlogger.cmake") kde_ctest_setup() FindOS(OS_NAME OS_VERSION) set(ctest_config ${CTEST_BASE_DIRECTORY}/CTestConfig.cmake) ####################################################################### ctest_empty_binary_directory(${CTEST_BINARY_DIRECTORY}) find_program(CTEST_GIT_COMMAND NAMES git) set(CTEST_UPDATE_TYPE git) set(CTEST_UPDATE_COMMAND ${CTEST_GIT_COMMAND}) if(NOT EXISTS "${CTEST_SOURCE_DIRECTORY}/.git/HEAD") set(CTEST_CHECKOUT_COMMAND "${CTEST_GIT_COMMAND} clone ${URL} ${CTEST_SOURCE_DIRECTORY}") endif(NOT EXISTS "${CTEST_SOURCE_DIRECTORY}/.git/HEAD") ctest_start(${_ctest_type}) ctest_update(SOURCE ${CTEST_SOURCE_DIRECTORY}) ctest_submit(PARTS Update) execute_process( COMMAND ${CTEST_GIT_COMMAND} checkout ${_git_branch} WORKING_DIRECTORY ${CTEST_SOURCE_DIRECTORY} ) # to get CTEST_PROJECT_SUBPROJECTS definition: set(CMAKE_BUILD_TYPE Release) if(CMAKE_TOOLCHAIN_FILE) kde_ctest_write_initial_cache("${CTEST_BINARY_DIRECTORY}" CMAKE_TOOLCHAIN_FILE CMAKE_INSTALL_PREFIX CMAKE_BUILD_TYPE ) set(OS_NAME "openWRT") set(OS_VERSION "10.03.1") set(CMAKE_SYSTEM_PROCESSOR ${openwrt_arch}) else(CMAKE_TOOLCHAIN_FILE) kde_ctest_write_initial_cache("${CTEST_BINARY_DIRECTORY}" CMAKE_BUILD_TYPE ) endif(CMAKE_TOOLCHAIN_FILE) ctest_configure(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE resultConfigure) message("====> Configure: ${resultConfigure}") if( STAGING_DIR) include(${CTEST_BINARY_DIRECTORY}/CMakeCache.txt) set(ENV{STAGING_DIR} ${OPENWRT_STAGING_DIR}) endif( STAGING_DIR) ctest_build(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE build_res) message("====> BUILD: ${build_res}") ctest_test(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE test_res) message("====> TESTS: ${test_res}") ctest_submit(RETURN_VALUE res) # package files include(${CTEST_BINARY_DIRECTORY}/CPackConfig.cmake) if( STAGING_DIR) set(ENV{PATH} ${OPENWRT_STAGING_DIR}/host/bin:$ENV{PATH}) endif( STAGING_DIR) if( NOT ${build_res}) execute_process( COMMAND cpack -G DEB WORKING_DIRECTORY ${CTEST_BINARY_DIRECTORY} ) endif( NOT ${build_res}) # upload files if( NOT ${build_res} AND ${CTEST_PUSH_PACKAGES}) message( "OS_NAME .....: ${OS_NAME}") message( "OS_VERSION ..: ${OS_VERSION}") message( "CMAKE_SYSTEM_PROCESSOR ..: ${CMAKE_SYSTEM_PROCESSOR}") if(CPACK_ARCHITECTUR) set(OPKG_FILE_NAME "${CPACK_PACKAGE_NAME}_${CPACK_PACKAGE_VERSION}_${CPACK_ARCHITECTUR}") set(_package_file "${OPKG_FILE_NAME}.ipk") else(CPACK_ARCHITECTUR) set(_package_file "${CPACK_PACKAGE_FILE_NAME}.deb") endif(CPACK_ARCHITECTUR) message("==> Upload packages - ${_package_file}") set(_export_host ${CTEST_PACKAGE_SITE}) set(_remote_dir "packages/${OS_NAME}/${OS_VERSION}/${CMAKE_SYSTEM_PROCESSOR}") execute_process( COMMAND ssh ${_export_host} mkdir -p ${_remote_dir} ) execute_process( COMMAND scp -p ${_package_file} ${_export_host}:${_remote_dir}/${_package_file} WORKING_DIRECTORY ${CTEST_BINARY_DIRECTORY}/${subproject} ) endif( NOT ${build_res} AND ${CTEST_PUSH_PACKAGES}) message("DONE") vzlogger-0.8.6/Dashboards/run_nightly000077500000000000000000000010241462212027200177210ustar00rootroot00000000000000#!/bin/bash export LANG=en_US.UTF-8 export CTEST=/usr/bin/ctest echo "Running ctest" ${CTEST} -V -VV -S ${HOME}/vzlogger/Dashboards/VZLoggerNightly.cmake,CTEST_PUSH_PACKAGES=1,TARGET_ARCH=ar71xx ${CTEST} -V -VV -S ${HOME}/vzlogger/Dashboards/VZLoggerNightly.cmake,CTEST_PUSH_PACKAGES=1, ${CTEST} -V -VV -S ${HOME}/vzlogger/Dashboards/VZLoggerNightly.cmake,compiler=clang ${CTEST} -V -VV -S ${HOME}/vzlogger/Dashboards/VZLoggerCoverage.cmake ${CTEST} -V -VV -S ${HOME}/vzlogger/Dashboards/VZLoggerCoverage.cmake,compiler=clang vzlogger-0.8.6/Dockerfile000066400000000000000000000032301462212027200153520ustar00rootroot00000000000000############################ # STEP 1 build executable binary ############################ FROM alpine:latest as builder RUN apk add --no-cache \ gcc \ g++ \ libc-dev \ linux-headers \ git \ make \ cmake \ curl-dev \ gnutls-dev \ cyrus-sasl-dev \ # for libuuid util-linux-dev \ libtool \ libgcrypt-dev \ libmicrohttpd-dev \ json-c-dev \ mosquitto-dev \ libunistring-dev \ automake \ autoconf \ gtest-dev WORKDIR /vzlogger RUN git clone https://github.com/volkszaehler/libsml.git --depth 1 \ && make install -C libsml/sml RUN git clone https://github.com/rscada/libmbus.git --depth 1 \ && cd libmbus \ && ./build.sh \ && make install COPY . /vzlogger ARG build_test=off RUN cmake -DBUILD_TEST=${build_test} \ && make -j $(nproc --all || echo 1) \ && make install \ && if [ "$build_test" != "off" ]; then make test; fi ############################# ## STEP 2 build a small image ############################# FROM alpine:latest LABEL Description="vzlogger" RUN apk add --no-cache \ libcurl \ gnutls \ libsasl \ libuuid \ libgcrypt \ libmicrohttpd \ json-c \ libatomic \ mosquitto-libs \ libunistring \ libstdc++ \ libgcc # libsml is linked statically => no need to copy COPY --from=builder /usr/local/bin/vzlogger /usr/local/bin/vzlogger COPY --from=builder /usr/local/lib/libmbus.so* /usr/local/lib/ # without running a user context, no exec is possible and without the dialout group no access to usb ir reader possible RUN adduser -S vz -G dialout RUN vzlogger --version USER vz CMD ["vzlogger", "--foreground"] vzlogger-0.8.6/GITHUB_RELEASE.txt000066400000000000000000000014501462212027200162450ustar00rootroot00000000000000 How to do a Github Release Running debuild sets the version in CMakeLists.txt from the one in debian/changelog. This then has to be commited. To do a Github release that triggers the debuild action you have to create a version tag v. This version must match the version in first line of the debian/changelog. The tag must have a v prefix. So as a step by step guide this is: 1. Make a debian/changelog entry for the new version. This can be done with dch -v . 2. Run debuild followed by add -u; commit -m "v" and bring that commit into the master branch. 3. Create a tag v in Github. 4. Create a release from that tag. The release action that is triggered will create the packages and upload them to the cloudsmith repo. This will take about an hour. vzlogger-0.8.6/README.InfluxDB.md000066400000000000000000000020201462212027200163050ustar00rootroot00000000000000InfluxDB api ================== **vzlogger** can send measurements to a InfluxDB server. Configuration --------------------------- Set `"api"` to`"influxdb"` to use the InfluxDB API. `"host"` is the IP address or hostname of the InfluxDB server in the format `127.0.0.1:8086` `"uuid"` is the unique channel ID. Use the `uuid` or `uuidgen` command to generate one. For optional parameters such as `username` or `password` have a look at the example config file is available at [`etc/vzlogger.conf.InfluxDB`](https://github.com/volkszaehler/vzlogger/blob/master/etc/vzlogger.conf.InfluxDB) Message Format --------------------------- Messages are sent in the following format: ,uuid=, value= In the above, measurement_name, tags and uuid are from the configuration while value and time[ms] are value and time of the measurement. Details about this can be found in the [InfluxDB line protocol tutorial](https://docs.influxdata.com/influxdb/v1.8/write_protocols/line_protocol_tutorial/) vzlogger-0.8.6/README.md000066400000000000000000000110231462212027200146360ustar00rootroot00000000000000vzlogger ========= * is a part of the volkszaehler.org smart meter * is a tool to read and log measurements of a wide variety of smart meters and sensors to the volkszaehler.org middleware * can run as a daemon or via cron * includes a tiny onboard http daemon to serve realtime readings * is written in C++ and should run on most embedded devices which conform to the POSIX standard Feel free to implement support your own hardware ;) Installation --------------- To install, follow the detailed installation instructions at http://wiki.volkszaehler.org/software/controller/vzlogger/installation_cpp-version If you're impatient you can quickstart using (Debian Bullseye or Ubuntu 18.04 LTS): sudo apt-get install build-essential git-core cmake pkg-config subversion libcurl3-dev \ libgnutls-dev libsasl2-dev uuid-dev uuid-runtime libtool dh-autoreconf libunistring-dev If you want to use MQTT support: sudo apt-get install libmosquitto-dev Then run the installation: wget https://raw.github.com/volkszaehler/vzlogger/master/install.sh sudo bash install.sh Docker ------ You can also build a docker image: docker build -t vzlogger . Note, that this will use the newest vzlogger from volkszaehler github (not your local clone). You can start it: docker run --restart=always -v /home/pi/projects/vzlogger-docker:/cfg \ --device=/dev/serial/by-id/usb-FTDI_FT230X_Basic_UART_D30A9U5N-if00-port0 \ --name vzlogger -d vzlogger where /home/pi/projects/vzlogger-docker is the path to the directory containing the vzlogger.conf file and /dev/serial/by-id/usb-FTDI_FT230X_Basic_UART_D30A8U6N-if00-port0 is your device. You can pass several devices if you have them. Debian and Raspberry Pi OS Packages ------------- [![Hosted By: Cloudsmith](https://img.shields.io/badge/OSS%20hosting%20by-cloudsmith-blue?logo=cloudsmith&style=flat-square)](https://cloudsmith.com) We now build Debian packages for amd64, armhf and arm64. Armel, which would be needed for Debian on RPi 1 hardware, is not supported. [Raspberry Pi OS packages for armhf]( https://cloudsmith.io/~volkszaehler/repos/volkszaehler-org-project/packages/?q=distribution%3Araspbian+AND+architecture%3Aarmhf) are also part of our releases. Unfortunately Debian armhf packages do not run on Raspberry Pi 1 although the architecture has been named armhf in Raspbian. Using "Raspbian armhf" packages fixes that. For RPi 2 and above Debian packages run on Raspberry Pi OS. Our packages are built with MQTT support, but without OMS support. The packages attached to the release are meant for Debian trixie. The full set of packages is provided through a repository graciously provided by [Cloudsmith](https://cloudsmith.com). The setup of the repository is also [explained by Cloudsmith](https://cloudsmith.io/~volkszaehler/repos/volkszaehler-org-project/setup/#formats-deb). The easy way to do it is running ``` curl -1sLf \ 'https://dl.cloudsmith.io/public/volkszaehler/volkszaehler-org-project/setup.deb.sh' \ | sudo -E bash ``` If you do it the easy way you should however be aware of the high amount of trust you put into cloudsmith not beeing compromised. As an alternative there is the manual way to achive the same result. That starts with adding a file to /etc/apt/sources.list.d/ containing ``` deb [signed-by=/usr/share/keyrings/volkszaehler-volkszaehler-org-project-archive-keyring.gpg] https://dl.cloudsmith.io/public/volkszaehler/volkszaehler-org-project/deb/debian bookworm main deb-src [signed-by=/usr/share/keyrings/volkszaehler-volkszaehler-org-project-archive-keyring.gpg] https://dl.cloudsmith.io/public/volkszaehler/volkszaehler-org-project/deb/debian bookworm main ``` You need to replace bookworm with your distro and debian with raspbian in case you are using an RPi 1. You also need to retrieve our repository key as a trusted one. ``` curl -1sLf "https://dl.cloudsmith.io/public/volkszaehler/volkszaehler-org-project/gpg.21DBDAC56DF44DA1.key" | \ gpg --dearmor > /usr/share/keyrings/volkszaehler-volkszaehler-org-project-archive-keyring.gpg ``` After that you can do the usual ``` apt update apt install vzlogger ``` An official Debian vzlogger package is currently in unstable. Mailing List ------------- If you have questions, contact the volkszaehler mailing lists: * Users mailing list: https://demo.volkszaehler.org/mailman/listinfo/volkszaehler-users * Developers mailing list: https://demo.volkszaehler.org/mailman/listinfo/volkszaehler-dev More information is available in our wiki: http://wiki.volkszaehler.org/software/controller/vzlogger vzlogger-0.8.6/README.mysmartgrid.md000066400000000000000000000025441462212027200172070ustar00rootroot00000000000000MySmartGrid API ================== **vzlogger** can also send measurement values to a MySmartGrid webserver. The channel-configuration has some MySmartGrid specific parameters To generate the Unique Ids one can use the command `uuidgen` General channel parameters: --------------------------- Set `"api"` to`"mysmartgrid"` to use the MySmartGrid API. `"middleware"` defines the MySmartGrid server url. `"uuid"` defines the Unique ID of the sensor. example: ```` "api" : "mysmartgrid", "middleware" : "https://api.mysmartgrid.de:8443", "uuid" : "e0c9dd9a-8f3c-4fc4-8a99-f2393ca60924", ```` Mysmartgrid channel parameters ------------------------------- `"type"` should be `"sensor"` to send the sensor data `"device"` unique id for the server to identifiy the device/vzlogger `"secretKey"` unique secret key to sign the messages to the server `"name"` gives the functionname of the sensor ```"channels" : [{...}[,{...}]]``` for each channel define: "type" : "sensor", "device" : "52709939-4183-472e-a3bb-78d944da9937", "secretKey" : "57c56da4-5932-497c-bd80-6cb210c0b891", "name" : "s01", "interval" : 300, /* */ /* identifier for measurement: 1-0:1.8.0 */ "identifier" : "counter", "scaler" : 1, /* sml counter is in Wh */ // "scaler" : 1000, /* d0 counter is in kWh */ vzlogger-0.8.6/check-formatting.sh000077500000000000000000000004311462212027200171440ustar00rootroot00000000000000#!/bin/bash set -xe SRCDIRS=(include src tests) clang-format --version find "${SRCDIRS[@]}" -type f -name '*.h' -o -name '*.cpp' -o -name '*.hpp' | xargs -I{} -P1 clang-format -i -style=file {} [[ -z "$(git status --porcelain "${SRCDIRS[@]}")" ]] || (git status; git diff; false) vzlogger-0.8.6/clean-all-cmake.txt000066400000000000000000000010771462212027200170360ustar00rootroot00000000000000# will be called if make clean-all is called (after make clean) # afterwards "make" doesn't work anylonger -> "cmake ." set(cmake_generated ${CMAKE_BINARY_DIR}/CMakeCache.txt ${CMAKE_BINARY_DIR}/cmake_install.cmake ${CMAKE_BINARY_DIR}/Makefile ${CMAKE_BINARY_DIR}/CMakeFiles ) foreach(file ${cmake_generated}) if (EXISTS ${file}) file(REMOVE_RECURSE ${file}) endif() endforeach(file) MESSAGE ( STATUS "removed CMakeCache.txt, cmake_install.cmake, MakeFiles and CMakeFiles. Recreate by calling cmake." ) vzlogger-0.8.6/config.hpp.in000066400000000000000000000030321462212027200157430ustar00rootroot00000000000000#ifndef _config_hpp_in_ #define _config_hpp_in_ /* Local interface */ #cmakedefine LOCAL_SUPPORT 1 /* mqtt support */ #cmakedefine ENABLE_MQTT 1 /* Name of package */ #define PACKAGE "vzlogger" /* Define to the address where bug reports for this package should be sent. */ #define PACKAGE_BUGREPORT "https://github.com/volkszaehler/vzlogger/issues" /* Define to the full name of this package. */ #define PACKAGE_NAME "vzlogger" /* Define to the full name and version of this package. */ #cmakedefine PACKAGE_STRING "@PACKAGE_STRING@" /* Define to the one symbol short name of this package. */ #define PACKAGE_TARNAME "vzlogger" /* Define to the home page for this package. */ #define PACKAGE_URL "https://github.com/volkszaehler/vzlogger" /* Define to the version of this package. */ #cmakedefine PACKAGE_VERSION "@PACKAGE_VERSION@" /* Smart Messaging Language */ #cmakedefine SML_SUPPORT 1 // OMS based devices support #cmakedefine OMS_SUPPORT 1 /* OCR Meter support */ #cmakedefine OCR_SUPPORT 1 /* OCR text recognition support */ #cmakedefine OCR_TESSERACT_SUPPORT 1 /* Allow MeterExec protocol to use root privileges */ #cmakedefine METEREXEC_ROOTACCESS 1 /* true if we use shared_ptr from stl */ #cmakedefine USE_STL_TR1 1 /* true if openssl is found */ #cmakedefine WITH_OPENSSL 1 /* true if openssl is found */ #cmakedefine HAVE_OPENSSL 1 /* Version number of package */ #cmakedefine VERSION "@VZLOGGER_RPM_VERSION@" /* do we have a compiler with proper c++ regex support? */ #cmakedefine HAVE_CPP_REGEX 1 #endif /* _config_hpp_in_ */ vzlogger-0.8.6/debian/000077500000000000000000000000001462212027200146045ustar00rootroot00000000000000vzlogger-0.8.6/debian/changelog000066400000000000000000000065531462212027200164670ustar00rootroot00000000000000vzlogger (0.8.6) unstable; urgency=medium * Release as base for an official Debian release -- Joachim Zobel Thu, 16 May 2024 21:35:26 +0200 vzlogger (0.8.5) unstable; urgency=medium * Fixed missing user name rename in logrotate configuration. -- Joachim Zobel Sun, 21 Apr 2024 07:03:21 +0200 vzlogger (0.8.4) unstable; urgency=medium * Added build for Raspbian. * Removed armel architecture. * Renamed service user to _vzlogger -- Joachim Zobel Sat, 30 Mar 2024 06:24:25 +0100 vzlogger (0.8.3) unstable; urgency=medium * Added armel as release architecture -- Joachim Zobel Tue, 31 Oct 2023 15:38:49 +0100 vzlogger (0.8.2) unstable; urgency=medium * Fixed service running as root -- Joachim Zobel Tue, 23 May 2023 06:18:00 +0200 vzlogger (0.8.1) unstable; urgency=low * Latest version -- Joachim Zobel Sat, 21 Jan 2023 19:52:01 +0100 vzlogger (0.3.5) stable; urgency=low * including changes kindly contributed by Peter Evertz (initiation sequence for some meters) -- Justin Otherguy (signing key for debian packages only) Tue, 08 Oct 2013 21:28:01 +0200 vzlogger (0.3.4-rc1) stable; urgency=low * updated version to reflect changes in CMakeLists.txt -- Justin Otherguy (signing key for debian packages only) Wed, 15 Apr 2013 23:19:01 +0200 vzlogger (0.3.3-rc3) stable; urgency=low * removed a warning in vzlogger.postinst (thx to RG) -- Justin Otherguy (signing key for debian packages only) Wed, 14 Apr 2013 23:45:01 +0200 vzlogger (0.3.3-rc2) stable; urgency=low * minor clean-up in default config -- Justin Otherguy (signing key for debian packages only) Wed, 10 Apr 2013 23:45:01 +0200 vzlogger (0.3.3-rc1) stable; urgency=low * added support for new fluksometer * some code refactoring & cleanup -- Steffen Vogel Thu, 19 Jan 2012 18:52:32 +0100 vzlogger (0.3.2-1) stable; urgency=low * new release with improvments to various protocols and configuration parsing * do not run with root privileges anymore -- Steffen Vogel Tue, 06 Dec 2011 02:37:26 +0100 vzlogger (0.3.1-2) stable; urgency=low * updated version number * fixed forking behavior of init script -- Steffen Vogel Sun, 16 Oct 2011 14:45:32 +0200 vzlogger (0.3.1-1) stable; urgency=low * fixed bug in parsing configuration for sml meters -- Steffen Vogel Sun, 16 Oct 2011 14:31:26 +0200 vzlogger (0.3-2) stable; urgency=low * fixed typo in description * fixed static linking of libsml * added dependency for libsml -- Steffen Vogel Sun, 16 Oct 2011 00:25:27 +0200 vzlogger (0.3-1) stable; urgency=high * Rewrite of meter & channel mapping * Added SML support -- Steffen Vogel Thu, 15 Sep 2011 23:26:31 +0200 vzlogger (0.2-1) stable; urgency=low * Fixed some bugs after porting to armel architecture * Improved init script -- Steffen Vogel Thu, 04 Aug 2011 20:00:25 +0200 vzlogger (0.2) unstable; urgency=low * Initial Release. -- Steffen Vogel Thu, 09 Jun 2011 16:04:25 +0200 vzlogger-0.8.6/debian/clean000066400000000000000000000000131462212027200156030ustar00rootroot00000000000000vzlogger.8 vzlogger-0.8.6/debian/compat000066400000000000000000000000031462212027200160030ustar00rootroot0000000000000012 vzlogger-0.8.6/debian/control000066400000000000000000000021321462212027200162050ustar00rootroot00000000000000Source: vzlogger Section: net Priority: optional Maintainer: Joachim Zobel Build-Depends: debhelper (>= 12), pkgconf, libjson-c-dev, libcurl4-openssl-dev, libmicrohttpd-dev (>= 0.4.6), libsml-dev (>= 1.0), cmake, libsasl2-dev, libssl-dev, libgcrypt-dev, libgnutls28-dev, uuid-dev, libunistring-dev, libgmock-dev, libgtest-dev, pandoc, libmosquitto-dev Standards-Version: 4.6.2 Rules-Requires-Root: no Homepage: http://wiki.volkszaehler.org/software/controller/vzlogger Vcs-Git: https://github.com/volkszaehler/vzlogger.git Vcs-Browser: https://github.com/volkszaehler/vzlogger Package: vzlogger Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends}, adduser Pre-Depends: ${misc:Pre-Depends} Description: program for logging measurements to a volkszaehler.org middleware vzlogger... * is a tool to read and log measurements of a wide variety of smartmeters and sensors to the volkszaehler.org middleware. * can run as a daemon or via Cron. * includes a tiny onboard httpd to serve realtime readings to the AJAX web frontend. * is written in C++. vzlogger-0.8.6/debian/copyright000066400000000000000000000055641462212027200165510ustar00rootroot00000000000000Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Upstream-Name: vzlogger Source: https://github.com/narc-Ontakac2/vzlogger.git Files: * Copyright: Copyright 2011 Steffen Vogel Copyright (C) 2009 by Tobias Mueller Copyright (c) 2011, DAI-Labor, TU-Berlin Copyright 2011 Fraunhofer ITWM Copyright (c) 2015, 2018 Matthias Behr Copyright (c) 2011 - 2024, The volkszaehler.org project License: GPL-3.0-or-later Files: modules/GetGitRevisionDescription.cmake* Copyright: Copyright Iowa State University 2009-2010. License: BSL-1.0 Files: debian/* Copyright: Copyright 2011 Steffen Vogel Copyright 2023 - 2024 Joachim Zobel License: GPL-3.0-or-later License: GPL-3.0-or-later This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. . This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. . You should have received a copy of the GNU General Public License along with this program. If not, see . . On Debian systems, the full text of the GNU General Public License version 3 can be found in the file `/usr/share/common-licenses/GPL-3'. License: BSL-1.0 Boost Software License - Version 1.0 - August 17th, 2003 . Permission is hereby granted, free of charge, to any person or organization obtaining a copy of the software and accompanying documentation covered by this license (the "Software") to use, reproduce, display, distribute, execute, and transmit the Software, and to prepare derivative works of the Software, and to permit third-parties to whom the Software is furnished to do so, all subject to the following: . The copyright notices in the Software and this entire statement, including the above license grant, this restriction and the following disclaimer, must be included in all copies of the Software, in whole or in part, and all derivative works of the Software, unless such copies or derivative works are solely in the form of machine-executable object code generated by a source language processor. . THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. vzlogger-0.8.6/debian/rules000077500000000000000000000032471462212027200156720ustar00rootroot00000000000000#!/usr/bin/make -f # -*- makefile -*- # Sample debian/rules that uses debhelper. # This file was originally written by Joey Hess and Craig Small. # As a special exception, when this file is copied by dh-make into a # dh-make output file, you may use that output file without restriction. # This special exception was added by Craig Small in version 0.37 of dh-make. # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 export DEB_BUILD_MAINT_OPTIONS = hardening=+all DPKG_EXPORT_BUILDFLAGS = 1 include /usr/share/dpkg/buildflags.mk include /usr/share/dpkg/pkg-info.mk # Debian flags invented usage of LTO, which in combination with google test on # Ubuntu 22.04.4 causes the errors supressed below export CXXFLAGS += -Wno-lto-type-mismatch -Wno-odr VERSION1=$(shell echo ${DEB_VERSION_UPSTREAM} | cut -f1 -d.) VERSION2=$(shell echo ${DEB_VERSION_UPSTREAM} | cut -f2 -d.) VERSION3=$(shell echo ${DEB_VERSION_UPSTREAM} | cut -f3 -d.) execute_before_dh_auto_configure: sed -i "s#set(VZLOGGER_MAJOR_VERSION.*)#set(VZLOGGER_MAJOR_VERSION ${VERSION1})#" CMakeLists.txt sed -i "s#set(VZLOGGER_MINOR_VERSION.*)#set(VZLOGGER_MINOR_VERSION ${VERSION2})#" CMakeLists.txt sed -i "s#set(VZLOGGER_SUB_VERSION.*)#set(VZLOGGER_SUB_VERSION ${VERSION3})#" CMakeLists.txt ifneq (,$(filter nocheck,$(DEB_BUILD_OPTIONS))) override_dh_auto_configure: dh_auto_configure -- -DBUILD_TEST=off endif override_dh_installsystemd: # stop the service during install, see man dh_installsystemd dh_installsystemd --no-restart-after-upgrade ifneq (,$(filter nocheck,$(DEB_BUILD_OPTIONS))) override_dh_auto_test: ; endif execute_after_dh_auto_build: pandoc -o vzlogger.8 -s -t man debian/vzlogger.8.md %: dh $@ vzlogger-0.8.6/debian/source/000077500000000000000000000000001462212027200161045ustar00rootroot00000000000000vzlogger-0.8.6/debian/source/format000066400000000000000000000000151462212027200173130ustar00rootroot000000000000003.0 (native) vzlogger-0.8.6/debian/source/lintian-overrides000066400000000000000000000003421462212027200214640ustar00rootroot00000000000000# May be odd, but I don't want to change the (non debian) past odd-historical-debian-changelog-version *0.3.4-rc1* # Having a debian watch file in the native package is easier to maintain debian-watch-file-in-native-package * vzlogger-0.8.6/debian/vzlogger.8.md000066400000000000000000000030301462212027200171270ustar00rootroot00000000000000% VZLOGGER(8) Volkszaehler project | System management commands % Joachim Zobel # NAME vzlogger -- A tool to read and log measurements of a wide variety of smart meters and sensors # SYNOPSIS **vzlogger** [**-c** *conf*] [**-o** *log*] [**-f**] [**-l**] [**-p** *port*] [**-r**] [**-v**] [**-h**] [**-V**] # DESCRIPTION This is the man page for the vzlogger program. It briefly documents the parameters. The main documentation is available online. A list of supported protocols can be obtained with the -h option. **-c, --config** **** : This option sets the configuration file to read from. The default is **/etc/vzlogger.conf**. Note that command line options override configuration file entries. **-o, --log** **** : This options sets the file to log output to. **-f, --foreground** : This prevents detaching from the terminal and lets the program run in the foreground. **-l, --httpd** : This activates a local interface tiny HTTPd which serves live readings. **-p, --httpd-port** : This sets the TCP port the HTTPd is listening on. **-r, --register** : This registers a device. **-v, --verbose** : This enables verbose output. **-h, --help** : This shows the help. **-V, --version** : This shows the version of vzlogger. # COPYRIGHT The vzlogger program is Copyright (C) by Steffen Vogel and others. # SEE ALSO [vzlogger.conf parameters](https://wiki.volkszaehler.org/software/controller/vzlogger/vzlogger_conf_parameter?s[]=vzlogger&s[]=conf) vzlogger-0.8.6/debian/vzlogger.docs000066400000000000000000000000141462212027200173100ustar00rootroot00000000000000README.*.md vzlogger-0.8.6/debian/vzlogger.examples000066400000000000000000000001571462212027200202060ustar00rootroot00000000000000etc/vzlogger.conf.InfluxDB etc/vzlogger.conf.meterOCR etc/vzlogger.conf.meterOMS etc/vzlogger.conf.mySmartGrid vzlogger-0.8.6/debian/vzlogger.init000066400000000000000000000076571462212027200173470ustar00rootroot00000000000000#!/bin/sh ### BEGIN INIT INFO # Provides: vzlogger # Required-Start: $remote_fs # Required-Stop: $remote_fs # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: logging measurements to a volkszaehler.org middelware ### END INIT INFO # Author: Steffen Vogel # PATH should only include /usr/* if it runs after the mountnfs.sh script PATH=/sbin:/usr/sbin:/bin:/usr/bin DESC="smartmetering server" NAME=vzlogger DAEMON=/usr/bin/vzlogger DAEMON_ARGS="-d" # Arguments to run the daemon with #PIDFILE=/var/run/$NAME.pid SCRIPTNAME=/etc/init.d/$NAME USER=_vzlogger GROUP=_vzlogger # Exit if the package is not installed [ -x $DAEMON ] || exit 0 # Read configuration variable file if it is present [ -r /etc/default/$NAME ] && . /etc/default/$NAME # Load the VERBOSE setting and other rcS variables . /lib/init/vars.sh # Define LSB log_* functions. # Depend on lsb-base (>= 3.0-6) to ensure that this file is present. . /lib/lsb/init-functions # # Function that starts the daemon/service # do_start() { # Return # 0 if daemon has been started # 1 if daemon was already running # 2 if daemon could not be started start-stop-daemon --start --chuid $USER --group $GROUP --quiet --exec $DAEMON --test > /dev/null \ || return 1 start-stop-daemon --start --chuid $USER --group $GROUP --quiet --exec $DAEMON -- \ $DAEMON_ARGS \ || return 2 # Add code here, if necessary, that waits for the process to be ready # to handle requests from services started subsequently which depend # on this one. As a last resort, sleep for some time. } # # Function that stops the daemon/service # do_stop() { # Return # 0 if daemon has been stopped # 1 if daemon was already stopped # 2 if daemon could not be stopped # other if a failure occurred start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --name $NAME RETVAL="$?" [ "$RETVAL" = 2 ] && return 2 # Wait for children to finish too if this is a daemon that forks # and if the daemon is only ever run from this initscript. # If the above conditions are not satisfied then add some other code # that waits for the process to drop all resources that could be # needed by services started subsequently. A last resort is to # sleep for some time. start-stop-daemon --stop --quiet --oknodo --retry=0/30/KILL/5 --exec $DAEMON [ "$?" = 2 ] && return 2 return "$RETVAL" } # # Function that sends a SIGHUP to the daemon/service # do_reload() { # # If the daemon can reload its configuration without # restarting (for example, when it is sent a SIGHUP), # then implement that here. # start-stop-daemon --stop --signal 1 --quiet --name $NAME return 0 } case "$1" in start) [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC " "$NAME" do_start case "$?" in 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; esac ;; stop) [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME" do_stop case "$?" in 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; esac ;; status) status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $? ;; #reload|force-reload) # # If do_reload() is not implemented then leave this commented out # and leave 'force-reload' as an alias for 'restart'. # #log_daemon_msg "Reloading $DESC" "$NAME" #do_reload #log_end_msg $? #;; restart|force-reload) # # If the "reload" option is implemented then remove the # 'force-reload' alias # log_daemon_msg "Restarting $DESC" "$NAME" do_stop case "$?" in 0|1) do_start case "$?" in 0) log_end_msg 0 ;; 1) log_end_msg 1 ;; # Old process is still running *) log_end_msg 1 ;; # Failed to start esac ;; *) # Failed to stop log_end_msg 1 ;; esac ;; *) #echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload}" >&2 echo "Usage: $SCRIPTNAME {start|stop|status|restart|force-reload}" >&2 exit 3 ;; esac : vzlogger-0.8.6/debian/vzlogger.install000066400000000000000000000000771462212027200200370ustar00rootroot00000000000000etc/vzlogger.conf etc etc/logrotate.d/vzlogger etc/logrotate.d vzlogger-0.8.6/debian/vzlogger.manpages000066400000000000000000000000131462212027200201520ustar00rootroot00000000000000vzlogger.8 vzlogger-0.8.6/debian/vzlogger.postinst000077500000000000000000000014671462212027200202630ustar00rootroot00000000000000#!/bin/sh -e set -e case "$1" in configure) if id vzlogger > /dev/null 2>&1 \ && dpkg --compare-versions "$2" le-nl 0.8.3 \ && dpkg --compare-versions "$2" ge 0.8.2; then # maintain compatibility with existing native installations usermod -l _vzlogger vzlogger groupmod --new-name _vzlogger vzlogger fi if ! id _vzlogger > /dev/null 2>&1 ; then adduser --quiet --system --no-create-home --home /nonexistent \ --group --disabled-password --shell /bin/false \ _vzlogger usermod -a -G dialout _vzlogger fi touch /var/log/vzlogger.log chown _vzlogger:adm /var/log/vzlogger.log ;; abort-upgrade|abort-remove|abort-deconfigure) ;; *) echo "$0 called with unknown argument \`$1'" >&2 exit 1 ;; esac #DEBHELPER# exit 0 vzlogger-0.8.6/debian/vzlogger.postrm000077500000000000000000000004361462212027200177170ustar00rootroot00000000000000#!/bin/sh -e set -e case "$1" in purge) rm -f /var/log/vzlogger.log* ;; remove|abort-install|abort-upgrade|disappear) ;; upgrade|failed-upgrade) ;; *) echo "$0 called with unknown argument \`$1'" >&2 exit 1 ;; esac #DEBHELPER# exit 0 vzlogger-0.8.6/debian/vzlogger.service000066400000000000000000000004141462212027200200240ustar00rootroot00000000000000[Unit] Description=vzlogger Documentation=man:vzlogger(8) After=network.target ntp.service [Service] ExecStart=/usr/bin/vzlogger -c /etc/vzlogger.conf User=_vzlogger Group=_vzlogger ExecReload= StandardOutput=null PrivateTmp=yes [Install] WantedBy=multi-user.target vzlogger-0.8.6/debian/watch000066400000000000000000000001211462212027200156270ustar00rootroot00000000000000version=4 https://github.com/volkszaehler/vzlogger/tags .*/v?(\d.*)@ARCHIVE_EXT@ vzlogger-0.8.6/etc/000077500000000000000000000000001462212027200141355ustar00rootroot00000000000000vzlogger-0.8.6/etc/logrotate.d/000077500000000000000000000000001462212027200163575ustar00rootroot00000000000000vzlogger-0.8.6/etc/logrotate.d/vzlogger000066400000000000000000000002231462212027200201360ustar00rootroot00000000000000/var/log/vzlogger.log { rotate 1 size=100k copytruncate missingok notifempty create 0664 _vzlogger root } vzlogger-0.8.6/etc/vzlogger.conf000066400000000000000000000260451462212027200166520ustar00rootroot00000000000000/** * vzlogger configuration * * Use properly encoded JSON with javascript comments * * Take a look at the wiki for detailed information: * http://wiki.volkszaehler.org/software/controller/vzlogger#configuration * * For an online configuration editor refer to: * http://volkszaehler.github.io/vzlogger/ */ { // General settings "verbosity": 5, // log verbosity (0=log_alert, 1=log_error, 3=log_warning, 5=log_info, 10=log_debug, 15=log_finest) "log": "/var/log/vzlogger.log", // log file, optional "retry": 30, // http retry delay in seconds // Build-in HTTP server "local": { "enabled": false, // enable local HTTPd for serving live readings "port": 8080, // TCP port for local HTTPd "index": true, // provide index listing of available channels if no UUID was requested "timeout": 30, // timeout for long polling comet requests in seconds (0 disables comet) "buffer": -1 // HTTPd buffer configuration for serving readings, default -1 // >0: number of seconds of readings to serve // <0: number of tuples to server per channel (e.g. -3 will serve 3 tuples) }, // realtime notification settings "push": [ { "url": "http://127.0.0.1:5582" // notification destination, e.g. frontend push-server } ], // mqtt client support (if ENABLE_MQTT set at cmake generation) "mqtt": { "enabled": false, // enable mqtt client. needs host and port as well "host": "test.mosquitto.org", // mqtt server addr "port": 1883, // 1883 for unencrypted, 8883 enc, 8884 enc cert needed, "cafile": "", // optional file with server CA "capath": "", // optional path for server CAs. see mosquitto.conf. Specify only cafile or capath "certfile": "", // optional file for your client certificate (e.g. client.crt) "keyfile": "", // optional path for your client certficate private key (e.g. client.key) "keypass": "", // optional password for your private key "keepalive": 30, // optional keepalive in seconds. "topic": "vzlogger/data", // optional topic dont use $ at start and no / at end "id": "", // optional static id, if not set "vzlogger_" will be used "user": "", // optional user name for the mqtt server "pass": "", // optional password for the mqtt server "retain": false, // optional use retain message flag "rawAndAgg": false, // optional publish raw values even if agg mode is used "qos": 0, // optional quality of service, default is 0 "timestamp": false // optional whether to include a timestamp in the payload }, // Meter configuration "meters": [ { // Example SML meter "enabled": false, // disabled meters will be ignored (default) "allowskip": false, // errors when opening meter may be ignored if enabled "protocol": "sml", // meter protocol, see 'vzlogger -h' for full list "device": "/dev/ttyUSB1", // meter device // "host": "http://my.ddns.net::7331", // uri if meter not locally connected using "aggtime": 10, // aggregate meter readings and send middleware update after seconds "channels": [{ "api": "volkszaehler", // middleware api, default volkszaehler "uuid": "fde8f1d0-c5d0-11e0-856e-f9e4360ced10", "middleware": "http://localhost/middleware.php", "identifier": "power" // OBIS identifier (alias for '1-0:1.7.ff') // see 'vzlogger -h' for available aliases // see 'vzlogger -v20' for available identifiers for attached meters }, { "uuid": "a8da012a-9eb4-49ed-b7f3-38c95142a90c", "middleware": "http://localhost/middleware.php", "identifier": "counter", // OBIS identifier "duplicates": 10 // duplicate handling, default 0 (send duplicate values) // >0: send duplicate values only each seconds // Activate only for abs. counter values (Zaehlerstaende) and not for impulses }, { "uuid": "d5c6db0f-533e-498d-a85a-be972c104b48", "middleware": "http://localhost/middleware.php", "identifier": "1-0:1.8.0" // OBIS identifier }] }, { // Example S0 meter "enabled": false, // disabled meters will be ignored (default) "allowskip": false, // errors when opening meter may be ignored if enabled "protocol": "s0", // meter protocol, see 'vzlogger -h' for full list "device": "/dev/ttyUSB0", // meter device "aggtime": 300, // aggregate meter readings and send middleware update after seconds "aggfixedinterval": true, // round timestamps to nearest before sending to middleware "channel": { "identifier": "Impulse", // s0 meter knows "Impulse" and "Power" "uuid": "d495a390-f747-11e0-b3ca-f7890e45c7b2", "middleware": "http://localhost/middleware.php", "aggmode": "SUM" // aggregation mode: aggregate meter readings during interval // "SUM": add readings (use for s0 impulses) // "MAX": maximum value (use for meters sending absolute readings) // "AVG": average value (use for meters sending current usage) } }, { // Example D0 meter "enabled": false, // disabled meters will be ignored (default) "allowskip": false, // errors when opening meter may be ignored if enabled "protocol": "d0", // meter protocol, see 'vzlogger -h' for full list "device": "/dev/ttyUSB0", // meter device "dump_file": "/var/log/d0.txt", // detailed log file for all received/transmitted data (optional) "parity": "7E1", // Serial parity, 7E1 or 8N1 "baudrate": 9600, // Serial baud rate, typically 9600 or 300 // optional D0 interface settings // "pullseq": "2F3F210D0A", // Pull sequence in 'hex' // "ackseq": "063030300d0a", // optional (default: keine Antwortsequenz auf Zaehlerantwort) kann entweder feste hex-Sequenz sein (z.B. 063035300d0a für mode C mit 9600bd oder 063030300d0a = 300bd) oder kann auf "auto" gesetzt werden, damit die Sequenz autom. berechnet wird und autom. auf die max. Baudrate umgeschaltet wird (baudrate_read wird dann ignoriert) // "read_timeout": 10, // optional read timeout, default 10s. Data reading is considered finished if no state change after that timeout // "baudrate_change_delay": 400, // optional, default none. Delay value in ms after ACKSEQ send before baudrate change // "baudrate_read": 300, // Baudratenumschaltung auf gewünschte Baudrate, abhängig von Zählerantwort // "aggtime": 20, // aggregate meter readings and send middleware update after seconds "interval": 0, // Wartezeit in Sekunden bis neue Werte in die middleware übertragen werden "channel": { "uuid": "aaaaaaaa-bbbb-cccc-dddd-eeeeeeee", "middleware": "http://localhost/middleware.php", "identifier": "1-0:1.8.1" // OBIS identifier // "aggmode": "MAX" // aggregation mode: aggregate meter readings during interval } }, // examples for non-device protocols { "enabled": false, // disabled meters will be ignored "allowskip": false, // errors when opening meter may be ignored if enabled "protocol": "random", "interval": 2, "max": 40.0, // has to be double! "min": -5.0, // has to be double! "channel": { "uuid": "bac2e840-f72c-11e0-bedf-3f850c1e5a66", "middleware": "http://localhost/middleware.php" } }, { "enabled": false, // disabled meters will be ignored "allowskip": false, // errors when opening meter may be ignored if enabled "protocol": "file", "path": "/proc/loadavg", // "format": "$i $v $t", // a format string for parsing complex logfiles // arbitrary text and whitespaces are allowed, see 'scanf()' // at least $v has to be used // $i => identifier, $v => value, $t => timestamp "rewind": true, // reset file pointer each interval to the beginning of the file "interval": 2 // if ommitted, we will try to listen on changes with inotify }, { "enabled": false, // disabled meters will be ignored "allowskip": false, // if enabled, errors when opening meter will lead to meter being ignored "protocol": "exec", "command": "python /path/to/yourscript.py", // is the command line as you'll type it in the shell - remember to test your command from the root directory // "format": "$i $v $t", // a format string for parsing complex logfiles // arbitrary text and whitespaces are allowed, see 'scanf()' // at least $v has to be used // $i => identifier, $v => value, $t => timestamp "interval": 2 }, // examples for Flukso-based sensors { "enabled": false, // disabled meters will be ignored "allowskip": false, // errors when opening meter may be ignored if enabled "protocol": "fluksov2", "fifo": "/var/spid/delta/out", "channel": { "uuid": "3b4da450-42a8-11e1-8b8d-c526d853edec", "middleware": "http://localhost/middleware.php", "identifier": "sensor0/power" // or "sensor2/consumption" } }, // example for 1wire temp sensors { "enabled": false, "allowskip": true, "protocol": "w1therm" } ] } vzlogger-0.8.6/etc/vzlogger.conf.InfluxDB000066400000000000000000000051661462212027200203250ustar00rootroot00000000000000/** * vzlogger configuration example for InfluxDB * * use proper encoded JSON with javascript comments * * take a look at the wiki for detailed information: * http://wiki.volkszaehler.org/software/controller/vzlogger#configuration */ { // ... for general vzlogger settings see vzlogger.conf "meters": [ // examples for InfluxDB as storage { // See vzlogger.conf for complete meter configuration options "enabled": true, // disabled meters will be ignored "protocol": "sml", // see 'vzlogger -h' for list of available protocols "device": "/dev/ttyAMA0", "channels": [{ "api": "influxdb", // use the InfluxDB api "uuid": "01234567-9abc-def0-1234-56789abcdefe", // use the uuid command to generate this "identifier" : "1-0:16.7.0", // OBIS code for "power" "host": "127.0.0.1:8086", // This assumes that InfluxDB is running on localhost //"database": "vzlogger", // Optional: make sure this database exists in InfluxDB //"measurement_name": "vz_measurement", // Optional: It is recommended that all your meters have the same InfluxDB measurement name //"tags": "foo=bar,example=42", // Optional: Additional tags to append when inserting data //"username": "example", // Optional: When InfluxDB Auth is enabled you need to set the correct user and password //"password": "secure", //"token": "login token", // Optional: Use login token instead of username. Remove username from config to use token. //"organization": "example.com", // Optional: Configure organization to use /api/v2/write?org=xxx&bucket=database entry point //"max_batch_inserts": 4500, // Optional: Max number of measurements per request. No need to change this //"max_buffer_size": 450000, // Optional: Max number of measurements to be cached when InfluxDB is not available //"timeout": 30, // Optional: Time in seconds after which requests to InfluxDB time out //"send_uuid": false, // Optional: Disables the sending of the UUID to the InfluxDB server //"ssl_verifypeer": false, // Optional: Disables the certificate verification for https connections }] }, ] } vzlogger-0.8.6/etc/vzlogger.conf.meterOCR000066400000000000000000000066611462212027200203330ustar00rootroot00000000000000/** * vzlogger configuration example for meterOCR * * use proper encoded JSON with javascript comments * * take a look at the wiki for detailed information: * http://wiki.volkszaehler.org/software/controller/vzlogger#configuration */ { // ... for general vzlogger settings see vzlogger.conf "meters": [ // example for OCR (image processing/recognizing) "meter" { "enabled" : false, "allowskip": true, "protocol": "ocr", "impulses": 10000, // (optional, default 0 = no impules but abs. values), >0 impulses per unit // "file": "/tmp/image.png", // name of file to be processed "v4l2_dev": "/dev/video0", // name of the v4l2 device (optional, if provided file is ignored) "generate_debug_image": false, // (optional, default false) set true to help in calibrating and debugging. generates one png named _debug.png "rotate": -2.0, // (optional, default 0.0) angle in deg for rotation. pos = clockwise, neg = counterclockwise "autofix" : {"range": 20, "x":42, "y":43}, // (optional default none) "auto fix"/move the pic based on some edge located at (x, y) within +/-"range" pixs "recognizer": [ // { "type": "tesseract", // (optional default tesseract). // "gamma": 1.0, // (optional default 1.0) gamma correction to be applied to the image // "gamma_min": 50, // (optional default 50) gamma TRC min value (see leptonica pixGammaTRC) // "gamma_max": 120, // (optional default 120) gamma TRC max value // "boundingboxes": [{ // list of bounding boxes for detection, at least one must be defined // "identifier": "1-0:1.8.1", // this reading will be given the Obis-like id (can actually be any string). Multiple boxes can contribute to the same id. E.g. when using scaler one box can be for a single digit // "confidence_id": "1-0:0.0.1", // (optional default none) name for identifier returning the min. confidence (0-100 (best)) per processed image. If multiple boundingboxes with same identifier are used this can just be set once (i.e. is assigned to the identifier)! // "scaler" : 0, // (optional, default 0) 10^scaler, e.g. 0 = *1, -1 = *0,1, -2 = *0,01, 2 = *100 // "digit" : false, // (optional default false) a single digit is expected (thus the recognized value can only be within -9..9) // "box" : { "x1": -1, "y1": -1, "x2": -1, "y2": -1 }, // (optional default full image) coordinates for this box as {x1=left, y1=top, x2=right (excl), y2=bottom (excl)} // }] // }, { "type": "needle", "kernelColorString": "2 -2 -2 0 0 0 0 0 0", // (optional default red channel only) Color conversion 3x3 matrix to be applied before detecting (first line channel red). Needles need to be color red. "boundingboxes": [{ "identifier": "1-0:1.8.1", "confidence_id": "1-0:0.0.2", "scaler": -1, "digit": true, "circle": {"cx": 100, "cy": 100, // center pos (x/y) of needle "cr": 50, // radius where to scan for the needle "offset": 0.0 // optional (default 0) offset of this needle. E.g. if at 5.0 (2nd digit needle at zero) but this needle show ~4.6 enter offset 0.4. } }] } ], "channel": { // example channel. multiple channels supported as well "uuid": "aaaaaaaa-bbbb-cccc-dddd-eeeeeeee", "middleware": "http://127.0.0.1/middleware.php", "identifier": "1-0:1.8.1" // alias for '1-0:1.8.1', see 'vzlogger -h' for list of available aliases } } ] } vzlogger-0.8.6/etc/vzlogger.conf.meterOMS000066400000000000000000000020561462212027200203400ustar00rootroot00000000000000/** * vzlogger configuration example for meterOMS * * use proper encoded JSON with javascript comments * * take a look at the wiki for detailed information: * http://wiki.volkszaehler.org/software/controller/vzlogger#configuration */ { // ... for general vzlogger settings see vzlogger.conf "meters": [ // example for OMS (M-Bus based) meter { "enabled" : true, "allowskip": false, "protocol": "oms", "device": "/dev/ttyUSB0", "baudrate": 9600, // optional default 9600 "key": "0102030405060708090a0b0c0d0e0f10", // AES key in hex without spaces. Needs to be exactly 32 chars "mbus_debug": false, // optional provide additional debug output from libmbus on the console/stderr/stdout "channel": { // example channel. multiple channels supported as well "uuid": "aaaaaaaa-bbbb-cccc-dddd-eeeeeeee", "middleware": "http://127.0.0.1/middleware.php", "identifier": "1.7.0" // currently 1.7.0, 1.8.0, 2.7.0, 2.8.0 supported } } ] } vzlogger-0.8.6/etc/vzlogger.conf.mySmartGrid000066400000000000000000000065571462212027200211210ustar00rootroot00000000000000/** * vzlogger configuration example for mySmartGrid * * use proper encoded JSON with javascript comments * * take a look at the wiki for detailed information: * http://wiki.volkszaehler.org/software/controller/vzlogger#configuration */ { // ... for general vzlogger settings see vzlogger.conf "meters": [ // examples for MySmartGrid as middleware { "enabled": false, // disabled meters will be ignored "allowskip": false, // if enabled, errors when opening meter will lead to meter being ignored "protocol": "d0", // see 'vzlogger -h' for list of available protocols "device": "/dev/ttyUSB2", "interval": 2, "resolution": 2000, "channels": [{ "api": "mysmartgrid", // use MySmartgrid as middleware api "type": "sensor", "uuid": "01234567-9abc-def0-1234-56789abcdefe", "secretKey": "0123456789abcdef0123456789abcdef", "interval": 300, "middleware": "https://api.mysmartgrid.de:8443", // identifier for measurement: 1-0:1.8.0 "identifier": "1-0:1.8.0", // see 'vzlogger -v20' for an output with all available identifiers/OBIS ids "scaler": 1000 // d0 counter is in kWh, so scaling is 1000 }] }, { "enabled": false, // disabled meters will be ignored "allowskip": false, // if enabled, errors when opening meter will lead to meter being ignored "protocol": "sml", // see 'vzlogger -h' for list of available protocols "device": "/dev/ttyUSB0", "interval": 2, "resolution": 2000, "channels": [{ "api": "mysmartgrid", // use MySmartgrid as middleware api "type": "sensor", "uuid": "01234567-9abc-def0-1234-56789abcdefe", "secretKey": "0123456789abcdef0123456789abcdef", "interval": 300, "middleware": "https://api.mysmartgrid.de:8443", // identifier for measurement: 1-0:1.8.0 "identifier": "1-0:1.8.0", // see 'vzlogger -v20' for an output with all available identifiers/OBIS ids "scaler": 1 // sml counter is in Wh, so scaling is 1 }] }, { "enabled": false, // disabled meters will be ignored "allowskip": false, // if enabled, errors when opening meter will lead to meter being ignored "protocol": "s0", // see 'vzlogger -h' for list of available protocols "device": "/dev/ttyUSB1", "interval": 2, "resolution": 2000, "channels": [{ "api": "mysmartgrid", // use MySmartgrid as middleware api "type": "sensor", "uuid": "01234567-9abc-def0-1234-56789abcdefe", "secretKey": "0123456789abcdef0123456789abcdef", "interval": 300, "middleware": "https://api.mysmartgrid.de:8443", // identifier for measurement: 1-0:1.8.0 "identifier": "counter", "scaler": "1-0" // s0 counter is in Wh }] } ] } vzlogger-0.8.6/etc/vzlogger.service000066400000000000000000000003241462212027200173550ustar00rootroot00000000000000[Unit] Description=vzlogger After=syslog.target network.target ntp.service [Service] ExecStart=/usr/local/bin/vzlogger -c /etc/vzlogger.conf ExecReload= StandardOutput=null [Install] WantedBy=multi-user.target vzlogger-0.8.6/etc/vzlogger_generic.schema.json000066400000000000000000001276171462212027200216400ustar00rootroot00000000000000{ "$schema": "http://json-schema.org/draft-04/schema#", "definitions": { "pushdataentry": { "type": "object", "title": "pushdataentry", "properties": { "url": { "type": "string", "description": "full URL of the middleware to push data to e.g. http://127.0.0.1/push/data.json" } }, "required": ["url"] }, "local": { "type": "object", "properties": { "enabled": { "id": "/local/enabled", "type": "boolean", "description": "should we start the local HTTPd for serving live readings?" }, "port": { "id": "/local/port", "type": "integer", "default": 8080, "description": "the TCP port for the local HTTPd" }, "index": { "id": "/local/index", "type": "boolean", "description": "should we provide a index listing of available channels if no UUID was requested?" }, "timeout": { "id": "/local/timeout", "type": "integer" }, "buffer": { "id": "/local/buffer", "type": "integer" } }, "required": ["enabled"] }, "channelNULL": { "type": "object", "title": "no channel, just local-httpd", "properties": { "api": { "type": "string", "enum": ["null"], "default": "null", "description": "middleware api to be used." }, "uuid": { "type": "string", "description": "uuid of this channel for index:false ", "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" }, "identifier": { "type": "string", "description": "identifier of this channel from the meter. E.g. 1-0:1.8.0 (for sml) or Impulse (for s0)" } }, "required": ["api", "identifier"] }, "channelVZ": { "type": "object", "title": "channel for volkszaehler", "properties": { "api": { "type": "string", "enum": ["volkszaehler"], "default": "volkszaehler", "description": "middleware/api/database to be used." }, "uuid": { "type": "string", "description": "uuid of this channel towards the middleware", "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" }, "identifier": { "type": "string", "description": "identifier of this channel from the meter. E.g. 1-0:1.8.0 (for sml) or Impulse (for s0)" }, "middleware": { "type": "string", "default": "http://localhost/middleware.php", "description": "path/url to the api/middleware" }, "aggmode": { "type": "string", "enum": ["avg", "max", "sum", "none"], "description": "AVeraGe for power (W), MAXimum for meter (Wh), SUMmary for counter (S0)", "default": "none" }, "duplicates": { "type": "integer", "minimum": 0, "default": 0, "description": "default 0 (send duplicate values), >0 = send duplicate values only each seconds. Activate only for abs. counter values (Zaehlerstaende) and not for impulses!" } }, "required": ["api", "uuid", "identifier", "middleware", "aggmode", "duplicates"] }, "channelmySmartGrid": { "type": "object", "title": "channel for mySmartGrid", "properties": { "api": { "type": "string", "enum": ["mysmartgrid"], "default": "volkszaehler", "description": "middleware/api/database to be used. Defaults to volkszaehler.org" }, "uuid": { "type": "string", "description": "uuid of this channel towards the middleware", "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" }, "identifier": { "type": "string", "description": "identifier of this channel from the meter. E.g. 1-0:1.8.0 (for sml) or Impulse (for s0)" }, "middleware": { "type": "string", "default": "https://api.mysmartgrid.de:8443", "description": "path/url to the api/middleware" }, "secretKey": { "type": "string", "description": "secret key to use to talk to MySmartGrid api." }, "interval": { "type": "integer", "default": 300, "description": "time between 2 logtuples" }, "type": { "type": "string", "enum": ["device", "sensor"], "default": "device", "description": "type of connected meter." }, "scaler": { "type": "integer", "default": 1, "description": "scaling factor to use." }, "aggmode": { "type": "string", "enum": ["avg", "max", "sum", "none"], "description": "AVeraGe for power (W), MAXimum for meter (Wh), SUMmary for counter (S0)", "default": "none" } }, "required": ["api", "uuid", "identifier", "middleware", "type", "scaler", "duplicates"] }, "channelInFluxDB": { "type": "object", "title": "channel for InFluxDB", "properties": { "api": { "type": "string", "enum": ["influxdb"], "default": "influxdb", "description": "middleware/api/database to be used." }, "uuid": { "type": "string", "description": "uuid of this channel towards the middleware", "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$" }, "identifier": { "type": "string", "description": "identifier of this channel from the meter. E.g. 1-0:1.8.0 (for sml) or Impulse (for s0)" }, "host": { "type": "string", "default": "http://localhost:8086", "description": "path/url to the database" }, "database": { "type": "string", "description": "i.e. vzlogger, make sure this database exists in InfluxDB" }, "measurement_name": { "type": "string", "description": "i.e. vz_measurement, it is recommended that all your meters have the same InfluxDB measurement name" }, "tags": { "type": "string", "description": "Additional tags to append when inserting data. E.g. 'meter=main,location=home'" }, "username": { "type": "string", "description": "When InfluxDB Auth is enabled you need to set the correct user and password" }, "password": { "type": "string", "description": "When InfluxDB Auth is enabled you need to set the correct user and password" }, "max_batch_inserts": { "type": "integer", "default": 4500, "description": "Max number of measurements per request. No need to change this" }, "max_buffer_size": { "type": "integer", "default": 450000, "description": "Max number of measurements to be cached when InfluxDB is not available" }, "timeout": { "type": "integer", "default": 30, "description": "Time in seconds after which requests to InfluxDB time out" }, "aggmode": { "type": "string", "enum": ["avg", "max", "sum", "none"], "description": "AVeraGe for power (W), MAXimum for meter (Wh), SUMmary for counter (S0)", "default": "none" }, "duplicates": { "type": "integer", "minimum": 0, "default": 0, "description": "default 0 (send duplicate values), >0 = send duplicate values only each seconds. Activate only for abs. counter values (Zaehlerstaende) and not for impulses!" } }, "required": ["api", "uuid", "identifier", "host"] }, "meter": { "type": "object", "title": "meter", "properties": { "enabled": { "type": "boolean", "description": "enable or disable this meter. Disabled meter will be ignored.", "default": false }, "allowskip": { "type": "boolean", "description": "if enabled, errors when opening meter will lead to meter being ignored", "default": false }, "interval": { "type": "integer", "description": "delay in secs between queries to the meter", "default": -1 }, "aggtime": { "type": "integer", "description": "aggregate all signals and give one update to middleware every seconds", "default": -1 }, "aggfixedinterval": { "type": "boolean", "description": "round all timestamps to middleware to nearest aggtime", "default": false }, "channels": { "$ref": "#/definitions/channels" } }, "required": ["enabled"] }, "meterInvalid": { "title": "invalid config for a meter. Choose any of the supported ones.", "allOf": [{ "$ref": "#/definitions/meter" }, { "properties": { "protocol": { "type": "string", "enum": ["invalid"] } } }] }, "meterS0": { "title": "S0 based meter", "allOf": [{ "$ref": "#/definitions/meter" }, { "properties": { "protocol": { "type": "string", "enum": ["s0"], "default": "s0" }, "device": { "type": "string", "description": "UART device the meter is connected to. E.g. /dev/ttyUSB0" }, "gpio": { "type": "integer", "default": -1, "description": "Number of GPIO port to be used. If this is set >-1 device will be ignored." }, "mmap": { "type": "string", "default": "", "description": "For gpio based devices and high frequency signals (>5-10kHz on a rpi2) memory mapped gpio can be used. Currently only supported on Raspberry-Pi 1 or 2. Leads to a constant but high CPU load depending on nonblocking_delay value. MMAPed GPIO pins need to be configured manually as input pins.", "enum": ["", "rpi1", "rpi2"] }, "gpio_dir": { "type": "integer", "default": -1, "description": "Number of GPIO port to be used as directional pin. If this pin is used and active Impulses_neg instead of Impulses is returned. Keep to -1 if unsure about the purpose." }, "configureGPIO": { "type": "boolean", "default": true, "description": "If true then vzlogger will export, configure,... the GPIO port. Needs proper access rights to /sys/class/gpio/." }, "resolution": { "type": "integer", "default": 1000, "description": "number of impulses per kWh" }, "send_zero": { "type": "boolean", "default": false, "description": "If active/true send data once a second even if no impulses have been received. Use aggregation is this case to reduce frequency." }, "debounce_delay": { "type": "integer", "default": 30, "description": "Delay in ms until the next edge is detected" }, "nonblocking_delay": { "type": "integer", "default": 100000, "description": "Delay in ns for polling/non-blocking interface. On an rpi2 e.g. 5000 can be used to detect up to 30kHz signals with mmap active." } }, "required": ["protocol"] }] }, "meterD0dev": { "title": "D0 based meter connected by device", "allOf": [{ "$ref": "#/definitions/meter" }, { "properties": { "protocol": { "type": "string", "enum": ["d0"], "default": "d0" }, "device": { "type": "string", "description": "device the meter is connected to. E.g. /dev/ttyUSB0", "default": "/dev/lesekopf0", "pattern": "^/dev/[^/]+(/[^/]+)*$" }, "dump_file": { "type": "string", "description": "path/filename of the file for the serial dump" }, "pullseq": { "type": "string", "description": "sequence in hex to send to the meter before each read call. E.g. 2F3F210D0A" }, "ackseq": { "type": "string", "description": "Reply sequence towards the meter. Should indicate the baud rate wanted. Will be send with initial baudrate. E.g. 063030300d0a for 300 baud. Use 'auto' to let vzlogger determine.", "default": "auto" }, "baudrate": { "type": "integer", "enum": [50, 75, 110, 134, 150, 200, 300, 600, 1200, 1800, 2400, 4800, 9600, 19200, 38400, 57600, 115200, 230400], "default": 300, "description": "Baudrate to be used to for initial communication with the meter." }, "baudrate_read": { "type": "integer", "enum": [50, 75, 110, 134, 150, 200, 300, 600, 1200, 1800, 2400, 4800, 9600, 19200, 38400, 57600, 115200, 230400], "default": 300, "description": "Baudrate to be used after initial handshake (pullseq/answer/ackseq). Has to fit to ackseq. Will be determined automatically if ackseq 'auto' is used." }, "parity": { "type": "string", "enum": ["8n1", "7n1", "7e1", "7o1"], "default": "7e1", "description": "parity used for serial communication" }, "wait_sync": { "type": "string", "enum": ["end", "off"], "default": "off", "description": "Wait once for the sync pattern '!'. Intended for meters that start sending data automatically without pullseq." }, "read_timeout": { "type": "integer", "default": 10, "description": "Read timeout in secs. Data readout is considered finished if no state change after that timeout." }, "baudrate_change_delay": { "type": "integer", "default": 0, "description": "Delay in ms to apply before changing the baudrate. Defaults to 0 where tcdrain is used instead of a timeout." } }, "required": ["protocol", "device", "baudrate", "parity"] }] }, "meterD0host": { "title": "D0 based meter connected by host", "allOf": [{ "$ref": "#/definitions/meter" }, { "properties": { "protocol": { "type": "string", "enum": ["d0"], "default": "d0" }, "host": { "type": "string", "description": "hostname or ip address of the meter" }, "dump_file": { "type": "string", "description": "path/filename of the file for the serial dump" }, "pullseq": { "type": "string", "description": "sequence in hex to send to the meter before each read call. E.g. 2F3F210D0A" }, "ackseq": { "type": "string", "description": "Reply sequence towards the meter. Should indicate the baud rate wanted. Will be send with initial baudrate. E.g. 063030300d0a for 300 baud. Use 'auto' to let vzlogger determine.", "default": "auto" }, "baudrate": { "type": "integer", "enum": [50, 75, 110, 134, 150, 200, 300, 600, 1200, 1800, 2400, 4800, 9600, 19200, 38400, 57600, 115200, 230400], "default": 300, "description": "Baudrate to be used to for initial communication with the meter." }, "baudrate_read": { "type": "integer", "enum": [50, 75, 110, 134, 150, 200, 300, 600, 1200, 1800, 2400, 4800, 9600, 19200, 38400, 57600, 115200, 230400], "default": 300, "description": "Baudrate to be used after initial handshake (pullseq/answer/ackseq). Has to fit to ackseq. Will be determined automatically if ackseq 'auto' is used." }, "parity": { "type": "string", "enum": ["8n1", "7n1", "7e1", "7o1"], "default": "7e1", "description": "parity used for serial communication" }, "wait_sync": { "type": "string", "enum": ["end", "off"], "default": "off", "description": "Wait once for the sync pattern '!'. Intended for meters that start sending data automatically without pullseq." }, "read_timeout": { "type": "integer", "default": 10, "description": "Read timeout in secs. Data readout is considered finished if no state change after that timeout." }, "baudrate_change_delay": { "type": "integer", "default": 0, "description": "Delay in ms to apply before changing the baudrate. Defaults to 0 where tcdrain is used instead of a timeout." } }, "required": ["protocol", "host", "baudrate", "parity"] }] }, "meterSMLdev": { "title": "SML based meter connected by device", "allOf": [{ "$ref": "#/definitions/meter" }, { "properties": { "protocol": { "type": "string", "enum": ["sml"], "default": "sml" }, "device": { "type": "string", "description": "device the meter is connected to. E.g. /dev/ttyUSB0", "default": "/dev/lesekopf0", "pattern": "^/dev/[^/]+(/[^/]+)*$" }, "pullseq": { "type": "string", "description": "sequence in hex to send to the meter before each read call" }, "baudrate": { "type": "integer", "enum": [50, 75, 110, 134, 150, 200, 300, 600, 1200, 1800, 2400, 4800, 9600, 19200, 38400, 57600, 115200, 230400], "default": 9600, "description": "baudrate for serial communication" }, "parity": { "type": "string", "enum": ["8n1", "7n1", "7e1", "7o1"], "default": "8n1", "description": "parity used for serial communication" }, "use_local_time": { "type": "boolean", "default": false, "description": "use the local time for reading timestamp?" } }, "required": ["protocol", "device", "baudrate", "parity"] } ] }, "meterSMLhost": { "title": "SML based meter connected by host", "allOf": [{ "$ref": "#/definitions/meter" }, { "properties": { "protocol": { "type": "string", "enum": ["sml"], "default": "sml" }, "host": { "type": "string", "description": "hostname or ip address of the meter" }, "pullseq": { "type": "string", "description": "sequence in hex to send to the meter before each read call" }, "baudrate": { "type": "integer", "enum": [50, 75, 110, 134, 150, 200, 300, 600, 1200, 1800, 2400, 4800, 9600, 19200, 38400, 57600, 115200, 230400], "default": 9600, "description": "baudrate for serial communication" }, "parity": { "type": "string", "enum": ["8n1", "7n1", "7e1", "7o1"], "default": "8n1", "description": "parity used for serial communication" }, "use_local_time": { "type": "boolean", "default": false, "description": "use the local time for reading timestamp?" } }, "required": ["protocol", "host", "baudrate", "parity"] } ] }, "meterRandom": { "title": "example meter returning random values", "allOf": [{ "$ref": "#/definitions/meter" }, { "properties": { "protocol": { "type": "string", "enum": ["random"], "default": "random" }, "min": { "type": "number", "description": "minimum value (floating point) that will be returned. E.g. 0.0" }, "max": { "type": "number", "description": "maximum value (floating point) that will be returned. E.g. 10.0" } }, "required": ["protocol", "min", "max"] } ] }, "meterFile": { "title": "meter extracting data from a given file", "allOf": [{ "$ref": "#/definitions/meter" }, { "properties": { "protocol": { "type": "string", "enum": ["file"], "default": "file" }, "path": { "type": "string", "description": "file incl. path to be used for data extraction" }, "format": { "type": "string", "description": "optional format string. Supports $v for value, $i for identifier and $t for timestamp. E.g. $i:$v. If empty just a value is read from each line of the file." }, "rewind": { "type": "boolean", "description": "rewind the file handle at each read?", "default": false } }, "required": ["path", "protocol"] } ] }, "meterExec": { "title": "meter extracting data from the output of a shell command/executable", "allOf": [{ "$ref": "#/definitions/meter" }, { "properties": { "protocol": { "type": "string", "enum": ["exec"], "default": "exec" }, "command": { "type": "string", "description": "Command to be executed. Only possible if running as non root. Output will be parsed." }, "format": { "type": "string", "description": "optional format string. Supports $v for value, $i for identifier and $t for timestamp. E.g. $i:$v. If empty just a value is read from each line of the file." } }, "required": ["command", "protocol"] } ] }, "meterFluksoV2": { "title": "fluksov2 meter", "allOf": [{ "$ref": "#/definitions/meter" }, { "properties": { "protocol": { "type": "string", "enum": ["fluksov2"], "default": "fluksov2" }, "fifo": { "type": "string", "description": "fifo to be used.", "default": "/var/run/spid/delta/out" } }, "required": ["fifo", "protocol"] } ] }, "meterW1therm": { "title": "w1-therm / 1wire temperature sensors", "allOf": [{ "$ref": "#/definitions/meter" }, { "properties": { "protocol": { "type": "string", "enum": ["w1therm"], "default": "w1therm" } }, "required": ["protocol"] } ] }, "meterOMS": { "title": "OMS / OMS (M-Bus) based devices", "allOf": [{ "$ref": "#/definitions/meter" }, { "properties": { "protocol": { "type": "string", "enum": ["oms"], "default": "oms" }, "device": { "type": "string", "description": "serial device the meter is connected to. E.g. /dev/ttyUSB0", "default": "/dev/ttyUSB0", "pattern": "^/dev/[^/]+(/[^/]+)*$" }, "baudrate": { "type": "number", "default": 9600, "description": "Baudrate to use. Default to 9600." }, "key": { "type": "string", "description": "AES key for the device in hex. Needs to be exactly 32 characters. E.g. 0102030405060708090a0b0c0d0e0f10" }, "mbus_debug": { "type": "boolean", "default": false, "description": "provide some more debug output on console by calling some libmbus debug functions" }, "use_local_time": { "type": "boolean", "default": false, "description": "use the local time for reading timestamp?" } }, "required": ["protocol", "device", "key"] } ] }, "meterOCRBB": { "type": "object", "properties": { "identifier": { "type": "string", "description": "id (obis-like) for this reading" }, "scaler": { "type": "integer", "default": 0, "description": "Scaling factor by 10^. E.g. 0 = *1, -1 = *0.1, 2 = *100" }, "digit": { "type": "boolean", "default": false, "description": "a single digit is expected (thus the recognized value can only be within -9..9)" } } }, "meterOCRBBInvalid": { "title": "invalid bounding-box. Choose any of the supported ones.", "allOf": [{ "$ref": "#/definitions/meterOCRBB" }, { "properties": { "type": { "type": "string", "enum": ["invalid"] } } }] }, "meterOCRBBCircle": { "title": "bounding-box with a circle", "allOf": [{ "$ref": "#/definitions/meterOCRBB" }, { "properties": { "type": { "type": "string", "enum": ["circle"], "default": "circle" }, "circle": { "type": "object", "properties": { "cx": { "type": "integer", "description": "x coordinate of the center of the circle (top-left corner is (0,0))" }, "cy": { "type": "integer", "description": "y coordinate of the center of the circle" }, "cr": { "type": "integer", "default": 10, "description": "radius of the circle. 10 pixel minimum." }, "offset": { "type": "number", "default": 0.0, "description": "offset of this needle. E.g. if at 5.0 (2nd digit needle at zero) but this needle show ~4.6 enter offset 0.4." } } } }, "required": ["type"] }] }, "meterOCRBBBox": { "title": "bounding-box with a rectangle", "allOf": [{ "$ref": "#/definitions/meterOCRBB" }, { "properties": { "type": { "type": "string", "enum": ["box"], "default": "box" }, "box": { "type": "object", "properties": { "x1": { "type": "integer", "description": "left coordinate of the rectangle" }, "y1": { "type": "integer", "description": "top coordinate of the rectangle" }, "x2": { "type": "integer", "description": "right coordinate of the rectangle" }, "y2": { "type": "integer", "description": "bottom coordinate of the rectangle" } } } }, "required": ["type"] }] }, "meterOCRRecognizer": { "type": "object", "properties": { "boundingboxes": { "oneOf": [{ "$ref": "#/definitions/meterOCRBBInvalid" }, { "$ref": "#/definitions/meterOCRBBCircle" }, { "$ref": "#/definitions/meterOCRBBBox" }] } } }, "meterOCRRecognizerInvalid": { "title": "invalid recognizer. Choose any of the supported ones.", "allOf": [{ "$ref": "#/definitions/meterOCRRecognizer" }, { "properties": { "type": { "type": "string", "enum": ["invalid"] } } }] }, "meterOCRRecognizerNeedle": { "title": "needle type recognizer", "allOf": [{ "$ref": "#/definitions/meterOCRRecognizer" }, { "properties": { "type": { "type": "string", "enum": ["needle"], "default": "needle" }, "kernelColorString": { "type": "string", "description": "Color conversion 3x3 matrix. Default red channel only (2 -1 -1 0 0 0 0 0 0). First line channel red. Needles are detected for red color after matrix application. See leptonica:pixMultMatrixColor" } }, "required": ["type"] }] }, "meterOCRRecognizerBinary": { "title": "binary (impulses) recognizer", "allOf": [{ "$ref": "#/definitions/meterOCRRecognizer" }, { "properties": { "type": { "type": "string", "enum": ["binary"], "default": "binary" }, "kernelColorString": { "type": "string", "description": "Color conversion 3x3 matrix. Default red channel only (2 -1 -1 0 0 0 0 0 0). First line channel red. Rectangle/pixes are detected for red color after matrix application. See leptonica:pixMultMatrixColor" } }, "required": ["type"] }] }, "meterOCR": { "title": "meter extracting data from images (meterOCR)", "allOf": [{ "$ref": "#/definitions/meter" }, { "properties": { "protocol": { "type": "string", "enum": ["ocr"], "default": "ocr" }, "impulses": { "type": "integer", "default": 0, "description": "0 = report absolute values, >0 = report given impulses per unit" }, "file": { "type": "string", "default": "/mnt/ramdisk/image.png", "description": "filename of the image to be processed (or use v4l2_dev)" }, "v4l2_dev": { "type": "string", "description": "v4l2 device name (e.g. /dev/video0). Keep empty if file based image should be used. Has preference over file." }, "generate_debug_image": { "type": "boolean", "default": false, "description": "generate debug images to ease configuration. Will be created in /run/vzlogger_debug.jpg for v4l2 or as _debug.jpg if file based detection is used." }, "rotate": { "type": "number", "default": 0.0, "description": "angle in degree for rotation of the image. Positive angle turn clockwise." }, "recognizer": { "type": "array", "items": { "oneOf": [{ "$ref": "#/definitions/meterOCRRecognizerInvalid" }, { "$ref": "#/definitions/meterOCRRecognizerNeedle" }, { "$ref": "#/definitions/meterOCRRecognizerBinary" }] } } }, "required": ["protocol"] }] }, "channels": { "type": "array", "items": { "oneOf": [{ "$ref": "#/definitions/channelNULL" },{ "$ref": "#/definitions/channelVZ" },{ "$ref": "#/definitions/channelmySmartGrid" },{ "$ref": "#/definitions/channelInFluxDB" }] } }, "meters": { "type": "array", "minItems": 1, "items": { "oneOf": [{ "$ref": "#/definitions/meterInvalid" }, { "$ref": "#/definitions/meterS0" }, { "$ref": "#/definitions/meterD0dev" }, { "$ref": "#/definitions/meterD0host" }, { "$ref": "#/definitions/meterSMLdev" }, { "$ref": "#/definitions/meterSMLhost" }, { "$ref": "#/definitions/meterRandom" }, { "$ref": "#/definitions/meterFile" }, { "$ref": "#/definitions/meterExec" }, { "$ref": "#/definitions/meterFluksoV2" }, { "$ref": "#/definitions/meterOCR" }, { "$ref": "#/definitions/meterOMS" }, { "$ref": "#/definitions/meterW1therm" } ] } }, "push": { "type": "array", "minItems": 0, "items": { "oneOf": [{ "$ref": "#/definitions/pushdataentry" }] }, "description": "list of middlewares receiving push data (i.e. non aggregated live data in single http request)" } }, "type": "object", "properties": { "retry": { "id": "/retry", "type": "integer", "description": "How long to sleep between failed requests, in seconds" }, "verbosity": { "id": "/verbosity", "type": "integer", "enum": [0, 1, 3, 5, 10, 15], "default": 1, "description": "depth of loging. 0=log_alert, 1=log_error, 3=log-warning, 5=log_info, 10=log-debug, 15=log_finest" }, "log": { "id": "/log", "type": "string", "description": "path to logfile", "default": "/var/log/vzlogger.log" }, "push": { "$ref": "#/definitions/push" }, "local": { "$ref": "#/definitions/local" }, "meters": { "$ref": "#/definitions/meters" } }, "required": [ "log" ] } vzlogger-0.8.6/etc/vzlogger_generic.schema.json.todo000066400000000000000000000004031462212027200225630ustar00rootroot00000000000000/* use http://jeremydorn.com/json-editor/ as editor (paste below into schema) todo: for some meter (with periodic=true) interval needs to be positive todo: for some meter interval is not allowed todo: "meters" can be called "sensors" as well */ vzlogger-0.8.6/gtest/000077500000000000000000000000001462212027200145105ustar00rootroot00000000000000vzlogger-0.8.6/gtest/CMakeLists.txt.in000066400000000000000000000006651462212027200176640ustar00rootroot00000000000000cmake_minimum_required(VERSION 2.8.2) project(gtest-download NONE) include(ExternalProject) ExternalProject_Add(googletest GIT_REPOSITORY https://github.com/google/googletest.git GIT_TAG release-1.12.1 SOURCE_DIR "${CMAKE_CURRENT_BINARY_DIR}/gtest-src" BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}/gtest-build" CONFIGURE_COMMAND "" BUILD_COMMAND "" INSTALL_COMMAND "" TEST_COMMAND "" ) vzlogger-0.8.6/include/000077500000000000000000000000001462212027200150055ustar00rootroot00000000000000vzlogger-0.8.6/include/ApiIF.hpp000066400000000000000000000034211462212027200164460ustar00rootroot00000000000000/***********************************************************************/ /** @file ApiIF.hpp * Header file for volkszaehler.org API calls * * @author Kai Krueger * @date 2012-03-15 * @email kai.krueger@itwm.fraunhofer.de * @copyright Copyright (c) 2011 - 2023, The volkszaehler.org project * @package vzlogger * @license http://opensource.org/licenses/gpl-license.php GNU Public License * * (C) Fraunhofer ITWM **/ /*---------------------------------------------------------------------*/ /* * This file is part of volkzaehler.org * * volkzaehler.org is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * any later version. * * volkzaehler.org is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with volkszaehler.org. If not, see . */ #ifndef _ApiIF_hpp_ #define _ApiIF_hpp_ #include #include #include namespace vz { class ApiIF { public: typedef vz::shared_ptr Ptr; ApiIF(Channel::Ptr ch) : _ch(ch) {} virtual ~ApiIF(){}; /** * @brief send measurement values to middleware * to be implemented specific API. **/ virtual void send() = 0; virtual void register_device() = 0; protected: Channel::Ptr channel() { return _ch; } private: Channel::Ptr _ch; /**< pointer to channel where API belongs to */ }; // class ApiIF } // namespace vz #endif /* _ApiIF_hpp_ */ vzlogger-0.8.6/include/Buffer.hpp000066400000000000000000000052361462212027200167350ustar00rootroot00000000000000/** * Circular buffer (double linked, threadsafe) * * Used to store recent readings and buffer in case of net inconnectivity * * @author Steffen Vogel * @copyright Copyright (c) 2011 - 2023, The volkszaehler.org project * @package vzlogger * @license http://opensource.org/licenses/gpl-license.php GNU Public License */ /* * This file is part of volkzaehler.org * * volkzaehler.org is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * any later version. * * volkzaehler.org is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with volkszaehler.org. If not, see . */ #ifndef _BUFFER_H_ #define _BUFFER_H_ #include #include #include #include class Buffer { public: typedef vz::shared_ptr Ptr; typedef std::list::iterator iterator; typedef std::list::const_iterator const_iterator; enum aggmode { NONE, MAX, AVG, SUM }; Buffer(); virtual ~Buffer(); void aggregate(int aggtime, bool aggFixedInterval); void push(const Reading &rd); void clean(bool deleted_only = true); void undelete(); void shrink(/*size_t keep = 0*/); std::string dump(); inline iterator begin() { return _sent.begin(); } inline iterator end() { return _sent.end(); } inline size_t size() { lock(); size_t s = _sent.size(); unlock(); return s; } inline bool newValues() const { return _newValues; } inline void clear_newValues() { _newValues = false; } inline void lock() { pthread_mutex_lock(&_mutex); } inline void unlock() { pthread_mutex_unlock(&_mutex); } inline void wait(pthread_cond_t *condition) { pthread_cond_wait(condition, &_mutex); } inline void have_newValues() { _newValues = true; } inline void set_aggmode(Buffer::aggmode m) { _aggmode = m; } inline aggmode get_aggmode() const { return _aggmode; } private: Buffer(const Buffer &); // don't allow copy constructor Buffer &operator=(const Buffer &); // and no assignment op. std::list _sent; bool _newValues; Buffer::aggmode _aggmode; size_t _keep; /**< number of readings to cache for local interface */ pthread_mutex_t _mutex; Reading *_last_avg; // keeps value and time from last reading from aggregate call for aggmode AVG }; #endif /* _BUFFER_H_ */ vzlogger-0.8.6/include/Channel.hpp000066400000000000000000000100351462212027200170650ustar00rootroot00000000000000/** * Channel handling * * @package vzlogger * @copyright Copyright (c) 2011 - 2023, The volkszaehler.org project * @license http://www.gnu.org/licenses/gpl.txt GNU Public License * @author Steffen Vogel */ /* * This file is part of volkzaehler.org * * volkzaehler.org is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * any later version. * * volkzaehler.org is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with volkszaehler.org. If not, see . */ #ifndef _CHANNEL_H_ #define _CHANNEL_H_ #include #include #include "Buffer.hpp" #include "Reading.hpp" #include #include #include class Channel { public: typedef vz::shared_ptr Ptr; // This shared_ptr is set when a logging_thread for an object of this class is started. // Inside the logging_thread, a Channel::Ptr is used. Data is passed via the void* // argument of pthread_create, and thus directly passing a shared pointer will break it. Ptr _this_forthread; Channel(const std::list