@alteriom/painlessmesh 1.6.1 → 1.7.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (129) hide show
  1. package/CHANGELOG.md +380 -143
  2. package/LICENSE +674 -674
  3. package/README.md +477 -434
  4. package/RELEASE_GUIDE.md +504 -418
  5. package/docs/DOCUMENTATION_MIGRATION_PLAN.md +175 -175
  6. package/docs/IMPLEMENTATION_PLAN_MESH_TOPOLOGY.md +1062 -0
  7. package/docs/MESH_TOPOLOGY_GUIDE.md +992 -0
  8. package/docs/MESH_TOPOLOGY_PROGRESS.md +422 -0
  9. package/docs/MQTT_BRIDGE_COMMANDS.md +894 -0
  10. package/docs/MQTT_BRIDGE_IMPLEMENTATION_SUMMARY.md +324 -0
  11. package/docs/MQTT_COMMAND_SCHEMA_PROPOSAL.md +576 -0
  12. package/docs/MQTT_SCHEMA_COMPLIANCE.md +285 -0
  13. package/docs/MQTT_SCHEMA_PROPOSALS.md +446 -0
  14. package/docs/MQTT_SCHEMA_REVIEW.md +690 -0
  15. package/docs/OTA_COMMANDS_REFERENCE.md +554 -0
  16. package/docs/PHASE1_GUIDE.md +349 -0
  17. package/docs/PHASE2_GUIDE.md +543 -0
  18. package/docs/README.md +77 -70
  19. package/docs/SCHEMA_VALIDATION_CHECKLIST.md +222 -0
  20. package/docs/alteriom/overview.md +507 -507
  21. package/docs/api/core-api.md +606 -606
  22. package/docs/architecture/mesh-architecture.md +378 -378
  23. package/docs/architecture/plugin-system.md +516 -516
  24. package/docs/getting-started/first-mesh.md +409 -409
  25. package/docs/getting-started/installation.md +274 -274
  26. package/docs/getting-started/quickstart.md +157 -157
  27. package/docs/improvements/FEATURE_PROPOSALS.md +337 -0
  28. package/docs/improvements/PHASE1_IMPLEMENTATION.md +325 -0
  29. package/docs/improvements/PHASE2_IMPLEMENTATION.md +567 -0
  30. package/docs/improvements/README.md +86 -68
  31. package/docs/improvements/ota-and-status-enhancements.md +911 -0
  32. package/docs/improvements/ota-status-architecture-diagrams.md +658 -0
  33. package/docs/improvements/ota-status-quick-reference.md +284 -0
  34. package/docs/platformio-publishing.md +255 -0
  35. package/docs/platformio-setup-summary.md +121 -0
  36. package/docs/troubleshooting/common-issues.md +520 -520
  37. package/docs/troubleshooting/faq.md +472 -472
  38. package/docs/tutorials/basic-examples.md +717 -717
  39. package/docs/wiki/API-Reference.md +245 -245
  40. package/docs/wiki/Complete-Documentation.md +122 -122
  41. package/examples/alteriom/README.md +139 -81
  42. package/examples/alteriom/alteriom.ino +186 -185
  43. package/examples/alteriom/alteriom_sensor_package.hpp +240 -127
  44. package/examples/alteriom/platformio.ini +24 -24
  45. package/examples/alteriomImproved/alteriom_sensor_package.hpp +224 -0
  46. package/examples/{alteriom → alteriomImproved}/improved_sensor_node.ino +245 -245
  47. package/examples/alteriomImproved/platformio.ini +25 -0
  48. package/examples/alteriomPhase1/alteriom_sensor_package.hpp +224 -0
  49. package/examples/alteriomPhase1/phase1_features.ino +242 -0
  50. package/examples/alteriomPhase1/platformio.ini +25 -0
  51. package/examples/alteriomPhase2/alteriom_sensor_package.hpp +224 -0
  52. package/examples/alteriomPhase2/phase2_features.ino +186 -0
  53. package/examples/alteriomPhase2/platformio.ini +25 -0
  54. package/examples/{alteriom → alteriomSensorNode}/alteriom_sensor_node.ino +183 -183
  55. package/examples/alteriomSensorNode/alteriom_sensor_package.hpp +224 -0
  56. package/examples/alteriomSensorNode/platformio.ini +25 -0
  57. package/examples/basic/basic.ino +66 -66
  58. package/examples/basic/platformio.ini +25 -25
  59. package/examples/bridge/bridge.ino +51 -51
  60. package/examples/bridge/mesh_event_publisher.hpp +253 -0
  61. package/examples/bridge/mesh_topology_reporter.hpp +303 -0
  62. package/examples/bridge/mqtt_command_bridge.hpp +459 -0
  63. package/examples/bridge/mqtt_status_bridge.hpp +519 -0
  64. package/examples/bridge/platformio.ini +25 -25
  65. package/examples/echoNode/echoNode.ino +33 -33
  66. package/examples/echoNode/platformio.ini +25 -25
  67. package/examples/logClient/logClient.ino +109 -109
  68. package/examples/logClient/platformio.ini +25 -25
  69. package/examples/logServer/logServer.ino +81 -81
  70. package/examples/logServer/platformio.ini +25 -25
  71. package/examples/meshCommandNode/alteriom_sensor_package.hpp +235 -0
  72. package/examples/meshCommandNode/meshCommandNode.ino +263 -0
  73. package/examples/meshCommandNode/platformio.ini +25 -0
  74. package/examples/mqttBridge/mqttBridge.ino +118 -118
  75. package/examples/mqttBridge/platformio.ini +26 -26
  76. package/examples/mqttCommandBridge/alteriom_sensor_package.hpp +235 -0
  77. package/examples/mqttCommandBridge/mesh_event_publisher.hpp +253 -0
  78. package/examples/mqttCommandBridge/mesh_topology_reporter.hpp +303 -0
  79. package/examples/mqttCommandBridge/mqttCommandBridge.ino +252 -0
  80. package/examples/mqttCommandBridge/mqtt_command_bridge.hpp +459 -0
  81. package/examples/mqttCommandBridge/platformio.ini +26 -0
  82. package/examples/mqttStatusBridge/mqttStatusBridge.ino +216 -0
  83. package/examples/mqttStatusBridge/mqtt_status_bridge.hpp +522 -0
  84. package/examples/mqttStatusBridge/platformio.ini +26 -0
  85. package/examples/mqttTopologyTest/README.md +467 -0
  86. package/examples/mqttTopologyTest/mqttTopologyTest.ino +748 -0
  87. package/examples/mqttTopologyTest/platformio.ini +26 -0
  88. package/examples/namedMesh/namedMesh.ino +97 -97
  89. package/examples/namedMesh/platformio.ini +25 -25
  90. package/examples/otaReceiver/otaReceiver.ino +79 -79
  91. package/examples/otaReceiver/platformio.ini +25 -25
  92. package/examples/otaSender/otaSender.ino +160 -151
  93. package/examples/otaSender/platformio.ini +25 -25
  94. package/examples/startHere/platformio.ini +25 -25
  95. package/examples/startHere/startHere.ino +159 -159
  96. package/examples/webServer/platformio.ini +27 -27
  97. package/examples/webServer/webServer.ino +89 -89
  98. package/keywords.txt +48 -48
  99. package/library.json +55 -34
  100. package/library.properties +10 -10
  101. package/package.json +86 -78
  102. package/src/AlteriomPainlessMesh.h +97 -97
  103. package/src/arduino/wifi.hpp +365 -365
  104. package/src/boost/asynctcp.hpp +279 -279
  105. package/src/painlessMesh.h +70 -70
  106. package/src/painlessMeshSTA.cpp +236 -236
  107. package/src/painlessMeshSTA.h +58 -58
  108. package/src/painlessTaskOptions.h +4 -4
  109. package/src/painlessmesh/base64.hpp +111 -111
  110. package/src/painlessmesh/buffer.hpp +229 -229
  111. package/src/painlessmesh/callback.hpp +91 -91
  112. package/src/painlessmesh/configuration.hpp +77 -77
  113. package/src/painlessmesh/connection.hpp +192 -192
  114. package/src/painlessmesh/layout.hpp +188 -188
  115. package/src/painlessmesh/logger.hpp +158 -158
  116. package/src/painlessmesh/memory.hpp +119 -119
  117. package/src/painlessmesh/mesh.hpp +761 -560
  118. package/src/painlessmesh/metrics.hpp +322 -322
  119. package/src/painlessmesh/ntp.hpp +263 -263
  120. package/src/painlessmesh/ota.hpp +582 -553
  121. package/src/painlessmesh/plugin.hpp +188 -188
  122. package/src/painlessmesh/protocol.hpp +813 -813
  123. package/src/painlessmesh/router.hpp +322 -322
  124. package/src/painlessmesh/tcp.hpp +71 -71
  125. package/src/painlessmesh/validation.hpp +238 -238
  126. package/src/plugin/performance.hpp +214 -214
  127. package/src/plugin/remote.hpp +64 -64
  128. package/src/scheduler.cpp +10 -10
  129. package/src/wifi.cpp +2 -2
