Giter VIP home page Giter VIP logo

wmbusmeters / wmbusmeters Goto Github PK

View Code? Open in Web Editor NEW
832.0 29.0 203.0 4.83 MB

Read the wired or wireless mbus protocol to acquire utility meter readings.

License: GNU General Public License v3.0

Makefile 0.67% C++ 70.50% C 19.91% Shell 7.42% Java 0.12% Roff 0.39% Python 0.39% Dockerfile 0.06% M4 0.54%
mbus wireless-mbus-protocol wmbus wireless-mbus im871a raspberry-pi daemon wmbus-dongle meter utility-meters

wmbusmeters's Introduction

wmbusmeters

The program acquires utility meter readings from wired m-bus or wireless wm-bus meters. The readings can then be published using MQTT, curled to a REST api, inserted into a database or stored in a log file.

What does it do?

Wmbusmeters converts incoming telegrams from (w)mbus/OMS compatible meters like: 1844AE4C4455223368077A55000000_041389E20100023B0000

into human readable: MyTapWater 33225544 123.529 m³ 0 m³/h 2024-03-03 19:36:22

or into csv: MyTapWater;33225544;123.529;0;2024-03-03 19:36:45

or into json:

{
    "media":"water",
    "meter":"iperl",
    "name":"MyTapWater",
    "id":"33225544",
    "max_flow_m3h":0,
    "total_m3":123.529,
    "timestamp":"2024-03-03T18:37:00Z"
}

Wmbusmeters can collect telegrams from radio using hardware dongles or rtl-sdr software radio dongles, or from m-bus meters using serial ports, or from files/pipes.

FAQ/WIKI/MANUAL pages

The program runs on GNU/Linux, MacOSX, FreeBSD, and Raspberry Pi.

System Status
Ubuntu Build Ubuntu Status
MacOSX Build MacOSX Status
Docker Build Docker Status
Snap Build Snap Status

Distributions

wmbusmeters package is available on Fedora (version 31 or newer) and can be simply installed by using:

dnf install wmbusmeters

Availability of wmbusmeters for other Linux distributions can be checked on release-monitoring project page.

Docker

Experimental docker containers are available here: https://hub.docker.com/r/wmbusmeters/wmbusmeters

Snap

Experimental snaps are available here: https://snapcraft.io/wmbusmeters Read the wiki for more info on how to use the snap: https://wmbusmeters.github.io/wmbusmeters-wiki/SNAP.html

Build from source and run as a daemon

Building and installing from source is easy and recommended since the development progresses quickly. First remove the wmbus dongle (im871a,amb8465(metis),amb3665,cul,rc1180) or the generic rtlsdr dongle (RTL2832U) from your computer. Then do:

./configure; make; sudo make install will install wmbusmeters as a daemon.

Usage

Check the contents of your /etc/wmbusmeters.conf file, assuming it has device=auto:t1 and you are using a im871a,amb8465(metis),amb3665,rc1180,cul or rtlsdr device, then you can now start the daemon with sudo systemctl start wmbusmeters or you can try it from the command line wmbusmeters auto:t1

Wmbusmeters will scan for wmbus devices every few seconds and detect whenever a device is plugged in or removed. However since wmbusmeters now supports several dongle types, the scan can take some time!

Use auto for testing and to find your dongle. For production it is very much recommended that you change auto:t1 to the device name with the full device path (eg /dev/ttyUSB0:im871a:c1,t1). This will skip the slow probing for all possible wmbus dongles when wmbusmeters startup.

If the serial device (ttyUSB0) might change you can also use device=im871a:c1,t1 which will probe all serial devices but only scans for im871a which also speeds it up.

Note that the rtl-sdr devices are not found under the tty devices (e.g. /dev/tty...). Instead the rtl-sdr devices are accessed through character device special files named /dev/swradio0 to /dev/swradio2551. Wmbusmeters uses librtsldr to probe these devices.

If you have to scan serial devices, then remember that some Raspberry PIs are upset when random data is sent to /dev/ttyAMA0 when it is configured in bluetooth mode. To solve this, add donotprobe=/dev/ttyAMA0

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

(Note! make install only works for GNU/Linux. For MacOSX try to start wmbusmetersd /tmp/thepidfile from a script instead.)

You can also start the daemon with another set of config files: wmbusmetersd --useconfig=/home/me/.config/wmbusmeters /tmp/thepidfile

When using useconfig, the files/dir should be: /home/me/.config/wmbusmeters/wmbusmeters.conf and the meters dir: /home/me/.config/wmbusmeters/wmbusmeters.d

Check the config file /etc/wmbusmeters.conf and edit the device. For example: /dev/ttyUSB1:amb8465:c1,t1 or im871a:c1,t1 or im871a[457200101056]:t1.

Adding a device like auto or im871a will trigger an automatic probe of all serial ttys to auto find or to find on which tty the im871a resides.

If you specify a full device path like /dev/ttyUSB0:im871a:c1 or rtlwmbus or rtl433 then it will not probe the serial devices. If you must be really sure that it will not probe something you can add donotprobe=/dev/ttyUSB0 or donotprobe=all.

You can specify combinations like: device=rc1180:t1 device=auto:c1 to set the rc1180 dongle to t1 but any other auto-detected dongle to c1.

Some dongles have identifiers (im871a,amb8465(metis),amb3665 and rtlsdrs) (for example: rtlsdr can be set with rtl_eeprom -s myname) You might have two rtlsdr dongles, one attached to an antenna tuned to 433MHz and the other attached to an antenna tuned for 868.95MHz, then a more complicated setup could look like this:

device=rtlwmbus[555555]:433M
device=rtlwmbus[112233]
device=/dev/ttyUSB0:im871a[00102759]:c1,t1
device=/dev/ttyUSB1:rc1180:t1

Bus aliases and polling

To poll an C2/T2/S2 wireless meter or an wired m-bus meter you need to give the (w)mbus device a bus-alias, for example here we pick the bus alias MAIN for the mbus using 2400 bps for all meters on this bus.

MAIN=/dev/ttyUSB0:mbus:2400

and here we pick the bus alias RADIOMAIN for an im871a dongle:

RADIOMAIN=/dev/ttyUSB1:im871a:c2

The bus alias is then used in the meter driver specification to specify which bus the mbus poll request should be sent to.

wmbusmeters --pollinterval=60s MAIN=/dev/ttyUSB0:mbus:2400 MyTempMeter piigth:MAIN:mbus 12001932 NOKEY

If you want to poll an mbus meter using the primary address, use p0 to p250 (deciman numbers) instead of the full 8 digit secondary address.

wmbusmeters --pollinterval=60s MAIN=/dev/ttyUSB0:mbus:2400 MyTempMeter piigth:MAIN:mbus p0 NOKEY

Example wmbusmeter.conf file

loglevel=normal
# You can use auto:t1 to find the device you have connected to your system.
# But do not use auto here since it will cause unnecessary and slow probing of the serial ports.
device=/dev/ttyUSB0:im871a:c1,t1
# And mbus
device=MAIN=/dev/ttyUSB1:mbus:2400
# But do not probe this serial tty.
donotprobe=/dev/ttyACM2
logtelegrams=false
format=json
meterfiles=/var/lib/wmbusmeters/meter_readings
meterfilesaction=overwrite
meterfilesnaming=name
meterfilestimestamp=day
logfile=/var/log/wmbusmeters/wmbusmeters.log
shell=/usr/bin/mosquitto_pub -h localhost -t wmbusmeters/$METER_ID -m "$METER_JSON"
alarmshell=/usr/bin/mosquitto_pub -h localhost -t wmbusmeters_alarm -m "$ALARM_TYPE $ALARM_MESSAGE"
alarmtimeout=1h
alarmexpectedactivity=mon-sun(00-23)
ignoreduplicates=true

Then add a meter file in /etc/wmbusmeters.d/MyTapWater

name=MyTapWater
id=12345678
key=00112233445566778899AABBCCDDEEFF
driver=multical21

And an mbus meter file in /etc/wmbusmeters.d/MyTempHygro

name=MyTempHygro
id=11223344
driver=piigth:MAIN:mbus
pollinterval=60s

Important information about meter drivers and their names.

You can use driver=auto to have wmbusmeters automatically detect and use the best driver for your meter, but you should >not< use auto in production.

You can find out which driver is recommended by running wmbusmeters im871a:t1. This will print information like:

Received telegram from: 71727374
          manufacturer: (BMT) BMETERS, Italy (0x9b4)
                  type: Heat/Cooling load meter (0x0d) encrypted
                   ver: 0x0b
                driver: hydrocalm3

For production use it is very much recommended that you specify the exact driver in the meter file. The reason is that new and better drivers might be developed for your meter, where the keys and the content of the json might change. Such new drivers are guaranteed to have a different driver name. The auto look up will change to the new driver, but the old driver will still work.

So wmbusmeters strives to guarantee that if you have specified the driver name, then wmbusmeters can be safely upgraded at any time. The json will not change in an incompatible way. (The only allowed changes are: adding new fields and changing the ordering.)

Now plugin your wmbus dongle.

Wmbusmeters should start automatically, check with tail -f /var/log/syslog and tail -f /var/log/wmbusmeters/wmbusmeters.log (If you are using an rtlsdr dongle, then make sure that either the binaries /usr/bin/rtl_sdr and /usr/bin/rtl_wmbus exists and are executable. Or that the executable rtl_sdr/rtl_wmbus binaries exists inside the same directory as the wmbusmeters executable. If not you will see the error message (rtlwmbus) error: when starting as daemon, wmbusmeters looked for .../rtl_wmbus and /usr/bin/rtl_wmbus, but found neither! and the daemon will refuse to start.)

The latest reading of the meter can also be found here: /var/lib/wmbusmeters/meter_readings/MyTapWater

You can use several ids using id=1111111,2222222,3333333 or you can listen to all meters of a certain type id=* or you can suffix with star id=8765* to match all meters with a given prefix. If you supply at least one positive match rule, then you can add filter out rules as well. For example id=*,!2222* which will match all meter ids, except those that begin with 2222.

You can also specify the exact manufacturer, version and type: id=11111111.M=KAM.V=1b.T=16 or a subset: id=11111111.T=16 or all telegrams from 22222222 except those with version 77: id=22222222,!22222222.V=77 You can also use the fully specified secondary address that is printed by libmbus after doing a bus scan, ie 100002842941011B which is equivalent to 10000284.M=PII.V=01.T=1B

When matching all meters from the command line you can use ANYID instead of * to avoid shell quotes.

Add static and calculated fields to the output

You can add the static json data "address":"RoadenRd 456","city":"Stockholm" to every json message with the wmbusmeters.conf setting:

field_address=RoadenRd 456
field_city=Stockholm

If you add field_floor=5 to the meter file MyTapWater, then you can have the meter tailored static json "floor":"5" added to telegrams handled by that particular meter. (The old prefix json_ still works.)

You can add unit conversions and calculated values to the meter files using calculate_.... The formulas track units. If the unit do not match up, then the formula will generate a null value. When two units are compatible it will automatically convert the value between two units.

The formula

calculate_sum_mj=5 kwh + 8 gj + (7 kw * 3 h)

will add the field:

"sum_mj":8093.6

Units inside the formula calculation are tracked as arbitrary SI unit exponents (ie Volt is 1kgm²s⁻³a⁻¹) however the final result must be a named unit (ie the calculated field must end with _v). The existing named units can be found with wmbusmeters --listunits.

If you make a mistake in the formula you will get a warning:

Warning! Ignoring calculated field sum because parse failed:
Cannot add [kw|Power|1000kgm²s⁻³] to [gj|Energy|1×10⁹kgm²s⁻²]!
5 kw + 8 gj + (7 kw * 3 h)
     ^~~~~

You need parentheses in the formulas since operator precedence is not yet implemented.

calculate_total_l=total_m3
calculate_approx_power_m3ch=(t1_temperature_c-t2_temperature_c)*volume_flow_m3h
calculate_total_mj=total_energy_consumption_kwh
wmbusmeters --format=json --ppjson
--field_collector=cm57829
--calculate_total_l=total_volume_m3
--calculate_approx_power_m3ch='(t1_temperature_c-t2_temperature_c)*volume_flow_m3h'
--calculate_total_mj=total_energy_consumption_kwh
5e442d2c1155775540047a7d0050252f2f0406c50e000004147B86000004ff074254000004ff086047000002594117025d9a14023Bed0302ff220000026cca2c4406750B00004414ad680000426cc12c2f2f2f2f2f2f2f2f2f2f2f2f2f2f2f
Heato kamheat 55775511 NOKEY

which will output:

{
    "media":"heat",
    "meter":"kamheat",
    "name":"Heato",
    "id":"55775511",
    "status":"OK",
    "total_energy_consumption_kwh":3781,
    "total_volume_m3":344.27,
    "volume_flow_m3h":1.005,
    "t1_temperature_c":59.53,
    "t2_temperature_c":52.74,
    "forward_energy_m3c":21570,
    "return_energy_m3c":18272,
    "meter_date":"2022-12-10",
    "target_energy_kwh":2933,
    "target_volume_m3":267.97,
    "target_date":"2022-12-01",
    "total_l":344270,
    "approx_power_m3ch":6.82395,
    "total_mj":13611.6,
    "timestamp":"2023-01-14T07:20:22Z",
    "collector":"cm57829"
}

If you have connected your Lansen pulse counting meter to an electricity meter triggering a pulse per 0.1 kwh, then you can directly calculate a value based on the counters:

wmbusmeters --format=json --ppjson
--calculate_total_kwh='1000 kwh + (a_counter * 0.1 kwh)'
234433300602010014007a8e0400002f2f0efd3a1147000000008e40fd3a341200000000
Electricity lansenpu 00010206 NOKEY
{
    "media":"other",
    "meter":"lansenpu",
    "name":"Electricity",
    "id":"00010206",
    "status":"POWER_LOW",
    "a_counter":4711,
    "b_counter":1234,
    "total_kwh":1471.1,
    "timestamp":"2023-01-14T07:25:34Z"
}

Miscellaneous

If you are running on a Raspberry PI with flash storage and you relay the data to 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.

Also when using the Raspberry PI it can get confused by the serial ports, in particular the bluetooth port might come and go as a serial tty depending on the config. Therefore it can be advantageous to use the auto device to find the proper tty (eg /dev/ttyUSB0) and then specify this tty device explicitly in the config file, instead of using auto. This assumes that you only have a single usb dongle otherwise the USB tty names can change depending on how and when the devices are unplugged/replugged and the pi restarted. If you have multiple devies with different antennas, then you should instead use donotprobe to avoid the ttys that can never have a wmbus dongle.

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.

The purpose of the alarm shell and timeout is to notify you about problems within wmbusmeters and the wmbus dongles, not the meters themselves. Thus the timeout is for a dongle to receive some telegram at all. It does not matter from which meter.

Run using config files

If you cannot install as a daemon, then you can also start wmbusmeters in your terminal using the config files in /etc/wmbusmeters.

wmbusmeters --useconfig=/etc

Or you can start wmbusmeters with your own config files:

wmbusmeters --useconfig=/home/me/.config/wmbusmeters

If you already have config with a device specified, and you want to use the config with another device. You might have multiple meters in the config that you want to listen to. Then you can add --overridedevice to override the settings in the config. Like this:

wmbusmeters --useconfig=/home/me/.config/wmbusmeters --overridedevice=rtlwmbus

You must have both --useconfig= and --overridedevice= for it to work.

The files/dir should then be located here: /home/me/.config/wmbusmeters/wmbusmeters.conf and /home/me/.config/wmbusmeters/wmbusmeters.d

The option --useconfig= can only be combined with a few other options: --overridedevice= --listento= --exitafter= --oneshot= --silent --normal --verbose --debug --trace

When running using config files then you can trigger a reload of the config files using sudo killall -HUP wmbusmetersd or killall -HUP wmbusmeters depending on if you are running as a daemon or not.

Running without config files, good for experimentation and test.

wmbusmeters version: 1.15.0
Usage: wmbusmeters {options} [device] { [meter_name] [meter_driver] [meter_id] [meter_key] }*
       wmbusmeters {options} [hex]    { [meter_name] [meter_driver] [meter_id] [meter_key] }*
       wmbusmetersd {options} [pid_file]

As {options} you can use:

    --alarmexpectedactivity=mon-fri(08-17),sat-sun(09-12) Specify when the timeout is tested, default is mon-sun(00-23)
    --alarmshell=<cmdline> invokes cmdline when an alarm triggers
    --alarmtimeout=<time> Expect a telegram to arrive within <time> seconds, eg 60s, 60m, 24h during expected activity.
    --analyze Analyze a telegram to find the best driver.
    --analyze=<key> Analyze a telegram to find the best driver use the provided decryption key.
    --analyze=<driver> Analyze a telegram and use only this driver.
    --analyze=<driver>:<key> Analyze a telegram and use only this driver with this key.
    --calculate_field_unit='...' Add field_unit to the json and calculate it using the formula. E.g.
    --calculate_sumtemp_c='external_temperature_c+flow_temperature_c'
    --calculate_flow_f=flow_temperature_c
    --debug for a lot of information
    --donotprobe=<tty> do not auto-probe this tty. Use multiple times for several ttys or specify "all" for all ttys.
    --driver=<file> load a driver
    --driversdir=<dir> load all drivers in dir
    --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
    --identitymode=(id|id-mfct|full|none) group meter state based on the identity mode. Default is id.
    --ignoreduplicates=<bool> ignore duplicate telegrams, remember the last 10 telegrams
    --field_xxx=yyy always add "xxx"="yyy" to the json output and add shell env METER_xxx=yyy (--json_xxx=yyy also works)
    --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>
    --listunits list all unit suffixes that can be used for typing values
    --logfile=<file> use this file for logging or --logfile=syslog
    --logtelegrams log the contents of the telegrams for easy replay
    --logtimestamps=<when> add log timestamps: always never important
    --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
    --meterfilestimestamp=(never|day|hour|minute|micros) the meter file is suffixed with a
                          timestamp (localtime) with the given resolution.
    --metershell=<cmdline> invokes cmdline with env variables the first time a meter is seen since startup
    --nodeviceexit if no wmbus devices are found, then exit immediately
    --normal for normal logging
    --oneshot wait for an update from each meter, then quit
    --overridedevice=<device> override device in config files. Use only in combination with --useconfig= option
    --ppjson pretty print the json
    --pollinterval=<time> time between polling of meters, must be set to get polling.
    --resetafter=<time> reset the wmbus dongle regularly, default is 23h
    --selectfields=id,timestamp,total_m3 select only these fields to be printed (--listfields=<meter> to list available fields)
    --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 <dir>/wmbusmeters.conf and meters from <dir>/wmbusmeters.d
    --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:

auto:c1, to have wmbusmeters probe for devices: im871a, amb8465(metis), amb3665, cul, rc1180 or rtlsdr (spawns rtlwmbus).

im871a:c1 to start all connected im871a devices in c1 mode, ignore all other devices.

/dev/ttyUSB1:amb8465:c1 to start only this device on this tty. Do not probe for other devices.

If you have two im871a you can supply both of them with their unique id:s and set different listening modes: im871a[12345678]:c1 im871a[11223344]:t1

You can also specify rtlwmbus and if you set the serial in the rtlsdr dongle using rtl_eeprom -s 1234 you can also refer to a specific rtlsdr dongle like this rtlwmbus[1234].

/dev/ttyUSB0:amb8465, if you have an amb8465(metis) dongle assigned to ttyUSB0. Other suffixes are im871a,cul.

(Note that a plain /dev/ttyUSB0 no longer works, you have to specify the device expected on the device.)

/dev/ttyUSB0:38400, to have wmbusmeters set the baud rate to 38400 and listen for raw wmbus telegrams. These telegrams are expected to have the data link layer crc bytes removed already!

MAIN=/dev/ttyUSB0:mbus:2400, assume ttyUSB0 is an serial to mbus-master converter. The speed is set to 2400 bps.

rtlwmbus, to spawn the background process: rtl_sdr -f 868.625M -s 1600000 - 2>/dev/null | rtl_wmbus -f -s for each attached rtlsdr dongle. This will listen to S1,T1 and C1 meters in parallel.

For the moment, it is necessary to send the stderr to a file (/dev/null) because of a bug: https://github.com/osmocom/rtl-sdr/commit/142325a93c6ad70f851f43434acfdf75e12dfe03

Until this bug fix has propagated into Debian/Fedora etc, wmbusmeters uses a tmp file to see the stderr output from rtl_sdr. This tmp file is created in /tmp and will generate 420 bytes of data once ever 23 hours.

The current command line used by wmbusmeters to start the rtl_wmbus pipeline is therefore a bit longer:

ERRFILE=$(mktemp --suffix=_wmbusmeters_rtlsdr) ;
echo ERRFILE=$ERRFILE ;  date -Iseconds > $ERRFILE ;
tail -f $ERRFILE & /usr/bin/rtl_sdr  -d 0 -f 868.625M -s 1.6e6 - 2>>$ERRFILE | /usr/bin/rtl_wmbus -s -f

Note that the standard -s option uses a noticeable amount of CPU time by rtl_wmbus. You can therefore use a tailored rtl_wmbus command that is more suitable for your needs.

rtlwmbus:CMD(<command line>), to specify the entire background process command line that is expected to produce rtlwmbus compatible output. The command line cannot contain parentheses. Likewise for rtl433.

Here is an example command line that reduces the rtl_wmbus CPU usage if you only need T1/C1 telegrams. It disable S1 decoding (-p s) and trades lower cpu usage for reception performance (-a). You should always add the -f option to enable detection if rtl_sdr has stalled:

rtlwmbus:CMD(rtl_sdr -f 868.95M -s 1600000 - 2>/dev/null | rtl_wmbus -p s -a -f)

rtlwmbus(ppm=17), to tune your rtlsdr dongle accordingly. Use this to tune your dongle and at the same time listen to S1,T1 and C1.

rtlwmbus:433M, to tune to this fq instead. This will listen to exactly to what is on this frequency.

rtl433, to spawn the background process: rtl_433 -F csv -f 868.95M

rtl433(ppm=17), to tune your rtlsdr dongle accordingly.

rtl433:433M, to tune to this fq instead.

stdin:rawtty, to read raw binary telegrams from stdin. These telegrams are expected to have the data link layer crc bytes removed already!

telegrams.bin:rawtty, to read raw wmbus telegrams from this file. These telegrams are expected to have the data link layer crc bytes removed already!

