tokio-sunspec

A pure Rust SunSpec library based on tokio.

Crates.io Apache 2.0 licensed

Features

Installation

toml [dependencies] tokio-sunspec = "*"

Examples

The src/models/ folder contains all pre generated models which may be available by the device. If you need to add your own model you can generate one with included Python script in the scripts folder.

TCP Connect example for SMA Inverter

```rust let socketaddr = ":502".parse().unwrap(); let deviceid: u8 = 126; let start_addr: u16 = 40000;

let mut client = tokiosunspec::connecttcp(socketaddr, deviceid, start_addr).await?;

let res = client.readpoint(model1::Mn).await?; asserteq!(res, "SMA"); ```

Protocol-Specification

Fruther notice

This lib only implements the SunSpec part. The connection via modbus is done by the tokio-modbus lib.

License

Copyright (c) 2023 Lukas Kirner

Apache-2.0