@alteriom/painlessmesh 1.8.14 → 1.9.0

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 +89 -1
  3. package/CONTRIBUTING.md +79 -0
  4. package/README.md +70 -143
  5. package/docs/README.md +1 -0
  6. package/docs/api/shared-gateway.md +1207 -0
  7. package/docs/troubleshooting/common-issues.md +28 -0
  8. package/docs/troubleshooting/faq.md +113 -12
  9. package/examples/basic/test/simulator/CMakeLists.txt +40 -0
  10. package/examples/basic/test/simulator/README.md +149 -0
  11. package/examples/basic/test/simulator/firmware/basic_firmware.hpp +117 -0
  12. package/examples/basic/test/simulator/scenarios/basic_mesh_test.yaml +81 -0
  13. package/examples/bridge/bridge.ino +17 -4
  14. package/examples/bridge_failover/README.md +81 -0
  15. package/examples/bridge_failover/bridge_failover.ino +51 -6
  16. package/examples/sharedGateway/README.md +235 -0
  17. package/examples/{meshCommandNode → sharedGateway}/platformio.ini +3 -2
  18. package/examples/sharedGateway/sharedGateway.ino +303 -0
  19. package/library.json +3 -22
  20. package/library.properties +1 -1
  21. package/package.json +3 -3
  22. package/src/arduino/wifi.hpp +380 -13
  23. package/src/painlessmesh/gateway.hpp +2120 -0
  24. package/src/painlessmesh/mesh.hpp +1034 -6
  25. package/src/painlessmesh/message_tracker.hpp +311 -0
  26. package/src/painlessmesh/protocol.hpp +6 -0
  27. package/DOCUMENTATION_INDEX.md +0 -146
  28. package/docs/API_DESIGN_GUIDELINES.md +0 -414
  29. package/docs/ARDUINO_LIBRARY_MANAGER_SUBMISSION.md +0 -331
  30. package/docs/BOOLEAN_NAMING_CONVENTION.md +0 -235
  31. package/docs/BRIDGE_FAILOVER.md +0 -512
  32. package/docs/BRIDGE_HEALTH_MONITORING.md +0 -293
  33. package/docs/CHANNEL_SYNCHRONIZATION.md +0 -209
  34. package/docs/CREATE_MISSING_RELEASES.md +0 -321
  35. package/docs/DOCUMENTATION_MIGRATION_PLAN.md +0 -176
  36. package/docs/FAQ_VERSION_NUMBERS.md +0 -152
  37. package/docs/IMPLEMENTATION_PLAN_MESH_TOPOLOGY.md +0 -1062
  38. package/docs/MESH_TOPOLOGY_GUIDE.md +0 -992
  39. package/docs/MESH_TOPOLOGY_PROGRESS.md +0 -422
  40. package/docs/MQTT_BRIDGE_COMMANDS.md +0 -894
  41. package/docs/MQTT_BRIDGE_IMPLEMENTATION_SUMMARY.md +0 -324
  42. package/docs/MQTT_COMMAND_SCHEMA_PROPOSAL.md +0 -576
  43. package/docs/MQTT_SCHEMA_COMPLIANCE.md +0 -340
  44. package/docs/MQTT_SCHEMA_PROPOSALS.md +0 -446
  45. package/docs/MQTT_SCHEMA_REVIEW.md +0 -690
  46. package/docs/OTA_COMMANDS_REFERENCE.md +0 -554
  47. package/docs/PHASE1_GUIDE.md +0 -349
  48. package/docs/PHASE2_GUIDE.md +0 -543
  49. package/docs/QUICK_REFERENCE_VERSIONING.md +0 -127
  50. package/docs/RELEASE_AGENT_SUMMARY.md +0 -386
  51. package/docs/SCHEMA_VALIDATION_CHECKLIST.md +0 -222
  52. package/docs/VERSION_MANAGEMENT.md +0 -213
  53. package/docs/archive/DOCUSAURUS_DEPLOYMENT.md +0 -166
  54. package/docs/archive/FEATURE_PROPOSALS.md +0 -337
  55. package/docs/archive/LIBRARY_JSON_FIX.md +0 -98
  56. package/docs/archive/LIBRARY_STRUCTURE_FIX.md +0 -215
  57. package/docs/archive/PHASE1_IMPLEMENTATION.md +0 -325
  58. package/docs/archive/PHASE2_IMPLEMENTATION.md +0 -567
  59. package/docs/archive/RELEASE_SUMMARY.md +0 -173
  60. package/docs/archive/SCONS_BUILD_FIX.md +0 -313
  61. package/docs/archive/TRIGGER_RELEASE.md +0 -280
  62. package/docs/archive/VECTOR_INCLUDE_FIX.md +0 -129
  63. package/docs/archive/ota-and-status-enhancements.md +0 -911
  64. package/docs/archive/ota-status-architecture-diagrams.md +0 -658
  65. package/docs/archive/ota-status-quick-reference.md +0 -284
  66. package/docs/design/.gitkeep +0 -1
  67. package/docs/design/STATION_CREDENTIALS_DESIGN.md +0 -182
  68. package/docs/development/ARDUINO_COMPLIANCE_SUMMARY.md +0 -71
  69. package/docs/development/CODE_REFACTORING_RECOMMENDATIONS.md +0 -1011
  70. package/docs/development/DOCKER_TESTING.md +0 -196
  71. package/docs/development/PLATFORMIO_USAGE.md +0 -180
  72. package/docs/development/TESTING_SUMMARY.md +0 -126
  73. package/docs/development/contributing.md +0 -301
  74. package/docs/development/documentation.md +0 -583
  75. package/docs/features/DIAGNOSTICS_API.md +0 -534
  76. package/docs/implementation/BRIDGE_ARCHITECTURE_IMPLEMENTATION.md +0 -340
  77. package/docs/implementation/BRIDGE_HEALTH_MONITORING_IMPLEMENTATION.md +0 -213
  78. package/docs/implementation/BRIDGE_STATUS_FEATURE.md +0 -635
  79. package/docs/implementation/DIAGNOSTICS_API_IMPLEMENTATION.md +0 -232
  80. package/docs/implementation/IMPLEMENTATION_COMPLETE.md +0 -228
  81. package/docs/implementation/IMPLEMENTATION_NTP_TIME_SYNC.md +0 -325
  82. package/docs/implementation/IMPLEMENTATION_SUMMARY.md +0 -316
  83. package/docs/implementation/MESSAGE_QUEUE_IMPLEMENTATION.md +0 -405
  84. package/docs/implementation/MULTI_BRIDGE_IMPLEMENTATION.md +0 -520
  85. package/docs/implementation/NTP_TIME_SYNC_FEATURE.md +0 -392
  86. package/docs/improvements/FUTURE_PROPOSALS.md +0 -1016
  87. package/docs/improvements/IMPLEMENTATION_HISTORY.md +0 -1091
  88. package/docs/improvements/OTA_STATUS_ENHANCEMENTS.md +0 -709
  89. package/docs/improvements/README.md +0 -212
  90. package/docs/internal/CUSTOM_AGENT_ANALYSIS.md +0 -391
  91. package/docs/internal/ISSUE_65_VERIFICATION.md +0 -947
  92. package/docs/internal/ISSUE_66_CLOSURE.md +0 -249
  93. package/docs/internal/ISSUE_66_STATUS.md +0 -316
  94. package/docs/internal/PR_SUMMARY.md +0 -315
  95. package/docs/internal/REVIEW_SUMMARY.md +0 -332
  96. package/docs/multi-bridge-setup.md +0 -1025
  97. package/docs/platformio-publishing.md +0 -255
  98. package/docs/platformio-setup-summary.md +0 -121
  99. package/docs/releases/ANNOUNCEMENT_v1.8.6.md +0 -63
  100. package/docs/releases/ANNOUNCEMENT_v1.8.7.md +0 -113
  101. package/docs/releases/BRIDGE_STATUS_SELF_REGISTRATION_FIX.md +0 -221
  102. package/docs/releases/FEATURE_HISTORY.md +0 -543
  103. package/docs/releases/GITHUB_RELEASE_v1.8.6.md +0 -71
  104. package/docs/releases/GITHUB_RELEASE_v1.8.7.md +0 -90
  105. package/docs/releases/PATCH_v1.7.2.md +0 -262
  106. package/docs/releases/PATCH_v1.7.3.md +0 -262
  107. package/docs/releases/PATCH_v1.7.4.md +0 -219
  108. package/docs/releases/PHASE1_SUMMARY.md +0 -246
  109. package/docs/releases/PHASE2_SUMMARY.md +0 -499
  110. package/docs/releases/PUBLISH_v1.8.0_INSTRUCTIONS.md +0 -163
  111. package/docs/releases/QUICK_START_RELEASES.md +0 -113
  112. package/docs/releases/RELEASE_CHECKLIST_1.8.10.md +0 -331
  113. package/docs/releases/RELEASE_CHECKLIST_1.8.9.md +0 -207
  114. package/docs/releases/RELEASE_CHECKLIST_v1.7.4.md +0 -253
  115. package/docs/releases/RELEASE_CHECKLIST_v1.7.5.md +0 -315
  116. package/docs/releases/RELEASE_CHECKLIST_v1.7.6.md +0 -389
  117. package/docs/releases/RELEASE_CHECKLIST_v1.8.0.md +0 -331
  118. package/docs/releases/RELEASE_CHECKLIST_v1.8.2.md +0 -309
  119. package/docs/releases/RELEASE_NOTES_1.7.0.md +0 -539
  120. package/docs/releases/RELEASE_NOTES_1.8.10.md +0 -239
  121. package/docs/releases/RELEASE_NOTES_1.8.9.md +0 -213
  122. package/docs/releases/RELEASE_NOTES_v1.8.0.md +0 -685
  123. package/docs/releases/RELEASE_NOTES_v1.8.1.md +0 -221
  124. package/docs/releases/RELEASE_NOTES_v1.8.2.md +0 -421
  125. package/docs/releases/RELEASE_NOTES_v1.8.3.md +0 -292
  126. package/docs/releases/RELEASE_NOTES_v1.8.4.md +0 -277
  127. package/docs/releases/RELEASE_NOTES_v1.8.6.md +0 -205
  128. package/docs/releases/RELEASE_NOTES_v1.8.7.md +0 -184
  129. package/docs/releases/RELEASE_PLAN_v1.7.6.md +0 -816
  130. package/docs/releases/RELEASE_SUMMARY_1.8.10.md +0 -193
  131. package/docs/releases/RELEASE_SUMMARY_v1.7.4.md +0 -276
  132. package/docs/releases/RELEASE_SUMMARY_v1.7.5.md +0 -322
  133. package/docs/releases/RELEASE_SUMMARY_v1.7.6.md +0 -436
  134. package/docs/releases/RELEASE_SUMMARY_v1.7.7.md +0 -391
  135. package/docs/releases/RELEASE_SUMMARY_v1.7.8.md +0 -523
  136. package/docs/releases/RELEASE_SUMMARY_v1.7.9.md +0 -542
  137. package/docs/troubleshooting/ARDUINO_IDE_VERSION_FIX_SUMMARY.md +0 -229
  138. package/docs/troubleshooting/ARDUINO_LIBRARY_NAME_FIX.md +0 -197
  139. package/docs/troubleshooting/CRASH_QUICK_REF.md +0 -93
  140. package/docs/troubleshooting/ESP32_C6_COMPATIBILITY.md +0 -157
  141. package/docs/troubleshooting/FREERTOS_ASSERTION_FAILURE.md +0 -288
  142. package/docs/troubleshooting/FREERTOS_FIX_IMPLEMENTATION.md +0 -267
  143. package/docs/troubleshooting/NPM_PUBLISHING_ISSUE_SUMMARY.md +0 -110
  144. package/docs/troubleshooting/PAINLESSMESH_V1.7.4_COMPILATION_ISSUES.md +0 -547
  145. package/docs/troubleshooting/QUICK_FIX_FREERTOS.md +0 -164
  146. package/docs/troubleshooting/SENSOR_NODE_CONNECTION_CRASH.md +0 -264
  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 -96
  197. package/examples/multi_bridge/regular_node.ino +0 -141
  198. package/examples/multi_bridge/secondary_bridge.ino +0 -111
  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,685 +0,0 @@