stdin:hex, to read hex characters wmbus telegrams from stdin. These telegrams are expected to have the data link layer crc bytes removed already!

telegrams.txt:hex, to read hex characters wmbus telegrams from this file. These telegrams are expected to have the data link layer crc bytes removed already!

stdin:rtlwmbus, to read telegrams formatted using the rtlwmbus format from stdin. Works for rtl433 as well.

telegrams.msg:rtlwmbus, to read rtlwmbus formatted telegrams from this file. Works for rtl433 as well.

simulation_abc.txt, to read telegrams from the file (the file must have a name beginning with simulation_....) expecting the same format that is the output from --logtelegrams. This format also supports replay with timing. The telegrams are allowed to have valid dll crcs, which will be automatically stripped.

As meter quadruples you specify:

  • <meter_name>: a mnemonic for this particular meter (!Must not contain a colon ':' character!)
  • <meter_driver>: use auto or one of the supported meters (can be suffixed with: :<bus_alias> for selecting which bus where we should send the poll requests :<mode> to specify which mode you expect the meter to use when transmitting)
  • <meter_id>: an 8 digit mbus id, usually printed on the meter
  • <meter_key>: an encryption key unique for the meter if the meter uses no encryption, then supply NOKEY
Supported wmbus dongles:
IMST 871a (im871a)
Amber 8465-M/8665-M/8626-M/Metis-II (amb8465) 868MHz
Amber 3665-M (amb3665) 169MHz
CUL family (cul)
Radiocraft (rc1180)
rtl_wmbus (rtlwmbus)
rtl_433 (rtl433)

Supported mbus dongles:
Any bus controller dongle/board behaving like a plain serial port.

Supported water meters:
Aventies (aventieswm)
Apator at-wmbus-08   (apator08) (non-standard protocol)
Apator at-wmbus-16-2 (apator162) (non-standard protocol)
Apator at-wmbus-17-2 (apator172) (non-standard protocol)
Apator Ultrimis (ultrimis)
Aquametro/Integra Topas Es Kr (topaseskr)
Axioma W1 (q400)
Bmeters Hydrodigit (hydrodigit) (partly non-standard protocol)
Bmeters GSD8-I with IWM-TX5 module (iwmtx5)
Diehl/Sappel IZAR RC 868 I R4 PL and R3 (izar) (non-standard protocol)
Diehl HYDRUS (hydrus)
Diehl IZAR RC I G4 (dme_07)
Elster Merlin 868 (emerlin868)
Elster V200H (ev200)
GWF Water (gwfwater)
Maddalena EVO 868 (evo868)
Honeywell Q400 (q400)
Itron (itron)
Kamstrup Multical 21 (kamwater)
Kamstrup flowIQ 2200 (kamwater)
Kamstrup flowIQ 3100 (kamwater)
Qundis QWater5.5 (lse_07_17)
Sontex Supercom 587 (supercom587)
Sensus iPERL (iperl)
Techem MK Radio 3 and 4 (mkradio3,mkradio4) (non-standard protocols)
Waterstar M (waterstarm)
Watertech (watertech)
Zenner Minomess (minomess)

Supported heat cost allocators:
Apator E-ITN 30.51 (apatoreitn)
Engelmann HCA e2 (hcae2)
Innotas EurisII  (eurisii)
Qundis Q caloric (qcaloric)
Sontex 868 (sontex868)
Techem FHKV data II/III (fhkvdataiii)
Siemens WHE542 (whe5x)
BMeters Hydroclima RFM (hydroclima)
BFW 240 (bfw240radio)

