Reading from multiple MBUS meters with the EmonHub MBUS interfacer

I’ve added a couple of scripts to the usefulscripts repository that is included on the emonPi/emonbase/emonSD image to make changing the MBUS address of a connected MBUS meter easier.

Here are the steps to use this script:

  1. Make sure you have an up to date system, run a full update from Admin > Update > Full update

  2. SSH into the Pi (see: Service Credentials - Guide | OpenEnergyMonitor)

  3. Run the script by typing the following command:

python3 /opt/emoncms/modules/usefulscripts/mbus/mbus_set_address.py
  1. The script will for input on the right serial port, baud rate, starting address and new address to enter, you can just hit enter to use the defaults if they are correct, or alternatively enter the relevant values.

    If everything goes to plan you should see an output like this with ACK replies confirming the commands were received and acted on correctly:

Please enter serial port (default: /dev/ttyUSB0):
Please enter baud rate (default: 2400):
Trying to connect on /dev/ttyUSB0 2400
Please enter current address (default: 254):
Please enter new address (default: 1):
Sending command to check meter at address 254
ACK
Sending command to change meter on address 254 to address 1
ACK
Sending command to check meter at address 1
ACK

There’s also a second script just for checking that a meter is responding on a particular address without changing that address, again with input prompts to enter to specify the address etc:

python3 /opt/emoncms/modules/usefulscripts/mbus/mbus_check_address.py
2 Likes