Taras Greben's Meter-Bus Gateway Provides a Web Interface for M-Bus Energy Meters and More

Designed to provide an easy way to query M-Bus devices, including energy meters, this little black box is a self-contained gateway.

Self-described "lazy engineer" Taras Greben has built a gadget designed to provide web access to Meter-Bus (M-Bus) devices, like electricity meters, from an on-board web server — powered by a low-cost Espressif ESP8266 microcontroller.

"This device hosts a web server and an M-Bus gateway and allows to communicate with M-Bus consumption meters from a browser," Greben explains. "M-Bus is a standard for remote reading of consumption meters (e.g. water, heat, electricity meters, etc.) As of today, the standard is maintained by OMS-Group, and evolved to support other device types, including sensors, detectors, controllers, etc."

Designed for a compact footprint, Greben's custom gateway board hosts an Espressif ESP-01 module with ESP8266 microcontroller. It's based on earlier work by Thomas Menzl, who in turn adapted a circuit design from the 1990s created at Paderborn University, with some modifications — including moving control of the M-Bus interface to the ESP8266 microcontroller and a new capacitor to improve the reliability of readings over longer wires.

"All M-Bus devices must be connected in parallel to the M-Bus network (connector J4)," Greben writes of how to install the board to read M-Bus devices. "When connecting the device, polarity does not matter, but all meters must operate at the 2400 baud rate that is default for M-Bus. If the M-Bus devices (meters) do not yet have an M-Bus address assigned, connect them one at a time, assign an M-Bus address and repeat the procedure for the other devices."

Once running, the gateway provides a locally-hosted website with a means to scan the M-Bus for devices, take readings, and transmit commands. A unit converter allows for readings in one unit, for instance watt-hours, to be displayed in another, like kilowatt-hours, while a labeling system makes it easy to distinguish between multiple devices on the same bus.

Greben's source code, hardware design files, and a 3D-printable enclosure are available on GitHub under the permissive Apache License 2.0.

Gareth Halfacree
Freelance journalist, technical author, hacker, tinkerer, erstwhile sysadmin. For hire: freelance@halfacree.co.uk.
Latest articles
Sponsored articles
Related articles
Latest articles
Read more
Related articles