eigenein.dev

Tools that do one job well.

I make software for my own everyday problems, and share it when it might solve yours too.

Libraries

Parts I built for my projects that other projects can use too.

fennec-modbus

Rust crate · from Fennec

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?;

pure-protobuf

Python · since 2011

Protocol Buffers for Python, with plain dataclasses as the schema: no .proto files, no generated code. Finished · fixes only