Skip to content

esphome-libs/dsmr_parser

 
 

Repository files navigation

This is a fork of matthijskooijman/arduino-dsmr. The primary goal is to make the parser independent of the Arduino framework and usable on ESP32 with the ESP-IDF framework or any other platform.

Features

  • Combines all fixes from matthijskooijman/arduino-dsmr and glmnet/arduino-dsmr including unmerged pull requests.
  • Added an extensive unit test suite
  • Code optimizations
  • Supported compilers: MSVC, GCC, Clang
  • Header-only library, no dependencies
  • Code can be used on any platform, not only embedded.

Differences from the original arduino-dsmr

  • Requires a C++20 compatible compiler.
  • P1Reader class is replaced with the PacketAccumulator class with a different interface to allow usage on any platform.
  • Added DlmsPacketDecryptor class to work with encrypted DSMR messages (like from "Luxembourg Smarty").

How to use

General usage

The library is header-only. Add the src/dsmr_parser folder to your project.
Note: dlms_packet_decryptor.h depends on Mbed TLS or BearSsl library. Mbed TLS is already included in the ESP-IDF framework and can be easily added to any other platforms.

Usage from PlatformIO

The library is available on the PlatformIO registry:
esphome/dsmr_parser

Examples

History behind arduino-dsmr

matthijskooijman is the original creator of this DSMR parser. glmnet and zuidwijk continued work on this parser in the fork glmnet/arduino-dsmr. They used the parser to create ESPHome DSMR component. After that, the work on the arduino-dsmr parser stopped.

The reasons dsmr_parser fork was created

  • Dependency on the Arduino framework limits the applicability of this parser. For example, it is not possible to use it on Linux.
  • The Arduino framework on ESP32 inflates the FW size and doesn't allow usage of the latest version of ESP-IDF.
  • Many pull requests and bug fixes needed to be integrated into the parser.
  • Lack of support for encrypted DSMR messages.

How to work with the code

  • You can open the code using any IDE that supports CMake. It will allow you to modify the code and run the tests.
  • Notes if you want to run the build scripts:
    • build-win.ps1 needs Visual Studio to be installed.
    • build-linux.sh needs clang to be installed.

References

About

Arduino library for interfacing with Dutch smart meters implementing DSMR

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages

  • C++ 92.3%
  • Python 2.9%
  • CMake 2.6%
  • PowerShell 1.4%
  • Shell 0.8%