Supported heat meters:
Heat meter Techem Compact V / Compact Ve (compact5) (non-standard protocol)
Heat meter Techem vario 3 type 3.2.1 (mkradio3) (see here: https://github.com/weetmuts/wmbusmeters/issues/333)
Heat meter Techem vario 4 (vario451) (non-standard protocol)
Heat and Cooling meters Kamstrup Multical 302,403,602,603,803 (kamheat)
Heat meter Apator Elf (elf)
Heat meter Enercal F2 (enercal)
Heat meter Diehl Sharky 775 (sharky)
Heat meter Diehl Sharky 774 (sharky774)
Heat meter Maddelena microClima (microclima)
Heat and Cooling meter BMeters Hydrocal-M3 (hydrocalm3)
Heat and Cooling meter Axioma Qualcosonic E3 (qualcosonic)
Heat meter Qundis Q heat 5.5 (qheat)
Heat meter Sensus Pollucom F (pollucomf)

Supported room sensors:
Bmeters RFM-AMB Thermometer/Hygrometer (rfmamb)
Elvaco CMa12w Thermometer (cma12w)
Lansen Thermometer/Hygrometer (lansenth)
Weptech Munia / Robin Thermometer/Hygrometer (munia)
PiiGAB Thermometer/Hygrometer (piigth) wired

Supported smoke detectors:
Lansen Smoke Detector (lansensm)
EI Electronics Smoke Detector ei6500-oms (ei6500)

Supported door/window detectors:
Lansen Door/Window Detector (lansendw)

Supported pulse counter:
Lansen Pulse Counter (lansenpu)

Supported electricity meters:
Easy Meter ESYS-WM20 (esyswm)
eBZ wMB-E01 (ebzwmbe)
EMH Metering (ehzp)
Tauron Amiplus (amiplus) (includes vendor apator and echelon)
Gavazzi EM24 (em24)
Gransystems 301 and 303 (gransystems)
Kamstrup Omnipower (omnipower)

Supported gas meters:
uniSMART (unismart)

Supported pressure sensors:
Kamstrup Pressure Sensor (kampress)


The wmbus dongle im871a can listen to either s1, c1 or t1. With the latest firmware version (0x15) im871a can also listen to c1 and t1 telegrams at the same time. (Use --verbose to see your dongles firmware version.) If you have the older firmware you can download the upgrader here: https://wireless-solutions.de/downloadfile/wireless-m-bus-software/

The amb8465 dongle (new model name is Metis-II) can listen to either s1, c1 or t1. It can also listen to c1 and t1 at the same time.

With the latest rtlwmbus you can listen to s1, c1 and t1 at the same time. But you might want to disable some if you want to save cpu usage.

The cul dongle can listen to c1 and t1 at the same time, but only if you specify c1! If you specify t1 or s1, then it will only listen to t1 or s1.

Important!!!! Note that the cul dongle is limited to shorter telegrams. There is a firmware fix that allows somewhat longer, but still not full length telegrams. This can be a serious blocker if you want to receive long telegrams from advanced meters. Read the wiki to find this firmware.

The rc1180 dongle can listen only to t1.

Usage examples

wmbusmeters auto:c1

Listens for C1 telegrams using any of your available wmbus dongles:

Received telegram from: 12345678
          manufacturer: (KAM) Kamstrup Energi (0x2c2d)
           device type: Cold water meter (0x16) encrypted
            device ver: 0x1b
                device: im871a[12345678]
                  rssi: -77 dBm
                driver: multical21

You can see that this telegram is encrypted and therefore you need a key. Now listen to this specific meter, since the driver is auto-detected, we can use auto for the meter driver.

wmbusmeters auto:c1 MyTapWater auto 12345678 00112233445566778899AABBCCDDEEFF

(The Multical21 and other meters use compressed telegrams, which means that you might have to wait up to 8 telegrams (8*16 seconds) until you receive a full length telegram which gives all the information needed to decode the compressed telegrams.)

Example output:

MyTapWater 12345678 6.388 m3 6.377 m3 0.000 m3/h 8°C 23°C DRY(dry 22-31 days) 2018-03-05 12:02.50

(Here the multical21 itself, is configured to send target volume, therefore the max flow is 0.000 m3/h.)

Example format json output:

wmbusmeters --format=json /dev/ttyUSB0:im871a MyTapWater multical21:c1 12345678 00112233445566778899AABBCCDDEEFF MyHeater multical302 22222222 00112233445566778899AABBCCDDEEFF
{"media":"cold water","meter":"multical21","name":"MyTapWater","id":"12345678","total_m3":6.388,"target_m3":6.377,"max_flow_m3h":0.000,"flow_temperature":8,"external_temperature":23,"current_status":"DRY","time_dry":"22-31 days","time_reversed":"","time_leaking":"","time_bursting":"","timestamp":"2018-02-08T09:07:22Z","device":"im871a[1234567]","rssi_dbm":-40}
{"media":"heat","meter":"kamheat","name":"MyHeater","id":"22222222","total_kwh":0.000,"total_volume_m3":0.000,"current_kw":"0.000","timestamp":"2018-02-08T09:07:22Z"}

Example format fields output and use tuned rtlsdr dongle with rtlwmbus.

wmbusmeters --format=fields 'rtlwmbus(ppm=72)' GreenhouseWater multical21:c1 33333333 NOKEY
GreenhouseTapWater;33333333;9999.099;77.712;0.000;11;31;;2018-03-05 12:10.24

You can select a subset of all available fields, where we also select to print the timestamp as a unix timestamp. The timestamp field is UTC time for json and local time when hr and fields. To explicitly select utc you can specify timestamp_utc and timestamp_lt for local time.

wmbusmeters --format=fields --selectfields=id,total_m3,timestamp_ut,timestamp_utc /dev/ttyUSB0:im871a GreenhouseWater multical21:c1 33333333 NOKEY
33333333;9999.099;1628434800;2021-08-08T15:00.00Z

You can list all available fields for a meter: wmbusmeters --listfields=multical21

You can list all meters: wmbusmeters --listmeters

You can search for meters: wmbusmeters --listmeters=water or wmbusmeters --listmeters=q

Eaxmple of using the shell command to publish to MQTT:

wmbusmeters --shell='HOME=/home/you mosquitto_pub -h localhost -t water -m "$METER_JSON"' /dev/ttyUSB0:im871a GreenhouseWater multical21:c1 33333333 NOKEY

Example of using the shell command to inject data into postgresql database:

wmbusmeters --shell="psql waterreadings -c \"insert into readings values ('\$METER_ID',\$METER_TOTAL_M3,'\$METER_TIMESTAMP') \" " /dev/ttyUSB0:amb8465 MyColdWater multical21:c1 12345678 NOKEY

(It is much easier to add shell commands in the conf file since you do not need to quote the quotes.)

You can have multiple shell commands and they will be executed in the order you gave them on the command line.

To list the shell env variables available for a meter, run wmbusmeters --listenvs=multical21 which outputs:

METER_JSON
METER_TYPE
METER_NAME
METER_ID
METER_TOTAL_M3
METER_TARGET_M3
METER_MAX_FLOW_M3H
METER_FLOW_TEMPERATURE_C
METER_EXTERNAL_TEMPERATURE_C
METER_CURRENT_STATUS
METER_TIME_DRY
METER_TIME_REVERSED
METER_TIME_LEAKING
METER_TIME_BURSTING
METER_TIMESTAMP

(If you have supplied --field_floor=5 then you will also see METER_floor in the list)

Note that the METER_TIMESTAMP and the timestamp in the json output, is in UTC format, this is not your localtime. However the hr and fields output will print your localtime.

You can add shell=commandline to a meter file stored in wmbusmeters.d, then this meter will use this shell command instead of the command stored in wmbusmeters.conf.

You can use --debug to get both verbose output and the actual data bytes sent back and forth with the wmbus usb dongle.

If the meter does not use encryption of its meter data, then enter NOKEY on the command line.

wmbusmeters --format=json --meterfiles /dev/ttyUSB0:im871a:c1 MyTapWater multical21:c1 12345678 NOKEY

Using wmbusmeters in a pipe

rtl_sdr -f 868.625M -s 1600000 - 2>/dev/null | rtl_wmbus -f -s | wmbusmeters --format=json stdin:rtlwmbus MyMeter auto 12345678 NOKEY | ...more processing...

Or you can send rtl_wmbus formatted telegrams using nc over UDP to wmbusmeters.

rtl_sdr -f 868.95M -s 1600000 - 2>/dev/null | rtl_wmbus -f -p s -a | nc -u localhost 4444

And receive the telegrams with nc spawned by wmbusmeters.

wmbusmeters 'rtlwmbus:CMD(nc -lku 4444)'

Or start nc explicitly in a pipe.

nc -lku 4444 | wmbusmeters stdin:rtlwmbus

Telegrams can also be pulled in by listening on MQTT topics if they were captured by other tools like rtl_433

wmbusmeters 'hex:CMD(/usr/bin/mosquitto_sub -h 192.168.x.x -t rtl_433/device/devices/6/Wireless-MBus/+/data | tr -d "\n" )'

+ is a wild card that listens to all the captured telegrams but can be replaced with a specific meter's ID

Decoding hex string telegrams

If you have a single telegram as hex, which you want decoded, you do not need to create a simulation file, you can just supply the telegram as a hex string on the command line.

wmbusmeters 234433300602010014007a8e0000002f2f0efd3a1147000000008e40fd3a341200000000

which will output:

No meters configured. Printing id:s of all telegrams heard!
Received telegram from: 00010206
          manufacturer: (LAS) Lansen Systems, Sweden (0x3033)
                  type: Other (0x00)
                   ver: 0x14
                driver: lansenpu

You can of course decode the meter on the fly:

wmbusmeters --format=json 234433300602010014007a8e0000002f2f0efd3a1147000000008e40fd3a341200000000 MyCounter auto 00010206 NOKEY

which will output:

{"media":"other","meter":"lansenpu","name":"MyCounter","id":"00010206","a_counter":4711,"b_counter":1234,"timestamp":"2021-09-12T08:45:52Z"}

You can also pipe the hex into wmbusmeters like this:

echo 234433300602010014007a8e0000002f2f0efd3a1147000000008e40fd3a341200000000 | ./build/wmbusmeters --silent --format=json stdin:hex MyCounter auto 00010206 NOKEY

or read hex data from a a file, wmbusmeters myfile.txt:hex

Any non-hex characters are ignored when using the suffix :hex. However when the hex string is supplied on the command line it must be a proper hex string with no spaces.

When a telegram is supplied on the command line, then any valid dll crcs will be automatically removed, like when the telegram is suppled in a simulation file.

You can analyze a telegram, this is useful when developing new drivers or trying to find which driver is the best fit for an unknown mfct,type,ver combo.

wmbusmeters --analyze 3E44A5119035246141047A1A0030052F2F#0C06026301000C13688609040B3B0802000C2B220000F00A5A71020A5E72020AA61800004C0636370100426CBF25

Fields marked with C! (and green background) are content that is understood and put to use in the json. For example:

019 C!: 02630100 ("total_energy_consumption_kwh":16302)

Which shows the telegram raw data bytes and the json field into which the decoded value was presented. Fields marked with C? (and red background) are content that is not understood nor used in the json.

To force a driver use: --analyze=<driver> to supply a decryption key: --analyze=<key> and to do both: --analyze=<key>:<driver>

You can run the analyze functionality online here: wmbusmeters.org

Additional tools

If you have a Kamstrup meter and you have received a KEM file and its password from your supplier, then you can use python2 utils/kem-import.py utils/kem-import.py to extract meter information from that file (including the AES key) and to create corresponding meter files in wmbusmeters' config directory.

You can also use the XMLExtract Java program. javac utils/XMLExtract and then java -cp utils XMLExtract to print the key on the command line.

You can run wmbusmeters with --logtelegrams to get log output that can be placed in a simulation.txt file. You can then run wmbusmeters and instead of an usb device, you provide the simulation.txt file as argument. See test.sh for more info.

If you do not specify any meters on the command line, then wmbusmeters will listen and print the header information of any telegram it hears.

Builds and runs on GNU/Linux MacOSX (with recent XCode), and FreeBSD

(For MacOSX do brew install librtlsdr libusb which takes such a long time that the MacOSX travis build is disabled for the moment.)

./configure && make && make test

Binary generated: ./build/wmbusmeters

make install will install this binary.

make HOST=arm to cross compile from GNU/Linux to Raspberry PI.

Binary generated: ./build_arm/wmbusmeters

make DEBUG=true

Binary generated: ./build_debug/wmbusmeters

make testd to run all tests using the debug build.

Debug builds only work on FreeBSD if the compiler is LLVM. If your system default compiler is gcc, set CXX=clang++ to the build environment to force LLVM to be used.

make DEBUG=true HOST=arm

Binary generated: ./build_arm_debug/wmbusmeters

System configuration

make install installs the files:

/etc/wmbusmeters.conf /usr/bin/wmbusmeters /usr/sbin/wmbusmetersd /etc/systemd/system/wmbusmeters.service /etc/logrotate.d/wmbusmeters

creates these directories:

/etc/wmbusmeters.d /var/lib/wmbusmeters/meter_readings

and adds the user wmbusmeters with no login account.

Common problems

If wmbusmeters detects no device, but you know you have plugged in your wmbus dongle, then run with --verbose to get more information on why the devices are not detected. Typically this is because you are not in the dialout (for usb-serial dongles) or plugdev (for rtlsdr) group.

Run sudo make install to add the current user to the dialout group and the wmbusmeters group.

If the daemon has started then the wmbus device will be taken and you cannot start wmbusmeters manually.

To run manually, first make sure the daemon is stopped sudo systemctl stop wmbusmeters if this hangs, then do sudo killall -9 wmbusmetersd and/or sudo killall -9 wmbusmeters.

Non-standard baud rate set for AMB8465 USB stick

Wmbusmeters expects the serial baud rate for the AMB8465 USB stick to be 9600 8n1. If you have used another tool and changed the baud rate to something else you need to restore the baud rate to 9600 8n1.

If you like to send the bytes manually, the correct bytes are:

  • Factory reset of the settings: 0xFF1100EE
  • Reset the stick to apply the factory defaults: 0xFF0500FA this is not necessary if you unplug and reinsert the dongle.

How to add a new driver

Drivers are self contained source code files named src/driver_xyz.cc They register themselves at startup. The source file also contains the necessary tests for that driver.

Read more here: doc/CreateDriver.md

Caveat

If you do not get proper readings from the meters with non-standard protocols. apator162, mkradio3, vario451 then you have to open an issue here and help out by logging a lot of messages and reverse engineer them even more..... :-/

Good free documents on the wireless mbus protocol standard EN 13757

https://oms-group.org/

There is also a lot of wmbus protocol implementation details that are missing. They will be added to the program as we figure out how the meters send their data.

Footnotes

  1. https://docs.kernel.org/userspace-api/media/v4l/dev-sdr.html?highlight=sdr#software-defined-radio-interface-sdr

wmbusmeters's People

Contributors

andi252 avatar balczezzz avatar bb-froggy avatar bibolv avatar chpego avatar cinemarene avatar convicte avatar cubic3d avatar dedragonslayer avatar dependabot[bot] avatar domathome avatar don-vip avatar dwrobel avatar ebuzzz avatar elbaek89 avatar henryne avatar jacek27 avatar jannickfahlbusch avatar jnxxx avatar jsuchal avatar krzysztofhajdamowicz avatar petterreinholdtsen avatar pimlie avatar skazi0 avatar testuser7 avatar the78mole avatar thecem avatar to-masz avatar weetmuts avatar zewaren avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

wmbusmeters's Issues

apator162 - identified numbers of days since last reset

Still assumption but well documented and proven for 3 different meters
apator162 proprietary protocol - numbers of days since last reset / initial setup.

Below data from 2 different meters

[M1] 2019-09-05 14:47.32 2F|2F|0F|A9|65|99|93|0E|02|08|43|F3|01|82|DA|55|76|84|65|79|08|9E|07|0A|10|87|16|01|00|71|01|87|16|01|00|87|16|01|00|A0|1A|86|AF|03|FF|FFE6E2
[M2] 2019-09-05 2F|2F|0F|CF|65|99|93|0E|02|00|43|96|00|82|CD|79|74|CE|65|79|FF|E4|4B|00|10|2E|8A|00|00|75|01|0E|85|00|00|E6|54|00|00|97|17|00|00|04|01|00000401000000000000
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36

M1 - set up 2018
M2 - set up 2019

location 11, 12

M1 - hex 01F3 - 499 days
M2 - hex 0096 - dec 150 days

Multical302 warning: unknown frame with correct AES Key and no data

Hi Fredrik,

i try to get the data from my new Kamstrup Multical 302, i have the AES key but getting warnings an no Data. Is this a frame problem or maybe the wrong AES-Key? There are some decrypted blocks in the log.

Config File

name=Heat
type=multical302
id=67880556
key=0870C7A5438E42B6B5D1...

Debug Log

wmbusmeters --debug --verbose /dev/ttyUSB0:im871a multical302 multical302:c1 67880556 "0870C7A5..."

(wmbusmeters) version: 0.9.18
(config) using device: /dev/ttyUSB0
(config) with: im871a
(config) number of meters: 1
(detect) "/dev/ttyUSB0" "im871a"
(detect) is_tty=1 is_stdin=0 is_file=0
(im871a) on /dev/ttyUSB0
(serialtty) opened /dev/ttyUSB0
(config) meter multical302 link mode(s): c1
(config) all possible link modes that the meters might transmit on: c1
(config) listen link modes calculated to be: c1
(wmbusmeters) configured "multical302" "multical302" "67880556" encrypted
(im871a) set link mode 06
(serial /dev/ttyUSB0) sent "A5010306000206300101"
(serial) received binary A58104009CF7
(im871a) got crc16 f79c expected f79c
(im871a) set config completed
(im871a) get config
(serial /dev/ttyUSB0) sent "A5010500"
(serial) received binary A5810617FF000600B32558181000010001FF070232000101000077D9DB
(im871a) got crc16 dbd9 expected dbd9
(im871a) get config completed
(im871a) config: device mode 00
(im871a) config: link mode 06
(im871a) config: wmbus c-field 00
(im871a) config: wmbus mfg id 25b3 (IMS)
(im871a) config: wmbus device id 00101858
(im871a) config: wmbus version 01
(im871a) config: wmbus device type 00
(im871a) config: radio channel 01
(im871a) config: radio power level 07
(im871a) config: radio data rate 02
(im871a) config: radio rx window 32
(im871a) config: auto power saving 00
(im871a) config: auto RSSI attachment 01
(im871a) config: auto rx timestamp attachment 01
(im871a) config: led control 00
(im871a) config: rtc control 00
(config) listen to link modes: c1
(serial) waiting for stop

(serial) received binary A5E20325442D2C5605886730048D2046405C40206914B1DD04DBC608C9DB54B00CBA81FAF673221768EBCD000000DFF5
(im871a) timestamp 0000cdeb
(im871a) rssi 00
(im871a) got crc16 f5df expected f5df
(wmbus) received telegram 67880556 C-field=44 M-field=2c2d (KAM) A-field-version=30 A-field-dev-type=04 (Heat meter) Ci-field=8d (Extended Link Layer II (8 Byte)) CC-field=20 (slow_resp sync) ell header ACC=46 SN=20405c40
(wmbus) frame "25442D2C5605886730048D2046405C40206914B1DD04DBC608C9DB54B00CBA81FAF673221768"
(wmbus) payload "6914B1DD04DBC608C9DB54B00CBA81FAF673221768"
(wmbus) 00: 25 length (37 bytes)
(wmbus) 01: 44 c-field (SND_NR)
(wmbus) 02: 2d2c m-field (2c2d=KAM)
(wmbus) 04: 56058867 a-field-addr (67880556)
(wmbus) 08: 30 a-field-version
(wmbus) 09: 04 a-field-type (Heat meter)
(wmbus) 0a: 8d ci-field (Extended Link Layer II (8 Byte))
(wmbus) 0b: 20 cc-field (slow_resp sync)
(wmbus) 0c: 46 acc
(wmbus) 0d: 405c4020 sn
(wmbus) 25442D2C5605886730048D2046405C4020
(meter) multical302: for me? 67880556
(meter) multical302: yes for me
(multical302) multical302 67880556 (Mode1) decrypting "6914B1DD04DBC608C9DB54B00CBA81FAF673221768"
(Mode1) IV 2D2C56058867300420405C4020000000
(Mode1) decrypted first block "8EDDC982F3A62F39A5B5520FC4835965"
(Mode1) IV+1 2D2C56058867300420405C4020000001
(Mode1) decrypted second block "48CF2FF7C1"
(Mode1) decrypted "8EDDC982F3A62F39A5B5520FC483596548CF2FF7C1"
(multical302) log "telegram=|25442D2C5605886730048D2046405C4020|8EDDC982F3A62F39A5B5520FC483596548CF2FF7C1|+2"
(multical302) warning: unknown frame c9 (did you use the correct encryption key?)
(multical302) 11: 8edd payload crc
(multical302) 13: c9 frame type (?)
(multical302) 25442D2C5605886730048D2046405C40208EDDC9
multical302     67880556        0 kWh   0 m3    0 kW    2019-11-19 09:40.11

(serial) received binary A5E20325442D2C5605886730048D2047415C4020956F8BA42EB7F42FCDBA180CED8C2C8E0CC349390028820000003340
(im871a) timestamp 00008228
(im871a) rssi 00
(im871a) got crc16 4033 expected 4033
(wmbus) received telegram 67880556 C-field=44 M-field=2c2d (KAM) A-field-version=30 A-field-dev-type=04 (Heat meter) Ci-field=8d (Extended Link Layer II (8 Byte)) CC-field=20 (slow_resp sync) ell header ACC=47 SN=20405c41
(wmbus) frame "25442D2C5605886730048D2047415C4020956F8BA42EB7F42FCDBA180CED8C2C8E0CC3493900"
(wmbus) payload "956F8BA42EB7F42FCDBA180CED8C2C8E0CC3493900"
(wmbus) 00: 25 length (37 bytes)
(wmbus) 01: 44 c-field (SND_NR)
(wmbus) 02: 2d2c m-field (2c2d=KAM)
(wmbus) 04: 56058867 a-field-addr (67880556)
(wmbus) 08: 30 a-field-version
(wmbus) 09: 04 a-field-type (Heat meter)
(wmbus) 0a: 8d ci-field (Extended Link Layer II (8 Byte))
(wmbus) 0b: 20 cc-field (slow_resp sync)
(wmbus) 0c: 47 acc
(wmbus) 0d: 415c4020 sn
(wmbus) 25442D2C5605886730048D2047415C4020
(meter) multical302: for me? 67880556
(meter) multical302: yes for me
(multical302) multical302 67880556 (Mode1) decrypting "956F8BA42EB7F42FCDBA180CED8C2C8E0CC3493900"
(Mode1) IV 2D2C56058867300420415C4020000000
(Mode1) decrypted first block "145B6326F26C8F1730762D2A2DEACA8B"
(Mode1) IV+1 2D2C56058867300420415C4020000001
(Mode1) decrypted second block "F0B04C998B"
(Mode1) decrypted "145B6326F26C8F1730762D2A2DEACA8BF0B04C998B"
(multical302) log "telegram=|25442D2C5605886730048D2047415C4020|145B6326F26C8F1730762D2A2DEACA8BF0B04C998B|+18"
(multical302) warning: unknown frame 63 (did you use the correct encryption key?)
(multical302) 11: 145b payload crc
(multical302) 13: 63 frame type (?)
(multical302) 25442D2C5605886730048D2047415C4020145B63
multical302     67880556        0 kWh   0 m3    0 kW    2019-11-19 09:40.27

Thanks very much!
Ben

Techem sensor payload

Should be heat meters.

4 different device types:

model     : Wireless M-Bus                         Manufacturer: TCH         ID        : 21500591
Version   : 113          Device Type: 0x61         Device Type String:       Control   : 0x44          Data Length: 63
Data      : 364468509105502171614b75a000de2647b201d0ec0b0000b71680b2ae9569159978d3a9582577ca65aa67534f09f03508db54763d251666a9e160196ed7f0
Integrity : CRC
time      : @0.022837s
model     : Wireless M-Bus                         Manufacturer: TCH         ID        : 30586050
Version   : 34           Device Type: 0x43         Device Type String:       Control   : 0x44          Data Length: 63
Data      : 36446850506058302243f477a100de2616d600d0d302000117481611603da8108832c72c64544d52fd262070a465b213d559524b3583c9142938f040079406
Integrity : CRC
time      : @0.041196s
model     : Wireless M-Bus                         Manufacturer: TCH         ID        : 30717777
Version   : 105          Device Type: 0x80         Device Type String:       Control   : 0x44          Data Length: 59
Data      : 3244685077777130698091f6a011de264401e0340600390838080600fc9b000000051009120d0a1123282718161dea460f120a040000000000ada3
Integrity : CRC

model     : Wireless M-Bus                         Manufacturer: TCH         ID        : 25071981
Version   : 116          Device Type: 0x62         Device Type String:       Control   : 0x44          Data Length: 56
Data      : 2f44685081190725746203a9a206de266813e0344d000000041517125af6130c0a2924291e0f23202b262524270dfd2a231c2018061aa2d6
Integrity : CRC

Timestamp 2h diff in json output

Hi,

I just started to use the wmbusmeter tool to decrypt the messages from Multical meter. I noted that the timestamp differs 2h in the json output. The timestamp is correct when no format is given.

Include lastdebug/verbose output and date info from my server just after stopped wmbusmeter:

(serial /dev/im871a) received "A5E20323442D2C010641581B168D20DA24012B2019D4C34436FAAEB23E2EE5C4057834F561A92135C5000000A3FA"
(im871a) timestamp 0000c535
(im871a) rssi 00
(im871a) got crc16 faa3 expected faa3
(wmbus) received telegram 58410601 C-field=44 M-field=2c2d (KAM) A-field-version=1b A-field-dev-type=16 (Cold water meter) Ci-field=8d (Extended Link Layer II (8 Byte)) CC-field=20 (slow_resp sync) ell header ACC=da SN=202b0124
(wmbus) frame "23442D2C010641581B168D20DA24012B2019D4C34436FAAEB23E2EE5C4057834F561A921"
(wmbus) payload "19D4C34436FAAEB23E2EE5C4057834F561A921"
(wmbus) 00: 23 length (35 bytes)
(wmbus) 01: 44 c-field (SND_NR)
(wmbus) 02: 2d2c m-field (2c2d=KAM)
(wmbus) 04: 01064158 a-field-addr (58410601)
(wmbus) 08: 1b a-field-version
(wmbus) 09: 16 a-field-type (Cold water meter)
(wmbus) 0a: 8d ci-field (Extended Link Layer II (8 Byte))
(wmbus) 0b: 20 cc-field (slow_resp sync)
(wmbus) 0c: da acc
(wmbus) 0d: 24012b20 sn
(wmbus) 23442D2C010641581B168D20DA24012B20
(meter) MyTapWater: for me? 58410601
(meter) MyTapWater: yes for me
(multical21) MyTapWater 58410601 (Mode1) decrypting "19D4C34436FAAEB23E2EE5C4057834F561A921"
(Mode1) IV 2D2C010641581B162024012B20000000
(Mode1) decrypted first block "EF9079EB61ACEA00006B2A00004C2200"
(Mode1) IV+1 2D2C010641581B162024012B20000001
(Mode1) decrypted second block "000A15"
(Mode1) decrypted "EF9079EB61ACEA00006B2A00004C2200000A15"
(multical21) log "telegram=|23442D2C010641581B168D20DA24012B20|EF9079EB61ACEA00006B2A00004C2200000A15|+151"
(ACS) ignoring telegram since format signature hash 0x61eb is yet unknown.
(multical21) 11: ef90 payload crc
(multical21) 13: 79 frame type (short frame)
(multical21) 14: eb61 format signature
(multical21) 23442D2C010641581B168D20DA24012B20EF9079EB61
{"media":"cold water","meter":"multical21","name":"MyTapWater","id":"58410601","total_m3":0,"target_m3":0,"max_flow_m3h":0,"flow_temperature_c":127,"external_temperature_c":127,"current_status":"","time_dry":"","time_reversed":"","time_leaking":"","time_bursting":"","timestamp":"2019-06-06T08:46:11Z"}
^C(serialtty) event loop stopped!
(serialtty) closed /dev/im871a
(serialtty) closed /dev/im871a
banshee@kerberos ~ $ date
tor 6 jun 2019 10:46:19 CEST

It seems like the timestamp in the json is UTC time, while the server time is UTC+2 = CEST, which is the correct time.

Regards
//Anders

Protocol error

Hey,
I compiled
git://git.osmocom.org/rtl-sdr.git
and
https://github.com/xaelsouth/rtl-wmbus
The
rtl_sdr -f 868.95M -s 1600000 - 2>/dev/null | rtl_wmbus
command works fine and returns messages:

C1;0;1;2019-03-30 00:08:00.000;34;54;55150040;0x27442d2c4000155555055dd0450e0ec9c70a91808211311820206758e532c492410100e66c296910
T1;0;0;2019-03-30 00:08:20.000;14;37;83714654;0x2e44ffff544671837062a0009f252901e0270000000000000200000000010001000101010101020202040302040504
T1;0;0;2019-03-30 00:08:23.000;66;132;71708009;0x2e446850098070717072a0009f252904e0274b00ff08100c0e0f0d0e0d0e10070c0f0c0e0f0f0d0c0dffffffffff0b
T1;1;1;2019-03-30 00:08:28.000;19;36;83607818;0x2e446850187860837062a0009f25e001e0271400000605060404050605050505020b090a0606080905080200060709
C1;0;1;2019-03-30 00:08:31.000;17;15;67244331;0x27442d2c314324673004022298e521b9ac6b29ea03a8a2cb6544a5552904050820814041c001d274
T1;1;1;2019-03-30 00:08:45.000;32;34;83719309;0x2e446850099371837072a0009f250d06e02769000010110b1717131d1713170c0d141215141b101814181713171714
T1;1;1;2019-03-30 00:08:52.000;18;34;83714654;0x2e446850544671837062a0009f252901e0270000000000000200000000010001000101010101020202040302040504
T1;0;0;2019-03-30 00:08:54.000;67;173;83602033;0x2e446850332060837072a0009f25d904e027860000141814151a151515181aff120701090b07050a0100000b12ff14
T1;1;1;2019-03-30 00:08:54.000;17;31;71708005;0x2e446850058070717072a0009f255701e02724000005060c0b070d09090c0c070e0f0e0b070a090200010100010102

However, calling wmbusmeters:
wmbusmeters --debug "rtlwmbus:868.9M"
I get an error:

(wmbusmeters) version: 0.9.2
(config) using device: rtlwmbus
(config) with: 868.9M
(config) number of meters: 0
(rtlwmbus) using command: rtl_sdr -f 868.9M -s 16000000 - 2>/dev/null | rtl_wmbus
exec background "/bin/sh"
arg "-c"
arg "rtl_sdr -f 868.9M -s 16000000 - 2>/dev/null | rtl_wmbus"
(serialcmd) opened /bin/sh
(config) using link mode: Any
No meters configured. Printing id:s of all telegrams heard!

(serialcmd) received "3A20313A2072746C5F776D6275733A206E6F7420666F756E640A"
(rtl_wmbus) protocol error in message received!
(rtl_wmbus) protocol error "3A20313A2072746C5F776D6275733A206E6F7420666F756E640A"

regardless of whether the tuner is inserted into the port or not. What am I doing wrong?

Compile under MacOSX (and support for Qundis Q Caloric Heat Cost Allocator)

Hi,
sorry for the dumb question: I compiled wmbusmeters in a docker/debian container , but docker under mac cannot pass usb device to the hypervisor.

Under mac I cannot get it to compile. Here my g++ compiler specs and the output below.

I see in the Travis tests here that you are using C++ 4.8.something, maybe my problem is there?

A side question:
I cannot find a driver for mac to expose my cheap usb SDR (a chinese Realtek RTL28380, confirmed working with rtl_sdr and rtl-wmbus) under /dev/. I guess the rtl_sdr uses directly libusb to search for the device. There is a way to pass the data from stdin? Or any suggestion for running under mac?
In the future I'll switch this to a raspberry.

Thanks!

$ g++ -v
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/opt/local/libexec/gcc/x86_64-apple-darwin16/8.2.0/lto-wrapper
Target: x86_64-apple-darwin16
Configured with: /opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_lang_gcc8/gcc8/work/gcc-8.2.0/configure --prefix=/opt/local --build=x86_64-apple-darwin16 --enable-languages=c,c++,objc,obj-c++,lto,fortran --libdir=/opt/local/lib/gcc8 --includedir=/opt/local/include/gcc8 --infodir=/opt/local/share/info --mandir=/opt/local/share/man --datarootdir=/opt/local/share/gcc-8 --with-local-prefix=/opt/local --with-system-zlib --disable-nls --program-suffix=-mp-8 --with-gxx-include-dir=/opt/local/include/gcc8/c++/ --with-gmp=/opt/local --with-mpfr=/opt/local --with-mpc=/opt/local --with-isl=/opt/local --enable-stage1-checking --disable-multilib --enable-lto --enable-libstdcxx-time --with-build-config=bootstrap-debug --with-as=/opt/local/bin/as --with-ld=/opt/local/bin/ld --with-ar=/opt/local/bin/ar --with-bugurl=https://trac.macports.org/newticket --disable-tls --with-pkgversion='MacPorts gcc8 8.2.0_3'
Thread model: posix
gcc version 8.2.0 (MacPorts gcc8 8.2.0_3)
 make
g++ -Os -fPIC -fmessage-length=0 -std=c++11 -Wall -Wno-maybe-uninitialized -Wno-unused-function "-DWMBUSMETERS_VERSION=\"0.8.1\"" aes.cc -c -o build/aes.o
g++ -Os -fPIC -fmessage-length=0 -std=c++11 -Wall -Wno-maybe-uninitialized -Wno-unused-function "-DWMBUSMETERS_VERSION=\"0.8.1\"" cmdline.cc -c -o build/cmdline.o
In file included from /usr/include/_wctype.h:47,
                 from /usr/include/wchar.h:92,
                 from /opt/local/include/gcc8/c++/cwchar:44,
                 from /opt/local/include/gcc8/c++/bits/postypes.h:40,
                 from /opt/local/include/gcc8/c++/bits/char_traits.h:40,
                 from /opt/local/include/gcc8/c++/string:40,
                 from /opt/local/include/gcc8/c++/stdexcept:39,
                 from /opt/local/include/gcc8/c++/array:39,
                 from /opt/local/include/gcc8/c++/tuple:39,
                 from /opt/local/include/gcc8/c++/functional:54,
                 from util.h:23,
                 from meters.h:21,
                 from cmdline.h:21,
                 from cmdline.cc:18:
/usr/include/_types/_wctype_t.h:31:9: error: '__darwin_wctype_t' does not name a type; did you mean '__darwin_time_t'?
 typedef __darwin_wctype_t wctype_t;
         ^~~~~~~~~~~~~~~~~
         __darwin_time_t
In file included from /usr/include/wchar.h:92,
                 from /opt/local/include/gcc8/c++/cwchar:44,
                 from /opt/local/include/gcc8/c++/bits/postypes.h:40,
                 from /opt/local/include/gcc8/c++/bits/char_traits.h:40,
                 from /opt/local/include/gcc8/c++/string:40,
                 from /opt/local/include/gcc8/c++/stdexcept:39,
                 from /opt/local/include/gcc8/c++/array:39,
                 from /opt/local/include/gcc8/c++/tuple:39,
                 from /opt/local/include/gcc8/c++/functional:54,
                 from util.h:23,
                 from meters.h:21,
                 from cmdline.h:21,
                 from cmdline.cc:18:
/usr/include/_wctype.h:84:22: error: 'wctype_t' has not been declared
 iswctype(wint_t _wc, wctype_t _charclass)
                      ^~~~~~~~
/usr/include/_wctype.h:171:1: error: 'wctype_t' does not name a type; did you mean 'iswctype'?
 wctype_t
 ^~~~~~~~
 iswctype
In file included from /opt/local/include/gcc8/c++/cwchar:44,
                 from /opt/local/include/gcc8/c++/bits/postypes.h:40,
                 from /opt/local/include/gcc8/c++/bits/char_traits.h:40,
                 from /opt/local/include/gcc8/c++/string:40,
                 from /opt/local/include/gcc8/c++/stdexcept:39,
                 from /opt/local/include/gcc8/c++/array:39,
                 from /opt/local/include/gcc8/c++/tuple:39,
                 from /opt/local/include/gcc8/c++/functional:54,
                 from util.h:23,
                 from meters.h:21,
                 from cmdline.h:21,
                 from cmdline.cc:18:
/usr/include/wchar.h:98:15: error: 'FILE' was not declared in this scope
 wint_t fgetwc(FILE *);
               ^~~~
/usr/include/wchar.h:98:15: note: 'FILE' is defined in header '<cstdio>'; did you forget to '#include <cstdio>'?
/usr/include/wchar.h:93:1:
+#include <cstdio>

/usr/include/wchar.h:98:15:
 wint_t fgetwc(FILE *);
               ^~~~
/usr/include/wchar.h:98:21: error: expected primary-expression before ')' token
 wint_t fgetwc(FILE *);
                     ^
/usr/include/wchar.h:99:44: error: 'FILE' has not been declared
 wchar_t *fgetws(wchar_t * __restrict, int, FILE * __restrict);
                                            ^~~~
/usr/include/wchar.h:100:24: error: 'FILE' has not been declared
 wint_t fputwc(wchar_t, FILE *);
                        ^~~~
/usr/include/wchar.h:101:40: error: 'FILE' has not been declared
 int fputws(const wchar_t * __restrict, FILE * __restrict);
                                        ^~~~
/usr/include/wchar.h:102:11: error: 'FILE' was not declared in this scope
 int fwide(FILE *, int);
           ^~~~
/usr/include/wchar.h:102:11: note: 'FILE' is defined in header '<cstdio>'; did you forget to '#include <cstdio>'?
/usr/include/wchar.h:102:17: error: expected primary-expression before ',' token
 int fwide(FILE *, int);
                 ^
/usr/include/wchar.h:102:19: error: expected primary-expression before 'int'
 int fwide(FILE *, int);
                   ^~~
/usr/include/wchar.h:102:22: error: expression list treated as compound expression in initializer [-fpermissive]
 int fwide(FILE *, int);
                      ^
/usr/include/wchar.h:103:14: error: 'FILE' was not declared in this scope
 int fwprintf(FILE * __restrict, const wchar_t * __restrict, ...);
              ^~~~
/usr/include/wchar.h:103:14: note: 'FILE' is defined in header '<cstdio>'; did you forget to '#include <cstdio>'?
/usr/include/wchar.h:103:31: error: expected primary-expression before ',' token
 int fwprintf(FILE * __restrict, const wchar_t * __restrict, ...);
                               ^
/usr/include/wchar.h:103:33: error: expected primary-expression before 'const'
 int fwprintf(FILE * __restrict, const wchar_t * __restrict, ...);
                                 ^~~~~
/usr/include/wchar.h:103:61: error: expected primary-expression before '...' token
 int fwprintf(FILE * __restrict, const wchar_t * __restrict, ...);
                                                             ^~~
/usr/include/wchar.h:103:64: error: expression list treated as compound expression in initializer [-fpermissive]
 int fwprintf(FILE * __restrict, const wchar_t * __restrict, ...);
                                                                ^
/usr/include/wchar.h:104:13: error: 'FILE' was not declared in this scope
 int fwscanf(FILE * __restrict, const wchar_t * __restrict, ...);
             ^~~~
/usr/include/wchar.h:104:13: note: 'FILE' is defined in header '<cstdio>'; did you forget to '#include <cstdio>'?
/usr/include/wchar.h:104:30: error: expected primary-expression before ',' token
 int fwscanf(FILE * __restrict, const wchar_t * __restrict, ...);
                              ^
/usr/include/wchar.h:104:32: error: expected primary-expression before 'const'
 int fwscanf(FILE * __restrict, const wchar_t * __restrict, ...);
                                ^~~~~
/usr/include/wchar.h:104:60: error: expected primary-expression before '...' token
 int fwscanf(FILE * __restrict, const wchar_t * __restrict, ...);
                                                            ^~~
/usr/include/wchar.h:104:63: error: expression list treated as compound expression in initializer [-fpermissive]
 int fwscanf(FILE * __restrict, const wchar_t * __restrict, ...);
                                                               ^
/usr/include/wchar.h:105:14: error: 'FILE' was not declared in this scope
 wint_t getwc(FILE *);
              ^~~~
/usr/include/wchar.h:105:14: note: 'FILE' is defined in header '<cstdio>'; did you forget to '#include <cstdio>'?
/usr/include/wchar.h:105:20: error: expected primary-expression before ')' token
 wint_t getwc(FILE *);
                    ^
/usr/include/wchar.h:113:23: error: 'FILE' has not been declared
 wint_t putwc(wchar_t, FILE *);
                       ^~~~
/usr/include/wchar.h:117:24: error: 'FILE' has not been declared
 wint_t ungetwc(wint_t, FILE *);
                        ^~~~
/usr/include/wchar.h:118:15: error: 'FILE' was not declared in this scope
 int vfwprintf(FILE * __restrict, const wchar_t * __restrict,
               ^~~~
/usr/include/wchar.h:118:15: note: 'FILE' is defined in header '<cstdio>'; did you forget to '#include <cstdio>'?
/usr/include/wchar.h:118:32: error: expected primary-expression before ',' token
 int vfwprintf(FILE * __restrict, const wchar_t * __restrict,
                                ^
/usr/include/wchar.h:118:34: error: expected primary-expression before 'const'
 int vfwprintf(FILE * __restrict, const wchar_t * __restrict,
                                  ^~~~~
/usr/include/wchar.h:119:22: error: expected primary-expression before ')' token
      __darwin_va_list);
                      ^
/usr/include/wchar.h:119:22: error: expression list treated as compound expression in initializer [-fpermissive]
/usr/include/wchar.h:170:14: error: 'FILE' was not declared in this scope
 int vfwscanf(FILE * __restrict, const wchar_t * __restrict,
              ^~~~
/usr/include/wchar.h:170:14: note: 'FILE' is defined in header '<cstdio>'; did you forget to '#include <cstdio>'?
/usr/include/wchar.h:170:31: error: expected primary-expression before ',' token
 int vfwscanf(FILE * __restrict, const wchar_t * __restrict,
                               ^
/usr/include/wchar.h:170:33: error: expected primary-expression before 'const'
 int vfwscanf(FILE * __restrict, const wchar_t * __restrict,
                                 ^~~~~
/usr/include/wchar.h:171:22: error: expected primary-expression before ')' token
      __darwin_va_list);
                      ^
/usr/include/wchar.h:171:22: error: expression list treated as compound expression in initializer [-fpermissive]
/usr/include/wchar.h:214:18: error: 'FILE' was not declared in this scope
 wchar_t *fgetwln(FILE * __restrict, size_t *) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3);
                  ^~~~
/usr/include/wchar.h:214:18: note: 'FILE' is defined in header '<cstdio>'; did you forget to '#include <cstdio>'?
/usr/include/wchar.h:214:35: error: expected primary-expression before ',' token
 wchar_t *fgetwln(FILE * __restrict, size_t *) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3);
                                   ^
/usr/include/wchar.h:214:44: error: expected primary-expression before '*' token
 wchar_t *fgetwln(FILE * __restrict, size_t *) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3);
                                            ^
/usr/include/wchar.h:214:45: error: expected primary-expression before ')' token
 wchar_t *fgetwln(FILE * __restrict, size_t *) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3);
                                             ^
/usr/include/wchar.h:214:45: error: expression list treated as compound expression in initializer [-fpermissive]
In file included from /usr/include/wchar.h:92,
                 from /opt/local/include/gcc8/c++/cwchar:44,
                 from /opt/local/include/gcc8/c++/bits/postypes.h:40,
                 from /opt/local/include/gcc8/c++/bits/char_traits.h:40,
                 from /opt/local/include/gcc8/c++/string:40,
                 from /opt/local/include/gcc8/c++/stdexcept:39,
                 from /opt/local/include/gcc8/c++/array:39,
                 from /opt/local/include/gcc8/c++/tuple:39,
                 from /opt/local/include/gcc8/c++/functional:54,
                 from util.h:23,
                 from meters.h:21,
                 from cmdline.h:21,
                 from cmdline.cc:18:
/opt/local/include/gcc8/c++/bits/char_traits.h: In static member function 'static constexpr std::char_traits<wchar_t>::int_type std::char_traits<wchar_t>::eof()':
/opt/local/include/gcc8/c++/bits/char_traits.h:487:38: error: '__DARWIN_WEOF' was not declared in this scope
       { return static_cast<int_type>(WEOF); }
                                      ^~~~
In file included from /opt/local/include/gcc8/c++/string:40,
                 from /opt/local/include/gcc8/c++/stdexcept:39,
                 from /opt/local/include/gcc8/c++/array:39,
                 from /opt/local/include/gcc8/c++/tuple:39,
                 from /opt/local/include/gcc8/c++/functional:54,
                 from util.h:23,
                 from meters.h:21,
                 from cmdline.h:21,
                 from cmdline.cc:18:
/opt/local/include/gcc8/c++/bits/char_traits.h:487:45: error: body of 'constexpr' function 'static constexpr std::char_traits<wchar_t>::int_type std::char_traits<wchar_t>::eof()' not a return-statement
       { return static_cast<int_type>(WEOF); }
                                             ^
In file included from /opt/local/include/gcc8/c++/ext/string_conversions.h:43,
                 from /opt/local/include/gcc8/c++/bits/basic_string.h:6391,
                 from /opt/local/include/gcc8/c++/string:52,
                 from /opt/local/include/gcc8/c++/stdexcept:39,
                 from /opt/local/include/gcc8/c++/array:39,
                 from /opt/local/include/gcc8/c++/tuple:39,
                 from /opt/local/include/gcc8/c++/functional:54,
                 from util.h:23,
                 from meters.h:21,
                 from cmdline.h:21,
                 from cmdline.cc:18:
/opt/local/include/gcc8/c++/cstdio: At global scope:
/opt/local/include/gcc8/c++/cstdio:98:11: error: '::FILE' has not been declared
   using ::FILE;
           ^~~~
/opt/local/include/gcc8/c++/cstdio:99:11: error: '::fpos_t' has not been declared
   using ::fpos_t;
           ^~~~~~
/opt/local/include/gcc8/c++/cstdio:101:11: error: '::clearerr' has not been declared
   using ::clearerr;
           ^~~~~~~~
/opt/local/include/gcc8/c++/cstdio:102:11: error: '::fclose' has not been declared
   using ::fclose;
           ^~~~~~
/opt/local/include/gcc8/c++/cstdio:103:11: error: '::feof' has not been declared
   using ::feof;
           ^~~~
/opt/local/include/gcc8/c++/cstdio:104:11: error: '::ferror' has not been declared
   using ::ferror;
           ^~~~~~
/opt/local/include/gcc8/c++/cstdio:105:11: error: '::fflush' has not been declared
   using ::fflush;
           ^~~~~~
/opt/local/include/gcc8/c++/cstdio:106:11: error: '::fgetc' has not been declared
   using ::fgetc;
           ^~~~~
/opt/local/include/gcc8/c++/cstdio:107:11: error: '::fgetpos' has not been declared
   using ::fgetpos;
           ^~~~~~~
/opt/local/include/gcc8/c++/cstdio:108:11: error: '::fgets' has not been declared
   using ::fgets;
           ^~~~~
/opt/local/include/gcc8/c++/cstdio:109:11: error: '::fopen' has not been declared
   using ::fopen;
           ^~~~~
/opt/local/include/gcc8/c++/cstdio:110:11: error: '::fprintf' has not been declared
   using ::fprintf;
           ^~~~~~~
/opt/local/include/gcc8/c++/cstdio:111:11: error: '::fputc' has not been declared
   using ::fputc;
           ^~~~~
/opt/local/include/gcc8/c++/cstdio:112:11: error: '::fputs' has not been declared
   using ::fputs;
           ^~~~~
/opt/local/include/gcc8/c++/cstdio:113:11: error: '::fread' has not been declared
   using ::fread;
           ^~~~~
/opt/local/include/gcc8/c++/cstdio:114:11: error: '::freopen' has not been declared
   using ::freopen;
           ^~~~~~~
/opt/local/include/gcc8/c++/cstdio:115:11: error: '::fscanf' has not been declared
   using ::fscanf;
           ^~~~~~
/opt/local/include/gcc8/c++/cstdio:116:11: error: '::fseek' has not been declared
   using ::fseek;
           ^~~~~
/opt/local/include/gcc8/c++/cstdio:117:11: error: '::fsetpos' has not been declared
   using ::fsetpos;
           ^~~~~~~
/opt/local/include/gcc8/c++/cstdio:118:11: error: '::ftell' has not been declared
   using ::ftell;
           ^~~~~
/opt/local/include/gcc8/c++/cstdio:119:11: error: '::fwrite' has not been declared
   using ::fwrite;
           ^~~~~~
/opt/local/include/gcc8/c++/cstdio:120:11: error: '::getc' has not been declared
   using ::getc;
           ^~~~
/opt/local/include/gcc8/c++/cstdio:121:11: error: '::getchar' has not been declared
   using ::getchar;
           ^~~~~~~
/opt/local/include/gcc8/c++/cstdio:124:11: error: '::gets' has not been declared
   using ::gets;
           ^~~~
/opt/local/include/gcc8/c++/cstdio:126:11: error: '::perror' has not been declared
   using ::perror;
           ^~~~~~
/opt/local/include/gcc8/c++/cstdio:127:11: error: '::printf' has not been declared
   using ::printf;
           ^~~~~~
/opt/local/include/gcc8/c++/cstdio:128:11: error: '::putc' has not been declared
   using ::putc;
           ^~~~
/opt/local/include/gcc8/c++/cstdio:129:11: error: '::putchar' has not been declared
   using ::putchar;
           ^~~~~~~
/opt/local/include/gcc8/c++/cstdio:130:11: error: '::puts' has not been declared
   using ::puts;
           ^~~~
/opt/local/include/gcc8/c++/cstdio:131:11: error: '::remove' has not been declared
   using ::remove;
           ^~~~~~
/opt/local/include/gcc8/c++/cstdio:132:11: error: '::rename' has not been declared
   using ::rename;
           ^~~~~~
/opt/local/include/gcc8/c++/cstdio:133:11: error: '::rewind' has not been declared
   using ::rewind;
           ^~~~~~
/opt/local/include/gcc8/c++/cstdio:134:11: error: '::scanf' has not been declared
   using ::scanf;
           ^~~~~
/opt/local/include/gcc8/c++/cstdio:135:11: error: '::setbuf' has not been declared
   using ::setbuf;
           ^~~~~~
/opt/local/include/gcc8/c++/cstdio:136:11: error: '::setvbuf' has not been declared
   using ::setvbuf;
           ^~~~~~~
/opt/local/include/gcc8/c++/cstdio:137:11: error: '::sprintf' has not been declared
   using ::sprintf;
           ^~~~~~~
/opt/local/include/gcc8/c++/cstdio:138:11: error: '::sscanf' has not been declared
   using ::sscanf;
           ^~~~~~
/opt/local/include/gcc8/c++/cstdio:139:11: error: '::tmpfile' has not been declared
   using ::tmpfile;
           ^~~~~~~
/opt/local/include/gcc8/c++/cstdio:141:11: error: '::tmpnam' has not been declared
   using ::tmpnam;
           ^~~~~~
/opt/local/include/gcc8/c++/cstdio:143:11: error: '::ungetc' has not been declared
   using ::ungetc;
           ^~~~~~
/opt/local/include/gcc8/c++/cstdio:144:11: error: '::vfprintf' has not been declared
   using ::vfprintf;
           ^~~~~~~~
/opt/local/include/gcc8/c++/cstdio:145:11: error: '::vprintf' has not been declared
   using ::vprintf;
           ^~~~~~~
/opt/local/include/gcc8/c++/cstdio:146:11: error: '::vsprintf' has not been declared
   using ::vsprintf;
           ^~~~~~~~
/opt/local/include/gcc8/c++/cstdio:175:11: error: '::snprintf' has not been declared
   using ::snprintf;
           ^~~~~~~~
/opt/local/include/gcc8/c++/cstdio:176:11: error: '::vfscanf' has not been declared
   using ::vfscanf;
           ^~~~~~~
/opt/local/include/gcc8/c++/cstdio:177:11: error: '::vscanf' has not been declared
   using ::vscanf;
           ^~~~~~
/opt/local/include/gcc8/c++/cstdio:178:11: error: '::vsnprintf' has not been declared
   using ::vsnprintf;
           ^~~~~~~~~
/opt/local/include/gcc8/c++/cstdio:179:11: error: '::vsscanf' has not been declared
   using ::vsscanf;
           ^~~~~~~
/opt/local/include/gcc8/c++/cstdio:185:22: error: '__gnu_cxx::snprintf' has not been declared
   using ::__gnu_cxx::snprintf;
                      ^~~~~~~~
/opt/local/include/gcc8/c++/cstdio:186:22: error: '__gnu_cxx::vfscanf' has not been declared
   using ::__gnu_cxx::vfscanf;
                      ^~~~~~~
/opt/local/include/gcc8/c++/cstdio:187:22: error: '__gnu_cxx::vscanf' has not been declared
   using ::__gnu_cxx::vscanf;
                      ^~~~~~
/opt/local/include/gcc8/c++/cstdio:188:22: error: '__gnu_cxx::vsnprintf' has not been declared
   using ::__gnu_cxx::vsnprintf;
                      ^~~~~~~~~
/opt/local/include/gcc8/c++/cstdio:189:22: error: '__gnu_cxx::vsscanf' has not been declared
   using ::__gnu_cxx::vsscanf;
                      ^~~~~~~
In file included from /opt/local/include/gcc8/c++/string:52,
                 from /opt/local/include/gcc8/c++/stdexcept:39,
                 from /opt/local/include/gcc8/c++/array:39,
                 from /opt/local/include/gcc8/c++/tuple:39,
                 from /opt/local/include/gcc8/c++/functional:54,
                 from util.h:23,
                 from meters.h:21,
                 from cmdline.h:21,
                 from cmdline.cc:18:
/opt/local/include/gcc8/c++/bits/basic_string.h: In function 'std::__cxx11::string std::__cxx11::to_string(int)':
/opt/local/include/gcc8/c++/bits/basic_string.h:6445:50: error: 'vsnprintf' is not a member of 'std'
   { return __gnu_cxx::__to_xstring<string>(&std::vsnprintf, 4 * sizeof(int),
                                                  ^~~~~~~~~
/opt/local/include/gcc8/c++/bits/basic_string.h:6445:50: note: suggested alternative: 'isprint'
   { return __gnu_cxx::__to_xstring<string>(&std::vsnprintf, 4 * sizeof(int),
                                                  ^~~~~~~~~
                                                  isprint
/opt/local/include/gcc8/c++/bits/basic_string.h: In function 'std::__cxx11::string std::__cxx11::to_string(unsigned int)':
/opt/local/include/gcc8/c++/bits/basic_string.h:6450:50: error: 'vsnprintf' is not a member of 'std'
   { return __gnu_cxx::__to_xstring<string>(&std::vsnprintf,
                                                  ^~~~~~~~~
/opt/local/include/gcc8/c++/bits/basic_string.h:6450:50: note: suggested alternative: 'isprint'
   { return __gnu_cxx::__to_xstring<string>(&std::vsnprintf,
                                                  ^~~~~~~~~
                                                  isprint
/opt/local/include/gcc8/c++/bits/basic_string.h: In function 'std::__cxx11::string std::__cxx11::to_string(long int)':
/opt/local/include/gcc8/c++/bits/basic_string.h:6456:50: error: 'vsnprintf' is not a member of 'std'
   { return __gnu_cxx::__to_xstring<string>(&std::vsnprintf, 4 * sizeof(long),
                                                  ^~~~~~~~~
/opt/local/include/gcc8/c++/bits/basic_string.h:6456:50: note: suggested alternative: 'isprint'
   { return __gnu_cxx::__to_xstring<string>(&std::vsnprintf, 4 * sizeof(long),
                                                  ^~~~~~~~~
                                                  isprint
/opt/local/include/gcc8/c++/bits/basic_string.h: In function 'std::__cxx11::string std::__cxx11::to_string(long unsigned int)':
/opt/local/include/gcc8/c++/bits/basic_string.h:6461:50: error: 'vsnprintf' is not a member of 'std'
   { return __gnu_cxx::__to_xstring<string>(&std::vsnprintf,
                                                  ^~~~~~~~~
/opt/local/include/gcc8/c++/bits/basic_string.h:6461:50: note: suggested alternative: 'isprint'
   { return __gnu_cxx::__to_xstring<string>(&std::vsnprintf,
                                                  ^~~~~~~~~
                                                  isprint
/opt/local/include/gcc8/c++/bits/basic_string.h: In function 'std::__cxx11::string std::__cxx11::to_string(long long int)':
/opt/local/include/gcc8/c++/bits/basic_string.h:6467:50: error: 'vsnprintf' is not a member of 'std'
   { return __gnu_cxx::__to_xstring<string>(&std::vsnprintf,
                                                  ^~~~~~~~~
/opt/local/include/gcc8/c++/bits/basic_string.h:6467:50: note: suggested alternative: 'isprint'
   { return __gnu_cxx::__to_xstring<string>(&std::vsnprintf,
                                                  ^~~~~~~~~
                                                  isprint
/opt/local/include/gcc8/c++/bits/basic_string.h: In function 'std::__cxx11::string std::__cxx11::to_string(long long unsigned int)':
/opt/local/include/gcc8/c++/bits/basic_string.h:6473:50: error: 'vsnprintf' is not a member of 'std'
   { return __gnu_cxx::__to_xstring<string>(&std::vsnprintf,
                                                  ^~~~~~~~~
/opt/local/include/gcc8/c++/bits/basic_string.h:6473:50: note: suggested alternative: 'isprint'
   { return __gnu_cxx::__to_xstring<string>(&std::vsnprintf,
                                                  ^~~~~~~~~
                                                  isprint
/opt/local/include/gcc8/c++/bits/basic_string.h: In function 'std::__cxx11::string std::__cxx11::to_string(float)':
/opt/local/include/gcc8/c++/bits/basic_string.h:6482:50: error: 'vsnprintf' is not a member of 'std'
     return __gnu_cxx::__to_xstring<string>(&std::vsnprintf, __n,
                                                  ^~~~~~~~~
/opt/local/include/gcc8/c++/bits/basic_string.h:6482:50: note: suggested alternative: 'isprint'
     return __gnu_cxx::__to_xstring<string>(&std::vsnprintf, __n,
                                                  ^~~~~~~~~
                                                  isprint
/opt/local/include/gcc8/c++/bits/basic_string.h: In function 'std::__cxx11::string std::__cxx11::to_string(double)':
/opt/local/include/gcc8/c++/bits/basic_string.h:6491:50: error: 'vsnprintf' is not a member of 'std'
     return __gnu_cxx::__to_xstring<string>(&std::vsnprintf, __n,
                                                  ^~~~~~~~~
/opt/local/include/gcc8/c++/bits/basic_string.h:6491:50: note: suggested alternative: 'isprint'
     return __gnu_cxx::__to_xstring<string>(&std::vsnprintf, __n,
                                                  ^~~~~~~~~
                                                  isprint
/opt/local/include/gcc8/c++/bits/basic_string.h: In function 'std::__cxx11::string std::__cxx11::to_string(long double)':
/opt/local/include/gcc8/c++/bits/basic_string.h:6500:50: error: 'vsnprintf' is not a member of 'std'
     return __gnu_cxx::__to_xstring<string>(&std::vsnprintf, __n,
                                                  ^~~~~~~~~
/opt/local/include/gcc8/c++/bits/basic_string.h:6500:50: note: suggested alternative: 'isprint'
     return __gnu_cxx::__to_xstring<string>(&std::vsnprintf, __n,
                                                  ^~~~~~~~~
                                                  isprint
make: *** [build/cmdline.o] Error 1

Support for Kamstrup multical302 heat meter T1

Good Morning Fredrik.

My energy supplier is coming today and may be able to switch my heat meter from C1 to T1. If you have all logs, would it be generally possible to implement T1 for Kamstrup Multical 302?
Then i can switch over from RTL-Stick to my im871a.

Thanks very much!
Ben

Decode multiple sensors at once.

Thanks to #8 now I have a working chain to get wmbus data: Thanks @weetmuts , great work!

My work chain is:

  1. get the radio signal osmocom/rtl-sdr
  2. extract wmbus packet xaelsouth/rtl-wmbus
  3. decode my HCA sensors weetmuts/wmbusmeters

My problem is how tell wmbusmeters to decode a series/all sensors, not a single one.
Something like specify * as sensor ID?

Thanks to the new input, I filter the incoming data using a command like rtl_sdr | rtl-wmbus | grep [IDs] .

The use case is to get all the data from my flat with a single running instance (6 Heating Cost Allocators).

GWF watermeter

Greetings
I have a https://gwf.ch/en/produkt/gwfcoder-radio-wireless-m-bus/

Here are a few telegrams:
(wmbus) received telegram 00611742 C-field=44 M-field=1ee6 (GWF) A-field-version=02 A-field-dev-type=0e (Bus/System component) Ci-field=72 (EN 13757-3 Application Layer with long Transport Layer) CC-field=00 (slow_resp) long tpl header ACC=07 SN=00000000
(mtk3) MyTapWater 00611742 (mtk3) log "telegram=|3644E61E42176100020E7282997515|CEE6C7D7947AB4CA442D749A1A6F7A2BDB15F369D6B9CD0C9793F38EF52F4AAF|+414"
(wmbus) received telegram 00611742 C-field=44 M-field=1ee6 (GWF) A-field-version=02 A-field-dev-type=0e (Bus/System component) Ci-field=72 (EN 13757-3 Application Layer with long Transport Layer) CC-field=00 (slow_resp) long tpl header ACC=07 SN=00000000
(mtk3) MyTapWater 00611742 (mtk3) log "telegram=|3644E61E42176100020E7282997515|42E6FE98643C41E281D190EAEEC2A69F8C027CA698D883F6D215BEF924279F17|+429"
(wmbus) received telegram 00611742 C-field=44 M-field=1ee6 (GWF) A-field-version=02 A-field-dev-type=0e (Bus/System component) Ci-field=72 (EN 13757-3 Application Layer with long Transport Layer) CC-field=00 (slow_resp) long tpl header ACC=07 SN=00000000
(mtk3) MyTapWater 00611742 (mtk3) log "telegram=|3644E61E42176100020E7282997515|17808884BB9F59579D9EA84AB4A0936350C1938DE0CE1385D0ADDB1773F31C7D|+444"
(wmbus) received telegram 00611742 C-field=44 M-field=1ee6 (GWF) A-field-version=02 A-field-dev-type=0e (Bus/System component) Ci-field=72 (EN 13757-3 Application Layer with long Transport Layer) CC-field=00 (slow_resp) long tpl header ACC=07 SN=00000000
(mtk3) MyTapWater 00611742 (mtk3) log "telegram=|3644E61E42176100020E7282997515|FADE33E99FF004A137C111E008743E8F2EBC9ECE67C5B3032060EBE92C4566F3|+459"
(wmbus) received telegram 00611742 C-field=44 M-field=1ee6 (GWF) A-field-version=02 A-field-dev-type=0e (Bus/System component) Ci-field=72 (EN 13757-3 Application Layer with long Transport Layer) CC-field=00 (slow_resp) long tpl header ACC=07 SN=00000000
(mtk3) MyTapWater 00611742 (mtk3) log "telegram=|3644E61E42176100020E7282997515|DEB0C51BE197DD4CDE39E700A2EEA13F2FD1CD6F401A55CA40D0A698E7871D7E|+474"
(wmbus) received telegram 00611742 C-field=44 M-field=1ee6 (GWF) A-field-version=02 A-field-dev-type=0e (Bus/System component) Ci-field=72 (EN 13757-3 Application Layer with long Transport Layer) CC-field=00 (slow_resp) long tpl header ACC=07 SN=00000000
(mtk3) MyTapWater 00611742 (mtk3) log "telegram=|3644E61E42176100020E7282997515|8F3DA579019245D3124DE479847F6DD69AE8AE1A65821D66B8EF4B6DB59EEAE8|+489"
(wmbus) received telegram 00611742 C-field=44 M-field=1ee6 (GWF) A-field-version=02 A-field-dev-type=0e (Bus/System component) Ci-field=72 (EN 13757-3 Application Layer with long Transport Layer) CC-field=00 (slow_resp) long tpl header ACC=07 SN=00000000
(mtk3) MyTapWater 00611742 (mtk3) log "telegram=|3644E61E42176100020E7282997515|7811790F409F8A9F4C371ACB74C8F60D8B6B6E4F63D3DD5554144A50DC51DBC9|+504"
(wmbus) received telegram 00611742 C-field=44 M-field=1ee6 (GWF) A-field-version=02 A-field-dev-type=0e (Bus/System component) Ci-field=72 (EN 13757-3 Application Layer with long Transport Layer) CC-field=00 (slow_resp) long tpl header ACC=07 SN=00000000
(mtk3) MyTapWater 00611742 (mtk3) log "telegram=|3644E61E42176100020E7282997515|27F22A2A0763CCE865AD0F70265880813D4DDA18561B2297CF815B9641726773|+519"
(wmbus) received telegram 00611742 C-field=44 M-field=1ee6 (GWF) A-field-version=02 A-field-dev-type=0e (Bus/System component) Ci-field=72 (EN 13757-3 Application Layer with long Transport Layer) CC-field=00 (slow_resp) long tpl header ACC=07 SN=00000000
(mtk3) MyTapWater 00611742 (mtk3) log "telegram=|3644E61E42176100020E7282997515|AF3249D2E196A8249A6AD03B6EF0D66951AB329061341DAB64B939910597149E|+534"

Is it possible to parse the content?

Thanks

rtl_sdr + apator (AT-WMBUS-16-2a)

Hello,
I use rtl_sdr usb dongle to listen to apator at-wmbus-16-2a. I've got 2a version which have got another battery but i'm not sure about that its the same protocol as version 2, i hope so :) .
I add device as :
name=MyTapWater
type=apator162
id=01478662
key=00000000000000000000000000000000

about id i'm not sure its my water meter number becouse i've got few numbers on my water meter but i found this number in logs while i'm listening wmbus, i've also got the second water meter which i can find in logs so i think its correct

while im trying
wmbusmeters --logtelegrams --debug --verbose --format=json rtlwmbus MyTapWater apator162:t1 01478662 00000000000000000000000000000000

i've got:
(wmbusmeters) version: 0.9.13 (config) using device: rtlwmbus (config) number of meters: 1 (rtlwmbus) using command: rtl_sdr -f 868.95M -s 1.6e6 - | rtl_wmbus (bgshell) exec background "/bin/sh" (bgshell) arg "-c" (bgshell) arg "rtl_sdr -f 868.95M -s 1.6e6 - | rtl_wmbus" (serialcmd) opened /bin/sh (config) meter apator162 link mode(s): t1 (config) all possible link modes that the meters might transmit on: t1 (config) listen link modes calculated to be: t1 (config) listen to link modes: any (wmbusmeters) configured "MyTapWater" "apator162" "01478662" encrypted (serialcmd) received ": 1: rtl_wmbus: Permission denied<0A>" (serialcmd) received "Found 1 device(s):<0A>" (serialcmd) received " 0: Realtek, RTL2838UHIDIR, SN: 00000001<0A><0A>" (serialcmd) received "Using device 0: Generic RTL2832U OEM<0A>" (serialcmd) received "usb_claim_interface error -6<0A>" (serialcmd) received "usb_claim_interface error -6<0A>Fail<00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00><00>" (serialcmd) received "ed to open rtlsdr device #0.<0A>" (bgshell) 9985 exited with return code 126 (serialcmd) closed /bin/sh (rtlwmbus) child process exited! Command was: "rtl_sdr -f 868.95M -s 1.6e6 - | rtl_wmbus" (serialtty) event loop stopped! (serialcmd) closed /bin/sh

it's mean that i've got wrong key?

i also trying
wmbusmeters --verbose --useconfig=/ --meterfiles=/ rtlwmbus:868.95M Not a valid meter type "" Not a valid meter id ""

example of listening wmbus:

T1;1;1;2019-10-25 20:10:08.000;127;119;01478662;0x4e4401066286470105077ad100408545c894edb36e83870a0cac5d3ed785600486c8b2c65e1b98b56b1d1f206a411a947a67ea342f0985603533582
72ff8abdfaf0dacef50d145991db9c873f4147d
T1;1;1;2019-10-25
20:14:20.000;128;120;01478662;0x4e4401066286470105077ad2004085a6e48033247e61e39e8481ec330476a05657f3e4fbe1c4d1a250ed902fb451c0f76747d2d6d0c3a44b00d0fd8
72ecc94429f49c1d8ef5c72bf0084594213b460

@weetmuts could you say sth about that?

Regards
Luke

Valid JSON

In the JSON output the json keys "media" and "meter" has been left unquoted by double quotation marks. Quotation of strings is required by the JSON standard and could be easily fixed by the following patch.

--- a/meter_multical21.cc
+++ b/meter_multical21.cc
@@ -453,7 +453,9 @@ void MeterMultical21::printMeterFields(FILE *output, char separator)
 
 void MeterMultical21::printMeterJSON(FILE *output)
 {
-    fprintf(output, "{media:\"%s\",meter:\"multical21\","
+    fprintf(output, "{"
+           QS(media,%s)
+           QS(meter,multical21)
            QS(name,%s)
            QS(id,%s)
            Q(total_m3,%f)

(dvparser) warning: unexpected end of data

Hi,

And 1st of all THANKS for you great work!
I see the following error when trying to parse iperl data:

Do you know what could cause this?
I started with no meter defined and checked ID and CRC was always OK.
Could this be caused by missing encryption-key?

Thanks,
M

hac@hac:~/wmbusmeters/build$ ./wmbusmeters --debug /dev/ttyUSB3 iPerl iperl 20222542 ""
(config) using device: /dev/ttyUSB3
(config) number of meters: 1
(serialtty) opened /dev/ttyUSB3
(amb8465) are you there?
(serial /dev/ttyUSB3) sent "FF0B00F4"
(serialtty) closed /dev/ttyUSB3
(serialtty) closed /dev/ttyUSB3
(serialtty) opened /dev/ttyUSB3
(im871a) are you there?
(serial /dev/ttyUSB3) sent "A5010100"
(serial /dev/ttyUSB3) received "A58102004CA3"
(serialtty) closed /dev/ttyUSB3
(im871a) got crc16 a34c expected a34c
(serialtty) closed /dev/ttyUSB3
(im871a) detected on /dev/ttyUSB3
(serialtty) opened /dev/ttyUSB3
(im871a) set link mode 03
(serial /dev/ttyUSB3) sent "A5010306000203300101"
(serial /dev/ttyUSB3) received "A58104009CF7"
(im871a) got crc16 f79c expected f79c
(im871a) set config completed
(im871a) get config
(serial /dev/ttyUSB3) sent "A5010500"
(serial /dev/ttyUSB3) received "A5810617FF000300B32536171000010001FF07023200010100017938F1"
(im871a) got crc16 f138 expected f138
(im871a) get config completed
(im871a) config: device mode 00
(im871a) config: link mode 03
(im871a) config: wmbus c-field 00
(im871a) config: wmbus mfg id 25b3 (IMS)
(im871a) config: wmbus device id 00101736
(im871a) config: wmbus version 01
(im871a) config: wmbus device type 00
(im871a) config: radio channel 01
(im871a) config: radio power level 07
(im871a) config: radio data rate 02
(im871a) config: radio rx window 32
(im871a) config: auto power saving 00
(im871a) config: auto RSSI attachment 01
(im871a) config: auto rx timestamp attachment 01
(im871a) config: led control 00
(im871a) config: rtc control 01
(config) using link mode: T1
(iperl) configured "iPerl" "iperl" "20222542" not-encrypted
(serial /dev/ttyUSB3) received "A5E2031E44AE4C4225222068077A473010059DB71B3A527B2B5524C17F5BDD82FA5AF38D945362BCE1"
(im871a) timestamp 53948df3
(im871a) rssi 62
(im871a) got crc16 e1bc expected e1bc
(wmbus) received telegram 20222542 C-field=44 M-field=4cae (SEN) A-field-version=68 A-field-dev-type=07 (Water meter) Ci-field=7a (EN 13757-3 Application Layer with short Transport Layer) CC-field=00 (slow_resp) ACC=47
(wmbus) frame "1E44AE4C4225222068077A473010059DB71B3A527B2B5524C17F5BDD82FA5A"
(wmbus) payload "9DB71B3A527B2B5524C17F5BDD82FA5A"
(wmbus) 00: 1e length (30 bytes)
(wmbus) 01: 44 c-field (SND_NR)
(wmbus) 02: ae4c m-field (4cae=SEN)
(wmbus) 04: 42252220 a-field-addr (20222542)
(wmbus) 08: 68 a-field-version
(wmbus) 09: 07 a-field-type (Water meter)
(wmbus) 0a: 7a ci-field (EN 13757-3 Application Layer with short Transport Layer)
(wmbus) 0b: 47 acc
(wmbus) 0c: 30 status ()
(wmbus) 0d: 1005 configuration ()
(wmbus) 1E44AE4C4225222068077A47301005
(iperl) telegram for iPerl 20222542
(iperl) log "telegram=|1E44AE4C4225222068077A47301005|9DB71B3A527B2B5524C17F5BDD82FA5A|+730"
(dvparser) warning: unexpected end of data
wmbusmeters: src/dvparser.cc:261: bool parseDV(Telegram*, std::vector&, std::vector::iterator, size_t, std::map<std::__cxx11::basic_string, std::pair<int, DVEntry> >, std::vector::iterator, size_t, uint16_t*, std::function<int(int, int, int)>): Assertion `data+datalen <= databytes.end()' failed.
Aborted

Add rtl_433 support for datagram reception

rtl_433 will soon support mbus reception.

rtl_433 -R 104 -s 1200k -f 868800k

time : 2019-10-13 19:31:02
model : Wireless M-Bus Manufacturer: BMT ID : 16702184
Version : 16 Device Type: 0x1B Device Type String: Room sensor Control : 0x44
Data Length: 78 Data : 7ab00800000265130942652809820165e50822651b0912652e09626586085265680902fb1a820142fb1a8f018201fb1ab10122fb1a7a0112fb1a9b0162fb1a8b0152fb1af101066d3b31c46c2a00
Integrity : CRC


time : 2019-10-13 19:31:17
model : Wireless M-Bus Manufacturer: LAS ID : 14146
Version : 7 Device Type: 0x1B Device Type String: Room sensor Control : 0x44
Data Length: 37 Data : 7ac44820250893278890146570a085119a67f75e2880c1544edbfe8589c8b6df799e1aa102
Integrity : CRC

Would be nice with an alternative for datagram reception.

WMBUS-D1-TC support

Another day another device. So this device apparently listens to wmbus transmissions and outputs them on /dev/ttyUSB0 at 115200. When running the device it outputs an encapsulated payload.

A telegram that was decoded by the Bmeters device:

5744B40938227016101B7ADA00000002653D0842653308820165A60722652E0812653D08626583075265C20702FB1A740142FB1A70018201FB1A690122FB1A6E0112FB1A740162FB1A640152FB1A6D01066D3B09B7612B00

was decoded into this by the device:

7e 06 5944b40938227016101b7ada00000002653d0842653308820165a60722652e0812653d08626583075265c20702fb1a740142fb1a70018201fb1a690122fb1a6e0112fb1a740162fb1a640152fb1a6d01066d3b09b7612b00
d7b5b7 7e

The encapsulation starts with 7e 06, then compared to the Bmeters payload the value after is 2 larger. At the end 3 extra bytes are present and then it all ends with 7e. By chance it sometimes decode properly. To support this device one must most likely buffer the data until it is completely received and then send it for decode.

./wmbusmeters --debug --listento=t1 /dev/ttyUSB0:115200
(wmbusmeters) version: 0.9.15-4-g04d8662 with local changes
(config) using device: /dev/ttyUSB0
(config) with: 115200
(config) number of meters: 0
(rawtty) found /dev/ttyUSB0
(serialtty) opened /dev/ttyUSB0
(config) all possible link modes that the meters might transmit on: none
(config) explicitly listening to: t1
(config) listen link modes calculated to be: t1
(config) listen to link modes: t1
No meters configured. Printing id:s of all telegrams heard!

(serial /dev/ttyUSB0) received "007E"
(wmbus_rawtty) no sensible telegram found, clearing buffer.
(rawtty) protocol error in message received!
(rawtty) protocol error ""
(serial /dev/ttyUSB0) received "7E065944B40908227016101B7A870000000265490842654408820165A8072265410812654808626584075265CA0702FB1A720142FB1A75018201FB1A6C0122FB1A740112FB1A770162FB1A680152FB1A7001066D3B13B7612B00C71A357E"
(wmbus_rawtty) no sensible telegram found, clearing buffer.
(rawtty) protocol error in message received!
(rawtty) protocol error ""
(serial /dev/ttyUSB0) received "7E065944B40938227016101B7AE000"
(wmbus_rawtty) no sensible telegram found, clearing buffer.
(rawtty) protocol error in message received!
(rawtty) protocol error ""
(serial /dev/ttyUSB0) received "000002653C0842653308820165A60722652E0812653D08626583075265C20702FB1A750142FB1A70018201FB1A690122FB1A6E0112FB1A740162FB1A640152FB1A6D01066D3B13B7612B00DA849B7E"
(wmbus_rawtty) no sensible telegram found, clearing buffer.
(rawtty) protocol error in message received!
(rawtty) protocol error ""
(serial /dev/ttyUSB0) received "7E065944B40984"
(wmbus_rawtty) no sensible telegram found, clearing buffer.
(rawtty) protocol error in message received!
(rawtty) protocol error ""
(serial /dev/ttyUSB0) received "217016101B7A4608000002653608426529088201654E082265210812652E08626526085265800802FB1A7A0142FB1A7A018201FB1A580122FB1A770112FB1A7D5D0162FB1A490152FB1A7001066D3B27887F2A00D3601F7E"
(wmbus_rawtty) no sensible telegram found, clearing buffer.
(rawtty) protocol error in message received!
(rawtty) protocol error ""
(serial /dev/ttyUSB0) received "7E06"
(wmbus_rawtty) no sensible telegram found, clearing buffer.
(rawtty) protocol error in message received!
(rawtty) protocol error ""
(serial /dev/ttyUSB0) received "5944B40979217016101B7A500800000265BE0842659E088201652A08226590081265B5086265F2075265ED0802FB1A480142FB1A47018201FB1A300122FB1A440112FB1A4D0162FB1A170152FB1A6901066D3B13977F2A00DD4BAA7E"
(wmbus) received telegram 16702179 C-field=44 M-field=09b4 (BMT) A-field-version=10 A-field-dev-type=1b (Room sensor (eg temperature or humidity)) Ci-field=7a (EN 13757-3 Application Layer with short Transport Layer) CC-field=00 (slow_resp) short header ACC=50
(wmbus) frame "5944B40979217016101B7A500800000265BE0842659E088201652A08226590081265B5086265F2075265ED0802FB1A480142FB1A47018201FB1A300122FB1A440112FB1A4D0162FB1A170152FB1A6901066D3B13977F2A00DD4B"
(wmbus) payload "0265BE0842659E088201652A08226590081265B5086265F2075265ED0802FB1A480142FB1A47018201FB1A300122FB1A440112FB1A4D0162FB1A170152FB1A6901066D3B13977F2A00DD4B"
(wmbus) 00: 59 length (89 bytes)
(wmbus) 01: 44 c-field (SND_NR)
(wmbus) 02: b409 m-field (9b4=BMT)
(wmbus) 04: 79217016 a-field-addr (16702179)
(wmbus) 08: 10 a-field-version
(wmbus) 09: 1b a-field-type (Room sensor (eg temperature or humidity))
(wmbus) 0a: 7a ci-field (EN 13757-3 Application Layer with short Transport Layer)
(wmbus) 0b: 50 acc
(wmbus) 0c: 08 status ()
(wmbus) 0d: 0000 config ()
(wmbus) 5944B40979217016101B7A50080000
Received telegram from: 16702179
manufacturer: (BMT) BMETERS, Italy
device type: Room sensor (eg temperature or humidity)
(rawtty) telegram ignored by all configured meters!
(wmbus_rawtty) no sensible telegram found, clearing buffer.
(rawtty) protocol error in message received!
(rawtty) protocol error ""
(serial /dev/ttyUSB0) received "7E065944B40976217016101B7A8B0800000265410842655008820165610722654C0812655608626556075265790702FB1A6C0142FB1A71018201FB1A6E0122FB1A6E0112FB1A740162FB1A6A0152FB1A7101066D3B13B7612B00CE24597E"
(wmbus_rawtty) no sensible telegram found, clearing buffer.
(rawtty) protocol error in message received!
(rawtty) protocol error ""
(serial /dev/ttyUSB0) received "7E065944B40912227016101B7A890000000265470842654008820165A00722653D081265430862657D5E075265C00702FB1A6C0142FB1A71018201FB1A670122FB1A6F0112FB1A720162FB1A620152FB1A6B01066D3B13B7612B00C9A68F7E"
(wmbus_rawtty) no sensible telegram found, clearing buffer.
(rawtty) protocol error in message received!
(rawtty) protocol error ""
^C(serialtty) event loop stopped!
(serialtty) closed /dev/ttyUSB0

New meter type

I would be interested using this code to read data from Kamstrup FlowIQ3100. Can you describe shortly steps required to add new meter type?

Can I somehow see actual data received from meter to help in this process?

wmbusmeters works from command line but not as service

Firstly, nice program!

I have the following curious issue: I can start wmbusmeters from the command line and receive telegrams from my iPerl water meter. When I start it as a service it does not receive anything.

Setup:
Ubuntu 16.04 LTS with latest patches
Realtek RTL2838UHIDIR SDR
Latest rtl-sdr, rtl-wmbus, wmbusmeters from GitHub

Configuration:

/etc/wmbusmeters.conf

loglevel=debug
device=rtlwmbus:rtl_sdr -f 868.95M -s 1.6e6 - 2>/dev/null | rtl_wmbus
logtelegrams=true
format=fields
meterfiles=/var/log/wmbusmeters/meter_readings
meterfilesaction=overwrite
logfile=/var/log/wmbusmeters/wmbusmeters.log

/etc/wmbusmeters.d/iPerlWaterMeter

name=iPerlWaterMeter
type=iperl
id=20730893
key=035F3B08E6FF114F2B6C6B3xxxxxxxx

Start from command line:

wmbusmeters --verbose --useconfig=/ --meterfiles=/ rtlwmbus:868.95M

In another window .....

tail -f /var/log/wmbusmeters/wmbusmeters.log -n 15
(wmbusmeters) version: 0.9.4-2-g33ec7ec
(config) store meter files in: "/var/log/wmbusmeters/meter_readings"
(config) using device: rtlwmbus
(config) with: rtl_sdr -f 868.95M -s 1.6e6 - 2>/dev/null | rtl_wmbus
(config) number of meters: 1
(rtlwmbus) using command: rtl_sdr -f 868.95M -s 1.6e6 - 2>/dev/null | rtl_wmbus
(bgshell) exec background "/bin/sh"
(bgshell) arg "-c"
(bgshell) arg "rtl_sdr -f 868.95M -s 1.6e6 - 2>/dev/null | rtl_wmbus"
(serialcmd) opened /bin/sh
(config) using link mode: Any
(iperl) configured "iPerlWaterMeter" "iperl" "20730893" encrypted

ls -l /var/log/wmbusmeters/meter_readings/iPerlWaterMeter
-rw-rw-r-- 1 mo mo 65 Apr 25 15:49 iPerlWaterMeter

cat /var/log/wmbusmeters/meter_readings/iPerlWaterMeter
iPerlWaterMeter;20730893;36.089000;0.000000;2019-04-25T13:49:24Z

A telegram was received and decoded correctly. I also receive telegrams from other meters which are then (correctly) ignored. => Command line works!

Start as daemon

sudo systemctl status wmbusmeters

? wmbusmeters.service - wmbusmeters service
   Loaded: loaded (/etc/systemd/system/wmbusmeters.service; disabled; vendor preset: enabled)
   Active: active (running) since Thu 2019-04-25 08:21:29 CEST; 3h 48min ago
  Process: 22320 ExecStart=/usr/sbin/wmbusmetersd /var/run/wmbusmeters/wmbusmeters.pid (code=exited, status=0/SUCCESS)
  Process: 22315 ExecStartPre=/bin/chown -R wmbusmeters:wmbusmeters /var/run/wmbusmeters (code=exited, status=0/SUCCESS)
  Process: 22310 ExecStartPre=/bin/mkdir -p /var/run/wmbusmeters (code=exited, status=0/SUCCESS)
  Process: 22305 ExecStartPre=/bin/chown -R wmbusmeters:wmbusmeters /var/log/wmbusmeters (code=exited, status=0/SUCCESS)
  Process: 22300 ExecStartPre=/bin/mkdir -p /var/log/wmbusmeters/meter_readings (code=exited, status=0/SUCCESS)
 Main PID: 22324 (wmbusmetersd)
    Tasks: 6
   Memory: 4.8M
      CPU: 2h 22min 39.757s
   CGroup: /system.slice/wmbusmeters.service
           tq22324 /usr/sbin/wmbusmetersd /var/run/wmbusmeters/wmbusmeters.pid
           tq22326  -c rtl_sdr -f 868.95M -s 1.6e6 - 2>/dev/null | rtl_wmbus
           tq22327 rtl_sdr -f 868.95M -s 1.6e6 -
           mq22328 rtl_wmbus

Apr 25 08:21:29 FUTRO-400 systemd[1]: Starting wmbusmeters service...
Apr 25 08:21:29 FUTRO-400 wmbusmetersd[22320]: (wmbusmeters) started /var/run/wmbusmeters/wmbusmeters.pid
Apr 25 08:21:29 FUTRO-400 systemd[1]: Started wmbusmeters service.

tail -n15 -f /var/log/wmbusmeters/wmbusmeters.log

(wmbusmeters) logging started 2019-04-25 08:21:29
(wmbusmeters) version: 0.9.4-2-g33ec7ec
(config) store meter files in: "/var/log/wmbusmeters/meter_readings"
(config) using device: rtlwmbus
(config) with: rtl_sdr -f 868.95M -s 1.6e6 - 2>/dev/null | rtl_wmbus
(config) number of meters: 1
(rtlwmbus) using command: rtl_sdr -f 868.95M -s 1.6e6 - 2>/dev/null | rtl_wmbus
(bgshell) exec background "/bin/sh"
(bgshell) arg "-c"
(bgshell) arg "rtl_sdr -f 868.95M -s 1.6e6 - 2>/dev/null | rtl_wmbus"
(serialcmd) opened /bin/sh
(config) using link mode: Any
(iperl) configured "iPerlWaterMeter" "iperl" "20730893" encrypted
(wmbusmeters) waiting for telegrams

No matter how long I wait, nothing is ever received. The service seems to be correctly started. When I do a ps -A all the programs are started, apparently with the correct parameters.

Question1. Any ideas why this might be happening, or how I could go about debugging it?

Question2. There seems to be a typo in main.cc, line 224
command = prefix+"rtl_sdr -f "+freq+" -s 16000000 - 2>/dev/null | "+prefix+"rtl_wmbus";
My dongle gives an incorrect sample rate error. I changed it to 1.6e6 and the error went away.
Is there a 0 to many i.e. 16M instead of 1.6M?

Best regards,
Muiris.

Add support for EurisII heat cost allocator

Hello,
i like to read my Qundis Q caloric heat meters from IM871A-USB Stick.
I have installed wmbusmeters on my Ubuntu 18.04 Laptop and started with the following parameters with no success.
What time i must wait for Qundis Heat meter sends data ? or have i a Parameter problem
when i dont get data ?

wmbusmeters --debug --verbose --c1 /dev/ttyUSB0
(wmbusmeters) version:
(config) using device: /dev/ttyUSB0
(config) number of meters: 0
(serialtty) opened /dev/ttyUSB0
(amb8465) are you there?
(serial /dev/ttyUSB0) sent "FF0B00F4"
(serialtty) closed /dev/ttyUSB0
(serialtty) closed /dev/ttyUSB0
(serialtty) opened /dev/ttyUSB0
(im871a) are you there?
(serial /dev/ttyUSB0) sent "A5010100"
(serial /dev/ttyUSB0) received "A58102004CA3"
(serialtty) closed /dev/ttyUSB0
(im871a) got crc16 a34c expected a34c
(serialtty) closed /dev/ttyUSB0
(im871a) detected on /dev/ttyUSB0
(serialtty) opened /dev/ttyUSB0
(im871a) set link mode 06
(serial /dev/ttyUSB0) sent "A5010306000206300101"
(serial /dev/ttyUSB0) received "A58104009CF7"
(im871a) got crc16 f79c expected f79c
(im871a) set config completed
(im871a) get config
(serial /dev/ttyUSB0) sent "A5010500"
(serial /dev/ttyUSB0) received "A5810617FF000600B32563011000010001FF070232000101000000F70A"
(im871a) got crc16 0af7 expected 0af7
(im871a) get config completed
(im871a) config: device mode 00
(im871a) config: link mode 06
(im871a) config: wmbus c-field 00
(im871a) config: wmbus mfg id 25b3 (IMS)
(im871a) config: wmbus device id 00100163
(im871a) config: wmbus version 01
(im871a) config: wmbus device type 00
(im871a) config: radio channel 01
(im871a) config: radio power level 07
(im871a) config: radio data rate 02
(im871a) config: radio rx window 32
(im871a) config: auto power saving 00
(im871a) config: auto RSSI attachment 01
(im871a) config: auto rx timestamp attachment 01
(im871a) config: led control 00
(im871a) config: rtc control 00
(config) using link mode: C1
No meters configured. Printing id:s of all telegrams heard!

warning: Unknown format signature hash 0x12c4! Cannot decode telegram.

Hi

I have a multical21 , I get soem data , but I keep getting:
./wmbusmeters --c1 /dev/ttyUSB0 john_maaler multical21 57722865 FBF8D9E934BB81410736F0F97107xxxx
john_maaler 57722865 20.575 m3 0.000 m3 -°C -°C OK 2019-01-27 14:52.22
(multical21) warning: Unknown format signature hash 0x12c4! Cannot decode telegram.
john_maaler 57722865 20.575 m3 0.000 m3 -°C -°C OK 2019-01-27 14:54.00
(multical21) warning: Unknown format signature hash 0x12c4! Cannot decode telegram.
john_maaler 57722865 20.575 m3 0.000 m3 -°C -°C OK 2019-01-27 14:55.38

warning: Unknown format signature hash 0x12c4! Cannot decode telegram.

apator162 - offset of total water consumption value changes over time

Hi,

Thank you very much for your work!
You wrote:
"Added support for the at-wmbus-16-2 snap on meter (apator162).
Unfortunately it uses a vendor specific protocol,
that is merely wrapped inside a wmbus telegram. Lets hope
the offset to the consumption is stable between
meters of this type."

I use iM871A usb dongle

I've been strangling for some time to decode more then total water consumption. Without any success. Although over the year I've collected some data from 2 Apator meter. We could join our forces to decode Apator's proprietary protocol.

Unfortunately total water consumption changes unexpectedly over the time (there might be some logic but it happens to me after 4 months of use)

Initial location (offset you use in your code)

                                                                      Total - 281C                                              |0000802F2F0F|688|9D|6929|00|210432|E0|0101C280|0007|10106|1B00|00DC|0000|00A01A86|AF03|FFFF|FFFF|FFFF    09-06-2018

Location around 10-2018
Total - 73F0
|0000802F2F0F|D97|3B|A929|80|20043B|20|083000D5|A566|E5A01|8C34|0010|F073|00007101|AA72|0000|AA65|0000

Of course I am not aware; is it time driven, water value driven or what...

Add support for Tauron T1 power meters

Hi,

In Poland Tauron (one of 4 main energy distributors) replaces old Energy Meters to new ones with wireless m-bus devices. Over web you can enable wireless mbus broadcast plus get get port and encryption key. I've captured data from my meter but unfortunatly format is not recognized. There are 3 meter manufactures but all of them support same protocol.

(serial /dev/ttyUSB0) received "A5E2034E4401063712048602027A000040057FE1A953DEFF6D2DCF7547BA0E6809F7345D4BF9F1F70C97F85316E524514AAD96D8B9A70E8460F5BFF6CCF3319476188CA57F5F76F616120015DFA39657E4A60000000039693C"
(im871a) timestamp 00000000
(im871a) rssi 39
(im871a) got crc16 3c69 expected 3c69
(wmbus) received telegram 86041237 C-field=44 M-field=0601 (APA) A-field-version=02 A-field-dev-type=02 (Electricity meter) Ci-field=7a (EN 13757-3 Application Layer with short Transport Layer) CC-field=00 (slow_resp) ACC=00
(wmbus) frame "4E4401063712048602027A000040057FE1A953DEFF6D2DCF7547BA0E6809F7345D4BF9F1F70C97F85316E524514AAD96D8B9A70E8460F5BFF6CCF3319476188CA57F5F76F616120015DFA39657E4A6"
(wmbus) payload "7FE1A953DEFF6D2DCF7547BA0E6809F7345D4BF9F1F70C97F85316E524514AAD96D8B9A70E8460F5BFF6CCF3319476188CA57F5F76F616120015DFA39657E4A6"
(wmbus) 00: 4e length (78 bytes)
(wmbus) 01: 44 c-field (SND_NR)
(wmbus) 02: 0106 m-field (601=APA)
(wmbus) 04: 37120486 a-field-addr (86041237)
(wmbus) 08: 02 a-field-version
(wmbus) 09: 02 a-field-type (Electricity meter)
(wmbus) 0a: 7a ci-field (EN 13757-3 Application Layer with short Transport Layer)
(wmbus) 0b: 00 acc
(wmbus) 0c: 00 status ()
(wmbus) 0d: 4005 config (encrypted AES_CBC)
(wmbus) 4E4401063712048602027A00004005
(meter) MyTapWater: for me? 86041237
(meter) MyTapWater: not for me: no media match
(im871a) telegram ignored by all configured meters!

Tauron provided full specs http://amiplus.tauron-dystrybucja.pl/o-amiplus/han/Documents/TAURON_AMIplus-modul_Wireless_M-Bus_public_v2.1_FIN.pdf but they are in polish only.
Meter is configured to T1 slave

TX data options

OBIS code Description DIF (hex) VIF (hex) Format Example
0.0:1.0.0.255 Timestamp 06 6D CP48 -
0.0:C.1.0.255 S/N 0C 78 8 digits BCD 12345678
1.0:1.8.0.255 Energy from GRID 0E 03 12 digits BCD 000000000.000 kWh
1.0:1.8.1.255 Energy from GRID 8E, 10 03 12 digits BCD 000000000.000 kWh
1.0:1.8.2.255 Energy from GRID 8E, 20 03 12 digits BCD 000000000.000 kWh
1.0:1.8.3.255 Energy from GRID 8E, 30 03 12 digits BCD 000000000.000 kWh
1.0:1.8.4.255 Energy from GRID 8E, 80, 10 03 12 digits BCD 000000000.000 kWh
1.0:2.8.0.255 Energy to GRID 0E 83, 3C 12 digits BCD 000000000.000 kWh
1.0:2.8.1.255 Energy to GRID 8E, 10 83, 3C 12 digits BCD 000000000.000 kWh
1.0:2.8.2.255 Energy to GRID 8E, 20 83, 3C 12 digits BCD 000000000.000 kWh
1.0:2.8.3.255 Energy to GRID 8E, 30 83, 3C 12 digits BCD 000000000.000 kWh
1.0:2.8.4.255 Energy to GRID 8E, 80, 10 83, 3C 12 digits BCD 000000000.000 kWh
1.0:1.6.0.255 Maximum power from GRID 1B 2B 6 digits BCD 000.000 kW
1.0:1.7.0.255 Power from GRID - value on end of TX 0B 2B 6 digits BCD 000.000 kW
1.0:2.7.0.255 Power to GRID - value on end of TX 0B AB, 3C 6 digits BCD 000.000 kW
1.0:32.7.0.255 Voltage - phase 1 0A FD, C9, FC, 01 4 digits BCD 0000 V
1.0:52.7.0.255 Voltage - phase 2 0A FD, C9, FC, 02 4 digits BCD 0000 V
1.0:72.7.0.255 Voltage - phase 3 0A FD, C9, FC, 03 4 digits BCD 0000 V
1.0:15.35.0.255 Current power limit 0B AB, C8, FC, 10 6 digits BCD 000.000 kW

Depending on your tariff plan energy from grid will use different OBIS codes (table 6 rows 3-12)

Can you please let me know if I can use this project and if so how can I proceed ?

Regards
Marcin

BMT

Minimum Temperature and Maximum Temperature is most likely incorrect.

static char* oms_temp_el[3][4] = {
{"Temperature","Average Temperature 1h","Average Temperature 24h","Error [0][4]", },
{"Maximum Temperature 1h","Maximum Temperature 24h","Error [1][3]","Error [1][4]",},
{"Minimum Temperature 1h","Minimum Temperature 24h","Error [2][3]","Error [2][4]",}
};

I use this order. Instantaneous min and max cant exist. You need a duration.

[0][0]
[0][1]
[0][2]
[2][0]
[1][0]
[2][1]
[1][1]

This is the [ff][sn] index ordering I get.

Segmentation fault

During a debug run I started getting strange values eventually ending in a crash. Imo the receiver just returned garbage for whatever reason but that shouldn't lead to a crash. Maybe the last payload can reproduce the crash.

(serial /dev/ttyACM0) received "2E44333046410100071B7A12482025B08ECFA413404DED8B0E93D694ED3599390FC0D45F8024E89830D77EB9840BF4" (wmbus) received telegram 12082865 C-field=ec M-field=2207 (HPG) A-field-version=65 A-field-dev-type=2c (Reserved for environmental meter) Ci-field=08 (?) (wmbus) frame "65EC072265280812652C086265DE075265160802FB1A7C0142FB1A81018201FB1AB40122FB1A7F0112FB1A830162FB1A9E0152FB1ACB01066D3B31D67A2A002E44333046410100071B7A12482025B08ECFA413404DED8B0E93D694ED3599390FC0D45F8024E8" (wmbus) payload "6265DE075265160802FB1A7C0142FB1A81018201FB1AB40122FB1A7F0112FB1A830162FB1A9E0152FB1ACB01066D3B31D67A2A002E44333046410100071B7A12482025B08ECFA413404DED8B0E93D694ED3599390FC0D45F8024E8" (wmbus) 00: 65 length (101 bytes) (wmbus) 01: ec c-field (?) (wmbus) 02: 0722 m-field (2207=HPG) (wmbus) 04: 65280812 a-field-addr (12082865) (wmbus) 08: 65 a-field-version (wmbus) 09: 2c a-field-type (Reserved for environmental meter) (wmbus) 0a: 08 ci-field (?) (wmbus) 65EC072265280812652C08 Received telegram from: 12082865 manufacturer: (HPG) Unknown device type: Reserved for environmental meter (rawtty) telegram ignored by all configured meters! (serial /dev/ttyACM0) received "5744B40984217016101B7A440800000265290842652B08820165EC072265280812652C086265DE075265160802FB1A7C0142FB1A81018201FB1AB40122FB1A7F0112FB1A830162FB1A9E0152FB1ACB01066D3B31D67A2A00" (serial /dev/ttyACM0) received "5744B40979217016101B7A4E0800000265BE084265B30882016554082265B0081265B7086265F7075265E70802FB1A390142FB1A3C018201FB1A850122FB1A370112FB1A3F0162FB1A5C0152FB1AC401066D3B1D0D7B2A00" (wmbus) received telegram f40b84b9 C-field=30 M-field=7ed7 (_VW) A-field-version=57 A-field-dev-type=44 (Unknown) Ci-field=b4 (Mfct specific) (wmbus) frame "9830D77EB9840BF45744B40984217016101B7A440800000265290842652B08820165EC072265280812652C086265DE075265160802FB1A7C0142FB1A81018201FB1AB40122FB1A7F0112FB1A830162FB1A9E0152FB1ACB01066D3B31D67A2A005744B40979217016101B7A4E0800000265BE084265B30882016554082265B0081265B7086265F7075265E70802FB1A390142FB1A3C018201FB" (wmbus) payload "0984217016101B7A440800000265290842652B08820165EC072265280812652C086265DE075265160802FB1A7C0142FB1A81018201FB1AB40122FB1A7F0112FB1A830162FB1A9E0152FB1ACB01066D3B31D67A2A005744B40979217016101B7A4E0800000265BE084265B30882016554082265B0081265B7086265F7075265E70802FB1A390142FB1A3C018201FB" (wmbus) 00: 98 length (152 bytes) (wmbus) 01: 30 c-field (?) (wmbus) 02: d77e m-field (7ed7=_VW) (wmbus) 04: b9840bf4 a-field-addr (f40b84b9) (wmbus) 08: 57 a-field-version (wmbus) 09: 44 a-field-type (Unknown) (wmbus) 0a: b4 ci-field (Mfct specific) (wmbus) 9830D77EB9840BF45744B4 Received telegram from: f40b84b9 manufacturer: (_VW) Unknown device type: Unknown (rawtty) telegram ignored by all configured meters! (serial /dev/ttyACM0) received "5744B40984217016101B7A450800000265290842652B08820165EC072265280812652C086265DE075265160802FB1A7C0142FB1A81018201FB1AB40122FB1A7F0112FB1A830162FB1A9E0152FB1ACB01066D3B31D67A2A00" (wmbus) received telegram 01371afb C-field=85 M-field=2201 (HPA) A-field-version=12 A-field-dev-type=fb (Unknown) Ci-field=1a (?) (wmbus) frame "1A850122FB1A370112FB1A3F0162FB1A5C0152FB1AC401066D3B1D" (wmbus) payload "3F0162FB1A5C0152FB1AC401066D3B1D" (wmbus) 00: 1a length (26 bytes) (wmbus) 01: 85 c-field (?) (wmbus) 02: 0122 m-field (2201=HPA) (wmbus) 04: fb1a3701 a-field-addr (01371afb) (wmbus) 08: 12 a-field-version (wmbus) 09: fb a-field-type (Unknown) (wmbus) 0a: 1a ci-field (?) (wmbus) 1A850122FB1A370112FB1A Received telegram from: 01371afb manufacturer: (HPA) Unknown device type: Unknown (rawtty) telegram ignored by all configured meters! (serial /dev/ttyACM0) received "5744B40984217016101B7A460800000265290842652B08820165EC072265280812652C086265DE075265160802FB1A7C0142FB1A81018201FB1AB40122FB1A7F0112FB1A830162FB1A9E0152FB1ACB01066D3B31D67A2A00" (wmbus) received telegram 09b44457 C-field=7b M-field=002a (@AJ) A-field-version=84 A-field-dev-type=21 (Valve (gas or water)) Ci-field=70 (Application error from device without Transport Layer) (wmbus) frame "0D7B2A005744B40984217016101B" (wmbus) payload "16101B" (wmbus) 00: 0d length (13 bytes) (wmbus) 01: 7b c-field (?) (wmbus) 02: 2a00 m-field (2a=@AJ) (wmbus) 04: 5744b409 a-field-addr (09b44457) (wmbus) 08: 84 a-field-version (wmbus) 09: 21 a-field-type (Valve (gas or water)) (wmbus) 0a: 70 ci-field (Application error from device without Transport Layer) (wmbus) 0D7B2A005744B409842170 Received telegram from: 09b44457 manufacturer: (@AJ) Unknown device type: Valve (gas or water) (rawtty) telegram ignored by all configured meters! (serial /dev/ttyACM0) received "5744B40979217016101B7A500800000265BE084265B30882016554082265B0081265B7086265F7075265E70802FB1A390142FB1A3C018201FB1A850122FB1A370112FB1A3F0162FB1A5C0152FB1AC401066D3B1D0D7B2A00" (wmbus) received telegram 29650200 C-field=45 M-field=0008 (@@H) A-field-version=08 A-field-dev-type=42 (Unknown) Ci-field=65 (Reserved for OBIS-based Data sent by the Readout device to the meter with short Transport Layer) (wmbus) frame "7A450800000265290842652B08820165EC072265280812652C086265DE075265160802FB1A7C0142FB1A81018201FB1AB40122FB1A7F0112FB1A830162FB1A9E0152FB1ACB01066D3B31D67A2A005744B40984217016101B7A460800000265290842652B08820165EC072265280812652C086265DE075265160802" (wmbus) payload "2B08820165EC072265280812652C086265DE075265160802FB1A7C0142FB1A81018201FB1AB40122FB1A7F0112FB1A830162FB1A9E0152FB1ACB01066D3B31D67A2A005744B40984217016101B7A460800000265290842652B08820165EC072265280812652C086265DE075265160802" (wmbus) 00: 7a length (122 bytes) (wmbus) 01: 45 c-field (?) (wmbus) 02: 0800 m-field (08=@@H) (wmbus) 04: 00026529 a-field-addr (29650200) (wmbus) 08: 08 a-field-version (wmbus) 09: 42 a-field-type (Unknown) (wmbus) 0a: 65 ci-field (Reserved for OBIS-based Data sent by the Readout device to the meter with short Transport Layer) (wmbus) 7A45080000026529084265 Received telegram from: 29650200 manufacturer: (@@H) Unknown device type: Unknown (rawtty) telegram ignored by all configured meters! (serial /dev/ttyACM0) received "2E44333046410100071B7A13482025FE3EFDBBD0BB74EACA9EEA0C1D11BB055BFC5921B5772A6AABA04186E541FB6B" (serial /dev/ttyACM0) received "5744B40979217016101B7A510800000265BE084265B30882016554082265B0081265B7086265F7075265E70802FB1A390142FB1A3C018201FB1A850122FB1A370112FB1A3F0162FB1A5C0152FB1AC401066D3B1D0D7B2A00" (wmbus) received telegram 811afb42 C-field=1a M-field=017c (@K\) A-field-version=01 A-field-dev-type=82 (Unknown) Ci-field=01 (?) (wmbus) frame "FB1A7C0142FB1A81018201FB1AB40122FB1A7F0112FB1A830162FB1A9E0152FB1ACB01066D3B31D67A2A005744B40979217016101B7A500800000265BE084265B30882016554082265B0081265B7086265F7075265E70802FB1A390142FB1A3C018201FB1A850122FB1A370112FB1A3F0162FB1A5C0152FB1AC401066D3B1D0D7B2A002E44333046410100071B7A13482025FE3EFDBBD0BB74EACA9EEA0C1D11BB055BFC5921B5772A6AABA04186E541FB6B5744B40979217016101B7A510800000265BE084265B30882016554082265B0081265B7086265F7075265E70802FB1A390142FB1A3C018201FB1A850122FB1A370112FB1A3F0162FB1A5C" (wmbus) payload "FB1AB40122FB1A7F0112FB1A830162FB1A9E0152FB1ACB01066D3B31D67A2A005744B40979217016101B7A500800000265BE084265B30882016554082265B0081265B7086265F7075265E70802FB1A390142FB1A3C018201FB1A850122FB1A370112FB1A3F0162FB1A5C0152FB1AC401066D3B1D0D7B2A002E44333046410100071B7A13482025FE3EFDBBD0BB74EACA9EEA0C1D11BB055BFC5921B5772A6AABA04186E541FB6B5744B40979217016101B7A510800000265BE084265B30882016554082265B0081265B7086265F7075265E70802FB1A390142FB1A3C018201FB1A850122FB1A370112FB1A3F0162FB1A5C" (wmbus) 00: fb length (251 bytes) (wmbus) 01: 1a c-field (?) (wmbus) 02: 7c01 m-field (17c=@K\) (wmbus) 04: 42fb1a81 a-field-addr (811afb42) (wmbus) 08: 01 a-field-version (wmbus) 09: 82 a-field-type (Unknown) (wmbus) 0a: 01 ci-field (?) (wmbus) FB1A7C0142FB1A81018201 Received telegram from: 811afb42 manufacturer: (@K\) Unknown device type: Unknown (rawtty) telegram ignored by all configured meters! (serial /dev/ttyACM0) received "5744B40984217016101B7A470800000265290842652B08820165EC072265280812652C086265DE075265160802FB1A7C0142FB1A81018201FB1AB40122FB1A7F0112FB1A830162FB1A9E0152FB1ACB01066D3B31D67A2A00" Segmentation fault

Amber USB Dongle 8465-M and Apator

Hi,
I have issue with reading values from Apator Water Meter (apator162).
I'm using Amber USB Dongle 8465-M.
I'm not sure if I'm doing it right.

When I'm trying to sniff all telegrams using command:
wmbusmeters --logtelegrams --debug --format=json --c1 auto

I see a telegram from my meter:
(wmbus) 6E4401061034260105077A4C006085 (serial /dev/amb8465) received "6E" (serial /dev/amb8465) received "4401063676690105077A98006085F912" (serial /dev/amb8465) received "320384F4AD4FF6E3B86A790A461160" (serial /dev/amb8465) received "3E85ABD154168E13EDA6779B66E5C7EB" (serial /dev/amb8465) received "5E43C0FD359B9E1C33FA801C94B046" (serial /dev/amb8465) received "2620F005F1AB5B263D2BFC41D42A74" (serial /dev/amb8465) received "5712D2F43C674E881881CDFC1603BB62" (serial /dev/amb8465) received "C2636CD4E67122336F7544305C1C62" (serial /dev/amb8465) received "2058" (amb8465) rssi 219 (wmbus) received telegram 01697636 C-field=44 M-field=0601 (APA) A-field-version=05 A-field-dev-type=07 (Water meter) Ci-field=7a (EN 13757-3 Application Layer with short Transport Layer) CC-field=00 (slow_resp) short header ACC=98 (wmbus) frame "6E4401063676690105077A98006085F912320384F4AD4FF6E3B86A790A4611603E85ABD154168E13EDA6779B66E5C7EB5E43C0FD359B9E1C33FA801C94B0462620F005F1AB5B263D2BFC41D42A745712D2F43C674E881881CDFC1603BB62C2636CD4E67122336F7544305C1C622058" (wmbus) payload "F912320384F4AD4FF6E3B86A790A4611603E85ABD154168E13EDA6779B66E5C7EB5E43C0FD359B9E1C33FA801C94B0462620F005F1AB5B263D2BFC41D42A745712D2F43C674E881881CDFC1603BB62C2636CD4E67122336F7544305C1C622058" (wmbus) 00: 6e length (110 bytes) (wmbus) 01: 44 c-field (SND_NR) (wmbus) 02: 0106 m-field (601=APA) (wmbus) 04: 36766901 a-field-addr (01697636) (wmbus) 08: 05 a-field-version (wmbus) 09: 07 a-field-type (Water meter) (wmbus) 0a: 7a ci-field (EN 13757-3 Application Layer with short Transport Layer) (wmbus) 0b: 98 acc (wmbus) 0c: 00 status () (wmbus) 0d: 6085 config (encrypted AES_CBC bidirectional) (wmbus) 6E4401063676690105077A98006085

But when I'm trying to read data only from my meter using command:
# wmbusmeters --logtelegrams --debug --verbose --format=json auto kitchen apator162 01697636 00000000000000000000000000000000

I'm getting only information that program is started and that's all
(wmbusmeters) version: 0.9.8 (config) using device: auto (config) number of meters: 1 (serialtty) closed /dev/im871a (serialtty) opened /dev/amb8465 (amb8465) are you there? (serial /dev/amb8465) sent "FF0B00F4" (serial /dev/amb8465) received "86FF8B042701BB54B9" (serialtty) closed /dev/amb8465 (serialtty) closed /dev/amb8465 (amb8465) detected on /dev/amb8465 (serialtty) opened /dev/amb8465 (amb8465) set link mode 05 (serial /dev/amb8465) sent "FF040105FF000000" (serial /dev/amb8465) received "FF840100" (serial /dev/amb8465) received "7A" (amb8465) rssi 122 (amb8465) set link mode completed (amb8465) set link mode "0100" (amb8465) get config (serial /dev/amb8465) sent "FF0A02008077" (serial /dev/amb8465) received "FF8A7A00780080" (serial /dev/amb8465) received "710200000000FFFFFA00FFFFFFFFFF" (serial /dev/amb8465) received "FFFFFFFFFFFFFFFFFFFFFF0032000214" (serial /dev/amb8465) received "00FFFFFFFFFF010004000000FFFFFF" (serial /dev/amb8465) received "01440000000000000000FFFF0B040100" (serial /dev/amb8465) received "FFFFFFFFFF00030000FFFFFFFFFFFF" (serial /dev/amb8465) received "FF0000FFFFFFFFFFFFFFFFFFFFFFFF" (serial /dev/amb8465) received "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF" (serial /dev/amb8465) received "FFFFFFFFFFFFFFFFFFFF17" (amb8465) rssi 23 (amb8465) get config completed (amb8465) get config "7A00780080710200000000FFFFFA00FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF003200021400FFFFFFFFFF010004000000FFFFFF01440000000000000000FFFF0B040100FFFFFFFFFF00030000FFFFFFFFFFFFFF0000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF" (amb8465) config: uart 78 (amb8465) config: radio Channel ff (amb8465) config: rssi enabled ff (amb8465) config: mode Preselect 00 (config) using link mode: T1 (wmbusmeters) configured "kitchen" "apator162" "01697636" encrypted

Adding support for CUL Devices

Hi, im using an nanoCUL stick to receive wmbus frames from my Multical21 meter,
i have the correct AES key - tested with the FHEM platform.

Now i want to switch to your program:

frames are looking like this (7 shorter and 1 longer frame, every 16 secs):
bY25442D2C170935741B168D209622C841224F8B33D377F4560BB4B332CB9469E50AA16CAC529683FA bY2C442D2C170935741B168D209723C84122A806AA39352EAF7B218DF0B2E9134E1731D365BB5DDC370C72951AB48021
Where should i start to add support for this type of frames?

apator162 + rtl_sdr

Hi. I use rtl_sdr usb dongle to listen to apator at-wmbus-16-2. I add device as :

name=WMBUS_APA_01761839
type=apator162
id=*
key=00000000000000000000000000000000

and after a while in log I get :

(serialcmd) received "54313B313B313B323031392D30342D30332031393A30303A34322E3030
303B39373B3134383B30313631373630373B30783665343430313036303737363631303130353037
65396438376138353030363038356263323633303731333831393531326562346364383763623035
66626135353466623433663637636639363534613638656538653139343038383936626631363064
66373532653731363233383239326538616631616332303938363230636537313265653536316437
34333630323436363931356534326631313035643963363763643930383261353435303465346630
39396536356137363536623933306337336133306639346537373531323264326664663037346235
303335636661613765303035306266333032363132666161653033613737393839623B3078366534
34303130363037373636313031303530373761383530303630383562633236333037313338313935
31326562346364383766626135353466623433663637636639363534613638656538653139343038
38313630646637353265373136323338323932653861663161633230393836323032656535363164
37343336303234363639313565343266313130356439633637383261353435303465346630393965
36356137363536623933306337336133303737353132326432666466303734623530333563666161
376530303530626633326661616530336137370A
(meter) WMBUS_APA_01761839: for me?
(meter) WMBUS_APA_01761839: probably not for me since manufacturer differs
(meter) WMBUS_APA_01761839: probably not for me since media does not match
(meter) WMBUS_APA_01761839: yes for me"

but /var/log/wmbusmeters/meter_readings is empty - why ?

multical302 volume unit issue

There seems to be an issue with volume units in multical302 meter.

I am getting the following data: {"media":"heat","meter":"multical302","name":"67947613","id":"67947613","total_k
wh":305,"total_volume_m3":1830,"current_kw":0,"timestamp":"2019-11-20T18:29:15Z"
}
The display of the device shows 18.30 m3. The value reported by wmbusmeters thus should be divided by 100.0
I have the meter for two weeks now and its counters had started from zero, so volume around 18 m3 is much more sensible than 1830 m3.

Support for new IZAR water meter (RC 868 I R4)

Hi Fredrik,

I just got a new IZAR water meter. The following entries can now be found in the log file.

(meter) WaterIndoor: probably not for me since manufacturer differs
(meter) WaterIndoor: probably not for me since media does not match

All values look good.
{"media":"water","meter":"izar","name":"WaterIndoor","id":"12345678","total_m3":0.237,"last_month_total_m3":0,"timestamp":"2019-12-13T09:49:46Z"}

I will send you the debug log by mail.

Thanks very much!
Ben

Add plain mbus support, first meter to be supported is Engelmann heatmeter sensorstar2

Hi,
I got a Engelmann heat-meter, product is SensoStar2. I got a reading with an optical head, that I stored in a file. The telegram has valid data, I can read the device with libmbus. I get this output from wmbusmters

./programme/wmbusmeters/build/wmbusmeters --listento=c1 --debug engelmann.bin
(wmbusmeters) version: 0.9.18
(config) using device: engelmann.bin
(config) number of meters: 0
(detect) "engelmann.bin" ""
(detect) is_tty=0 is_stdin=0 is_file=1
(serial) override with devicefile: engelmann.bin
(rawtty) on engelmann.bin
(serialfile) reading from file engelmann.bin
(config) all possible link modes that the meters might transmit on: none
(config) explicitly listening to: c1
(config) listen link modes calculated to be: c1
No meters configured. Printing id:s of all telegrams heard!

(config) listen to link modes: c1
(serial) waiting for stop
(serial) no more data on fd=3
(serial) received binary 6893936808007275404810C51400043127000004786BF99F00046D040F632B0415E02000004415E0200000840115E02000000406A02100004406A0210000840106A021000084100600000000C410060000000084110600000000426C5F2C026C7F2C043B00000000143B08010000042B00000000142B39240000025B1800025F17000461380000000223810C01FD17000490280B0000005616
(serial) no devices working
(serial) stopping manager
(serialtty) WOHO? closed engelmann.bin -1
(wmbus_rawtty) no sensible telegram found, clearing buffer.
(rawtty) protocol error in message received!
(rawtty) protocol error ""
(serial) event loop stopped!
(serial) closing 0 devices

With libmbus I get this result

<SlaveInformation>
    <Id>10484075</Id>
    <Manufacturer>EFE</Manufacturer>
    <Version>0</Version>
    <ProductName>Engelmann SensoStar 2</ProductName>
    <Medium>Heat: Outlet</Medium>
    <AccessNumber>51</AccessNumber>
    <Status>27</Status>
    <Signature>0000</Signature>
</SlaveInformation>

<DataRecord id="0">
    <Function>Instantaneous value</Function>
    <Unit>Fabrication number</Unit>
    <Value>10484075</Value>
    <Timestamp>2019-11-03T14:54:18</Timestamp>
</DataRecord>

<DataRecord id="1">
    <Function>Instantaneous value</Function>
    <Unit>Time Point (time &amp; date)</Unit>
    <Value>2019-11-03T15:05:00</Value>
    <Timestamp>2019-11-03T14:54:18</Timestamp>
</DataRecord>

<DataRecord id="2">
    <Function>Instantaneous value</Function>
    <Unit>Volume (1e-1  m^3)</Unit>
    <Value>8416</Value>
    <Timestamp>2019-11-03T14:54:18</Timestamp>
</DataRecord>

<DataRecord id="3">
    <Function>Instantaneous value</Function>
    <Unit>Volume (1e-1  m^3)</Unit>
    <Value>8416</Value>
    <Timestamp>2019-11-03T14:54:18</Timestamp>
</DataRecord>

<DataRecord id="4">
    <Function>Instantaneous value</Function>
    <Unit>Volume (1e-1  m^3)</Unit>
    <Value>8416</Value>
    <Timestamp>2019-11-03T14:54:18</Timestamp>
</DataRecord>

<DataRecord id="5">
    <Function>Instantaneous value</Function>
    <Unit>Energy (kWh)</Unit>
    <Value>8608</Value>
    <Timestamp>2019-11-03T14:54:18</Timestamp>
</DataRecord>

<DataRecord id="6">
    <Function>Instantaneous value</Function>
    <Unit>Energy (kWh)</Unit>
    <Value>8608</Value>
    <Timestamp>2019-11-03T14:54:18</Timestamp>
</DataRecord>

<DataRecord id="7">
    <Function>Instantaneous value</Function>
    <Unit>Energy (kWh)</Unit>
    <Value>8608</Value>
    <Timestamp>2019-11-03T14:54:18</Timestamp>
</DataRecord>

<DataRecord id="8">
    <Function>Instantaneous value</Function>
    <Unit>Energy (kWh)</Unit>
    <Value>0</Value>
    <Timestamp>2019-11-03T14:54:18</Timestamp>
</DataRecord>

<DataRecord id="9">
    <Function>Instantaneous value</Function>
    <Unit>Energy (kWh)</Unit>
    <Value>0</Value>
    <Timestamp>2019-11-03T14:54:18</Timestamp>
</DataRecord>

<DataRecord id="10">
    <Function>Instantaneous value</Function>
    <Unit>Energy (kWh)</Unit>
    <Value>0</Value>
    <Timestamp>2019-11-03T14:54:18</Timestamp>
</DataRecord>

<DataRecord id="11">
    <Function>Instantaneous value</Function>
    <Unit>Time Point (date)</Unit>
    <Value>2018-12-31</Value>
    <Timestamp>2019-11-03T14:54:18</Timestamp>
</DataRecord>

<DataRecord id="12">
    <Function>Instantaneous value</Function>
    <Unit>Time Point (date)</Unit>
    <Value>2019-12-31</Value>
    <Timestamp>2019-11-03T14:54:18</Timestamp>
</DataRecord>

<DataRecord id="13">
    <Function>Instantaneous value</Function>
    <Unit>Volume flow (m m^3/h)</Unit>
    <Value>0</Value>
    <Timestamp>2019-11-03T14:54:18</Timestamp>
</DataRecord>

<DataRecord id="14">
    <Function>Maximum value</Function>
    <Unit>Volume flow (m m^3/h)</Unit>
    <Value>264</Value>
    <Timestamp>2019-11-03T14:54:18</Timestamp>
</DataRecord>

<DataRecord id="15">
    <Function>Instantaneous value</Function>
    <Unit>Power (W)</Unit>
    <Value>0</Value>
    <Timestamp>2019-11-03T14:54:18</Timestamp>
</DataRecord>

<DataRecord id="16">
    <Function>Maximum value</Function>
    <Unit>Power (W)</Unit>
    <Value>9273</Value>
    <Timestamp>2019-11-03T14:54:18</Timestamp>
</DataRecord>

<DataRecord id="17">
    <Function>Instantaneous value</Function>
    <Unit>Flow temperature (deg C)</Unit>
    <Value>24</Value>
    <Timestamp>2019-11-03T14:54:18</Timestamp>
</DataRecord>

<DataRecord id="18">
    <Function>Instantaneous value</Function>
    <Unit>Return temperature (deg C)</Unit>
    <Value>23</Value>
    <Timestamp>2019-11-03T14:54:18</Timestamp>
</DataRecord>

<DataRecord id="19">
    <Function>Instantaneous value</Function>
    <Unit>Temperature Difference (1e-2  deg C)</Unit>
    <Value>56</Value>
    <Timestamp>2019-11-03T14:54:18</Timestamp>
</DataRecord>

<DataRecord id="20">
    <Function>Instantaneous value</Function>
    <Unit>On time (days)</Unit>
    <Value>3201</Value>
    <Timestamp>2019-11-03T14:54:18</Timestamp>
</DataRecord>

<DataRecord id="21">
    <Function>Instantaneous value</Function>
    <Unit>Error flags</Unit>
    <Value>0</Value>
    <Timestamp>2019-11-03T14:54:18</Timestamp>
</DataRecord>

<DataRecord id="22">
    <Function>Instantaneous value</Function>
    <Unit>Volume (my m^3)</Unit>
    <Value>11</Value>
    <Timestamp>2019-11-03T14:54:18</Timestamp>
</DataRecord>

Is it possible to add this device?

Add support for HYDRUS water meter.

Hi, on the wmbusmeters.log file I get three lines repeating.

(meter) name: probably not for me since manufacturer differs
(meter) name: probably not for me since media does not match
(izar) Decoding PRIOS data failed. Ignoring telegram.

However there is a log file created and updated on the meter_readings

What could these problems be? @weetmuts

Send to domoticz

Hi.

Can somebody post some info how to send meter value to domoticz via MQTT ? How to pass device idx from domoticz etc

Read interval

Is it possible to change how often it will read my Multical21

Suggestion: Add support for iobroker

Hi,

This is a great tool - but wouldn't it be even greater if it was possible to integrate into iobroker?
I know there is a wmbus plugin for iobroker, but that is old and not supported anymore...I would so much love to see this great tool as an adapter in iobroker ;)

Any thoughts?

/M

Add exclude to meter matching

Hello,

it would be nice feature to exclude some ids from meter matching.
Or maybe make more specific matching and process packet using only one decoder?
Maybe something like this id=22*,!2222222?

My scenario: I have 2 entries in wmbusmeters.d/, one for my amiplus meter with specific id, and second with id=* to process all water meters (mkradio3) I could receive around.
Right now packets from energy meter are processed by amiplus AND mkradio3, so I'm getting a lot of nonsense messages from power meter processed as water meter. Exclude energy meter from water meters could fix this :-)

CRC code support

GPLv2+ licensed code from rtl_433.

uint16_t crc16(uint8_t const message[], unsigned nBytes, uint16_t polynomial, uint16_t init)
{
    uint16_t remainder = init;
    unsigned byte, bit;

    for (byte = 0; byte < nBytes; ++byte) {
        remainder ^= message[byte] << 8;
        for (bit = 0; bit < 8; ++bit) {
            if (remainder & 0x8000) {
                remainder = (remainder << 1) ^ polynomial;
            }
            else {
                remainder = (remainder << 1);
            }
        }
    }
    return remainder;
}
// Validate CRC
static int m_bus_crc_valid(r_device *decoder, const uint8_t *bytes, unsigned crc_offset)
{
    static const uint16_t CRC_POLY = 0x3D65;
    uint16_t crc_calc = ~crc16(bytes, crc_offset, CRC_POLY, 0);
    uint16_t crc_read = (((uint16_t)bytes[crc_offset] << 8) | bytes[crc_offset+1]);
    if (crc_calc != crc_read) {
        if (decoder->verbose) {
            fprintf(stderr, "M-Bus: CRC error: Calculated 0x%0X, Read: 0x%0X\n", (unsigned)crc_calc, (unsigned)crc_read);
        }
        return 0;
    }
    return 1;
}

Support for multiple connected dongles

Instead of using a repeater, I am trying to use two im871a dongles connected to two USB ports - each dongle then goes to a different floor.

The issue is how to run two instances of wmbusmeters each attached to a different device ... a daemon mode cannot be used obviously, so I thought of running two instances from the command line. One way is to have two distinct config folders and run each instance against its own config. There are two disadvantages: 1/ configs are identical except the device name, 2/ I have to put the device name in the config. The latter point is more serious as the device name may be changing (not always .e.g. /dev/ttyUSB0).

My best idea is that wmbusmeters, if used with --useconfig option, could still check the command line for the device name that would override the device in the config file; something like ./wmbusmeters --useconfig=/ /dev/ttyUSB0:im871a. In this way I could make a udev rule that would start wmbusmeters passing it the device name of the dongle that has been plugged in.

Even more elegantly, this could work in the daemon mode too, but it would require more changes. Apart the device name given on the command line, the pid file should somehow include the device name too, so that multiple daemons could co-exist.

What do you think?

Support Lansen thermo/hygro-meter

On the air payload (without crc)

{002f}
2e 44 33 30 46 41 01 00 07 1b 7a 63 48 20 25 af
3b 6f be fc 5f 40 b3 b1 d0 96 0d 52 1d c8 cd 53
7a 05 8e 5a 91 6d 48 f8 00 2e 78 a4 d0 d3 63

Encrypted part
af 3b 6f be fc 5f 40 b3 b1 d0 96 0d 52 1d c8 cd
53 7a 05 8e 5a 91 6d 48 f8 00 2e 78 a4 d0 d3 63
print_dec

Decrypted part
2f 2f 02 65 84 08 42 65 83 08 82 01 65 95 08 02
fb 1a ae 01 42 fb 1a ae 01 82 01 fb 1a a9 01 2f

im871a - multical21

Hi,
I have sucessfully connected a im871a to my raspberry pi, and now I want to read data from my water meter, a multical21. When running wmbusmeters I get this message

(multical21) warning: unknown frame a3 (did you use the correct encryption key?)

I have asked my provider for an AES key, and they send me an .zip.kem file. I do not know how to get the AES key from this file. Should I use some piece of software to generate the key from this file?

Thanks
Torben

Decode of iperl wmbus data

Hi,

I now have my iPerl water meter unencrypted, but I still see some strange warning by wmbusmeters.

(serial /dev/ttyUSB0) received "A5E2031844AE4C4225222068077A55000000041389E20100023B00000000000091B3FB"
(im871a) timestamp 00000000
(im871a) rssi 91
(im871a) got crc16 fbb3 expected fbb3
(wmbus) received telegram 20222542 C-field=44 M-field=4cae (SEN) A-field-version=68 A-field-dev-type=07 (Water meter) Ci-field=7a (EN 13757-3 Application Layer with short Transport Layer) CC-field=00 (slow_resp) ACC=55
(wmbus) frame "1844AE4C4225222068077A55000000041389E20100023B0000"
(wmbus) payload "041389E20100023B0000"
(wmbus) 00: 18 length (24 bytes)
(wmbus) 01: 44 c-field (SND_NR)
(wmbus) 02: ae4c m-field (4cae=SEN)
(wmbus) 04: 42252220 a-field-addr (20222542)
(wmbus) 08: 68 a-field-version
(wmbus) 09: 07 a-field-type (Water meter)
(wmbus) 0a: 7a ci-field (EN 13757-3 Application Layer with short Transport Layer)
(wmbus) 0b: 55 acc
(wmbus) 0c: 00 status ()
(wmbus) 0d: 0000 configuration ()
(wmbus) 1844AE4C4225222068077A55000000
(meter) iperl: for me? 20222542
(meter) iperl: not for me: not my id
(meter) iperl2: for me? 20222542
(meter) iperl2: yes for me
(iperl) telegram for iperl2 20222542
(meter_iperl) warning: telegram payload does not start with 2F2F (did you use the correct encryption key?)
(iperl) log "telegram=|1844AE4C4225222068077A55000000|041389E20100023B0000|+7045"
(iperl) 0f: 04 dif (32 Bit Integer/Binary Instantaneous value)
(iperl) 10: 13 vif (Volume l)
(iperl) 11: * 89E20100 total consumption (123.529000 m3)
(iperl) 15: 02 dif (16 Bit Integer/Binary Instantaneous value)
(iperl) 16: 3B vif (Volume flow l/h)
(iperl) 17: 0000
(iperl) 1844AE4C4225222068077A55000000041389E20100023B0000
iperl2 20222542 123.529 m3 2019-03-11 13:42.26

It seems to decode the m3 correct, but why the warning?

Thanks!

[Feature request] Techem Radio 3 water meters

Hello weetmuts, thanks for your awesome work.
Could it be possible to add support for Techem Radio 3 warm/cold water meters?

(serialcmd) received "T1;1;1;2019-04-27 07:20:05.000;53;142;62007430;0x2f446850307400627462a2069f255900b029310000000306060906030609070606050509050505050407040605070500<0A>"
(rtlwmbus) got full frame
Unknown ci-field a2
(wmbus) received telegram 62007430 C-field=44 M-field=5068 (TCH) A-field-version=74 A-field-dev-type=62 (Unknown) Ci-field=a2 (Mfct specific)
(wmbus) frame "2F446850307400627462A2069F255900B029310000000306060906030609070606050509050505050407040605070500"
(wmbus) payload "069F255900B029310000000306060906030609070606050509050505050407040605070500"
(wmbus) 00: 2f length (47 bytes)
(wmbus) 01: 44 c-field (SND_NR)
(wmbus) 02: 6850 m-field (5068=TCH)
(wmbus) 04: 30740062 a-field-addr (62007430)
(wmbus) 08: 74 a-field-version
(wmbus) 09: 62 a-field-type (Unknown)
(wmbus) 0a: a2 ci-field (Mfct specific)
(wmbus) 2F446850307400627462A2
Received telegram from: 62007430
manufacturer: (TCH) Techem Service,
device type: Unknown
(rtl_wmbus) telegram ignored by all configured meters!

A-field-dev-type=62 <-- warm water meter
A-field-dev-type=72 <-- cold water meter

Based on information found over the internet and my own observations, this is how I calculate current meter readings from mbus telegrams:

Payload:

06 9F25 5900 B029 3100 00000306060906030609070606050509050505050407040605070500

9F25 - previous period end date (?)
5900 - water consumption in previous period
B029 - current date
3100 - water consumption in current period

Calculations:

5900 -> 0059h -> 89
3100 -> 0031h -> 49

Current meter reading: (89 + 49) / 10 = 13.8 m3

Suggestion: Add support for Water Sappel/IZAR RC 868

Starting a new thread to enable water monitoring device . It uses IZAR RC 868 protocol over wm-bus. It's used in Wroclaw/Poland.

Datagram example:

(serial /dev/im871a) received "A5E2031944304CF8BED640CC01A2011500137E02C45F17397158677C5D00000000678528"
(im871a) timestamp 00000000
(im871a) rssi 67
(im871a) got crc16 2885 expected 2885
Unknown ci-field a2
(wmbus) received telegram 40d6bef8 C-field=44 M-field=4c30 (SAP) A-field-version=cc A-field-dev-type=01 (Oil meter) Ci-field=a2 (Mfct specific)
(wmbus) frame "1944304CF8BED640CC01A2011500137E02C45F17397158677C5D"
(wmbus) payload "011500137E02C45F17397158677C5D"
(wmbus) 00: 19 length (25 bytes)
(wmbus) 01: 44 c-field (SND_NR)
(wmbus) 02: 304c m-field (4c30=SAP)
(wmbus) 04: f8bed640 a-field-addr (40d6bef8)
(wmbus) 08: cc a-field-version
(wmbus) 09: 01 a-field-type (Oil meter)
(wmbus) 0a: a2 ci-field (Mfct specific)
(wmbus) 1944304CF8BED640CC01A2
(meter) EnergyMeter: for me? 40d6bef8
(meter) EnergyMeter: not for me: not my id
(im871a) telegram ignored by all configured meters!

Add duplicate telegram check.

Sometimes telegrams arrive twice due to repeaters.

Add a 10 second memory that will discard duplicate (identical) telegrams within that timeframe.

Bmeters water meter payload

Here is a payload from a water meter

4e44b409XXXXXXXX1307XXXX [7a 48 00 40 05] 948a8c3f164c34465990fdeacdf05e9dc625dbf27163eaf8f9172a74c1880ae5f6315baa3c45c5bc4d8ebd3659d0a473b27c3fae5cb1b7f7cbda557bb7865beaa28885b80251ec3ae776

I blanked out the id and crc. The CW indicates an aes encrypted payload. Do you have a set of "popular" key to try on this meter?

Support pi-temp_wl/

{0058}
57 44 b4 09 84 21 70 16 10 1b 7a b2 08 00 00 02
65 a0 08 42 65 8f 08 82 01 65 9f 08 22 65 89 08
12 65 a0 08 62 65 51 08 52 65 2b 09 02 fb 1a ba
01 42 fb 1a b0 01 82 01 fb 1a bd 01 22 fb 1a a9
01 12 fb 1a ba 01 62 fb 1a a6 01 52 fb 1a f5 01
06 6d 3b 3b b3 6b 2a 00

Datagram from rfm rx2 (without crc).

Bmeters rfm rx2 support

Hi, I have a rfm rx2 usb stick. It outputs raw wmbus (without crc) over the serial port. What is needed to add support for this device?

I wrote a proof of concept program to interface with the device and you only need to open the serial port and the telegrams just start to appear. It should be fairly easy to add support for this device.

https://github.com/merbanan/wmbus

Multical21 | Only receive total consumption and target consumption

I have a IMST871a-dongle and the water meter is a multical21(in sweden). I only receive the total consumption and target consumption values.

I see this information in the debug:
ignoring telegram since format signature hash 0xdd34 is yet unknown

Am i doing it wrong? The total consumption value I get is correct.

Here comes the debug:
(wmbusmeters) version: 0.9.19-5-gb8bafeb
(config) using device: auto
(config) number of meters: 1
(detect) "auto" ""
(detect) driver: auto
(serialtty) opened /dev/im871a
(serial) received binary
(im871a) are you there?
(serial /dev/im871a) sent "A5010100"
(serial) received binary A58102004CA3
(serialtty) closed /dev/im871a
(im871a) got crc16 a34c expected a34c
(im871a) on /dev/im871a
(serialtty) opened /dev/im871a
(config) meter multical21 link mode(s): c1
(config) all possible link modes that the meters might transmit on: c1
(config) listen link modes calculated to be: c1
(wmbusmeters) configured "MyTapDapper" "multical21" "63407299" encrypted
(im871a) set link mode 06
(serial /dev/im871a) sent "A5010306000206300101"
(serial) received binary A58104009CF7
(im871a) got crc16 f79c expected f79c
(im871a) set config completed
(im871a) get config
(serial /dev/im871a) sent "A5010500"
(serial) received binary A5810617FF000600B32500191000010001FF0702320001010000E0E21E
(im871a) got crc16 1ee2 expected 1ee2
(im871a) get config completed
(im871a) config: device mode 00
(im871a) config: link mode 06
(im871a) config: wmbus c-field 00
(im871a) config: wmbus mfg id 25b3 (IMS)
(im871a) config: wmbus device id 00101900
(im871a) config: wmbus version 01
(im871a) config: wmbus device type 00
(im871a) config: radio channel 01
(im871a) config: radio power level 07
(im871a) config: radio data rate 02
(im871a) config: radio rx window 32
(im871a) config: auto power saving 00
(im871a) config: auto RSSI attachment 01
(im871a) config: auto rx timestamp attachment 01
(im871a) config: led control 00
(im871a) config: rtc control 00
(config) listen to link modes: c1
(serial) waiting for stop
(serial) received binary A5E20321442D2C997240631B168D20D741524723A80788478C04E0E10912179C5C9D67FAD6DA28000000389F
(im871a) timestamp 000028da
(im871a) rssi 00
(im871a) got crc16 9f38 expected 9f38
(wmbus) received telegram 63407299 C-field=44 M-field=2c2d (KAM) A-field-version=1b A-field-dev-type=16 (Cold water meter) Ci-field=8d (Extended Link Layer II (8 Byte)) CC-field=20 (slow_resp sync) ell header ACC=d7 SN=23475241
(wmbus) frame "21442D2C997240631B168D20D741524723A80788478C04E0E10912179C5C9D67FAD6"
(wmbus) payload "A80788478C04E0E10912179C5C9D67FAD6"
(wmbus) 00: 21 length (33 bytes)
(wmbus) 01: 44 c-field (SND_NR)
(wmbus) 02: 2d2c m-field (2c2d=KAM)
(wmbus) 04: 99724063 a-field-addr (63407299)
(wmbus) 08: 1b a-field-version
(wmbus) 09: 16 a-field-type (Cold water meter)
(wmbus) 0a: 8d ci-field (Extended Link Layer II (8 Byte))
(wmbus) 0b: 20 cc-field (slow_resp sync)
(wmbus) 0c: d7 acc
(wmbus) 0d: 41524723 sn (encrypted session=1 time=3437860)
(wmbus) 21442D2C997240631B168D20D741524723
(meter) MyTapDapper: for me? 63407299
(meter) MyTapDapper: yes for me
(multical21) MyTapDapper 63407299 (Mode1) decrypting "A80788478C04E0E10912179C5C9D67FAD6"
(Mode1) IV 2D2C997240631B162041524723000000
(Mode1) decrypted first block "39977934DD45E2000053CE0800FFC708"
(Mode1) IV+1 2D2C997240631B162041524723000001
(Mode1) decrypted second block "00"
(Mode1) decrypted "39977934DD45E2000053CE0800FFC70800"
(multical21) log "telegram=|21442D2C997240631B168D20D741524723|39977934DD45E2000053CE0800FFC70800|+15"
(multical21) ignoring telegram since format signature hash 0xdd34 is yet unknown.
(multical21) 11: 3997 payload crc
(multical21) 13: 79 frame type (short frame)
(multical21) 14: 34dd format signature
(multical21) 21442D2C997240631B168D20D74152472339977934DD
{"media":"cold water","meter":"multical21","name":"MyTapDapper","id":"63407299","total_m3":0,"target_m3":0,"max_flow_m3h":0,"flow_temperature_c":127,"external_temperature_c":127,"current_status":"","time_dry":"","time_reversed":"","time_leaking":"","time_bursting":"","timestamp":"2019-12-06T11:57:28Z"}
(serial) received binary A5E20321442D2C997240631B168D20D841524723A80788478C04E0E10912179C5C9D67FAD661C600000013A9
(im871a) timestamp 0000c661
(im871a) rssi 00
(im871a) got crc16 a913 expected a913
(wmbus) received telegram 63407299 C-field=44 M-field=2c2d (KAM) A-field-version=1b A-field-dev-type=16 (Cold water meter) Ci-field=8d (Extended Link Layer II (8 Byte)) CC-field=20 (slow_resp sync) ell header ACC=d8 SN=23475241
(wmbus) frame "21442D2C997240631B168D20D841524723A80788478C04E0E10912179C5C9D67FAD6"
(wmbus) payload "A80788478C04E0E10912179C5C9D67FAD6"
(wmbus) 00: 21 length (33 bytes)
(wmbus) 01: 44 c-field (SND_NR)
(wmbus) 02: 2d2c m-field (2c2d=KAM)
(wmbus) 04: 99724063 a-field-addr (63407299)
(wmbus) 08: 1b a-field-version
(wmbus) 09: 16 a-field-type (Cold water meter)
(wmbus) 0a: 8d ci-field (Extended Link Layer II (8 Byte))
(wmbus) 0b: 20 cc-field (slow_resp sync)
(wmbus) 0c: d8 acc
(wmbus) 0d: 41524723 sn (encrypted session=1 time=3437860)
(wmbus) 21442D2C997240631B168D20D841524723
(meter) MyTapDapper: for me? 63407299
(meter) MyTapDapper: yes for me
(multical21) MyTapDapper 63407299 (Mode1) decrypting "A80788478C04E0E10912179C5C9D67FAD6"
(Mode1) IV 2D2C997240631B162041524723000000
(Mode1) decrypted first block "39977934DD45E2000053CE0800FFC708"
(Mode1) IV+1 2D2C997240631B162041524723000001
(Mode1) decrypted second block "00"
(Mode1) decrypted "39977934DD45E2000053CE0800FFC70800"
(multical21) log "telegram=|21442D2C997240631B168D20D841524723|39977934DD45E2000053CE0800FFC70800|+31"
(multical21) ignoring telegram since format signature hash 0xdd34 is yet unknown.
(multical21) 11: 3997 payload crc
(multical21) 13: 79 frame type (short frame)
(multical21) 14: 34dd format signature
(multical21) 21442D2C997240631B168D20D84152472339977934DD
{"media":"cold water","meter":"multical21","name":"MyTapDapper","id":"63407299","total_m3":0,"target_m3":0,"max_flow_m3h":0,"flow_temperature_c":127,"external_temperature_c":127,"current_status":"","time_dry":"","time_reversed":"","time_leaking":"","time_bursting":"","timestamp":"2019-12-06T11:57:44Z"}
(serial) received binary A5E20321442D2C997240631B168D20D941524723A80788478C04E0E10912179C5C9D67FAD697F70000002C0F
(im871a) timestamp 0000f797
(im871a) rssi 00
(im871a) got crc16 0f2c expected 0f2c
(wmbus) received telegram 63407299 C-field=44 M-field=2c2d (KAM) A-field-version=1b A-field-dev-type=16 (Cold water meter) Ci-field=8d (Extended Link Layer II (8 Byte)) CC-field=20 (slow_resp sync) ell header ACC=d9 SN=23475241
(wmbus) frame "21442D2C997240631B168D20D941524723A80788478C04E0E10912179C5C9D67FAD6"
(wmbus) payload "A80788478C04E0E10912179C5C9D67FAD6"
(wmbus) 00: 21 length (33 bytes)
(wmbus) 01: 44 c-field (SND_NR)
(wmbus) 02: 2d2c m-field (2c2d=KAM)
(wmbus) 04: 99724063 a-field-addr (63407299)
(wmbus) 08: 1b a-field-version
(wmbus) 09: 16 a-field-type (Cold water meter)
(wmbus) 0a: 8d ci-field (Extended Link Layer II (8 Byte))
(wmbus) 0b: 20 cc-field (slow_resp sync)
(wmbus) 0c: d9 acc
(wmbus) 0d: 41524723 sn (encrypted session=1 time=3437860)
(wmbus) 21442D2C997240631B168D20D941524723
(meter) MyTapDapper: for me? 63407299
(meter) MyTapDapper: yes for me
(multical21) MyTapDapper 63407299 (Mode1) decrypting "A80788478C04E0E10912179C5C9D67FAD6"
(Mode1) IV 2D2C997240631B162041524723000000
(Mode1) decrypted first block "39977934DD45E2000053CE0800FFC708"
(Mode1) IV+1 2D2C997240631B162041524723000001
(Mode1) decrypted second block "00"
(Mode1) decrypted "39977934DD45E2000053CE0800FFC70800"
(multical21) log "telegram=|21442D2C997240631B168D20D941524723|39977934DD45E2000053CE0800FFC70800|+47"
(multical21) ignoring telegram since format signature hash 0xdd34 is yet unknown.
(multical21) 11: 3997 payload crc
(multical21) 13: 79 frame type (short frame)
(multical21) 14: 34dd format signature
(multical21) 21442D2C997240631B168D20D94152472339977934DD
{"media":"cold water","meter":"multical21","name":"MyTapDapper","id":"63407299","total_m3":0,"target_m3":0,"max_flow_m3h":0,"flow_temperature_c":127,"external_temperature_c":127,"current_status":"","time_dry":"","time_reversed":"","time_leaking":"","time_bursting":"","timestamp":"2019-12-06T11:58:00Z"}
(serial) received binary A5E20324442D2C997240631B168D20DA70524723658873251CEF4F0612DA54744531263FDBABB320D923000000A15F
(im871a) timestamp 000023d9
(im871a) rssi 00
(im871a) got crc16 5fa1 expected 5fa1
(wmbus) received telegram 63407299 C-field=44 M-field=2c2d (KAM) A-field-version=1b A-field-dev-type=16 (Cold water meter) Ci-field=8d (Extended Link Layer II (8 Byte)) CC-field=20 (slow_resp sync) ell header ACC=da SN=23475270
(wmbus) frame "24442D2C997240631B168D20DA70524723658873251CEF4F0612DA54744531263FDBABB320"
(wmbus) payload "658873251CEF4F0612DA54744531263FDBABB320"
(wmbus) 00: 24 length (36 bytes)
(wmbus) 01: 44 c-field (SND_NR)
(wmbus) 02: 2d2c m-field (2c2d=KAM)
(wmbus) 04: 99724063 a-field-addr (63407299)
(wmbus) 08: 1b a-field-version
(wmbus) 09: 16 a-field-type (Cold water meter)
(wmbus) 0a: 8d ci-field (Extended Link Layer II (8 Byte))
(wmbus) 0b: 20 cc-field (slow_resp sync)
(wmbus) 0c: da acc
(wmbus) 0d: 70524723 sn (encrypted session=0 time=3437863)
(wmbus) 24442D2C997240631B168D20DA70524723
(meter) MyTapDapper: for me? 63407299
(meter) MyTapDapper: yes for me
(multical21) MyTapDapper 63407299 (Mode1) decrypting "658873251CEF4F0612DA54744531263FDBABB320"
(Mode1) IV 2D2C997240631B162070524723000000
(Mode1) decrypted first block "B5E27802FF200000041353CE08004413"
(Mode1) IV+1 2D2C997240631B162070524723000001
(Mode1) decrypted second block "FFC70800"
(Mode1) decrypted "B5E27802FF200000041353CE08004413FFC70800"
(multical21) log "telegram=|24442D2C997240631B168D20DA70524723|B5E27802FF200000041353CE08004413FFC70800|+63"
(dvparser) found new format "02FF2004134413" with hash dd34, remembering!
(dvparser) looking for type=instantaneous vif=Volume storagenr=0
(dvparser) match? type=instantaneous vif=Volume and storagenr=0
(dvparser) match? type=instantaneous vif=Volume and storagenr=0
(dvparser) found key 0413 for type=instantaneous vif=Volume storagenr=0
(dvparser) looking for type=unknown vif=Volume storagenr=1
(dvparser) match? type=instantaneous vif=Volume and storagenr=1
(dvparser) match? type=instantaneous vif=Volume and storagenr=1
(dvparser) match? type=instantaneous vif=Volume and storagenr=1
(dvparser) found key 4413 for type=instantaneous vif=Volume storagenr=1
(dvparser) looking for type=unknown vif=VolumeFlow storagenr=-1
(dvparser) match? type=instantaneous vif=VolumeFlow and storagenr=-1
(dvparser) match? type=instantaneous vif=VolumeFlow and storagenr=-1
(dvparser) match? type=instantaneous vif=VolumeFlow and storagenr=-1
(dvparser) looking for type=unknown vif=FlowTemperature storagenr=-1
(dvparser) match? type=instantaneous vif=FlowTemperature and storagenr=-1
(dvparser) match? type=instantaneous vif=FlowTemperature and storagenr=-1
(dvparser) match? type=instantaneous vif=FlowTemperature and storagenr=-1
(dvparser) looking for type=unknown vif=ExternalTemperature storagenr=-1
(dvparser) match? type=instantaneous vif=ExternalTemperature and storagenr=-1
(dvparser) match? type=instantaneous vif=ExternalTemperature and storagenr=-1
(dvparser) match? type=instantaneous vif=ExternalTemperature and storagenr=-1
(multical21) 11: b5e2 payload crc
(multical21) 13: 78 frame type (long frame)
(multical21) 14: 02 dif (16 Bit Integer/Binary Instantaneous value)
(multical21) 15: FF vif (Vendor extension)
(multical21) 16: 20 vife (per second)
(multical21) 17: * 0000 info codes (OK)
(multical21) 19: 04 dif (32 Bit Integer/Binary Instantaneous value)
(multical21) 1a: 13 vif (Volume l)
(multical21) 1b: * 53CE0800 total consumption (577.107000 m3)
(multical21) 1f: 44 dif (32 Bit Integer/Binary Instantaneous value storagenr=1)
(multical21) 20: 13 vif (Volume l)
(multical21) 21: * FFC70800 target consumption (575.487000 m3)
(multical21) 24442D2C997240631B168D20DA70524723B5E27802FF200000041353CE08004413FFC70800
{"media":"cold water","meter":"multical21","name":"MyTapDapper","id":"63407299","total_m3":577.107,"target_m3":575.487,"max_flow_m3h":0,"flow_temperature_c":127,"external_temperature_c":127,"current_status":"","time_dry":"","time_reversed":"","time_leaking":"","time_bursting":"","timestamp":"2019-12-06T11:58:16Z"}
^C(serial) stopping manager
(serial) event loop stopped!
(serial) closing 1 devices
(serial) no devices working
(serial) no devices working
(serialtty) closed /dev/im871a

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.