#meter #power #serial #dutch #no-std

no-std dsmr5

A no-std Rust implementation of the DSMR5 standard

8 unstable releases (3 breaking)

0.4.0 Mar 15, 2024
0.3.0 Jul 10, 2023
0.2.2 Oct 25, 2022
0.2.1 Sep 1, 2022
0.1.1 Mar 24, 2019

#687 in Parser implementations

Download history 22/week @ 2024-02-17 66/week @ 2024-02-24 53/week @ 2024-03-02 111/week @ 2024-03-09 132/week @ 2024-03-16 9/week @ 2024-03-23 33/week @ 2024-03-30 81/week @ 2024-04-06 41/week @ 2024-04-13

199 downloads per month
Used in slimmemeter

MIT license

33KB
698 lines

DSMR5

A no-std Rust implementation of the DSMR5/4.2 P1 companion standard.

Intended application

In the first instance using an FTDI -> USB module the smart meter emits its status every second.

How to use

Plug an FTDI cable into your P1 port. Your RX line will probably need to be inverted. Most off-the-shelf P1 FTDI's already have this preconfigured. Then create your own little crate using something like the serial crate, and use the Reader class like so:

let mut port = serial::open(&path).unwrap();
let reader = dsmr5::Reader::new(port.bytes());

for readout in reader {
    let telegram = readout.unwrap().to_telegram().unwrap();
    let state = dsmr5::Result::<dsmr5::state::State>::from(&telegram).unwrap();

    println!("{}", state.power_delivered.unwrap());
}

References

Dependencies

~0.5–1MB
~24K SLoC