From 58e89749d38e8005bcb2ab9d348bc89a16277c7d Mon Sep 17 00:00:00 2001 From: weetmuts Date: Tue, 26 Feb 2019 22:19:16 +0100 Subject: [PATCH] Updated command line options and added man page --- CHANGES | 3 +- README.md | 99 +++++++++++---------- install.sh | 15 +++- src/cmdline.cc | 29 +++++-- src/config.cc | 36 ++++---- src/config.h | 2 +- src/main.cc | 80 ++++++++++------- tests/config1/etc/wmbusmeters.conf | 2 +- tests/config2/etc/wmbusmeters.conf | 4 +- tests/test_c1_meters.sh | 2 +- tests/test_logfile.sh | 2 +- tests/test_meterfiles.sh | 4 +- tests/test_t1_meters.sh | 2 +- wmbusmeters.1 | 133 +++++++++++++++++++++++++++++ 14 files changed, 303 insertions(+), 110 deletions(-) create mode 100644 wmbusmeters.1 diff --git a/CHANGES b/CHANGES index b8bd7bf..bf204c0 100644 --- a/CHANGES +++ b/CHANGES @@ -7,6 +7,7 @@ Running wmbusmeters as daemon is now supported. Using rtl_wmbus to receive wmbus messages from rtl_sdr is work in progress. Updated README +Updated some command line options robot is now format. Version 0.8.4: 2019-02-23 @@ -24,7 +25,7 @@ Now properly extracts temperature from short frames! Added support for Multical21 meters with max flow configuration. Note! Since max flow was added to multical21, there is an extra -column in the human output and --robot=fields output. +column in the human output and --format=fields output. There is also "max_flow_m3h"="123" in the json output, but that does not affect existing code depending on json. diff --git a/README.md b/README.md index c30a76e..60748a1 100644 --- a/README.md +++ b/README.md @@ -27,7 +27,7 @@ Check the config file /etc/wmbusmeters.conf: loglevel=normal device=auto logtelegrams=false -meterfilesdir=/var/log/wmbusmeters/meter_readings +meterfiles=/var/log/wmbusmeters/meter_readings logfile=/var/log/wmbusmeters/wmbusmeters.log shell=/usr/bin/mosquitto_pub -h localhost -t wmbusmeters -m "$METER_JSON" ``` @@ -66,31 +66,45 @@ The files/dir should then be located here: ``` wmbusmeters version: 0.9 -Usage: wmbusmeters {options} (auto | /dev/ttyUSBx)] { [meter_name] [meter_type] [meter_id] [meter_key] }* +Usage: wmbusmeters {options} ( [meter_name] [meter_type] [meter_id] [meter_key] )* -Add more meter quadruplets to listen to more meters. -Add --verbose for detailed debug information. - --robot or --robot=json for json output. - --robot=fields for semicolon separated fields. - --separator=X change field separator to X. - --logfile=file - --meterfiles=dir to create status files below dir, - named dir/meter_name, containing the latest reading. - --meterfiles defaults dir to /tmp. - --c1 or --t1 listen to C1 or T1 messages - --shell=cmd invokes cmd with env variables containing the latest reading. - --shellenvs list the env variables available for the meter. - --oneshot wait for an update from each meter, then quit. - --useconfig=dir look for configuration file in dir/etc/wmbusmeters.conf and - dir/etc/wmbusmeters.d - --useconfig defaults to the root /etc - --exitafter=20h program exits after running for twenty hours, - or 10m for ten minutes or 5s for five seconds. +As you can use: -Specifying auto as the device will automatically look for usb -wmbus dongles on /dev/im871a and /dev/amb8465. + --c1 or --t1 listen to C1 or T1 messages when no meters are supplied + --debug for a lot of information + --exitafter=