项目作者: terual

项目描述 :
DSMR to MQTT bridge written in C
高级语言: C
项目地址: git://github.com/terual/dsmr2mqtt.git
创建时间: 2018-11-09T17:14:12Z
项目社区:https://github.com/terual/dsmr2mqtt

开源协议:Apache License 2.0

下载


dsmr2mqtt

This utility reads the telegrams from your DSMR-compatible smart meter and sends it
to a MQTT broker. I made use of dsmr-p1-parser and libmosquitto.

I wrote this so I would be able to plug my smart meter into my OpenWRT router with a
prefabricated cable (I used this one: https://www.sossolutions.nl/slimme-meter-kabel).

I used the MQTT topic definitions of dsmr-reader.
If you want to use other definitions, you can change the the #defines at the beginning of the dsmr2mqtt.c file.

Compiling

Debian/Ubuntu

First make sure you have git installed and the necessary library.

  1. # apt install git libmosquitto-dev

Then get the source code and use the command make to build the dsmr2mqtt executable:

  1. $ cd [whatever build dir]
  2. $ git clone https://github.com/terual/dsmr2mqtt
  3. $ cd dsmr2mqtt
  4. $ make
  5. $ ./dsmr2mqtt

Cross-compiling for OpenWRT

To compile this for OpenWRT, use the following guide,
place the Makefile.openwrt in a seperate dsmr2mqtt package folder, and rename it to Makefile.

Using the tool

  1. Usage: dsmr2mqtt [-d <serial_device>] [-m <mqtt_broker_host>] [-p <mqtt_broker_port>]
  2. -d <serial_device> Serial device for DSMR device (default is /dev/ttyUSB0)
  3. -m <mqtt_broker_host> Host name for MQTT broker (default is localhost)
  4. -p <mqtt_broker_port> Host name for MQTT broker port (default is 1883)