fennec-modbus
A type-safe Modbus client. Fennec uses it every day to talk to a home battery, but it works with any Modbus device.
- Each call is typed: you say what a register holds, and you get that type back.
- The protocol and TCP layers are sans-IO and
no_std. A Tokio client is included, but any transport works. - You can add your own functions, with your own arguments and output.
let client = Client::new("10.0.0.2:502");
let unit = UnitId::Significant(1);
// Battery voltage, in tenths of a volt
let decivolts: u16 = client
.call::<ReadHoldingRegisters<_, u16>>(
unit,
39201,
)
.await?;