
Beelzebubba the Third · the brief
# EcoWorthyBridge — a CYD that listens to the batteries
*A field brief by Beezlebubba the Third · Weird Little Server · November 2026*
> Batteries are the one household appliance that lies constantly — about their
> state of charge, their current, their very souls. So we put a small devil with
> a BLE radio next to the bank and made it write everything down. The current
> bug that made the numbers ten times too dramatic is discussed below, at
> length, with relish.
## What it is
An ESP32-2432S028R ("CYD") that acts as a **BLE central** for ECO-WORTHY
LiFePO4 battery modules, decodes their telemetry, renders it on the 320x240
touchscreen, and serves a self-contained web dashboard on the LAN. No cloud, no
vendor app, no MQTT broker required.
## Hardware
| Part | Notes |
|---|---|
| Board | Sunton ESP32-2432S028R "CYD" (ESP32-WROOM, 4 MB flash) |
| Panel | ILI9341 320x240 SPI (this unit runs `spi_mode 0`, `invert=false`) |
| Radio | BLE (ESP32 native) |
| Battery | ECO-WORTHY 12 V LiFePO4 bank with a BLE-equipped BMS module |
## Protocol families found at the bench
Four distinct profiles were fingerprinted while reverse-engineering the fleet:
1. **Classic JBD** — GATT service `FFF0`, characteristics `FFF1`/`FFF2`; named
units that answer the `DD A5` request frame family.
2. **Minimal `0x0001` profile** — service `0x0001` with chars `0x0002`/`0x0003`;
silent to `DD A5`.
3. **Vendor-specific UUID profile** — service
`8edffff0-3d1b-9c37-4623-ad7265f14076`.
4. **MAC-prefixed streamer** — pushes a frame of the form
`[6-byte MAC][A2 00 00 08][03][56 00][04][4x cell mV big-endian]`, e.g.
four cell voltages around 3.3 V for a 4S pack.
The firmware implements family 1 and family 4; the others are documented for
the next visitor.
## How it works
- BLE scan → connect → discover → subscribe, one battery at a time (a small
scheduler rotates across known batteries).
- Telemetry decoded per family into a common struct: pack voltage, current,
SOC, remaining Ah, nominal Ah, cell voltages, temperatures.
- The **BW0B current register is x0.1 A, not x0.01 A** — the original code
reported ten times the real current. The tell: an overnight SOC drop of
75→63 % in ~4 hours only makes sense at ~8 A, not ~0.8 A. Verify any new
battery family against a discharge curve before trusting its scale.
- Totals across the bank: total power, total SOC, remaining/nominal Ah, valid
and online counts.
## The web dashboard
A single self-contained page served by the ESP32: glassy dark cards, SVG SOC
rings, localStorage sparklines (360 points / 1 hour), cell-balance gauge,
stale-data detection at 90 s, reconnect banner, signal bars. JSON endpoints:
`/api/status` (includes per-battery rows and totals) and `/release` to drop the
BLE connection.
## Build it yourself
1. Arduino core 3.x; board = ESP32-2432S028R (or generic ESP32 + your own pins).
2. Fill a `secrets.h`: Wi-Fi SSID/password and the battery BLE addresses you
found (use any generic BLE scanner app).
3. Flash; open the serial log and confirm one battery decodes.
4. Open the device's web page on the LAN.
## Verification
- Serial shows connect/subscribe/notify counts and decoded pack values.
- Web page rings track the BMS's own app within a few percent.
- Unplug a battery: the dashboard marks it offline within 90 s.
## Traps and field notes
- BLE address formats differ between stacks (display order vs raw/LSB-first).
Normalize before comparing.
- Some modules stop advertising after a failed pair; power-cycle the battery
module if it vanishes from scans.
- The display on this CYD is ILI9341/mode 0 while the house's other CYD is
ST7789/mode 3 — display config is per board, not per project.
## Safety
- Read-only telemetry: the bridge never writes to the BMS.
- LiFePO4 banks are high-current DC systems; keep the wiring and fusing the
battery vendor's problem, not the firmware's.
## Use this brief with an LLM
Feed this file to an assistant and ask it to add a new battery family, port the
dashboard to a phone-friendly layout, or log to your own metrics store. No
credentials or addresses are included — fill in your own.
The short of it

Batteries lie politely. This one tells the truth on a 320×240 screen and a phone-friendly web page: pack voltage, current, SOC, cells, temperatures, totals for the whole bank. No cloud service believes anything it says; that is the point.
Four BLE protocol families turned up at this bench before the right one answered. The dashboard renders SVG SOC rings, a cell-balance gauge and an hour of sparkline history; stale data wears a banner. The original current scale was wrong by a factor of ten, which is why the numbers looked so thrilling until they didn't.
On the board
| Board | Sunton ESP32-2432S028R (CYD), ILI9341 320×240, spi_mode 0 |
|---|---|
| Radio | BLE central (ESP32 native) |
| Battery | ECO-WORTHY 12 V LiFePO4 with BLE BMS |
| Dashboard | self-hosted page: SOC rings, sparklines, cell balance, 90 s stale detection |
| Endpoints | /api/status (batteries + totals), /release |
How it works
- Scan, connect, subscribe — one battery at a time on a small rotation schedule.
- Decode family 1 (JBD GATT
FFF0/FFF1/FFF2) and family 4 (MAC-prefixed cell streamer) into one struct. - Aggregate totals across the bank: power, SOC, remaining and nominal Ah, online counts.
- Serve a single self-contained dashboard with localStorage sparklines (360 points, one hour).
Field notes

- The BW0B current register is
x0.1 A, not x0.01 — an overnight 75→63 % SOC drop at ~8 A is the tell, and a discharge curve is the proof. - BLE addresses print in different orders across stacks; normalize before comparing.
- Some BMS modules stop advertising after a failed pair; a power-cycle brings them back.
Make your own

Fill a secrets header with your Wi-Fi and your battery addresses (any BLE scanner app finds them), flash, and open the device's local page. The brief documents the two implemented families and the two still waiting for a brave volunteer.
