diff --git a/.travis.yml b/.travis.yml index 13ec7bd..841847a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,9 @@ -language: cpp -dist: bionic - os: - linux - osx + +language: cpp +sudo: required +dist: bionic +before_install: + - if [ $TRAVIS_OS_NAME = linux ]; then sudo apt-get install librtlsdr-dev libusb-dev; else brew install librtlsdr libusb; fi diff --git a/CHANGES b/CHANGES index 833342c..b0f1a39 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,61 @@ +Version 1.0.0: 2020-10-25 + +IMPORTANT CHANGES THAT MIGHT AFFECT YOU! + +** BREAKING No udev rules + +Wmbusmeters new default behaviour is to never exit if no wmbus +device is found. It stays running all the time even if no +wmbus device is detected. As soon as a device is inserted +it will detect/configure and start using the device. + +(When reading stdin and files, then wmbusmeters will of course exit +as soon as there is no more data or stdin is closed.) + +This means that the udev rules no longer are needed and must be +removed. This will be done automatically by the install script. + +** BREAKING The background rtlwmbus/rtl433 command must be wrapped in CMD(...) + +If you used your own command xxx to start rtlsdr+rtlwmbus then that command +was previously supplied like this rtlwmbus:xxx +You must now type rtlwmbus:CMD(xxx) + +** There is a possibility to identify some dongles with their id. + +The im871a/amb8465/rtlsdr dongles have an id. This id is printed when +wmbusmeters starts using the dongle. You can later use the same id to +configure different dongles for different frequencies and link modes. + +You could for example have one rtlsdr dongle with an antenna tuned for 434 MHz +and use set the id of that dongle to dongleALFA (rtl_eeprom -s dongleALFA) +likewise for 868.95 MHz. Then you can start your two dongles at the same time: + +wmbusmeters rtlwmbus[dongleALFA]:434M rtlmbus[dongleBETA]:868M + +The full specification of a wmbus device is this: + +tty/file/stdin : type [ id ] : bps : fq : linkmodes : command + +Not all values are relevant for all dongles though. + +** Use stderr for logging, stdout for data. + +wmbusmeters now uses STDERR as default for info/verbose/debug/trace output. +This will not affect you if you run wmbusmeters as a daemon, +but if you start wmbusmeters yourself you should check where stderr is going. +To use the old style add --usestdoutforlogging. + +** New features + +To list the shell envs for a meter do --listenvs=multical21 +To list the fields avilable for a meter do --listfields=multical21 +To list all meters do --listmeters +To search for a meter do --listmeters=water or --listmeters=multi + +The wmbus device used to received the telegram and the rssi level +is part of the json, eg: "device":"rtlwmbus[1234]","rssi_dbm":-47 + Version 0.9.36: 2020-09-08 Added support for detection of the proper driver diff --git a/Makefile b/Makefile index 51bec1a..4084820 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -# Copyright (C) 2017-2019 Fredrik Öhrström +# Copyright (C) 2017-2020 Fredrik Öhrström # # 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 @@ -146,8 +146,10 @@ METER_OBJS:=\ $(BUILD)/meter_vario451.o \ $(BUILD)/meter_waterstarm.o \ $(BUILD)/printer.o \ + $(BUILD)/rtlsdr.o \ $(BUILD)/serial.o \ $(BUILD)/shell.o \ + $(BUILD)/threads.o \ $(BUILD)/util.o \ $(BUILD)/units.o \ $(BUILD)/wmbus.o \ @@ -159,7 +161,7 @@ METER_OBJS:=\ $(BUILD)/wmbus_rtl433.o \ $(BUILD)/wmbus_simulator.o \ $(BUILD)/wmbus_rawtty.o \ - $(BUILD)/wmbus_wmb13u.o \ + $(BUILD)/wmbus_rc1180.o \ $(BUILD)/wmbus_utils.o all: $(BUILD)/wmbusmeters $(BUILD)/wmbusmeters-admin $(BUILD)/testinternals @@ -195,10 +197,10 @@ snapcraft: $(BUILD)/main.o: $(BUILD)/short_manual.h $(BUILD)/version.h $(BUILD)/wmbusmeters: $(METER_OBJS) $(BUILD)/main.o $(BUILD)/short_manual.h - $(CXX) -o $(BUILD)/wmbusmeters $(METER_OBJS) $(BUILD)/main.o $(LDFLAGS) -lpthread + $(CXX) -o $(BUILD)/wmbusmeters $(METER_OBJS) $(BUILD)/main.o $(LDFLAGS) -lrtlsdr -lusb-1.0 -lpthread -$(BUILD)/wmbusmeters-admin: $(METER_OBJS) $(BUILD)/admin.o $(BUILD)/short_manual.h - $(CXX) -o $(BUILD)/wmbusmeters-admin $(METER_OBJS) $(BUILD)/admin.o $(LDFLAGS) -lmenu -lncurses -lpthread +$(BUILD)/wmbusmeters-admin: $(METER_OBJS) $(BUILD)/admin.o $(BUILD)/ui.o $(BUILD)/short_manual.h + $(CXX) -o $(BUILD)/wmbusmeters-admin $(METER_OBJS) $(BUILD)/admin.o $(BUILD)/ui.o $(LDFLAGS) -lmenu -lform -lncurses -lrtlsdr -lusb-1.0 -lpthread $(BUILD)/short_manual.h: README.md echo 'R"MANUAL(' > $(BUILD)/short_manual.h @@ -208,10 +210,10 @@ $(BUILD)/short_manual.h: README.md echo ')MANUAL";' >> $(BUILD)/short_manual.h $(BUILD)/testinternals: $(METER_OBJS) $(BUILD)/testinternals.o - $(CXX) -o $(BUILD)/testinternals $(METER_OBJS) $(BUILD)/testinternals.o $(LDFLAGS) -lpthread + $(CXX) -o $(BUILD)/testinternals $(METER_OBJS) $(BUILD)/testinternals.o $(LDFLAGS) -lrtlsdr -lusb-1.0 -lpthread $(BUILD)/fuzz: $(METER_OBJS) $(BUILD)/fuzz.o - $(CXX) -o $(BUILD)/fuzz $(METER_OBJS) $(BUILD)/fuzz.o $(LDFLAGS) -lpthread + $(CXX) -o $(BUILD)/fuzz $(METER_OBJS) $(BUILD)/fuzz.o $(LDFLAGS) -lrtlsdr -lpthread clean: rm -rf build/* build_arm/* build_debug/* build_arm_debug/* *~ diff --git a/README.md b/README.md index 599cec0..cdd5ad5 100644 --- a/README.md +++ b/README.md @@ -29,16 +29,28 @@ Availability of **wmbusmeters** for other Linux distributions can be checked on # Run as a daemon -Remove the wmbus dongle (im871a,amb8465,rfmrx2,cul,d1tc) or the generic rtlsdr dongle (RTL2838) from your computer. +Remove the wmbus dongle (im871a,amb8465,cul,rc1180,rfmrx2,d1tc) or the generic rtlsdr dongle (RTL2838) from your computer. + +`./configure; make; sudo make install` will install wmbusmeters as a daemon. + +Check the contents of your `/etc/wmbusmeters.conf` file, assuming it +has `device=auto:c1` and you are using a im871a,amb8465,rc1180 or cul device, +then you can now start the daemon with `sudo systemctl start wmbusmeters` +or you can try it from the command line `wmbusmeters auto:c1` + +Wmbusmeters will scan for wmbus devices every few seconds and detect whenever +a device is plugged in or removed. + +To have the wmbusmeters daemon start automatically when the computer boots do: +`sudo systemctl enable wmbusmeters` + +You can trigger a reload of the config files with `sudo killall -HUP wmbusmetersd` -`make; sudo make install` will install wmbusmeters as a daemon that starts -automatically when an appropriate wmbus usb dongle is inserted in the computer. (Note! make install only works for GNU/Linux. For MacOSX try to start -`wmbusmetersd /tmp/thepidfile` from a script instead. Here you can also override the device: -`wmbusmetersd --device=/dev/ttyXXY --listento=t1 /tmp/thepidfile`) +`wmbusmetersd /tmp/thepidfile` from a script instead.) Check the config file /etc/wmbusmeters.conf and edit the device to -point to your dongle. +point to your dongle or use auto ``` loglevel=normal device=/dev/ttyUSB0:im871a @@ -109,9 +121,9 @@ Or you can start wmbusmeters with your own config files: wmbusmeters --useconfig=/home/me/.config/wmbusmeters ``` -You can add --device and --listento to override the settings in the config. Like this: +You can add --device to override the settings in the config. Like this: ``` -wmbusmeters --useconfig=/home/me/.config/wmbusmeters --device=/dev/ttyXXY --listento=t1` +wmbusmeters --useconfig=/home/me/.config/wmbusmeters --device=rtlwmbus ``` The files/dir should then be located here: @@ -124,23 +136,23 @@ depending on if you are running as a daemon or not. # Running without config files, good for experimentation and test. ``` -wmbusmeters version: 0.9.15 -Usage: wmbusmeters {options} {:suffix} ( [meter_name] [meter_type]{:} [meter_id] [meter_key] )* +wmbusmeters version: 0.9.36 +Usage: wmbusmeters {options} ( [meter_name] [meter_type]{:} [meter_id] [meter_key] )* As you can use: --addconversions=+ add conversion to these units to json and meter env variables (GJ) + --alarmexpectedactivity=mon-fri(08-17),sat-sun(09-12) Specify when the timeout is tested, default is mon-sun(00-23) + --alarmshell= invokes cmdline when an alarm triggers + --alarmtimeout=