How pekaway/esp32-ble-wifi-shunt works
This repository is an ESP32-C3 battery-shunt monitor: it measures current and voltage, tracks battery state of charge (SOC), and exposes readings and settings over BLE. The main workflow is sensor measurement, SOC/state handling, persistence, then BLE access by a phone or Python clients. The INA library and Python scripts are sampled; the firmware sketch is present in the tree but was not excerpted, so firmware relationships below rely on the README rather than inspected calls. Node-RED and other peripheral files are not mapped because their runtime roles are not documented in the supplied evidence.
Main entry points: Esp32c3_Shunt_BLE_0.2.ino ESP32-C3 firmware · INA.cpp INA sensor library · READesp32shunt.py Python readings client · SETesp32shunt.py Python settings client
Components 9
Measurement
- INA sensor library
INA-master_lib/src/INA.cpp
Device firmware
- ESP32-C3 firmware
Esp32c3_Shunt_BLE_0.2/Esp32c3_Shunt_BLE_0.2.ino - SOC and capacity
Esp32c3_Shunt_BLE_0.2/Esp32c3_Shunt_BLE_0.2.ino - BLE services
Esp32c3_Shunt_BLE_0.2/Esp32c3_Shunt_BLE_0.2.ino - SOC persistence
Esp32c3_Shunt_BLE_0.2/Esp32c3_Shunt_BLE_0.2.ino
BLE clients
- Python readings client
python read out/READesp32shunt.py - Python settings client
python read out/SETesp32shunt.py
Other components
- Battery shunt
- Device operator
Connections 9
- Battery shunt → INA sensor library: senses current
readme.md - INA sensor library → ESP32-C3 firmware: provides measurements
- ESP32-C3 firmware → SOC and capacity: tracks SOC
readme.md - ESP32-C3 firmware → BLE services: exposes readings
readme.md - ESP32-C3 firmware → SOC persistence: stores SOC
readme.md - Python readings client → BLE services: reads values
python read out/READesp32shunt.py - Python settings client → BLE services: writes settings
python read out/SETesp32shunt.py - Device operator → Python readings client: requests readings
readme.md - Device operator → Python settings client: sets capacity
readme.md