Fix BullTron GUI telemetry and MOS writes

This commit is contained in:
2026-07-11 12:01:16 +02:00
parent b45641b2aa
commit 2addde3dbc
5 changed files with 116 additions and 31 deletions
+2 -2
View File
@@ -95,10 +95,10 @@ Time-to-empty/full is not a separate BLE value in the live view. The app compute
```text
if register 0x002F == 1:
time-to-full = (rated_capacity_Ah * (100 - SOC_percent) / abs(current_A)) * 60 minutes
time-to-full = (rated_capacity_Ah * ((100 - SOC_percent) / 100) / abs(current_A)) * 60 minutes
if register 0x002F == 2:
time-to-empty = (rated_capacity_Ah * SOC_percent / abs(current_A)) * 60 minutes
time-to-empty = (rated_capacity_Ah * (SOC_percent / 100) / abs(current_A)) * 60 minutes
```
The `rated_capacity_Ah` input comes from the settings register set parsed into `contentByteArrayByReadSet`. The app also has a separate read of register `0x0064` length `1` that stores `residueTime`, but the visible live time calculation above is derived from SOC/current/capacity unless current is zero.
+7 -2
View File
@@ -182,11 +182,11 @@ rated_capacity_Ah = parsed settings capacity
if register 0x002F == 1:
label = TimeToFull
minutes = rated_capacity_Ah * (100 - soc_percent) / current_A * 60
minutes = rated_capacity_Ah * ((100 - soc_percent) / 100) / current_A * 60
if register 0x002F == 2:
label = TimetoEmpty
minutes = rated_capacity_Ah * soc_percent / current_A * 60
minutes = rated_capacity_Ah * (soc_percent / 100) / current_A * 60
```
If current is zero or the state is neither `1` nor `2`, the UI shows `-- h --m`.
@@ -203,6 +203,11 @@ If current is zero or the state is neither `1` nor `2`, the UI shows `-- h --m`.
| `40` | version data |
| `06` | password data |
| `12` | balancing state |
In the BullTron system screen, rated capacity is settings word `0` scaled by
`0.1 Ah`. The charge and discharge MOS controls write single registers
`0x00A5` and `0x00A6`; live MOS status is read separately from telemetry
registers `0x0035` and `0x0036`.
| `0A` | new alarm info |
| `4A` | device parameter info |
| `04` | communication/protocol or production date |