Scroll to navigation

LIBMBUS(1) libmbus LIBMBUS(1)

NAME

libmbus (utilities) - support utilities to the libmbus. libmbus is an open source M-bus (Meter-Bus) library. The Meter-Bus is a standard for reading out meter data from electricity meters, heat meters, gas meters, etc. The role of the libmbus library is to decode/encode M-bus data, and to handle the communication with M-Bus devices.

SYNOPSIS

mbus-serial-switch-baudrate [-b BAUDRATE] device address target-baudrate

mbus-serial-set-address [-d] [-b BAUDRATE] device mbus-address new-primary-address

mbus-serial-scan [-d] [-b BAUDRATE] [-r RETRIES] device

mbus-tcp-scan [-d] [-r RETRIES] host port

mbus-serial-scan-secondary [-d] [-b BAUDRATE] device [address-mask]

mbus-tcp-scan-secondary host port [address-mask]

mbus-serial-request-data [-d] [-b BAUDRATE] device mbus-address

mbus-tcp-request-data [-d] host port mbus-address

mbus-serial-request-data-multi-reply [-d] [-b BAUDRATE] [-f FRAMES] device mbus-address

mbus-tcp-request-data-multi-reply [-d] [-f FRAMES] host port mbus-address

mbus-serial-select-secondary [-b BAUDRATE] device secondary-mbus-address

mbus-tcp-select-secondary host port secondary-mbus-address

mbus-tcp-raw-send [-d] host port mbus-address [file]

DESCRIPTION

mbus-serial-switch-baudrate - attempts to switch the communication speed of the MBus device.

mbus-serial-scan, mbus-tcp-scan - sequentially scan for devices on MBus bus using primary addresses.

mbus-serial-scan-secondary, mbus-tcp-scan-secondary - scan for devices on MBus bus using secondary addresses. The scan is not sequential.

mbus-serial-request-data, mbus-tcp-request-data - read data from given device. Supports both primary and secondary address types.

mbus-serial-request-data-multi-reply, mbus-tcp-request-data-multi-reply - read data from given device supporting multi-telegram (default: up to 16 frames) reply. Can be also used for single telegram as mbus-serial-request-data or mbus-tcp-request-data. Supports both primary and secondary address types.

mbus-serial-select-secondary, mbus-tcp-select-secondary - perform single secondary address select to check what device responds.

mbus-tcp-raw-send - send a single raw hex frame to a MBus device.

OPTIONS

There are following options/parameters:

For serial communication, use given BAUDRATE (integer in Bd). If not used then default baudrate of 9600 will be used. libmbus supports following baud rates: 300, 600, 1200, 2400, 4800, 9600, 19200, 38400. Note that your MBus gateway and/or MBus device will most likely support only a subset of these. The most commonlu used/supported rates are probably 9600, 2400 and 300.
Maximum retransmissions. In case a MBus device doesn't reply to a request or the response is erroneous, the MBus master can send a retransmissions.

libmbus supports the following range of retransmission: 0 until 9

Maximum response frames.
Enable debugging messages.
For serial communication, the serial device which represents the MBus (gateway). Typically something like /dev/ttyS0, /dev/ttyUSB0, etc.
For TCP communciation, the host which represents the MBus (gateway).
For TCP communciation, the port on the host which represents the MBus (gateway). An integer between 0 and 65535.
MBus device primary address. An integer between 1 and 250.
Address mask for secondary address scan - you can restrict the search by supplying an optional address mask on the form 'FFFFFFFFFFFFFFFF' where F is a wildcard character.
MBus device address. Could be a primary address or a secondary address (sixteen digit hexadecimal number).

The primary address should be an integer between 1 and 250 for addressing individual devices. However the program does allow using any one byte number (i.e. 0 to 255) so that you can also use addresses reserved for physical or data link layers management, secondary addressing, broadcasts, etc.

MBus secondary address of the device. Sixteen digit hexadecimal number.
For serial communication, the baudrate to which the device should be switched.
Path to an file with hex values.

EXAMPLES

Scan for MBus devices on the serial port:

  mbus-serial-scan -d -b 2400 /dev/ttyS0

Try to switch baud rate of a device on address 59 from 2400Bd to 9600Bd:

  mbus-serial-switch-baudrate -b 2400 /dev/ttyUSB0 59 9600

Readout a MBus device on address 59 at 2400Bd:

  mbus-serial-request-data-multi-reply -b 2400 /dev/ttyS0 59

SEE ALSO

http://www.rscada.se/libmbus and http://www.m-bus.com

AUTHORS

See http://www.rscada.se/libmbus and https://github.com/rscada/libmbus

2022-05-25 0.9.0