@@ -0,0 +1,658 @@
1
+ # OTA and Status Architecture Diagrams
2
+
3
+ Visual reference for understanding the different implementation options.
4
+
5
+ ---
6
+
7
+ ## OTA Distribution Architectures
8
+
9
+ ### Current Implementation (Sequential)
10
+
11
+ ```
12
+ ┌──────────────┐
13
+ │ Sender Node │
14
+ │ (Root/SD) │
15
+ └──────┬───────┘
16
+ │ Announce broadcast every 60s
17
+
18
+
19
+ ┌──────────────────────────────────────┐
20
+ │ All Nodes Receive Announce │
21
+ └──┬───────┬───────┬───────┬──────────┘
22
+ │ │ │ │
23
+ ▼ ▼ ▼ ▼
24
+ ┌─────┐ ┌─────┐ ┌─────┐ ┌─────┐
25
+ │Node1│ │Node2│ │Node3│ │Node4│
26
+ └──┬──┘ └──┬──┘ └──┬──┘ └──┬──┘
27
+ │ │ │ │
28
+ │ Request chunk 0
29
+ ├──────────────────────────────────►
30
+ │ │ │ │
31
+ ◄───────┤ │ │
32
+ │ Data chunk 0 │ │
33
+ │ │ │ │
34
+ │ Request chunk 1 │
35
+ ├──────────────────────────────────►
36
+ │ │ │ │
37
+ ◄───────┤ │ │
38
+ │ Data chunk 1 │ │
39
+ │ │ │ │
40
+ │ │ Request chunk 0
41
+ │ ├──────────────────────────►
42
+ │ │ │ │
43
+ │ ◄───────┤ │
44
+ │ │ Data chunk 0 │
45
+ └───────┴───────┴───────┴───────────
46
+
47
+ Time: 60-120s for 4 nodes
48
+ Network: N * Firmware_Size (each node gets full copy)
49
+ ```
50
+
51
+ ---
52
+
53
+ ### Option 1A: Mesh-Wide Broadcast
54
+
55
+ ```
56
+ ┌──────────────┐
57
+ │ Sender Node │
58
+ │ (Root/SD) │
59
+ └──────┬───────┘
60
+
61
+ │ Broadcast: Announce
62
+ ├─────────────────────────────────┐
63
+ │ │
64
+ │ Broadcast: Chunk 0 (1s delay) │
65
+ ├─────────────────────────────────┤
66
+ │ │
67
+ │ Broadcast: Chunk 1 (1s delay) │
68
+ ├─────────────────────────────────┤
69
+ │ │
70
+ │ Broadcast: Chunk N (1s delay) │
71
+ ├─────────────────────────────────┤
72
+ │ │
73
+ ▼ ▼
74
+ ┌────────────────────────────────────────────┐
75
+ │ All Nodes Receive All Broadcasts │
76
+ │ (Assemble chunks, handle out-of-order) │
77
+ └┬─────────┬─────────┬─────────┬────────────┘
78
+ │ │ │ │
79
+ ▼ ▼ ▼ ▼
80
+ ┌────┐ ┌────┐ ┌────┐ ┌────┐
81
+ │Node│ │Node│ │Node│ │Node│
82
+ │ 1 │ │ 2 │ │ 3 │ │ 4 │
83
+ └─┬──┘ └─┬──┘ └─┬──┘ └─┬──┘
84
+ │ │ │ │
85
+ │ NAK: Missing chunk 5 │
86
+ ├───────────────────────────┤
87
+ │ │ │ │
88
+ │ Broadcast: Chunk 5 resend │
89
+ ◄────────┴────────┴─────────┘
90
+
91
+ Time: ~30s for any number of nodes
92
+ Network: 1 * Firmware_Size (broadcast to all)
93
+ Memory: +2-5KB per node (chunk tracking)
94
+ ```
95
+
96
+ ---
97
+
98
+ ### Option 1B: Progressive Rollout
99
+
100
+ ```
101
+ Phase 1: Canary (5-10 minutes)
102
+ ┌──────────┐
103
+ │ Sender │
104
+ └────┬─────┘
105
+
106
+ │ OTA to 1-2 test nodes
107
+ ├──────────────┐
108
+ │ │
109
+ ▼ ▼
110
+ ┌────┐ ┌────┐
111
+ │ N1 │ │ N2 │
112
+ └─┬──┘ └─┬──┘
113
+ │ │
114
+ │ Monitor for errors/crashes
115
+ └──────┬───────┘
116
+
117
+
118
+ [Health Check]
119
+
120
+ ├─ OK ──► Phase 2
121
+
122
+ └─ FAIL ─► ABORT & ALERT
123
+
124
+ Phase 2: Early Adopters (10-20% of nodes)
125
+ ┌──────────┐
126
+ │ Sender │
127
+ └────┬─────┘
128
+
129
+ │ OTA to 20% of remaining nodes
130
+ ├─────┬─────┬─────┬─────┐
131
+ │ │ │ │ │
132
+ ▼ ▼ ▼ ▼ ▼
133
+ ┌──┐ ┌──┐ ┌──┐ ┌──┐ ┌──┐
134
+ │N3│ │N4│ │N5│ │N6│ │N7│
135
+ └┬─┘ └┬─┘ └┬─┘ └┬─┘ └┬─┘
136
+ │ │ │ │ │
137
+ │ Monitor for stability
138
+ └─────┴─────┴─────┴─────┘
139
+
140
+
141
+ [Health Check]
142
+
143
+ ├─ OK ──► Phase 3
144
+
145
+ └─ FAIL ─► ROLLBACK
146
+
147
+ Phase 3: Full Rollout (All remaining)
148
+ ┌──────────┐
149
+ │ Sender │
150
+ └────┬─────┘
151
+
152
+ │ OTA to all remaining nodes
153
+
154
+
155
+ [All Other Nodes]
156
+
157
+
158
+ [Complete]
159
+
160
+ Time: 30-60 minutes (safe but slow)
161
+ Safety: High (early failure detection)
162
+ ```
163
+
164
+ ---
165
+
166
+ ### Option 1C: Peer-to-Peer Distribution
167
+
168
+ ```
169
+ Initial Wave:
170
+ ┌──────────────┐
171
+ │ Sender Node │
172
+ │ (Source) │
173
+ └──────┬───────┘
174
+
175
+ │ Direct OTA to first 3 nodes
176
+ ├───────┬───────┬───────┐
177
+ │ │ │ │
178
+ ▼ ▼ ▼ ▼
179
+ ┌───┐ ┌───┐ ┌───┐
180
+ │ A │ │ B │ │ C │
181
+ └─┬─┘ └─┬─┘ └─┬─┘
182
+ │ │ │
183
+ │ Cache firmware in flash
184
+ │ │ │
185
+
186
+ Second Wave (exponential growth):
187
+ ┌────────┬────────┬────────┬────────┐
188
+ │ │ │ │ │
189
+ ▼ ▼ ▼ ▼ ▼
190
+ Sender A B C
191
+ │ │ │ │
192
+ ├───┬────┤ │ │
193
+ │ │ │ │ │
194
+ ▼ ▼ ▼ ▼ ▼
195
+ D E F G H
196
+
197
+ Third Wave:
198
+ D, E, F, G, H all become sources...
199
+ │ │ │ │ │
200
+ ▼ ▼ ▼ ▼ ▼
201
+ I J K L M, etc.
202
+
203
+ Time: ~15s for large mesh (exponential)
204
+ Memory: +200-500KB flash (cached firmware)
205
+ Scalability: Excellent (viral propagation)
206
+ ```
207
+
208
+ ---
209
+
210
+ ### Option 1E: Compressed OTA Transfer
211
+
212
+ ```
213
+ Build Process:
214
+ ┌──────────────┐
215
+ │firmware.bin │
216
+ │ (200KB) │
217
+ └──────┬───────┘
218
+
219
+ │ gzip -9
220
+
221
+ ┌──────────────┐
222
+ │firmware.bin.gz│
223
+ │ (~100KB) │ 40-60% size reduction
224
+ └──────┬───────┘
225
+
226
+ │ Split into chunks
227
+
228
+
229
+ Distribution (same topology as current):
230
+ ┌──────────────┐
231
+ │ Sender Node │
232
+ └──────┬───────┘
233
+
234
+ │ Announce (with compression flag)
235
+
236
+
237
+ Node receives compressed chunks
238
+
239
+ │ ┌─────────────────┐
240
+ │ │ Decompression │
241
+ │ │ Buffer (8KB) │
242
+ ├─┤ │
243
+ │ │ Streaming │
244
+ │ │ decompress to │
245
+ │ │ flash │
246
+ │ └─────────────────┘
247
+
248
+ Flash Write
249
+
250
+ Time Saved: 40-60% (less data to transfer)
251
+ Memory: +4-8KB (decompression buffer)
252
+ CPU: Minimal (streaming decompression)
253
+ Compatibility: Works with all distribution methods
254
+ ```
255
+
256
+ ---
257
+
258
+ ## Mesh Status Monitoring Architectures
259
+
260
+ ### Current State (Manual)
261
+
262
+ ```
263
+ Application Code:
264
+ ┌───────────────────────────┐
265
+ │ User Application │
266
+ │ │
267
+ │ Manually poll nodes: │
268
+ │ - getNodeList() │
269
+ │ - subConnectionJson() │
270
+ │ - getNodeTime() │
271
+ │ │
272
+ │ Store and process data │
273
+ └───────────────────────────┘
274
+
275
+ │ Multiple API calls
276
+
277
+
278
+ ┌───────────────────────────┐
279
+ │ painlessMesh Library │
280
+ └───────────────────────────┘
281
+
282
+
283
+ [Mesh Nodes]
284
+
285
+ Manual status collection
286
+ No standardization
287
+ Application-specific
288
+ ```
289
+
290
+ ---
291
+
292
+ ### Option 2A: Enhanced StatusPackage
293
+
294
+ ```
295
+ Each Node (periodic broadcast):
296
+ ┌──────────────────────────┐
297
+ │ Node Application │
298
+ └──────┬───────────────────┘
299
+
300
+ │ Create status (every 60s)
301
+
302
+ ┌──────────────────────────┐
303
+ │ EnhancedStatusPackage │
304
+ │ - uptime │
305
+ │ - memory │
306
+ │ - message stats │
307
+ │ - network info │
308
+ │ - alerts │
309
+ └──────┬───────────────────┘
310
+
311
+ │ mesh.sendBroadcast()
312
+
313
+ ┌──────────────────────────┐
314
+ │ Mesh Network │
315
+ └──────┬───────────────────┘
316
+
317
+ │ All nodes receive
318
+
319
+ Collection Node:
320
+ ┌──────────────────────────┐
321
+ │ onReceive() callback │
322
+ │ │
323
+ │ if (type == 202) { │
324
+ │ processStatus() │
325
+ │ storeMetrics() │
326
+ │ checkAlerts() │
327
+ │ } │
328
+ └──────────────────────────┘
329
+
330
+ Frequency: 30-60s typical
331
+ Overhead: ~500 bytes per update
332
+ Integration: Simple, builds on existing
333
+ ```
334
+
335
+ ---
336
+
337
+ ### Option 2B: Mesh Status Service
338
+
339
+ ```
340
+ Root/Bridge Node initiates:
341
+ ┌──────────────────────────┐
342
+ │ Root Node │
343
+ │ (Status Collector) │
344
+ └──────┬───────────────────┘
345
+
346
+ │ StatusQuery(node_list)
347
+ ├────────┬────────┬────────┐
348
+ │ │ │ │
349
+ ▼ ▼ ▼ ▼
350
+ ┌───┐ ┌───┐ ┌───┐ ┌───┐
351
+ │ A │ │ B │ │ C │ │ D │
352
+ └─┬─┘ └─┬─┘ └─┬─┘ └─┬─┘
353
+ │ │ │ │
354
+ │ StatusReport (metrics)
355
+ ├────────┼────────┼────────┤
356
+ │ │ │ │
357
+ ▼ ▼ ▼ ▼
358
+ ┌──────────────────────────────────┐
359
+ │ Root Node Aggregation │
360
+ │ │
361
+ │ { │
362
+ │ "nodeA": {...}, │
363
+ │ "nodeB": {...}, │
364
+ │ "nodeC": {...}, │
365
+ │ "nodeD": {...} │
366
+ │ } │
367
+ └──────┬───────────────────────────┘
368
+
369
+ │ Publish via MQTT or API
370
+
371
+ ┌──────────────────────────────────┐
372
+ │ External Monitoring System │
373
+ └──────────────────────────────────┘
374
+
375
+ Query Mode: On-demand or periodic
376
+ Aggregation: Centralized at root
377
+ Response Timeout: 5-10 seconds
378
+ ```
379
+
380
+ ---
381
+
382
+ ### Option 2C: Telemetry Stream
383
+
384
+ ```
385
+ Continuous streaming from all nodes:
386
+
387
+ Node 1: Node 2: Node 3: Node 4:
388
+ │ │ │ │
389
+ │ Telemetry (every 60s) │ │
390
+ ├───────────┴───────────┴───────────┤
391
+ │ │
392
+ ▼ ▼
393
+ ┌─────────────────────────────────────────┐
394
+ │ Root Node │
395
+ │ (State Maintenance) │
396
+ │ │
397
+ │ ┌───────────────────────────────────┐ │
398
+ │ │ Internal State Model │ │
399
+ │ │ - Node 1: [metrics] │ │
400
+ │ │ - Node 2: [metrics] │ │
401
+ │ │ - Node 3: [metrics] │ │
402
+ │ │ - Node 4: [metrics] │ │
403
+ │ └───────────────────────────────────┘ │
404
+ │ │
405
+ │ ┌───────────────────────────────────┐ │
406
+ │ │ Anomaly Detection │ │
407
+ │ │ - Memory critically low on N2 │ │
408
+ │ │ - High packet loss on N3 │ │
409
+ │ └───────────────────────────────────┘ │
410
+ └─────────┬───────────────────────────────┘
411
+
412
+ │ Export alerts & metrics
413
+
414
+ ┌─────────────────────────────────────────┐
415
+ │ Time-Series Database / MQTT │
416
+ │ (InfluxDB, Prometheus, etc.) │
417
+ └─────────────────────────────────────────┘
418
+
419
+ Format: Compact binary (64 bytes)
420
+ Encoding: Delta (only changes)
421
+ Frequency: 30-60s
422
+ Overhead: Very low (~1KB/hour per node)
423
+ ```
424
+
425
+ ---
426
+
427
+ ### Option 2D: Health Dashboard
428
+
429
+ ```
430
+ ┌─────────────────────────────────────────┐
431
+ │ Dashboard Node (ESP32) │
432
+ │ │
433
+ │ ┌───────────────────────────────────┐ │
434
+ │ │ Status Collector Service │ │
435
+ │ │ (Polls all nodes every 30s) │ │
436
+ │ └───────┬───────────────────────────┘ │
437
+ │ │ │
438
+ │ ┌───────▼───────────────────────────┐ │
439
+ │ │ LittleFS Storage │ │
440
+ │ │ - Current status │ │
441
+ │ │ - Historical data (24h) │ │
442
+ │ │ - Alert history │ │
443
+ │ └───────┬───────────────────────────┘ │
444
+ │ │ │
445
+ │ ┌───────▼───────────────────────────┐ │
446
+ │ │ AsyncWebServer │ │
447
+ │ │ - REST API │ │
448
+ │ │ - WebSocket (live updates) │ │
449
+ │ │ - Static files (HTML/CSS/JS) │ │
450
+ │ └───────┬───────────────────────────┘ │
451
+ └──────────┼─────────────────────────────┘
452
+
453
+ │ HTTP/WebSocket
454
+
455
+ ┌─────────────────────────────────────────┐
456
+ │ Web Browser / Mobile │
457
+ │ │
458
+ │ ┌─────────────────────────────────┐ │
459
+ │ │ Real-Time Mesh Visualization │ │
460
+ │ │ ┌─────┐ ┌─────┐ ┌─────┐ │ │
461
+ │ │ │ A ├──┤ B ├──┤ C │ │ │
462
+ │ │ └─────┘ └─────┘ └──┬──┘ │ │
463
+ │ │ │ │ │
464
+ │ │ ┌──┴──┐ │ │
465
+ │ │ │ D │ │ │
466
+ │ │ └─────┘ │ │
467
+ │ └─────────────────────────────────┘ │
468
+ │ │
469
+ │ ┌─────────────────────────────────┐ │
470
+ │ │ Per-Node Metrics │ │
471
+ │ │ - Memory: [====> ] 60% │ │
472
+ │ │ - Uptime: 2d 14h │ │
473
+ │ │ - Messages: 12,345 │ │
474
+ │ └─────────────────────────────────┘ │
475
+ │ │
476
+ │ ┌─────────────────────────────────┐ │
477
+ │ │ Alerts & Events │ │
478
+ │ │ ⚠ Node 3: Low memory │ │
479
+ │ │ ⚠ Node 7: High packet loss │ │
480
+ │ └─────────────────────────────────┘ │
481
+ └─────────────────────────────────────────┘
482
+
483
+ Features:
484
+ - Live topology visualization
485
+ - Historical graphs (ChartJS)
486
+ - Alert management
487
+ - Firmware tracking
488
+ - Mobile responsive
489
+ ```
490
+
491
+ ---
492
+
493
+ ### Option 2E: MQTT Status Bridge
494
+
495
+ ```
496
+ Mesh Network:
497
+ ┌────┐ ┌────┐ ┌────┐ ┌────┐
498
+ │ N1 │ │ N2 │ │ N3 │ │ N4 │
499
+ └─┬──┘ └─┬──┘ └─┬──┘ └─┬──┘
500
+ │ │ │ │
501
+ │ Mesh communication │
502
+ └───────┴───────┴────────┘
503
+
504
+ │ Status collection
505
+
506
+ ┌─────────────────────────────┐
507
+ │ Bridge Node (Root) │
508
+ │ │
509
+ │ ┌──────────────────────┐ │
510
+ │ │ Status Collector │ │
511
+ │ │ - Polls mesh nodes │ │
512
+ │ │ - Aggregates data │ │
513
+ │ └──────┬───────────────┘ │
514
+ │ │ │
515
+ │ ┌──────▼───────────────┐ │
516
+ │ │ MQTT Publisher │ │
517
+ │ │ - JSON formatting │ │
518
+ │ │ - Topic routing │ │
519
+ │ └──────┬───────────────┘ │
520
+ └─────────┼───────────────────┘
521
+
522
+ │ MQTT/TLS
523
+
524
+ ┌─────────────────────────────┐
525
+ │ MQTT Broker │
526
+ │ (Mosquitto, HiveMQ) │
527
+ └─────────┬───────────────────┘
528
+
529
+ │ Topics:
530
+ │ - mesh/status/nodes
531
+ │ - mesh/status/topology
532
+ │ - mesh/status/metrics
533
+ │ - mesh/status/alerts
534
+ │ - mesh/status/node/{id}
535
+
536
+ ├──────┬──────┬──────┬──────┐
537
+ ▼ ▼ ▼ ▼ ▼
538
+ ┌─────┐ ┌────┐ ┌────┐ ┌────┐ ┌────┐
539
+ │Grafa│ │Prom│ │Home│ │Node│ │Cust│
540
+ │ na │ │eth │ │Asst│ │RED │ │ om │
541
+ └─────┘ └────┘ └────┘ └────┘ └────┘
542
+
543
+ JSON Payload Example:
544
+ {
545
+ "timestamp": 1638360000,
546
+ "nodes": [
547
+ {
548
+ "id": 123456789,
549
+ "uptime": 86400,
550
+ "memory": 45000,
551
+ "rssi": -65,
552
+ "version": "v2.1.0"
553
+ },
554
+ ...
555
+ ]
556
+ }
557
+ ```
558
+
559
+ ---
560
+
561
+ ## Comparison: OTA Performance
562
+
563
+ ### Time to Update 20 Nodes (200KB firmware)
564
+
565
+ ```
566
+ Current (Sequential):
567
+ [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 20 min
568
+
569
+ + Compression (1E):
570
+ [▓▓▓▓▓▓▓▓▓▓▓▓] 12 min (40% faster)
571
+
572
+ + Broadcast (1A):
573
+ [▓▓▓▓▓] 5 min (75% faster)
574
+
575
+ + Broadcast + Compression:
576
+ [▓▓▓] 3 min (85% faster)
577
+
578
+ + Peer-to-Peer (1C):
579
+ [▓] 1 min (95% faster)
580
+ ```
581
+
582
+ ### Network Bandwidth Usage
583
+
584
+ ```
585
+ Current: 20 nodes × 200KB = 4000KB total
586
+
587
+ Broadcast: 1 × 200KB = 200KB total
588
+ (20x reduction!)
589
+
590
+ Compressed: 20 × 100KB = 2000KB
591
+ (or 1 × 100KB = 100KB if broadcast)
592
+
593
+ Peer-to-Peer: ~400KB total
594
+ (viral propagation, shared load)
595
+ ```
596
+
597
+ ---
598
+
599
+ ## Comparison: Status Monitoring Overhead
600
+
601
+ ### Network Traffic (10 nodes, 1 hour)
602
+
603
+ ```
604
+ Option 2A (StatusPackage @ 5min):
605
+ │█│█│█│█│█│█│█│█│█│█│█│ ~60KB/hour
606
+ (12 updates × 500B × 10 nodes)
607
+
608
+ Option 2B (Status Service @ 30s):
609
+ │███│ ~15KB/hour
610
+ (Queries + responses, aggregated)
611
+
612
+ Option 2C (Telemetry @ 60s):
613
+ │█│ ~4KB/hour
614
+ (Delta encoding, very efficient)
615
+
616
+ Option 2D (Dashboard - polling @ 30s):
617
+ │██│ ~10KB/hour
618
+ (Collector queries nodes)
619
+
620
+ Option 2E (MQTT Bridge @ 30s):
621
+ │███│ ~20KB/hour
622
+ (JSON overhead, but external)
623
+ ```
624
+
625
+ ---
626
+
627
+ ## Decision Tree
628
+
629
+ ```
630
+ ┌─────────────────┐
631
+ │ Do you need │
632
+ │ OTA or Status? │
633
+ └────┬────┬───────┘
634
+ │ │
635
+ ┌───────────┘ └──────────┐
636
+ │ │
637
+ ▼ ▼
638
+ ┌─────────────┐ ┌─────────────┐
639
+ │ OTA │ │ STATUS │
640
+ └──────┬──────┘ └──────┬──────┘
641
+ │ │
642
+ ▼ ▼
643
+ What's your How many nodes?
644
+ priority? │
645
+ │ │
646
+ ┌──────┼──────┐ ├──────┬──────┐
647
+ ▼ ▼ ▼ ▼ ▼ ▼
648
+ Speed Safety Simple <10 10-50 >50
649
+ │ │ │ │ │ │
650
+ ▼ ▼ ▼ ▼ ▼ ▼
651
+ 1A+1E 1B+1E 1E 2A 2E 2C+2E
652
+ ```
653
+
654
+ ---
655
+
656
+ **See also:**
657
+ - [Full Proposal](ota-and-status-enhancements.md)
658
+ - [Quick Reference](ota-status-quick-reference.md)