MoaT EMS Battery
% start synopsis % start main
This module implements a generic battery controller.
The client is a microcontroller, e.g. an ESP32 or a RP2040. It runs MicroPython and talks to the server via the MoaT messaging protocol.
The server side runs in the MoaT multiplexer that talks to the battery. It typically uses a web page for setup, and/or connects to DBus.
% end synopsis
Rationale
One of the MoaT project's objectives is to implement a uniform, multiplexable front-end for various devices.
Battery management systems typically have interfaces with device-specific command sets that can only be talked to by a single client, so devising a common language makes sense.
Also, a BMS may not have the required features. For instance, you might want to chain multiple batteries in series or in parallel. Or, the BMS firmware does not understand that some battery chemistries require adaptive strategies for charging that cannot be expressed with a single charge curve.
Why so complex?
The client connects to the actual BMS hardware with TTL serial, SPI, I²C, RS485, CAN, or similar. For the most part, these interfaces do not support galvanic separation, may not even exist on a server.
The client needs to constantly monitor battery current, cell and system voltage, battery temperature et al.. It must be able to disconnect the battery's relay if any parameter exceeds the cell and battery specifications. This function should run continuously even if communication with the server fails.
% end main
Setup
As typical clients are resource-constrained, you need to add the Battery
management code to the MicroPython flash image. Add this repository's
manifest, from moat/micro/_embed/manifest_bms.py, alongside the one from
moat.micro.
Add a "BMS" app to the "moat.micro" configuration::
apps:
…
bat1: bms.std.Cmd
bat1:
…
The "bat1" section (or however you want to name it) is described in
moat/ems/battery/_cfg.yaml. More extensive documentation is TODO.
Start the client and multiplexer normally; the MoaT BMS will run as part of the multiplexer.
Server-only operation
Some systems don't need a client. A commercial BMS with an RS485 interface e.g. can be connected directly to the server, no intermediate client required.
In this case, set the "dev:" entry in the "port:" section to "null".
Modules
Right now the only battery model is "std". It connects several subsystems:
-
system voltage, current and temperature
-
cell voltage and temperature
It controls
-
the balancing system(s)
-
the battery relay
Also, it sends the battery's SoC and its voltage and current limits to whichever program requires them, as well as displaying them to the user.
Metadata
Release files for moat-ems-battery 0.2.25
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| moat_ems_battery-0.2.25.tar.gz | 24.4 kB | Without provenance | Details for moat_ems_battery-0.2.25.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| moat_ems_battery-0.2.25-py3-none-any.whl | Python 3 | none | any | Details for moat_ems_battery-0.2.25-py3-none-any.whl |
Total release size: 46.6 kB
Release files / moat_ems_battery-0.2.25.tar.gz
| Download URL | moat_ems_battery-0.2.25.tar.gz |
|---|---|
| Size | 24.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ca0d0557abae9ea13b2cac5e08c6a06ce2ecc7c4f6b4dec52637e662e471046d
|
|
BLAKE2b-256 checksum How to use checksums |
e29c84dc5eaf702b322ba84edc9933228fdaeb55076dfc65bcad82f320feb1d7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.8
|
Release files / moat_ems_battery-0.2.25-py3-none-any.whl
| Download URL | moat_ems_battery-0.2.25-py3-none-any.whl |
|---|---|
| Size | 22.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
12a70d7f1e11a641232e670ae6c810a05fac129f27af32095caf878f4fb8f55b
|
|
BLAKE2b-256 checksum How to use checksums |
01659f3cbc514d03fb559860359ade44596bc4b5ae821f1e0684251291f4415c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.8
|
Security for moat-ems-battery 0.2.25
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.