Skip to content

Read data registers from Smart Power Meters (EMIs) and publish them using MQTT.

License

Notifications You must be signed in to change notification settings

Dannyps/emi-modbus

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

EMI-Modbus

We adapted the original modbus library and created a lightweight version of it. Ours is also more flexible, but only offers support for the RTU configuration, and only for the modbus_read_input_registers call.

How to run

  1. Make sure you have git, make and gcc.

  2. Install paho.mqtt.c:

    1. git clone git@github.com:eclipse/paho.mqtt.c.git
    2. cd paho.mqtt.c
    3. make install
  3. Install libsystemd-dev:

    1. sudo apt install libsystemd-dev
  4. Build the software: make

  5. Run it: build/emi-read mqtt://<mqtt-host> <mqtt-user> <mqtt-pwd>

Future steps

  1. Code cleanup.
  2. Add support for write (so that EMI address can be changed. Might be useful for residential buildings).
  3. Allow further customisation via args:
    1. Serial device file name
    2. Interval for instant values polling
    3. Values to poll
    4. We may consider going next level with a yaml config file instead.
  4. Contrib flow and guidelines
  5. install signal handlers for mqtt logoff and signaling.

About

Read data registers from Smart Power Meters (EMIs) and publish them using MQTT.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published