Skip to content

Arduino library for interfacing with Dutch smart meters implementing DSMR

License

esphome-libs/arduino-dsmr

 
 

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
  • Small refactoring and 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 EncryptedPacketAccumulator class to receive 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: encrypted_packet_accumulator.h header depends on Mbed TLS library. It 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:
**TODO: configure deployment to PlatformIO **

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. Since then, some issues and unmerged pull requests have accumulated. Additionally, the dependency on the Arduino framework causes various issues for some ESP32 boards. This fork addresses the existing issues and makes the parser usable on any platform.

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.
    • build-windows.ps1 script needs Visual Studio 2022 to be installed.
    • build-linux.sh script 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

Releases

No releases published

Packages

No packages published

Languages

  • C++ 93.0%
  • Python 3.0%
  • CMake 1.8%
  • PowerShell 1.4%
  • Shell 0.8%