Sync man with readme with code.

pull/303/head
Fredrik Öhrström 2021-06-26 12:24:30 +02:00
rodzic 08b9153167
commit e93310e008
5 zmienionych plików z 41 dodań i 28 usunięć

Wyświetl plik

@ -199,7 +199,14 @@ all: $(BUILD)/wmbusmeters $(BUILD)/wmbusmeters-admin $(BUILD)/testinternals
deb: wmbusmeters_$(DEBVERSION)_$(DEBARCH).deb
install: $(BUILD)/wmbusmeters
check_docs:
@cat src/cmdline.cc | grep -o -- '--[a-z][a-z]*' | sort | uniq | grep -v internaltesting > /tmp/options_in_code
@cat wmbusmeters.1 | grep -o -- '--[a-z][a-z]*' | sort | uniq | grep -v internaltesting > /tmp/options_in_man
@cat README.md | grep -o -- '--[a-z][a-z]*' | sort | uniq | grep -v internaltesting > /tmp/options_in_readme
@diff /tmp/options_in_code /tmp/options_in_man
@diff /tmp/options_in_code /tmp/options_in_readme
install: $(BUILD)/wmbusmeters check_docs
@./install.sh $(BUILD)/wmbusmeters $(DESTDIR) $(EXTRA_INSTALL_OPTIONS)
uninstall:

Wyświetl plik

