Press "Enter" to skip to content

M-Bus Master Hat Troubleshooting

Green Power LED Isn’t Lit

Make sure the Hat is properly seated on the Pi’s 40-pin GPIO connector, and the Raspberry Pi is powered on.

Pi Doesn’t Recognise the Hat

Make sure the Hat is properly seated on the Pi’s 40-pin GPIO connector.

Physically power of the Pi and power it on. Then check again with the following command:

  • cat /proc/device-tree/hat/product

Red M-Bus LED Isn’t Lit

GPIO 26 (25 if using wiringPi) must be set to output mode and set high to power on the M-Bus. To do this, run:

Make sure the Hat is properly seated on the Pi’s 40-pin GPIO connector, and the Raspberry Pi is powered on.

  • sudo apt install wiringpi
  • gpio mode 25 out
  • gpio write 25 1

Check for a short on the M-Bus.

If you are using a Raspberry Pi 4 make sure you have upgraded wiringPi to at least version 2.52 following the instructions here. Then try the following again:

  • gpio mode 25 out
  • gpio write 25 1

Red M-Bus LED Is Dimly Lit

Check for a short on the M-Bus.

libmbus Reports Collisions

Ensure two slaves aren’t configured to use the same address.

You may have more than 3 unit loads (4.5mA) of slaves attached. The M-Bus Master Hat only supports up to 3 unit loads. Disconnect some slaves, or use slaves that require fewer unit loads.

It is possible that your meter doesn’t support the M-Bus protocol, just the M-Bus physical layer. Instead it may support the IEC 62056 protocol. While the M-Bus Master Hat does support being used as the physical layer for meters that use just the M-Bus physical layer, M-Bus protocol software doesn’t support communicating over IEC 62056. You would need to connect to the meter using the M-Bus Master Hat, and a serial connection from the Raspberry Pi using the appropriate port, and then use a piece of software to decode the IEC 62056 encoded data. To test this, use the linux callup tool “cu” as follows:

  • sudo apt install cu
  • cu -l /dev/ttyAMA0 -s 2400

If you receive some data back then your meter likely supports IEC 62056 rather than the M-Bus protocol.