Crates.io | dsmr5 |
lib.rs | dsmr5 |
version | 0.4.0 |
source | src |
created_at | 2019-03-24 19:57:23.094049 |
updated_at | 2024-03-15 18:22:09.750312 |
description | A no-std Rust implementation of the DSMR5 standard |
homepage | |
repository | https://github.com/wassasin/dsmr5 |
max_upload_size | |
id | 123553 |
size | 37,873 |
A no-std Rust implementation of the DSMR5/4.2 P1 companion standard.
In the first instance using an FTDI -> USB module the smart meter emits its status every second.
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());
}