1
- # painlessMesh v1.8.0 Release Notes
2
-
3
- **Release Date:** November 9, 2025
4
- **Version:** 1.8.0
5
- **Type:** Major Feature Release
6
- **Compatibility:** 100% backward compatible with v1.7.x
7
-
8
- ---
9
-
10
- ## 🎯 Executive Summary
11
-
12
- Version 1.8.0 is a major feature release that transforms painlessMesh into a production-ready solution for bridged mesh networks with comprehensive monitoring, diagnostics, and time synchronization capabilities. This release focuses on bridge operations, adding eight major features that enable robust Internet connectivity, real-time monitoring, automatic failover, and offline operation.
13
-
14
- ### Key Highlights
15
-
16
- ✨ **Bridge-Centric Architecture** - Zero-configuration bridge setup with automatic channel detection
17
- 📊 **Comprehensive Monitoring** - Real-time health metrics and diagnostics API
18
- 🕐 **Time Synchronization** - NTP distribution with RTC backup
19
- 🔍 **Diagnostics Tools** - Deep insights into bridge operations and network topology
20
- ⚡ **Production Ready** - All features tested, documented, and backward compatible
21
-
22
- ---
23
-
24
- ## 🚀 What's New
25
-
26
- ### 1. Bridge-Centric Architecture with Auto Channel Detection
27
-
28
- The most significant improvement to bridge setup, eliminating manual configuration entirely.
29
-
30
- **Before (v1.7.x):**
31
- ```cpp
32
- mesh.init(MESH_PREFIX, MESH_PASSWORD, &userScheduler, MESH_PORT, WIFI_AP_STA, 6);
33
- mesh.stationManual(ROUTER_SSID, ROUTER_PASSWORD);
34
- mesh.setRoot(true);
35
- mesh.setContainsRoot(true);
36
- ```
37
-
38
- **After (v1.8.0):**
39
- ```cpp
40
- mesh.initAsBridge(MESH_PREFIX, MESH_PASSWORD,
41
- ROUTER_SSID, ROUTER_PASSWORD,
42
- &userScheduler, MESH_PORT);
43
- ```
44
-
45
- **Features:**
46
- - ✅ Automatic WiFi channel detection from router
47
- - ✅ One-line bridge initialization
48
- - ✅ Graceful fallback on connection failure
49
- - ✅ Support for channel auto-detection on regular nodes (`channel=0`)
50
- - ✅ New `scanForMeshChannel()` helper function
51
- - ✅ Comprehensive logging and error handling
52
-
53
- **Benefits:**
54
- - No manual channel configuration required
55
- - Works with any router out of the box
56
- - Eliminates most common bridge setup errors
57
- - Reduces support burden significantly
58
-
59
- **PR:** #72 | **Docs:** `BRIDGE_ARCHITECTURE_IMPLEMENTATION.md`
60
-
61
- ---
62
-
63
- ### 2. Diagnostics API for Bridge Operations
64
-
65
- Comprehensive tools for monitoring, debugging, and analyzing bridge operations.
66
-
67
- **New API Methods:**
68
- ```cpp
69
- // Get current bridge status and role
70
- BridgeStatus status = mesh.getBridgeStatus();
71
-
72
- // Get election history (when diagnostics enabled)
73
- std::vector<ElectionEvent> history = mesh.getElectionHistory();
74
-
75
- // Get network topology with neighbor info
76
- std::vector<TopologyNode> topology = mesh.getNetworkTopology();
77
-
78
- // Test connectivity to specific node
79
- ConnectivityTestResult result = mesh.testConnectivity(nodeId);
80
-
81
- // Generate comprehensive diagnostic report
82
- String report = mesh.generateDiagnosticReport();
83
-
84
- // Enable/disable diagnostics tracking
85
- mesh.enableDiagnostics(true);
86
- ```
87
-
88
- **Data Structures:**
89
- - `BridgeStatus` - Current bridge state and role
90
- - `ElectionEvent` - Historical bridge election data
91
- - `TopologyNode` - Network topology information
92
- - `ConnectivityTestResult` - Connectivity validation
93
-
94
- **Use Cases:**
95
- - Real-time bridge monitoring
96
- - Troubleshooting connectivity issues
97
- - Network topology visualization
98
- - Performance analysis
99
- - Automated testing
100
-
101
- **PR:** #79 | **Docs:** `DIAGNOSTICS_API.md`
102
-
103
- ---
104
-
105
- ### 3. Bridge Health Monitoring & Metrics Collection
106
-
107
- Real-time performance metrics for production monitoring and integration with standard tools.
108
-
109
- **New API:**
110
- ```cpp
111
- // Get comprehensive health metrics
112
- BridgeHealthMetrics metrics = mesh.getBridgeHealthMetrics();
113
-
114
- // Export as JSON for MQTT/Prometheus/Grafana
115
- String json = mesh.getHealthMetricsJSON();
116
-
117
- // Periodic callback (every 60 seconds)
118
- mesh.onHealthMetricsUpdate(&metricsCallback, 60000);
119
-
120
- // Reset counters
121
- mesh.resetHealthMetrics();
122
- ```
123
-
124
- **Metrics Tracked:**
125
- - **Connectivity:** Uptime, Internet uptime, disconnect count
126
- - **Signal Quality:** Current/avg/min/max RSSI
127
- - **Traffic:** Bytes and messages sent/received/queued/dropped
128
- - **Performance:** Average latency, packet loss, node count
129
-
130
- **Integration Examples:**
131
- - MQTT publishing for cloud monitoring
132
- - Prometheus exporter for Grafana dashboards
133
- - CloudWatch metrics for AWS
134
- - Custom monitoring solutions
135
-
136
- **PR:** #78 | **Docs:** `docs/BRIDGE_HEALTH_MONITORING.md` | **Example:** `examples/bridge/bridge_health_monitoring_example.ino`
137
-
138
- ---
139
-
140
- ### 4. Automatic Bridge Failover with RSSI-Based Election
141
-
142
- Production-ready high-availability bridge management with automatic failover when primary bridge fails.
143
-
144
- **Architecture:**
145
- When the primary bridge loses Internet connectivity, mesh nodes automatically:
146
- 1. Detect bridge failure through missing heartbeats
147
- 2. Initiate distributed election protocol
148
- 3. Scan router signal strength (RSSI)
149
- 4. Elect node with best signal as new bridge
150
- 5. Winner promotes itself to bridge role
151
-
152
- **New API:**
153
- ```cpp
154
- // Enable automatic failover
155
- mesh.enableBridgeFailover(true);
156
- mesh.setRouterCredentials(ROUTER_SSID, ROUTER_PASSWORD);
157
-
158
- // Callback when this node's role changes
159
- mesh.onBridgeRoleChanged([](bool isBridge, String reason) {
160
- if (isBridge) {
161
- Serial.printf("🎯 Promoted to bridge: %s\n", reason.c_str());
162
- }
163
- });
164
- ```
165
-
166
- **Election Process:**
167
- 1. Nodes broadcast `BridgeElectionPackage` (Type 611) with RSSI
168
- 2. All nodes collect candidates for 5 seconds
169
- 3. Node with best RSSI wins (tiebreaker: uptime → memory → node ID)
170
- 4. Winner broadcasts `BridgeTakeoverPackage` (Type 612)
171
- 5. Winner promotes to bridge using `initAsBridge()`
172
-
173
- **Features:**
174
- - Distributed consensus (no single coordinator)
175
- - Optimal bridge selection (best signal strength)
176
- - Split-brain prevention
177
- - Oscillation protection (60s minimum between changes)
178
- - Handles multiple sequential failures
179
- - Critical for life-safety systems (fish farm O2 monitoring)
180
-
181
- **PR:** #64 (Issue #64) | **Message Types:** 611 (Election), 612 (Takeover)
182
-
183
- ---
184
-
185
- ### 5. Bridge Status Broadcast & Callback
186
-
187
- Real-time Internet connectivity monitoring for intelligent node behavior.
188
-
189
- **New Callback:**
190
- ```cpp
191
- mesh.onBridgeStatusChanged([](uint32_t bridgeNodeId, bool hasInternet) {
192
- if (hasInternet) {
193
- Serial.println("✓ Internet available - sending queued data");
194
- flushQueuedMessages();
195
- } else {
196
- Serial.println("⚠ Internet offline - queueing messages");
197
- enableOfflineMode();
198
- }
199
- });
200
- ```
201
-
202
- **New API Methods:**
203
- ```cpp
204
- // Check if any bridge has Internet
205
- bool hasInternet = mesh.hasInternetConnection();
206
-
207
- // Get primary (best) bridge
208
- BridgeInfo* primary = mesh.getPrimaryBridge();
209
-
210
- // Get all known bridges
211
- std::vector<BridgeInfo> bridges = mesh.getBridges();
212
-
213
- // Check if this node is a bridge
214
- bool isBridge = mesh.isBridge();
215
- ```
216
-
217
- **Status Information:**
218
- - Internet connectivity state
219
- - Router signal strength (RSSI)
220
- - WiFi channel
221
- - Bridge uptime
222
- - Gateway IP address
223
-
224
- **Use Cases:**
225
- - Message queueing during Internet outages
226
- - Bridge failover implementation
227
- - User feedback about connectivity
228
- - Intelligent routing decisions
229
-
230
- **PR:** #73 | **Docs:** `BRIDGE_STATUS_FEATURE.md`
231
-
232
- ---
233
-
234
- ### 6. NTP Time Synchronization (Type 614)
235
-
236
- Bridge-to-mesh NTP time distribution, eliminating the need for per-node NTP queries.
237
-
238
- **Architecture:**
239
- ```
240
- Internet → Bridge (NTP Client) → Mesh → All Nodes (Synchronized)
241
- ```
242
-
243
- **Features:**
244
- - Bridge nodes fetch NTP time and distribute to mesh
245
- - Eliminates per-node NTP queries (saves bandwidth and power)
246
- - Automatic fallback to mesh time if NTP unavailable
247
- - Accuracy field for time uncertainty tracking
248
- - RTC integration for offline operation
249
-
250
- **New Package Type:**
251
- ```cpp
252
- // Type 614: NTP_TIME_SYNC
253
- NTPTimeSyncPackage pkg;
254
- pkg.unixTimestamp = ntpTime;
255
- pkg.accuracyMs = 50; // ±50ms accuracy
256
- mesh.sendBroadcast(pkg.toJson());
257
- ```
258
-
259
- **Benefits:**
260
- - Centralized time management
261
- - Reduced Internet bandwidth usage
262
- - Power savings on battery nodes
263
- - Coordinated time-based operations
264
-
265
- **PR:** #77 | **Docs:** `NTP_TIME_SYNC_FEATURE.md` | **Examples:** `ntpTimeSyncBridge.ino`, `ntpTimeSyncNode.ino`
266
-
267
- ---
268
-
269
- ### 7. RTC (Real-Time Clock) Integration
270
-
271
- Hardware RTC support for time persistence across reboots and offline operation.
272
-
273
- **Supported Modules:**
274
- - DS3231 (high precision, temperature compensated)
275
- - DS1307 (basic RTC)
276
- - PCF8523 (low power)
277
-
278
- **Features:**
279
- - Automatic time persistence across power failures
280
- - Seamless integration with NTP time sync
281
- - RTC updates from NTP when available
282
- - Fallback to RTC when offline
283
- - Comprehensive unit tests
284
-
285
- **Use Cases:**
286
- - Offline time tracking
287
- - Time-critical operations without Internet
288
- - Data timestamping during outages
289
- - Scheduled tasks without network
290
-
291
- **PR:** #76 | **Tests:** `test/catch/catch_rtc.cpp`
292
-
293
- ---
294
-
295
- ### 8. Enhanced Documentation & Examples
296
-
297
- **New Documentation Files:**
298
- - `DIAGNOSTICS_API.md` - Comprehensive diagnostics guide
299
- - `BRIDGE_ARCHITECTURE_IMPLEMENTATION.md` - Technical bridge details
300
- - `BRIDGE_STATUS_FEATURE.md` - Status broadcast documentation
301
- - `BRIDGE_HEALTH_MONITORING.md` - Metrics collection guide
302
- - `NTP_TIME_SYNC_FEATURE.md` - NTP implementation details
303
- - `BRIDGE_TO_INTERNET.md` - Updated bridge setup guide
304
-
305
- **New Examples:**
306
- - `examples/diagnostics/` - Diagnostics API usage
307
- - `examples/bridge/bridge_health_monitoring_example.ino` - Metrics collection
308
- - `ntpTimeSyncBridge.ino` - NTP distribution from bridge
309
- - `ntpTimeSyncNode.ino` - NTP reception on nodes
310
-
311
- **Updated Examples:**
312
- - `examples/bridge/bridge.ino` - Uses new `initAsBridge()` API
313
- - `examples/basic/basic.ino` - Demonstrates auto channel detection
314
-
315
- ---
316
-
317
- ## 📊 Technical Statistics
318
-
319
- ### Code Delivered
320
-
321
- - **New Files:** 15+ files
322
- - **Modified Files:** 20+ files
323
- - **Lines Added:** 5,000+ lines of production code
324
- - **Test Assertions:** 1,500+ (including 300+ new tests)
325
- - **Documentation:** 50+ pages
326
-
327
- ### Test Coverage
328
-
329
- ✅ All existing tests passing (1,200+ assertions)
330
- ✅ 300+ new test assertions for new features
331
- ✅ Zero compilation warnings
332
- ✅ Zero security vulnerabilities
333
- ✅ ESP32 and ESP8266 compatibility verified
334
-
335
- ### Performance Characteristics
336
-
337
- - **Memory Overhead:** <5KB for all new features
338
- - **CPU Overhead:** <2% additional usage
339
- - **Network Bandwidth:** ~150 bytes/sec for full feature set (10 nodes)
340
- - **Latency Impact:** Negligible (<1ms)
341
-
342
- ---
343
-
344
- ## 🔄 Migration Guide
345
-
346
- ### From v1.7.x to v1.8.0
347
-
348
- **No breaking changes!** Version 1.8.0 is 100% backward compatible.
349
-
350
- ### Adopting New Features (Optional)
351
-
352
- #### 1. Upgrade Bridge Nodes
353
-
354
- **Simple (recommended):**
355
- ```cpp
356
- // Replace old initialization code with:
357
- mesh.initAsBridge(MESH_PREFIX, MESH_PASSWORD,
358
- ROUTER_SSID, ROUTER_PASSWORD,
359
- &userScheduler, MESH_PORT);
360
- ```
361
-
362
- **Advanced (with monitoring):**
363
- ```cpp
364
- mesh.initAsBridge(MESH_PREFIX, MESH_PASSWORD,
365
- ROUTER_SSID, ROUTER_PASSWORD,
366
- &userScheduler, MESH_PORT);
367
-
368
- // Enable health monitoring
369
- mesh.onHealthMetricsUpdate([](BridgeHealthMetrics metrics) {
370
- String json = mesh.getHealthMetricsJSON();
371
- mqttClient.publish("bridge/metrics", json.c_str());
372
- }, 60000);
373
-
374
- // Enable diagnostics
375
- mesh.enableDiagnostics(true);
376
- ```
377
-
378
- #### 2. Add Bridge Status Monitoring to Nodes
379
-
380
- ```cpp
381
- mesh.onBridgeStatusChanged([](uint32_t bridgeNodeId, bool hasInternet) {
382
- if (hasInternet) {
383
- flushQueuedMessages();
384
- } else {
385
- enableOfflineMode();
386
- }
387
- });
388
- ```
389
-
390
- #### 3. Enable Auto Channel Detection
391
-
392
- ```cpp
393
- // For regular nodes, use channel=0 for auto-detection
394
- mesh.init(MESH_PREFIX, MESH_PASSWORD, &userScheduler, MESH_PORT, WIFI_AP_STA, 0);
395
- ```
396
-
397
- #### 4. Add NTP Time Sync
398
-
399
- **Bridge:**
400
- ```cpp
401
- #include <NTPClient.h>
402
- WiFiUDP ntpUDP;
403
- NTPClient timeClient(ntpUDP);
404
-
405
- // In setup()
406
- timeClient.begin();
407
-
408
- // In loop()
409
- timeClient.update();
410
- NTPTimeSyncPackage pkg;
411
- pkg.unixTimestamp = timeClient.getEpochTime();
412
- mesh.sendBroadcast(pkg.toJson());
413
- ```
414
-
415
- **Node:**
416
- ```cpp
417
- mesh.onReceive([](uint32_t from, String& msg) {
418
- // Parse NTP time and sync local clock
419
- // See examples for complete implementation
420
- });
421
- ```
422
-
423
- ---
424
-
425
- ## 🎯 Use Cases Enabled
426
-
427
- ### Production IoT Deployments
428
-
429
- - **Enterprise Networks:** Robust bridge connectivity with failover
430
- - **Industrial IoT:** Real-time monitoring and diagnostics
431
- - **Smart Buildings:** Time-synchronized operations
432
- - **Environmental Monitoring:** Reliable data collection with offline support
433
-
434
- ### Commercial Applications
435
-
436
- - **Professional Monitoring:** Integration with Grafana, Prometheus, CloudWatch
437
- - **SLA Compliance:** Detailed uptime and performance metrics
438
- - **Predictive Maintenance:** Early problem detection
439
- - **Automated Alerting:** Critical event notifications
440
-
441
- ### Development & Testing
442
-
443
- - **Troubleshooting:** Comprehensive diagnostic tools
444
- - **Performance Analysis:** Real-time metrics collection
445
- - **Network Visualization:** Topology mapping
446
- - **Quality Assurance:** Connectivity testing
447
-
448
- ---
449
-
450
- ## 🔧 Configuration Examples
451
-
452
- ### Complete Bridge Setup
453
-
454
- ```cpp
455
- #include "painlessMesh.h"
456
- #include <NTPClient.h>
457
-
458
- #define MESH_PREFIX "MyMesh"
459
- #define MESH_PASSWORD "meshpass"
460
- #define ROUTER_SSID "MyRouter"
461
- #define ROUTER_PASSWORD "routerpass"
462
- #define MESH_PORT 5555
463
-
464
- painlessMesh mesh;
465
- WiFiUDP ntpUDP;
466
- NTPClient timeClient(ntpUDP);
467
-
468
- void setup() {
469
- Serial.begin(115200);
470
-
471
- // Initialize as bridge with auto channel detection
472
- mesh.initAsBridge(MESH_PREFIX, MESH_PASSWORD,
473
- ROUTER_SSID, ROUTER_PASSWORD,
474
- &userScheduler, MESH_PORT);
475
-
476
- // Enable diagnostics
477
- mesh.enableDiagnostics(true);
478
-
479
- // Health metrics callback (every 60 seconds)
480
- mesh.onHealthMetricsUpdate([](BridgeHealthMetrics metrics) {
481
- Serial.printf("Uptime: %us, Nodes: %u, RSSI: %d dBm\n",
482
- metrics.uptimeSeconds,
483
- metrics.meshNodeCount,
484
- metrics.currentRSSI);
485
- }, 60000);
486
-
487
- // Start NTP client
488
- timeClient.begin();
489
-
490
- Serial.println("Bridge node initialized");
491
- }
492
-
493
- void loop() {
494
- mesh.update();
495
- timeClient.update();
496
-
497
- // Distribute NTP time every 10 seconds
498
- static unsigned long lastNTP = 0;
499
- if (millis() - lastNTP > 10000) {
500
- lastNTP = millis();
501
- NTPTimeSyncPackage pkg;
502
- pkg.unixTimestamp = timeClient.getEpochTime();
503
- pkg.accuracyMs = 50;
504
- mesh.sendBroadcast(pkg.toJson());
505
- }
506
- }
507
- ```
508
-
509
- ### Complete Regular Node Setup
510
-
511
- ```cpp
512
- #include "painlessMesh.h"
513
-
514
- #define MESH_PREFIX "MyMesh"
515
- #define MESH_PASSWORD "meshpass"
516
- #define MESH_PORT 5555
517
-
518
- painlessMesh mesh;
519
- bool offlineMode = false;
520
-
521
- void setup() {
522
- Serial.begin(115200);
523
-
524
- // Initialize with auto channel detection
525
- mesh.init(MESH_PREFIX, MESH_PASSWORD, &userScheduler, MESH_PORT, WIFI_AP_STA, 0);
526
-
527
- // Bridge status callback
528
- mesh.onBridgeStatusChanged([](uint32_t bridgeNodeId, bool hasInternet) {
529
- offlineMode = !hasInternet;
530
- if (hasInternet) {
531
- Serial.println("✓ Internet available");
532
- } else {
533
- Serial.println("⚠ Internet offline");
534
- }
535
- });
536
-
537
- // Message receiver
538
- mesh.onReceive(&receivedCallback);
539
-
540
- Serial.println("Regular node initialized");
541
- }
542
-
543
- void loop() {
544
- mesh.update();
545
-
546
- // Your application logic here
547
- }
548
-
549
- void receivedCallback(uint32_t from, String& msg) {
550
- // Handle NTP time sync and other messages
551
- }
552
- ```
553
-
554
- ---
555
-
556
- ## ⚠️ Known Limitations
557
-
558
- 1. **Single Bridge Support** - Current architecture assumes one bridge node (multi-bridge in v1.8.1)
559
- 2. **2.4GHz Only** - Channels 1-13, no 5GHz support (hardware limitation)
560
- 3. **Blocking Bridge Init** - Bridge initialization blocks for up to 30s during router connection
561
- 4. **No Dynamic Channel Switching** - Requires restart if router changes channel
562
-
563
- ---
564
-
565
- ## 🔮 Future Roadmap (v1.8.1)
566
-
567
- Planned features for next release:
568
-
569
- - **Message Queuing (#66)** - Automatic message queuing during Internet outages
570
- - **Multi-Bridge Coordination (#65)** - Load balancing across multiple bridges
571
- - **Automatic Bridge Failover (#64)** - RSSI-based election when primary fails
572
- - **Enhanced Diagnostics** - Machine learning-based failure prediction
573
- - **Cloud Integration** - Native AWS IoT and Azure IoT Hub support
574
-
575
- ---
576
-
577
- ## 📋 Upgrade Checklist
578
-
579
- ### For Bridge Nodes
580
-
581
- - [ ] Update to v1.8.0
582
- - [ ] Replace old initialization with `initAsBridge()`
583
- - [ ] Enable health metrics (optional)
584
- - [ ] Enable diagnostics (optional)
585
- - [ ] Add NTP time distribution (optional)
586
- - [ ] Test bridge connectivity
587
- - [ ] Monitor metrics in production
588
-
589
- ### For Regular Nodes
590
-
591
- - [ ] Update to v1.8.0
592
- - [ ] Enable auto channel detection (`channel=0`)
593
- - [ ] Add bridge status callback (optional)
594
- - [ ] Add NTP time sync receiver (optional)
595
- - [ ] Test connectivity
596
- - [ ] Verify time synchronization
597
-
598
- ### For Monitoring Infrastructure
599
-
600
- - [ ] Subscribe to health metrics topics
601
- - [ ] Configure Grafana/Prometheus dashboards
602
- - [ ] Set up alerting rules
603
- - [ ] Test end-to-end monitoring
604
- - [ ] Document alert procedures
605
-
606
- ---
607
-
608
- ## 🐛 Bug Fixes
609
-
610
- This release also includes several important bug fixes from v1.7.9:
611
-
612
- - Fixed submodule initialization in CI/CD pipeline
613
- - Fixed compilation errors in alteriomMetricsHealth example
614
- - Fixed workflow triggers and concurrency issues
615
- - Updated deprecated ArduinoJson API usage
616
- - Improved PlatformIO test reliability
617
-
618
- ---
619
-
620
- ## 📚 Resources
621
-
622
- ### Documentation
623
-
624
- - **Release Notes:** `RELEASE_NOTES_v1.8.0.md` (this file)
625
- - **Changelog:** `CHANGELOG.md`
626
- - **API Reference:** See individual feature docs
627
- - **Examples:** `examples/` directory
628
- - **Website:** https://alteriom.github.io/painlessMesh/
629
-
630
- ### Support
631
-
632
- - **GitHub Issues:** https://github.com/Alteriom/painlessMesh/issues
633
- - **Discussions:** https://github.com/Alteriom/painlessMesh/discussions
634
- - **Examples:** Complete working examples included
635
-
636
- ### Getting Help
637
-
638
- 1. Check documentation and examples
639
- 2. Search existing issues
640
- 3. Test with provided examples
641
- 4. Report issues with logs and configuration
642
-
643
- ---
644
-
645
- ## 🎉 Credits
646
-
647
- **Contributors:**
648
- - Alteriom Team - Feature design and implementation
649
- - GitHub Copilot - Development assistance
650
- - painlessMesh Community - Testing and feedback
651
- - @woodlist - Feature requests and real-world use cases
652
-
653
- **Special Thanks:**
654
- - Original painlessMesh authors and maintainers
655
- - ArduinoJson and TaskScheduler libraries
656
- - ESP32/ESP8266 communities
657
-
658
- ---
659
-
660
- ## 📄 License
661
-
662
- LGPL-3.0 - Same as painlessMesh
663
-
664
- ---
665
-
666
- **Ready to Upgrade?** Follow the migration guide above to get started with v1.8.0 today!
667
-
668
- **Questions?** Open an issue on GitHub or join our discussions.
669
-
670
- ---
671
-
672
- ## Quick Links
673
-
674
- - 📦 [Download v1.8.0](https://github.com/Alteriom/painlessMesh/releases/tag/v1.8.0)
675
- - 📖 [Full Documentation](https://alteriom.github.io/painlessMesh/)
676
- - 🐛 [Report Issues](https://github.com/Alteriom/painlessMesh/issues)
677
- - 💬 [Community Discussions](https://github.com/Alteriom/painlessMesh/discussions)
678
- - 🔧 [Examples Directory](examples/)
679
-
680
- ---
681
-
682
- **Version:** 1.8.0
683
- **Release Date:** November 9, 2025
684
- **Build Status:** ✅ All tests passing
685
- **Compatibility:** 100% backward compatible with v1.7.x