@alteriom/painlessmesh 1.8.15 → 1.9.1

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 (208) hide show
  1. package/BRIDGE_TO_INTERNET.md +229 -0
  2. package/CHANGELOG.md +101 -1
  3. package/CONTRIBUTING.md +79 -0
  4. package/README.md +69 -144
  5. package/docs/README.md +1 -0
  6. package/docs/api/shared-gateway.md +1207 -0
  7. package/examples/bridge_failover/README.md +113 -0
  8. package/examples/bridge_failover/bridge_failover.ino +38 -4
  9. package/examples/sharedGateway/README.md +235 -0
  10. package/examples/{meshCommandNode → sharedGateway}/platformio.ini +3 -2
  11. package/examples/sharedGateway/sharedGateway.ino +303 -0
  12. package/library.json +3 -22
  13. package/library.properties +1 -1
  14. package/package.json +3 -6
  15. package/src/arduino/wifi.hpp +504 -4
  16. package/src/painlessmesh/gateway.hpp +2120 -0
  17. package/src/painlessmesh/mesh.hpp +1034 -6
  18. package/src/painlessmesh/message_tracker.hpp +311 -0
  19. package/src/painlessmesh/protocol.hpp +6 -0
  20. package/DOCUMENTATION_INDEX.md +0 -146
  21. package/RELEASE_NOTES_1.8.15.md +0 -160
  22. package/RELEASE_READINESS_PLAN.md +0 -323
  23. package/TESTING_WITH_SIMULATOR.md +0 -259
  24. package/docs/API_DESIGN_GUIDELINES.md +0 -414
  25. package/docs/ARDUINO_LIBRARY_MANAGER_SUBMISSION.md +0 -331
  26. package/docs/BOOLEAN_NAMING_CONVENTION.md +0 -235
  27. package/docs/BRIDGE_FAILOVER.md +0 -512
  28. package/docs/BRIDGE_HEALTH_MONITORING.md +0 -293
  29. package/docs/BRIDGE_INITIALIZATION_FALLBACK.md +0 -357
  30. package/docs/CHANNEL_SYNCHRONIZATION.md +0 -209
  31. package/docs/CREATE_MISSING_RELEASES.md +0 -321
  32. package/docs/DOCUMENTATION_MIGRATION_PLAN.md +0 -176
  33. package/docs/FAQ_VERSION_NUMBERS.md +0 -152
  34. package/docs/IMPLEMENTATION_PLAN_MESH_TOPOLOGY.md +0 -1062
  35. package/docs/MESH_TOPOLOGY_GUIDE.md +0 -992
  36. package/docs/MESH_TOPOLOGY_PROGRESS.md +0 -422
  37. package/docs/MQTT_BRIDGE_COMMANDS.md +0 -894
  38. package/docs/MQTT_BRIDGE_IMPLEMENTATION_SUMMARY.md +0 -324
  39. package/docs/MQTT_COMMAND_SCHEMA_PROPOSAL.md +0 -576
  40. package/docs/MQTT_SCHEMA_COMPLIANCE.md +0 -340
  41. package/docs/MQTT_SCHEMA_PROPOSALS.md +0 -446
  42. package/docs/MQTT_SCHEMA_REVIEW.md +0 -690
  43. package/docs/OTA_COMMANDS_REFERENCE.md +0 -554
  44. package/docs/PHASE1_GUIDE.md +0 -349
  45. package/docs/PHASE2_GUIDE.md +0 -543
  46. package/docs/QUICK_REFERENCE_VERSIONING.md +0 -127
  47. package/docs/RELEASE_AGENT_SUMMARY.md +0 -386
  48. package/docs/SCHEMA_VALIDATION_CHECKLIST.md +0 -222
  49. package/docs/SIMULATOR_TESTING.md +0 -408
  50. package/docs/VERSION_MANAGEMENT.md +0 -213
  51. package/docs/archive/DOCUSAURUS_DEPLOYMENT.md +0 -166
  52. package/docs/archive/FEATURE_PROPOSALS.md +0 -337
  53. package/docs/archive/LIBRARY_JSON_FIX.md +0 -98
  54. package/docs/archive/LIBRARY_STRUCTURE_FIX.md +0 -215
  55. package/docs/archive/PHASE1_IMPLEMENTATION.md +0 -325
  56. package/docs/archive/PHASE2_IMPLEMENTATION.md +0 -567
  57. package/docs/archive/RELEASE_SUMMARY.md +0 -173
  58. package/docs/archive/SCONS_BUILD_FIX.md +0 -313
  59. package/docs/archive/TRIGGER_RELEASE.md +0 -280
  60. package/docs/archive/VECTOR_INCLUDE_FIX.md +0 -129
  61. package/docs/archive/ota-and-status-enhancements.md +0 -911
  62. package/docs/archive/ota-status-architecture-diagrams.md +0 -658
  63. package/docs/archive/ota-status-quick-reference.md +0 -284
  64. package/docs/design/.gitkeep +0 -1
  65. package/docs/design/STATION_CREDENTIALS_DESIGN.md +0 -182
  66. package/docs/development/ARDUINO_COMPLIANCE_SUMMARY.md +0 -71
  67. package/docs/development/CODE_REFACTORING_RECOMMENDATIONS.md +0 -1011
  68. package/docs/development/DOCKER_TESTING.md +0 -196
  69. package/docs/development/PLATFORMIO_USAGE.md +0 -180
  70. package/docs/development/TESTING_SUMMARY.md +0 -126
  71. package/docs/development/contributing.md +0 -301
  72. package/docs/development/documentation.md +0 -583
  73. package/docs/features/DIAGNOSTICS_API.md +0 -534
  74. package/docs/implementation/BRIDGE_ARCHITECTURE_IMPLEMENTATION.md +0 -340
  75. package/docs/implementation/BRIDGE_HEALTH_MONITORING_IMPLEMENTATION.md +0 -213
  76. package/docs/implementation/BRIDGE_STATUS_FEATURE.md +0 -635
  77. package/docs/implementation/DIAGNOSTICS_API_IMPLEMENTATION.md +0 -232
  78. package/docs/implementation/IMPLEMENTATION_COMPLETE.md +0 -228
  79. package/docs/implementation/IMPLEMENTATION_NTP_TIME_SYNC.md +0 -325
  80. package/docs/implementation/IMPLEMENTATION_SUMMARY.md +0 -316
  81. package/docs/implementation/MESSAGE_QUEUE_IMPLEMENTATION.md +0 -405
  82. package/docs/implementation/MULTI_BRIDGE_IMPLEMENTATION.md +0 -520
  83. package/docs/implementation/NTP_TIME_SYNC_FEATURE.md +0 -392
  84. package/docs/improvements/FUTURE_PROPOSALS.md +0 -1016
  85. package/docs/improvements/IMPLEMENTATION_HISTORY.md +0 -1091
  86. package/docs/improvements/OTA_STATUS_ENHANCEMENTS.md +0 -709
  87. package/docs/improvements/README.md +0 -212
  88. package/docs/internal/CUSTOM_AGENT_ANALYSIS.md +0 -391
  89. package/docs/internal/ISSUE_65_VERIFICATION.md +0 -947
  90. package/docs/internal/ISSUE_66_CLOSURE.md +0 -249
  91. package/docs/internal/ISSUE_66_STATUS.md +0 -316
  92. package/docs/internal/PR_SUMMARY.md +0 -315
  93. package/docs/internal/REVIEW_SUMMARY.md +0 -332
  94. package/docs/multi-bridge-setup.md +0 -1025
  95. package/docs/platformio-publishing.md +0 -255
  96. package/docs/platformio-setup-summary.md +0 -121
  97. package/docs/releases/ANNOUNCEMENT_v1.8.6.md +0 -63
  98. package/docs/releases/ANNOUNCEMENT_v1.8.7.md +0 -113
  99. package/docs/releases/BRIDGE_STATUS_SELF_REGISTRATION_FIX.md +0 -221
  100. package/docs/releases/FEATURE_HISTORY.md +0 -543
  101. package/docs/releases/GITHUB_RELEASE_v1.8.6.md +0 -71
  102. package/docs/releases/GITHUB_RELEASE_v1.8.7.md +0 -90
  103. package/docs/releases/PATCH_v1.7.2.md +0 -262
  104. package/docs/releases/PATCH_v1.7.3.md +0 -262
  105. package/docs/releases/PATCH_v1.7.4.md +0 -219
  106. package/docs/releases/PHASE1_SUMMARY.md +0 -246
  107. package/docs/releases/PHASE2_SUMMARY.md +0 -499
  108. package/docs/releases/PUBLISH_v1.8.0_INSTRUCTIONS.md +0 -163
  109. package/docs/releases/QUICK_START_RELEASES.md +0 -113
  110. package/docs/releases/RELEASE_CHECKLIST_1.8.10.md +0 -331
  111. package/docs/releases/RELEASE_CHECKLIST_1.8.9.md +0 -207
  112. package/docs/releases/RELEASE_CHECKLIST_v1.7.4.md +0 -253
  113. package/docs/releases/RELEASE_CHECKLIST_v1.7.5.md +0 -315
  114. package/docs/releases/RELEASE_CHECKLIST_v1.7.6.md +0 -389
  115. package/docs/releases/RELEASE_CHECKLIST_v1.8.0.md +0 -331
  116. package/docs/releases/RELEASE_CHECKLIST_v1.8.2.md +0 -309
  117. package/docs/releases/RELEASE_NOTES_1.7.0.md +0 -539
  118. package/docs/releases/RELEASE_NOTES_1.8.10.md +0 -239
  119. package/docs/releases/RELEASE_NOTES_1.8.9.md +0 -213
  120. package/docs/releases/RELEASE_NOTES_v1.8.0.md +0 -685
  121. package/docs/releases/RELEASE_NOTES_v1.8.1.md +0 -221
  122. package/docs/releases/RELEASE_NOTES_v1.8.2.md +0 -421
  123. package/docs/releases/RELEASE_NOTES_v1.8.3.md +0 -292
  124. package/docs/releases/RELEASE_NOTES_v1.8.4.md +0 -277
  125. package/docs/releases/RELEASE_NOTES_v1.8.6.md +0 -205
  126. package/docs/releases/RELEASE_NOTES_v1.8.7.md +0 -184
  127. package/docs/releases/RELEASE_PLAN_v1.7.6.md +0 -816
  128. package/docs/releases/RELEASE_SUMMARY_1.8.10.md +0 -193
  129. package/docs/releases/RELEASE_SUMMARY_v1.7.4.md +0 -276
  130. package/docs/releases/RELEASE_SUMMARY_v1.7.5.md +0 -322
  131. package/docs/releases/RELEASE_SUMMARY_v1.7.6.md +0 -436
  132. package/docs/releases/RELEASE_SUMMARY_v1.7.7.md +0 -391
  133. package/docs/releases/RELEASE_SUMMARY_v1.7.8.md +0 -523
  134. package/docs/releases/RELEASE_SUMMARY_v1.7.9.md +0 -542
  135. package/docs/troubleshooting/ARDUINO_IDE_VERSION_FIX_SUMMARY.md +0 -229
  136. package/docs/troubleshooting/ARDUINO_LIBRARY_NAME_FIX.md +0 -197
  137. package/docs/troubleshooting/CRASH_QUICK_REF.md +0 -93
  138. package/docs/troubleshooting/ESP32_C6_COMPATIBILITY.md +0 -157
  139. package/docs/troubleshooting/FREERTOS_ASSERTION_FAILURE.md +0 -288
  140. package/docs/troubleshooting/FREERTOS_FIX_IMPLEMENTATION.md +0 -267
  141. package/docs/troubleshooting/NPM_PUBLISHING_ISSUE_SUMMARY.md +0 -110
  142. package/docs/troubleshooting/PAINLESSMESH_V1.7.4_COMPILATION_ISSUES.md +0 -547
  143. package/docs/troubleshooting/QUICK_FIX_FREERTOS.md +0 -164
  144. package/docs/troubleshooting/SENSOR_NODE_CONNECTION_CRASH.md +0 -264
  145. package/docs/troubleshooting/common-architecture-mistakes.md +0 -438
  146. package/docs/troubleshooting/internet-access-faq.md +0 -299
  147. package/docs/troubleshooting/station-reconnection-issues.md +0 -172
  148. package/docs/v1.7.7_MQTT_IMPROVEMENTS.md +0 -794
  149. package/docs/wiki/API-Reference.md +0 -246
  150. package/docs/wiki/Complete-Documentation.md +0 -123
  151. package/examples/alteriomImproved/alteriom_sensor_package.hpp +0 -224
  152. package/examples/alteriomImproved/improved_sensor_node.ino +0 -248
  153. package/examples/alteriomImproved/platformio.ini +0 -32
  154. package/examples/alteriomMetricsHealth/alteriom_sensor_package.hpp +0 -796
  155. package/examples/alteriomMetricsHealth/metrics_health_node.ino +0 -429
  156. package/examples/alteriomMetricsHealth/platformio.ini +0 -26
  157. package/examples/alteriomPhase1/alteriom_sensor_package.hpp +0 -224
  158. package/examples/alteriomPhase1/phase1_features.ino +0 -242
  159. package/examples/alteriomPhase1/platformio.ini +0 -26
  160. package/examples/alteriomPhase2/alteriom_sensor_package.hpp +0 -224
  161. package/examples/alteriomPhase2/phase2_features.ino +0 -186
  162. package/examples/alteriomPhase2/platformio.ini +0 -26
  163. package/examples/alteriomSensorNode/alteriom_sensor_node.ino +0 -186
  164. package/examples/alteriomSensorNode/alteriom_sensor_package.hpp +0 -1227
  165. package/examples/alteriomSensorNode/platformio.ini +0 -26
  166. package/examples/bridge/alteriom_sensor_package.hpp +0 -1170
  167. package/examples/bridge/bridge_health_monitoring_example.ino +0 -188
  168. package/examples/bridge/enhanced_mqtt_bridge.hpp +0 -610
  169. package/examples/bridge/enhanced_mqtt_bridge_example.ino +0 -226
  170. package/examples/bridge/mesh_event_publisher.hpp +0 -253
  171. package/examples/bridge/mesh_topology_reporter.hpp +0 -303
  172. package/examples/bridge/mqtt_command_bridge.hpp +0 -459
  173. package/examples/bridge/mqtt_status_bridge.hpp +0 -519
  174. package/examples/bridgeAwareSensorNode/alteriom_sensor_package.hpp +0 -1227
  175. package/examples/bridgeAwareSensorNode/bridgeAwareSensorNode.ino +0 -342
  176. package/examples/bridgeAwareSensorNode/platformio.ini +0 -26
  177. package/examples/diagnosticsExample/diagnosticsExample.ino +0 -171
  178. package/examples/diagnosticsExample/platformio.ini +0 -26
  179. package/examples/echoNode/echoNode.ino +0 -33
  180. package/examples/echoNode/platformio.ini +0 -26
  181. package/examples/meshCommandNode/alteriom_sensor_package.hpp +0 -235
  182. package/examples/meshCommandNode/meshCommandNode.ino +0 -265
  183. package/examples/mqttCommandBridge/alteriom_sensor_package.hpp +0 -235
  184. package/examples/mqttCommandBridge/mesh_event_publisher.hpp +0 -253
  185. package/examples/mqttCommandBridge/mesh_topology_reporter.hpp +0 -303
  186. package/examples/mqttCommandBridge/mqttCommandBridge.ino +0 -254
  187. package/examples/mqttCommandBridge/mqtt_command_bridge.hpp +0 -462
  188. package/examples/mqttCommandBridge/platformio.ini +0 -27
  189. package/examples/mqttStatusBridge/mqttStatusBridge.ino +0 -218
  190. package/examples/mqttStatusBridge/mqtt_status_bridge.hpp +0 -522
  191. package/examples/mqttStatusBridge/platformio.ini +0 -27
  192. package/examples/mqttTopologyTest/README.md +0 -467
  193. package/examples/mqttTopologyTest/mqttTopologyTest.ino +0 -754
  194. package/examples/mqttTopologyTest/platformio.ini +0 -27
  195. package/examples/multi_bridge/README.md +0 -346
  196. package/examples/multi_bridge/primary_bridge.ino +0 -108
  197. package/examples/multi_bridge/regular_node.ino +0 -141
  198. package/examples/multi_bridge/secondary_bridge.ino +0 -123
  199. package/examples/ntpTimeSyncBridge/alteriom_sensor_package.hpp +0 -1383
  200. package/examples/ntpTimeSyncBridge/ntpTimeSyncBridge.ino +0 -86
  201. package/examples/ntpTimeSyncNode/alteriom_sensor_package.hpp +0 -1383
  202. package/examples/ntpTimeSyncNode/ntpTimeSyncNode.ino +0 -109
  203. package/examples/queued_alarms/README.md +0 -390
  204. package/examples/queued_alarms/queued_alarms.ino +0 -265
  205. package/examples/routing_demo/README.md +0 -172
  206. package/examples/routing_demo/routing_demo.ino +0 -102
  207. package/examples/rtcIntegration/README.md +0 -294
  208. package/examples/rtcIntegration/rtcIntegration.ino +0 -210
@@ -1,658 +0,0 @@
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)