dsmr-parse
Support the project | Documentation
Usage
Run:
cargo add dsmr-parse
Or add to your Cargo.toml:
[]
= "0.4.0"
dsmr-parse
A small library for parsing DSMR 5 (Dutch Smart Meter Requirements) telegrams from Dutch electricity meters.
The central struct is [Telegram] with its single method [Telegram::read_from]. Pass anything that implements std::io::Read
to it, and it will try to read a valid and conforming DSMR telegram with the correct CRC from it.
Usage
Reading from a serial port
use Telegram;
// Open serial port (example path)
let port = new;
// Parse telegram
match read_from
Reading from a byte slice
use Telegram;
let telegram_data = b"/XMX5LGBBFG1009394887\r\n\r\n1-3:0.2.8(42)\r\n0-0:1.0.0(190101125431W)\r\n1-0:1.8.1(004169.415*kWh)\r\n!1234\r\n";
match read_from
Potential Pitfalls
- CRC Validation: telegrams with incorrect CRC checksums will be rejected. Ensure data integrity during transmission, especially when reading from serial ports with poor connections.
- Serial Port Configuration: DSMR meters typically use 115200 baud, 8N1: 8 data bits, no parity, 1 stop bit. Incorrect settings will result in garbled data and parse errors.
Specification
License
MIT OR Apache-2.0