Skip to content
tsgb edited this page Jun 4, 2026 · 3 revisions

OpenMPPT

OpenMPPT is a generic, vendor-extensible .NET library for solar charge controllers and battery devices. It owns everything from raw bytes on a wire to decoded telemetry — Modbus frame reassembly, CRC validation, register decoding, Victron passive-broadcast parsing — and exposes a clean driver interface to the host application. There is no UI, no platform BLE stack, and no transport code inside the library.

NuGet id: OpenMPPT | License: GPL-3.0-or-later | Targets: net8.0 (library), net10.0 (tests)


What you can build on it

The library is a device layer, not an application. One IDeviceDriver instance can simultaneously feed:

  • A desktop or mobile app (live telemetry display, settings editor)
  • A web dashboard or chart renderer
  • A database ingester or CSV logger
  • A headless monitoring service or alerting daemon

Because the library never touches a radio, the same driver code runs unchanged whether the host app connects over BLE GATT, RS-485 serial, or Modbus-TCP. The host supplies an IFrameTransport (a byte pipe); the driver never knows or cares what is underneath.


The one core idea

A driver only sees a byte pipe.

The IFrameTransport interface is connection-oriented and transport-agnostic. It delivers raw byte chunks; the library's ModbusReassembler handles frame boundaries and resyncs on bad CRCs. This separation means:

// Host wires up any transport it likes — the driver is identical in every case
IFrameTransport transport = new MyBleGattTransport();   // or serial, or TCP
IDeviceDriver driver = new GenericModbusDriver(transport);  // planned — see Roadmap
await driver.StartAsync(deviceId);

driver.LiveChanged += live => Console.WriteLine(
    $"{live.BatteryVoltage:F2} V  {live.ChargeCurrent:F2} A  {live.ChargerState.Label()}");

Transports (BLE GATT, serial-RS485, Modbus-TCP) are implemented entirely by the host application. The library defines the IFrameTransport contract; it never implements one.


Start here

  • Getting Started — add the NuGet package, wire up DemoDriver, and receive live telemetry in under 20 lines
  • Architecture — namespace map, data-flow diagram, how codecs compose with drivers and transports
  • The IDeviceDriver Contract — full specification of IDeviceDriver, connection lifecycle, event ordering, and disposal

Current status

OpenMPPT is pre-1.0 and under active development.

What Status
net8.0 library + net10.0 xUnit test project Done
83 headless tests (no hardware required) Done
DemoDriver — synthetic telemetry, no hardware Done
Modbus frame codec (ModbusFrame, ModbusReassembler, ModbusCrc) Done
Modbus register decode (MpptRegisters, MpptProtocol) Done
Victron passive-broadcast decode (VictronDecoder) Done
Model types (MpptLive, MpptSettings, BatteryProfile, ChargerState, …) Done
Real vendor drivers (generic Chinese Modbus MPPT, Victron, Renogy/SRNE, EPEver) Done
Vendor registry (DeviceRegistry + VendorDescriptor + factory) Done

The drivers and the vendor registry are built and tested; DemoDriver remains the zero-hardware starting point. See the Roadmap for what's next.


Quick build

dotnet build OpenMppt.slnx
dotnet test  OpenMppt.slnx

No hardware, no BLE radio, no serial port required.


See also

Clone this wiki locally