|
Bogdan Timofte
authored
2 weeks ago
|
1
|
# PW0316 BLE Module Working Summary
|
|
|
2
|
|
|
|
3
|
This note summarizes the imported module manual [`PW0316_User_Manual_V2.9.pdf`](../Manuals/PW0316_User_Manual_V2.9.pdf) and records why it matters for `TC66C`.
|
|
|
4
|
|
|
|
5
|
## Source Snapshot
|
|
|
6
|
|
|
|
7
|
- imported file: `Documentation/Research Resources/Manuals/PW0316_User_Manual_V2.9.pdf`
|
|
|
8
|
- source path before import: `/Users/bogdan/Documents/Documentatie/TC66/Other/PW0316_User_Manual_V2.9.pdf`
|
|
|
9
|
- pages: `28`
|
|
|
10
|
- version label in manual: `V2.9`
|
|
|
11
|
- part number: `PW0316`
|
|
|
12
|
- SHA-1: `e325f7708f18400fd774f60219e76395797c51cc`
|
|
|
13
|
|
|
|
14
|
## Why This Matters
|
|
|
15
|
|
|
|
16
|
The current app already mapped `TC66C` to radio type `PW0316`, but until now that was only a code-level assumption.
|
|
|
17
|
|
|
|
18
|
This manual strongly supports that mapping and validates the BLE side of the current `TC66C` transport model.
|
|
|
19
|
|
|
|
20
|
## Confirmed Module Role
|
|
|
21
|
|
|
|
22
|
The manual describes `PW0316` as a BLE 4.0 transparent serial bridge:
|
|
|
23
|
|
|
|
24
|
- user MCU talks to the module over UART
|
|
|
25
|
- mobile app talks to the module over BLE
|
|
|
26
|
- the module forwards data between UART and BLE
|
|
|
27
|
- upper-layer meaning is defined by the host MCU and mobile app
|
|
|
28
|
|
|
|
29
|
This is a strong fit for the existing `TC66C` implementation:
|
|
|
30
|
|
|
|
31
|
- the app sends ASCII commands
|
|
|
32
|
- the module bridges them to the device MCU
|
|
|
33
|
- the device MCU returns data that the module fragments into BLE notifications
|
|
|
34
|
|
|
|
35
|
## Confirmed GATT Layout
|
|
|
36
|
|
|
|
37
|
The manual explicitly documents the following BLE services and characteristics.
|
|
|
38
|
|
|
|
39
|
### Serial data channel
|
|
|
40
|
|
|
|
41
|
- service `0xFFE0`
|
|
|
42
|
- characteristic `0xFFE4`
|
|
|
43
|
- operation: `Notification`
|
|
|
44
|
- payload size: `20` bytes
|
|
|
45
|
- meaning: UART RX input is forwarded to BLE notifications
|
|
|
46
|
|
|
|
47
|
### Bluetooth data channel
|
|
|
48
|
|
|
|
49
|
- service `0xFFE5`
|
|
|
50
|
- characteristic `0xFFE9`
|
|
|
51
|
- operation: `Write`
|
|
|
52
|
- payload size: `20` bytes
|
|
|
53
|
- meaning: BLE writes are forwarded to UART TX
|
|
|
54
|
|
|
|
55
|
### Anti-hijacking channel
|
|
|
56
|
|
|
|
57
|
- service `0xFFC0`
|
|
|
58
|
- characteristic `0xFFC1`
|
|
|
59
|
- operation: `Write`
|
|
|
60
|
- size: `12` ASCII bytes
|
|
|
61
|
- meaning: current password + new password
|
|
|
62
|
- characteristic `0xFFC2`
|
|
|
63
|
- operation: `Notify`
|
|
|
64
|
- size: `1` byte
|
|
|
65
|
- meaning: password operation result
|
|
|
66
|
|
|
|
67
|
Password event values documented by the module vendor:
|
|
|
68
|
|
|
|
69
|
- `0` = password accepted
|
|
|
70
|
- `1` = password incorrect
|
|
|
71
|
- `2` = password updated
|
|
|
72
|
- `3` = password cancelled
|
|
|
73
|
|
|
|
74
|
## Broadcast and Identity Hints
|
|
|
75
|
|
|
|
76
|
Default BLE advertise data includes partial 16-bit UUIDs for:
|
|
|
77
|
|
|
|
78
|
- `FFC0`
|
|
|
79
|
- `FFE0`
|
|
|
80
|
- `FFE5`
|
|
|
81
|
|
|
|
82
|
Default scan-response data includes:
|
|
|
83
|
|
|
|
84
|
- manufacturer-specific data with default text payload `RW-BLE`
|
|
|
85
|
- local name `PW0316`
|
|
|
86
|
|
|
|
87
|
This directly explains why the current app can recognize a peripheral named `PW0316` as `TC66C`.
|
|
|
88
|
|
|
|
89
|
## UART and Flow-Control Behavior
|
|
|
90
|
|
|
|
91
|
The module manual documents a hardware flow-control model around:
|
|
|
92
|
|
|
|
93
|
- `BRTS`
|
|
|
94
|
- `BCTS`
|
|
|
95
|
|
|
|
96
|
Relevant points:
|
|
|
97
|
|
|
|
98
|
- default UART is `9600`, `8N1`
|
|
|
99
|
- transparent serial payloads can be any size up to `200` bytes
|
|
|
100
|
- BLE wireless payloads are `20` bytes each
|
|
|
101
|
- the module automatically splits large UART payloads into BLE packets
|
|
|
102
|
- the host MCU must manage `BRTS`
|
|
|
103
|
- the module uses `BCTS` to tell the MCU when module-to-host data is pending
|
|
|
104
|
|
|
|
105
|
## Throughput and Timing
|
|
|
106
|
|
|
|
107
|
The manual states:
|
|
|
108
|
|
|
|
109
|
- default BLE connection interval: `20 ms`
|
|
|
110
|
- highest theoretical transparent throughput is achieved with `115200` UART and `20 ms` BLE interval
|
|
|
111
|
- reliable Bluetooth data transmission is limited to about `10 KByte/s`
|
|
|
112
|
|
|
|
113
|
This is consistent with the current app's expectation that a `TC66C` response arrives as multiple `20`-byte BLE fragments.
|
|
|
114
|
|
|
|
115
|
## AT Command Surface
|
|
|
116
|
|
|
|
117
|
The module supports UART-side `TTM:` AT commands for module management, including:
|
|
|
118
|
|
|
|
119
|
- test
|
|
|
120
|
- MAC read/write
|
|
|
121
|
- baud rate
|
|
|
122
|
- rename
|
|
|
123
|
- manufacturer data
|
|
|
124
|
- advertise / scan response
|
|
|
125
|
- TX power
|
|
|
126
|
- reset
|
|
|
127
|
- factory reset
|
|
|
128
|
- version
|
|
|
129
|
- product identification code
|
|
|
130
|
- advertise interval
|
|
|
131
|
- connection interval
|
|
|
132
|
- broadcast on/off
|
|
|
133
|
- serial send setup delay
|
|
|
134
|
- anti-hijack password
|
|
|
135
|
|
|
|
136
|
Important implication:
|
|
|
137
|
|
|
|
138
|
- these are module-management commands, not necessarily `TC66C` application commands
|
|
|
139
|
- they should not be confused with the ASCII commands already seen in the app for meter data requests
|
|
|
140
|
|
|
|
141
|
## What This Validates For `TC66C`
|
|
|
142
|
|
|
|
143
|
High-confidence validations:
|
|
|
144
|
|
|
|
145
|
- `TC66C` does not use the same BLE channel shape as the `UM` family
|
|
|
146
|
- the current app's `FFE0` / `FFE4` and `FFE5` / `FFE9` mapping is correct for `PW0316`
|
|
|
147
|
- BLE traffic is expected in `20`-byte chunks
|
|
|
148
|
- a separate security channel `FFC0` exists and may matter if the module password is enabled
|
|
|
149
|
- the peripheral name `PW0316` is a credible alias for the hardware module used inside `TC66C`
|
|
|
150
|
|
|
|
151
|
## What This Does Not Validate
|
|
|
152
|
|
|
|
153
|
The module manual does not describe:
|
|
|
154
|
|
|
|
155
|
- the `TC66C` meter's application-level ASCII commands such as `bgetva`
|
|
|
156
|
- the `192`-byte encrypted snapshot format used by the current app
|
|
|
157
|
- the AES key or packet layout of `pac1` / `pac2` / `pac3`
|
|
|
158
|
- the meaning of measurement fields returned by the meter MCU
|
|
|
159
|
|
|
|
160
|
So this manual validates the transport shell, not the meter payload itself.
|
|
|
161
|
|
|
|
162
|
## Practical Implications For The Codebase
|
|
|
163
|
|
|
|
164
|
- keep `TC66C` on the `PW0316` transport path
|
|
|
165
|
- keep `TC66C` separate from the `UM25C` / `UM34C` `HM-10` style path
|
|
|
166
|
- consider adding `FFC0` / `FFC1` / `FFC2` support only if we discover password-protected modules in the field
|
|
|
167
|
- when debugging fragmentation, assume the BLE layer naturally emits `20`-byte chunks and that larger frames are reconstructed above that layer
|