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.
- 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.
- 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").
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.
The library is available on the PlatformIO registry:
esphome/dsmr_parser
- How to use the parser
- Complete example using PacketAccumulator
- Example using DlmsPacketDecryptor
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.
- 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.
- 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.ps1needsVisual Studioto be installed.build-linux.shneedsclangto be installed.
- DSMR parser in Python - alternative DSMR parser implementation in Python.
- SmartyReader - open source hardware to communicate with P1 port.
- SmartyReader. Chapter "Encryption" - how the encrypted DSMR protocol works.