@ -1,3 +1,4 @@
# wmbusmeters
The program receives and decodes C1,T1 or S1 telegrams
@ -132,7 +133,7 @@ If you are running on a Raspberry PI with flash storage and you relay the data t
another computer using a shell command (mosquitto_pub or curl or similar) then you might want to remove
`meterfiles` and `meterfilesaction` to minimize the writes to the local flash file system.
If you specify --metefilesaction=append --meterfilestimestamp=day then wmbusmeters will
If you specify --meterfilesaction=append --meterfilestimestamp=day then wmbusmeters will
append all todays received telegrams in for example the file Water_2019-12-11, the day
after the telegrams will be recorded in Water_2019-12-12. You can change the resolution
to day,hour,minute and micros. Micros means that every telegram gets their own file.
@ -187,15 +188,19 @@ As <options> you can use:
--donotprobe=<tty> do not auto-probe this tty. Use multiple times for several ttys or specify "all" for all ttys.
--exitafter=<time> exit program after time, eg 20h, 10m 5s
--format=<hr/json/fields> for human readable, json or semicolon separated fields
--help list all options
--ignoreduplicates=<bool> ignore duplicate telegrams, remember the last 10 telegrams
--json_xxx=yyy always add "xxx"="yyy" to the json output and add shell env METER_xxx=yyy
--license print GPLv3+ license
--listento=<mode> listen to one of the c1,t1,s1,s1m,n1a-n1f link modes
--listento=<mode>,<mode> listen to more than one link mode at the same time, assuming the dongle supports it
--listenvs=<meter_driver> list the env variables available for the given meter driver
--listfields=<meter_driver> list the fields selectable for the given meter driver
--listmeters list all meter drivers
--listmeters=<search> list all meter drivers containing the text <search>
--logfile=<file> use this file instead of stdout
--logfile=<file> use this file for logging
--logtelegrams log the contents of the telegrams for easy replay
--logtimestamps=<when> add log timestamps: always never important
--ignoreduplicates=<bool> ignore duplicate telegrams, remember the last 10 telegrams
--meterfiles=<dir> store meter readings in dir
--meterfilesaction=(overwrite|append) overwrite or append to the meter readings file
--meterfilesnaming=(name|id|name-id) the meter file is the meter's: name, id or name-id
@ -208,10 +213,12 @@ As <options> you can use:
--separator=<c> change field separator to c
--shell=<cmdline> invokes cmdline with env variables containing the latest reading
--silent do not print informational messages nor warnings
--trace for tons of information
--useconfig=<dir> load config files from dir/etc
--usestderr write notices/debug/verbose and other logging output to stderr (the default)
--usestdoutforlogging write debug/verbose and logging output to stdout
--verbose for more information
--version print version
```
As device you can use:

Wyświetl plik

@ -227,13 +227,6 @@ shared_ptr<Configuration> parseCommandLine(int argc, char **argv) {
return shared_ptr<Configuration>(c);
continue;
}
if (!strcmp(argv[i], "--reload")) {
c->reload = true;
if (i > 1 || argc > 2) {
error("Usage error: --reload implies no other arguments on the command line.\n");
}
return shared_ptr<Configuration>(c);
}
if (!strncmp(argv[i], "--format=", 9))
{
if (!strcmp(argv[i]+9, "json"))

Wyświetl plik

@ -53,7 +53,6 @@ struct Configuration
std::string listento_override;
bool useconfig {};
std::string config_root;
bool reload {};
bool need_help {};
bool silent {};
bool verbose {};
@ -62,7 +61,8 @@ struct Configuration
bool debug {};
bool trace {};
AddLogTimestamps addtimestamps {};
bool internaltesting {}; // Only for testing! When true, shorten all timeouts.
bool internaltesting {}; // Not currently used. Was used for speeding up testing. I.e. it shortened all timeouts.
// Might be needed in the future. Therefore it is still here.
bool logtelegrams {};
bool meterfiles {};
std::string meterfiles_dir;

Wyświetl plik

@ -11,8 +11,8 @@ wmbusmeters \- listen to wireless mbus radio traffic and relay the decoded teleg
Wmbusmeters acquires wmbus telegrams, decodes them and relays them to
some other software for further processing. It can for example listen
to radio traffic using dedicated wmbus dongles like (im871a amb8465 rfmrx2 cul d1tc)
or a generic software defined radio dongle (rtl_sdr).
to radio traffic using dedicated wmbus dongles like (im871a,amb8465,cul,rc1180)
or a generic software defined radio dongle (rtl_sdr) with an RTL2832U.
After the received telegram has been decrypted and parsed, it can then
be relayed using a shell command, or stored in a log file. The shell
@ -27,27 +27,29 @@ mqtt_publish) sent to a REST API (eg curl) or store it in a database
\fB\--alarmshell=\fR<cmdline> invokes cmdline when an alarm triggers
\fB\--alarmtimeout=\fR<time> Expect a telegram to arrive within <time> seconds, eg 60s, 60m, 24h during expected activity.
\fB\--alarmtimeout=\fR<time> Expect a telegram to arrive within <time> seconds, eg 60s, 60m, 24h during expected activity
\fB\--debug\fR for a lot of information
\fB\--donotprobe=\fR<tty> do not auto-probe this tty. Use multiple times for several ttys or specify "all" for all ttys.
\fB\--device=\fR<device> override device in config files. Use only in combination with --useconfig= option
\fB\--donotprobe=\fR<tty> do not auto-probe this tty. Use multiple times for several ttys or specify "all" for all ttys
\fB\--exitafter=\fR<time> exit program after time, eg 20h, 10m 5s
\fB\--format=\fR(hr|json|fields) for human readable, json or semicolon separated fields
\fB\--ignoreduplicates\fR=true ignore telegram duplicates (when using multiple receiving dongles or repeaters)
\fB\--help\fR list all options
\fB\--ignoreduplicates\fR=<bool> ignore duplicate telegrams, remember the last 10 telegrams. Default is true.
\fB\--json_xxx=yyy\fR always add "xxx"="yyy" to the json output and add shell env METER_xxx=yyy
\fB\--listento=\fR<mode> listen to one of the c1,t1,s1,s1m,n1a-n1f link modes.
\fB\--license\fR print GPLv3+ license
\fB\--listento=\fR<mode>,<mode> listen to more than one link mode at the same time, assuming the dongle supports it.
\fB\--listento=\fR<mode> listen to one of the c1,t1,s1,s1m,n1a-n1f link modes
\fB\--logtimestamps=\fR<when> add timestamps to log entries: never/always/important.
\fB\--c1 --t1 --s1 --s1m --n1a ... --n1f\fR listen to c1,t1,s1,s1m,n1a-n1f telegrams.
\fB\--listento=\fR<mode>,<mode> listen to more than one link mode at the same time, assuming the dongle supports it
\fB\--listenvs=\fR<meter_type> list the env variables available for the given meter type
@ -57,10 +59,12 @@ mqtt_publish) sent to a REST API (eg curl) or store it in a database
\fB\--listmeters=\fR<search> list all meter types containing the text <search>
\fB\--logfile=\fR<dir> use this file instead of stdout
\fB\--logfile=\fR<dir> use this file for logging
\fB\--logtelegrams\fR log the contents of the telegrams for easy replay
\fB\--logtimestamps=\fR<when> add timestamps to log entries: never/always/important
\fB\--meterfiles=\fR<dir> store meter readings in dir
\fB\--meterfilesaction=\fR(overwrite|append) overwrite or append to the meter readings file
@ -73,9 +77,7 @@ mqtt_publish) sent to a REST API (eg curl) or store it in a database
\fB\--oneshot\fR wait for an update from each meter, then quit
\fB\--resetafter=\fR<time> reset the wmbus dongle regularly, default is 24h
\fB\--separator=\fR<c> change field separator to c
\fB\--resetafter=\fR<time> reset the wmbus dongle regularly, default is 23h
\fB\--selectfields=\fRid,timestamp,total_m3 select fields to be printed (--listfields=<meter> to list available fields)
@ -85,6 +87,8 @@ mqtt_publish) sent to a REST API (eg curl) or store it in a database
\fB\--silent\fR do not print informational messages nor warnings
\fB\--trace\fR for tons of information
\fB\--useconfig=\fR<dir> load config files from dir/etc
\fB\--usestderr\fR write notices/debug/verbose and other logging output to stderr (the default)
@ -93,9 +97,11 @@ mqtt_publish) sent to a REST API (eg curl) or store it in a database
\fB\--verbose\fR for more information
\fB\--version\fR print version
.SH DEVICES
.TP
\fBauto:c1\fR detect any serially connected wmbus dongles and rtl_sdr dongles and configure them for c1 mode. (You do not need to use --c1 or --listento=c1 when suffixing the device with the linkmode.) Always try to use auto first.
\fBauto:c1\fR detect any serially connected wmbus dongles and rtl_sdr dongles and configure them for c1 mode. Always try to use auto first.
.TP
\fBim871a:t1\fR look for an im871a dongle attached to any of the serial ttys and configure it for t1 mode.