|
Bogdan Timofte
authored
2 weeks ago
|
1
|
# UM24C / UM25C / UM34C Notes from `floriandotorg/um24c`
|
|
|
2
|
|
|
|
3
|
Source project:
|
|
|
4
|
|
|
|
5
|
- https://github.com/floriandotorg/um24c
|
|
|
6
|
- file reviewed: `src/App.js`
|
|
|
7
|
|
|
|
8
|
## Scope
|
|
|
9
|
|
|
|
10
|
This note captures protocol knowledge inferred from the external `floriandotorg/um24c` project.
|
|
|
11
|
|
|
|
12
|
It applies to:
|
|
|
13
|
|
|
|
14
|
- `UM24C`
|
|
|
15
|
- `UM25C`
|
|
|
16
|
- `UM34C`
|
|
|
17
|
|
|
|
18
|
It does not appear to cover:
|
|
|
19
|
|
|
|
20
|
- `TC-66C`
|
|
|
21
|
|
|
|
22
|
## BLE Transport Hints
|
|
|
23
|
|
|
|
24
|
The external project uses:
|
|
|
25
|
|
|
|
26
|
- service `0xFFE0`
|
|
|
27
|
- characteristic `0xFFE1`
|
|
|
28
|
- notifications on `0xFFE1`
|
|
|
29
|
- request command `0xF0` to trigger a new measurement snapshot
|
|
|
30
|
|
|
|
31
|
The connection flow matches the HM-10 style radio path already present in our project.
|
|
|
32
|
|
|
Bogdan Timofte
authored
2 weeks ago
|
33
|
The imported `HM-10` and `DX-BT18` module references strengthen this:
|
|
|
34
|
|
|
|
35
|
- generic `HM-10` documentation explicitly uses `FFE0` / `FFE1`
|
|
|
36
|
- the `DX-BT18` manual documents default UUIDs `FFE0`, `FFE1`, and `FFE2`
|
|
|
37
|
- the `DX-BT18` manual also explains how a UM-family device could support both desktop serial-style workflows and iOS BLE workflows
|
|
|
38
|
|
|
Bogdan Timofte
authored
2 weeks ago
|
39
|
## Model Identifiers
|
|
|
40
|
|
|
|
41
|
The external project maps:
|
|
|
42
|
|
|
|
43
|
- `0x0963 -> UM24C`
|
|
|
44
|
- `0x09c9 -> UM25C`
|
|
|
45
|
- `0x0d4c -> UM34C`
|
|
|
46
|
|
|
|
47
|
This is useful as a concrete reference for the 16-bit model field found at payload offset `0`.
|
|
|
48
|
|
|
|
49
|
## Snapshot Framing
|
|
|
50
|
|
|
|
51
|
The external project accumulates notification fragments until a total payload size of `130` bytes is available.
|
|
|
52
|
|
|
|
53
|
It then parses that `130`-byte buffer as one UM snapshot and schedules the next `0xF0` request after about `500 ms`.
|
|
|
54
|
|
|
|
55
|
Important note:
|
|
|
56
|
|
|
|
57
|
- this confirms a `130`-byte UM payload
|
|
|
58
|
- it does not prove that the final notification is always `10` bytes long as a protocol guarantee
|
|
|
59
|
- that detail may only reflect the behavior observed by that project
|
|
|
60
|
|
|
|
61
|
## Payload Layout Extracted From The External Project
|
|
|
62
|
|
|
|
63
|
All offsets below are byte offsets into the `130`-byte UM payload.
|
|
|
64
|
|
|
|
65
|
| Offset | Size | External interpretation | Notes |
|
|
|
66
|
|---|---:|---|---|
|
|
|
67
|
| `0` | 2 | `modelId` | Used with the model map above |
|
|
|
68
|
| `2` | 2 | `voltage` | `UM25C`: raw / 1000 V, `UM24C` and `UM34C`: raw / 100 V |
|
|
|
69
|
| `4` | 2 | `amperage` | External project displays raw / 1000 A |
|
|
|
70
|
| `6` | 4 | `wattage` | Displayed as raw / 1000 W |
|
|
|
71
|
| `10` | 2 | `temperature` | External project uses only one temperature field here |
|
|
|
72
|
| `14` | 2 | `group` | Selected data group |
|
|
|
73
|
| `16 + group * 8` | 4 | `capacityAmperage` | Group-specific accumulated charge |
|
|
|
74
|
| `20 + group * 8` | 4 | `capacityWattage` | Group-specific accumulated energy |
|
|
|
75
|
| `96` | 2 | `negativeDataLineVoltage` | External project treats offset `96` as D- |
|
|
|
76
|
| `98` | 2 | `positiveDataLineVoltage` | External project treats offset `98` as D+ |
|
|
|
77
|
| `100` | 2 | `chargingMode` | Uses the charging mode map below |
|
|
|
78
|
| `112` | 4 | `duration` | External project interprets as seconds and multiplies by `1000` for ms formatting |
|
|
|
79
|
| `122` | 4 | `impedance` | Displayed as raw / 10 ohms |
|
|
|
80
|
|
|
|
81
|
## Charging Mode Map
|
|
|
82
|
|
|
|
83
|
The external project maps the charging mode field at offset `100` as:
|
|
|
84
|
|
|
|
85
|
- `1 -> QC2`
|
|
|
86
|
- `2 -> QC3`
|
|
|
87
|
- `3 -> APP2.4A`
|
|
|
88
|
- `4 -> APP2.1A`
|
|
|
89
|
- `5 -> APP1.0A`
|
|
|
90
|
- `6 -> APP0.5A`
|
|
|
91
|
- `7 -> DCP1.5A`
|
|
|
92
|
- `8 -> SAMSUNG`
|
|
|
93
|
|
|
|
94
|
## Comparison With Our Current Implementation
|
|
|
95
|
|
|
|
96
|
The external project confirms several parts of our existing UM parser:
|
|
|
97
|
|
|
|
98
|
- request command `0xF0`
|
|
|
99
|
- expected response length `130`
|
|
|
100
|
- model number at offset `0`
|
|
|
101
|
- selected data group at offset `14`
|
|
|
102
|
- duration at offset `112`
|
|
|
103
|
- load resistance / impedance data at offset `122`
|
|
|
104
|
|
|
|
105
|
It also exposes a few differences that should be treated as verification targets:
|
|
|
106
|
|
|
|
107
|
### 1. Current scaling for `UM25C`
|
|
|
108
|
|
|
|
109
|
Our code currently uses:
|
|
|
110
|
|
|
|
111
|
- `UM25C`: raw / `10000`
|
|
|
112
|
- `UM34C`: raw / `1000`
|
|
|
113
|
|
|
|
114
|
The external project uses:
|
|
|
115
|
|
|
|
116
|
- raw / `1000` for the shared `amperage` field
|
|
|
117
|
|
|
|
118
|
This is a high-value point to verify against real captures or device behavior.
|
|
|
119
|
|
|
|
120
|
### 2. Group capacity scaling
|
|
|
121
|
|
|
|
122
|
Our code currently divides group values by `1000` for:
|
|
|
123
|
|
|
|
124
|
- accumulated charge
|
|
|
125
|
- accumulated energy
|
|
|
126
|
|
|
|
127
|
The external project appears to present these values directly, without that division.
|
|
|
128
|
|
|
|
129
|
This may indicate:
|
|
|
130
|
|
|
|
131
|
- a difference in unit assumptions
|
|
|
132
|
- UI-only formatting choices
|
|
|
133
|
- or a real decoding discrepancy
|
|
|
134
|
|
|
|
135
|
### 3. D+ / D- offset naming
|
|
|
136
|
|
|
|
137
|
Our code currently interprets:
|
|
|
138
|
|
|
|
139
|
- offset `96` as `usbPlusVoltage`
|
|
|
140
|
- offset `98` as `usbMinusVoltage`
|
|
|
141
|
|
|
|
142
|
The external project interprets:
|
|
|
143
|
|
|
|
144
|
- offset `96` as negative data line voltage
|
|
|
145
|
- offset `98` as positive data line voltage
|
|
|
146
|
|
|
|
147
|
This should be verified carefully.
|
|
|
148
|
|
|
|
149
|
### 4. Extra fields present only in our code
|
|
|
150
|
|
|
|
151
|
Our UM parser also handles fields that the external project does not expose in its UI, including:
|
|
|
152
|
|
|
|
153
|
- Fahrenheit temperature at offset `12`
|
|
|
154
|
- recorded AH / WH
|
|
|
155
|
- recording threshold
|
|
|
156
|
- recording state
|
|
|
157
|
- screen timeout
|
|
|
158
|
- screen brightness
|
|
|
159
|
- current screen
|
|
|
160
|
|
|
|
161
|
These may still be correct, but the external project does not help validate them.
|
|
|
162
|
|
|
|
163
|
## Suggested Verification Priorities
|
|
|
164
|
|
|
|
165
|
When new captures or device access become available, verify in this order:
|
|
|
166
|
|
|
|
167
|
1. `UM25C` current scaling
|
|
|
168
|
2. group AH / WH scaling
|
|
|
169
|
3. D+ / D- offset naming
|
|
|
170
|
4. charging mode values
|
|
|
171
|
5. meaning of the extra UM fields parsed only by our code
|
|
|
172
|
|
|
|
173
|
## Practical Value
|
|
|
174
|
|
|
|
175
|
This external project is useful mainly because it provides:
|
|
|
176
|
|
|
|
177
|
- confirmed model identifiers
|
|
|
178
|
- a second implementation of the UM snapshot parser
|
|
|
179
|
- concrete charging mode names
|
|
|
180
|
- a reference point for disputed field scaling
|
|
|
181
|
|
|
|
182
|
It should be treated as a strong comparison source, but not as final protocol truth.
|