@alteriom/painlessmesh 1.7.7 → 1.7.9

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 (40) hide show
  1. package/CHANGELOG.md +115 -1
  2. package/README.md +21 -11
  3. package/RELEASE_GUIDE.md +57 -8
  4. package/docs/API_DESIGN_GUIDELINES.md +414 -0
  5. package/docs/BOOLEAN_NAMING_CONVENTION.md +235 -0
  6. package/docs/README.md +2 -1
  7. package/docs/RELEASE_AGENT_SUMMARY.md +386 -0
  8. package/docs/alteriom/overview.md +23 -0
  9. package/docs/releases/RELEASE_SUMMARY_v1.7.7.md +1 -1
  10. package/docs/troubleshooting/ESP32_C6_COMPATIBILITY.md +157 -0
  11. package/docs/troubleshooting/common-issues.md +28 -0
  12. package/docs/v1.7.7_MQTT_IMPROVEMENTS.md +21 -3
  13. package/examples/alteriom/README.md +13 -1
  14. package/examples/alteriom/alteriom_sensor_package.hpp +377 -3
  15. package/examples/alteriom/platformio.ini +1 -1
  16. package/examples/alteriomImproved/platformio.ini +1 -1
  17. package/examples/alteriomMetricsHealth/metrics_health_node.ino +18 -7
  18. package/examples/alteriomMetricsHealth/platformio.ini +1 -1
  19. package/examples/alteriomPhase1/platformio.ini +1 -1
  20. package/examples/alteriomPhase2/platformio.ini +1 -1
  21. package/examples/alteriomSensorNode/platformio.ini +1 -1
  22. package/examples/basic/platformio.ini +1 -1
  23. package/examples/bridge/alteriom_sensor_package.hpp +1170 -0
  24. package/examples/bridge/bridge.ino +2 -2
  25. package/examples/bridge/enhanced_mqtt_bridge.hpp +1 -1
  26. package/examples/bridge/mqtt_command_bridge.hpp +2 -2
  27. package/examples/bridge/platformio.ini +2 -1
  28. package/examples/echoNode/platformio.ini +1 -1
  29. package/examples/logClient/platformio.ini +1 -1
  30. package/examples/logServer/platformio.ini +1 -1
  31. package/examples/mqttStatusBridge/platformio.ini +1 -1
  32. package/examples/namedMesh/platformio.ini +1 -1
  33. package/examples/otaReceiver/platformio.ini +1 -1
  34. package/examples/startHere/platformio.ini +1 -1
  35. package/examples/webServer/platformio.ini +1 -1
  36. package/library.json +93 -53
  37. package/library.properties +1 -1
  38. package/package.json +2 -2
  39. package/src/arduino/wifi.hpp +9 -0
  40. package/src/painlessMeshSTA.cpp +5 -0
package/CHANGELOG.md CHANGED
@@ -19,7 +19,121 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
19
19
 
20
20
  - TBD
21
21
 
22
- ## [1.7.7] - 2025-10-23
22
+ ## [1.7.9] - 2025-11-08
23
+
24
+ ### Fixed
25
+
26
+ - **CI/CD Pipeline** - Fixed submodule initialization failures and PlatformIO test configuration in GitHub Actions workflows
27
+ - Added explicit `submodules: recursive` to checkout action in CI workflow
28
+ - Added manual `git submodule update --init --recursive` step for robustness
29
+ - Ensures test dependencies (ArduinoJson and TaskScheduler) are properly initialized
30
+ - Fixes build failures where submodules were not available during CI runs
31
+ - Removed redundant matrix strategy from PlatformIO build test (script builds both platforms anyway)
32
+ - Changed PlatformIO tests from random to deterministic (tests critical examples: basic, alteriomSensorNode, alteriomMetricsHealth)
33
+ - Improved concurrency grouping to properly handle PR branch names and prevent premature cancellations
34
+ - Affects all workflows: ci.yml, release.yml, docs.yml
35
+
36
+ - **Workflow Triggers** - Fixed duplicate CI runs and cancellation issues on PR branches
37
+ - Removed unnecessary `copilot/**` pattern from validate-release workflow branches filter
38
+ - Added explicit branch check in validate-release job condition to only run on main/develop
39
+ - Prevents validate-release workflow from running on PR branches
40
+ - Fixed concurrency grouping to use `github.head_ref` for PRs (branch name) instead of `github.ref` (commit SHA)
41
+ - Ensures proper workflow cancellation behavior and prevents confusion from cancelled runs
42
+
43
+ - **Example Code** - Fixed compilation errors in alteriomMetricsHealth example
44
+ - Removed incorrect `userScheduler.size()` call (TaskScheduler API doesn't expose queue size)
45
+ - Replaced non-existent `toJsonString()` methods with proper JSON serialization pattern
46
+ - Updated deprecated `DynamicJsonDocument` to `JsonDocument` for ArduinoJson v7 compatibility
47
+ - Changed `msgType` from `uint8_t` to `uint16_t` to support message types > 255 (400, 604, 605)
48
+
49
+ ### Technical Details
50
+
51
+ - GitHub Actions now properly initializes git submodules before build steps
52
+ - Both automated checkout with `submodules: recursive` and manual initialization step included
53
+ - Prevents "No such file or directory" errors for test/ArduinoJson and test/TaskScheduler
54
+ - Critical fix for maintaining CI/CD reliability across all build and test workflows
55
+ - Example code now uses proper serialization: `JsonDocument doc; JsonObject obj = doc.to<JsonObject>(); package.addTo(std::move(obj)); serializeJson(doc, msg);`
56
+
57
+ ## [1.7.8] - 2025-11-05
58
+
59
+ ### Added
60
+
61
+ - **MQTT Schema v0.7.3 Compliance** - Upgraded from v0.7.2 to v0.7.3
62
+ - Added `message_type` field to SensorPackage (Type 200)
63
+ - Added `message_type` field to StatusPackage (Type 202)
64
+ - Added `message_type` field to CommandPackage (Type 400)
65
+ - All packages now have `message_type` for 90% faster message classification
66
+ - Full alignment with @alteriom/mqtt-schema v0.7.3 specification
67
+
68
+ ### Added
69
+
70
+ - **BRIDGE_TO_INTERNET.md** - Comprehensive documentation for bridging mesh networks to the Internet via WiFi router
71
+ - Complete code examples with AP+STA mode configuration
72
+ - WiFi channel matching requirements and best practices
73
+ - Links to working bridge examples (basic, MQTT, web server, enhanced MQTT)
74
+ - Architecture diagrams and forwarding patterns
75
+ - Troubleshooting and additional resources
76
+
77
+ - **Enhanced StatusPackage** - New organization and sensor configuration fields
78
+ - Organization fields: `organizationId`, `organizationName`, `organizationDomain`
79
+ - Sensor configuration: `sensorTypes` array, `sensorConfig` JSON, `sensorInventory` array
80
+ - Separate JSON serialization keys for sensors data vs configuration
81
+ - CamelCase field naming convention for consistency
82
+
83
+ - **API Design Guidelines** - `docs/API_DESIGN_GUIDELINES.md`
84
+ - Field naming conventions (camelCase, units in field names)
85
+ - Boolean naming patterns (`is`, `has`, `should`, `can`)
86
+ - Time field naming with units (`_ms`, `_s`, `_us` suffixes)
87
+ - Serialization patterns and consistency rules
88
+ - Comprehensive validation tests
89
+
90
+ - **Manual Publishing Workflow** - `.github/workflows/manual-publish.yml`
91
+ - On-demand NPM and GitHub Packages publishing
92
+ - Fixes cases where automated release doesn't trigger package publication
93
+ - Configurable options for selective publishing
94
+
95
+ ### Changed
96
+
97
+ - **Time Field Naming Convention** - Consistent unit suffixes across all packages
98
+ - `collectionTimestamp` → `collectionTimestamp_ms`
99
+ - `avgResponseTime` → `avgResponseTime_us`
100
+ - `estimatedTimeToFailure` → `estimatedTimeToFailure_s`
101
+ - All time fields now include explicit units in field names
102
+ - Documentation: `docs/architecture/TIME_FIELD_NAMING.md`
103
+
104
+ - **StatusPackage JSON Structure** - Improved field organization
105
+ - Sensor data uses `sensors` key (array of readings)
106
+ - Sensor configuration uses separate keys (`sensorTypes`, `sensorConfig`, `sensorInventory`)
107
+ - No key collisions between runtime data and configuration
108
+ - Unconditional serialization for predictable JSON structure
109
+
110
+ - **MQTT Retry Logic** - Fixed serialization to include all retry fields
111
+ - Proper condition for including retry configuration
112
+ - Epsilon comparison for floating-point backoff multiplier
113
+
114
+ ### Fixed
115
+
116
+ - **CI Pipeline** - Made validate-release depend on CI completion
117
+ - Prevents release validation from running before tests complete
118
+ - Ensures all tests pass before release can proceed
119
+
120
+ - **ArduinoJson API** - Updated deprecated API usage
121
+ - Fixed deprecated JsonVariant::is<JsonObject>() calls
122
+ - Updated to ArduinoJson 7.x compatible patterns
123
+ - Code formatting improvements
124
+
125
+ - **ESP8266 Compatibility** - Fixed `getDeviceId()` function
126
+ - Added proper ESP8266 implementation in mqttTopologyTest
127
+ - Platform-specific device ID retrieval
128
+
129
+ - **Documentation** - Multiple improvements
130
+ - Fixed v1.7.7 release date in documentation
131
+ - Added comprehensive mqtt-schema v0.7.2+ message type codes table
132
+ - Corrected CommandPackage type number (400, not 201)
133
+ - Enhanced Alteriom Extensions section in README
134
+ - Added GitHub Packages authentication for npm install
135
+
136
+ ## [1.7.7] - 2025-11-05
23
137
 
24
138
  ### Added
25
139
 
package/README.md CHANGED
@@ -134,7 +134,7 @@ The MQTT bridge enables bidirectional communication between MQTT brokers and mes
134
134
  **Examples:**
135
135
 
136
136
  - 🌉 [MQTT Command Bridge](examples/mqttCommandBridge/mqttCommandBridge.ino) - Gateway bridge with bidirectional MQTT-mesh routing
137
- - 📡 [Mesh Command Node](examples/alteriom/mesh_command_node.ino) - Node that receives and handles MQTT commands
137
+ - 📡 [Alteriom Sensor Node](examples/alteriom/alteriom.ino) - Example node using SensorPackage, CommandPackage, and StatusPackage
138
138
 
139
139
  ### 🌐 Core Features
140
140
 
@@ -187,10 +187,12 @@ painlessMesh makes use of the following libraries, which can be installed throug
187
187
  - [ArduinoJson](https://github.com/bblanchon/ArduinoJson)
188
188
  - [TaskScheduler](https://github.com/arkhipenko/TaskScheduler)
189
189
  - [ESPAsyncTCP](https://github.com/me-no-dev/ESPAsyncTCP) (ESP8266)
190
- - [AsyncTCP](https://github.com/me-no-dev/AsyncTCP) (ESP32)
190
+ - [AsyncTCP](https://github.com/ESP32Async/AsyncTCP) (ESP32) - v3.3.0+ required for ESP32-C6
191
191
 
192
192
  If platformio is used to install the library, then the dependencies will be installed automatically.
193
193
 
194
+ > **⚠️ ESP32-C6 Users:** If you experience crashes with `tcp_alloc` errors, you need AsyncTCP v3.3.0+ with LWIP locking support. Use the [ESP32Async/AsyncTCP](https://github.com/ESP32Async/AsyncTCP) library or see the [ESP32-C6 Compatibility Guide](docs/troubleshooting/ESP32_C6_COMPATIBILITY.md) for details.
195
+
194
196
  ## Quick Start with Alteriom Packages
195
197
 
196
198
  ### Basic Sensor Node
@@ -245,9 +247,9 @@ void receivedCallback(uint32_t from, String& msg) {
245
247
  | Type | Class | Purpose | Fields |
246
248
  |------|-------|---------|--------|
247
249
  | 200 | `SensorPackage` | Environmental data | `temperature`, `humidity`, `pressure`, `sensorId`, `timestamp`, `batteryLevel` |
248
- | 201 | `CommandPackage` | Device control | `command`, `targetDevice`, `parameters`, `commandId` |
249
250
  | 202 | `StatusPackage` | Health monitoring | `deviceStatus`, `uptime`, `freeMemory`, `wifiStrength`, `firmwareVersion` |
250
251
  | 204 | `MetricsPackage` | Sensor metrics (v1.7.7+, aligns with schema v0.7.2+) | `cpuUsage`, `freeHeap`, `bytesReceived`, `currentThroughput`, `connectionQuality`, `wifiRSSI` |
252
+ | 400 | `CommandPackage` | Device control (v1.7.7+, moved from 201) | `command`, `targetDevice`, `parameters`, `commandId` |
251
253
  | 600 | `MeshNodeListPackage` | Mesh node list (v1.7.7+, MESH_NODE_LIST) | `nodes[]` (nodeId, status, lastSeen, signalStrength), `nodeCount`, `meshId` |
252
254
  | 601 | `MeshTopologyPackage` | Mesh topology (v1.7.7+, MESH_TOPOLOGY) | `connections[]` (fromNode, toNode, linkQuality, latencyMs), `rootNode` |
253
255
  | 602 | `MeshAlertPackage` | Mesh alerts (v1.7.7+, MESH_ALERT) | `alerts[]` (alertType, severity, message, nodeId), `alertCount` |
@@ -280,18 +282,25 @@ void receivedCallback(uint32_t from, String& msg) {
280
282
  - **Home Automation** - Distributed lighting, HVAC control
281
283
  - **Industrial Monitoring** - Equipment status, predictive maintenance
282
284
  - **Event Coordination** - Synchronized displays, distributed processing
283
- - **Bridge Networks** - Connect mesh to WiFi/Internet/MQTT
285
+ - **Bridge Networks** - Connect mesh to WiFi/Internet/MQTT - [📖 Bridge Guide](BRIDGE_TO_INTERNET.md)
286
+
287
+ ## Development Version: v1.7.8
288
+
289
+ **In Development** - Next release after v1.7.7
290
+
291
+ See [CHANGELOG](CHANGELOG.md) for upcoming changes.
284
292
 
285
- ## Latest Release: v1.7.6 (October 19, 2025)
293
+ ## Latest Release: v1.7.7 (November 5, 2025)
286
294
 
287
- **Critical emergency fix** for compilation failures in v1.7.4 and v1.7.5:
295
+ **MQTT Schema v0.7.2 Compliance with Enhanced Monitoring**:
288
296
 
289
- - ✅ **Compilation Fixed** - Resolved "_task_request_t was not declared" error
290
- - ✅ **ESP32 & ESP8266** - All platforms now compile successfully
291
- - ✅ **FreeRTOS Stability** - Maintained ~85% crash reduction on ESP32
292
- - 🚨 **v1.7.4/v1.7.5 Users** - Upgrade immediately (those versions don't compile)
297
+ - ✅ **MetricsPackage (Type 204)** - Comprehensive performance metrics for real-time monitoring
298
+ - ✅ **HealthCheckPackage (Type 605)** - Proactive health monitoring with problem detection
299
+ - ✅ **Mesh Topology Packages** - Complete network visualization (Types 600-603)
300
+ - **Enhanced MQTT Bridge** - On-demand metrics, health checks, and aggregated statistics
301
+ - ✅ **100% Backward Compatible** - All existing code continues to work
293
302
 
294
- **[📋 Full Release Notes](docs/releases/RELEASE_SUMMARY_v1.7.6.md)** | **[🔖 CHANGELOG](CHANGELOG.md)**
303
+ **[📋 Full Release Notes](docs/releases/RELEASE_SUMMARY_v1.7.7.md)** | **[🔖 CHANGELOG](CHANGELOG.md)**
295
304
 
296
305
  ## Getting Help
297
306
 
@@ -405,6 +414,7 @@ You can tip me using ko-fi:
405
414
  | Topic | Description | Link |
406
415
  |-------|-------------|------|
407
416
  | **🌳 Architecture** | How painlessMesh works internally | [📖 Architecture](https://alteriom.github.io/painlessMesh/#/architecture/mesh-architecture) |
417
+ | **🌉 Bridge to Internet** | Connect mesh to WiFi/Internet/MQTT | [📖 Bridge Guide](BRIDGE_TO_INTERNET.md) |
408
418
  | **🔌 Plugin System** | Create custom message packages | [📖 Plugins](https://alteriom.github.io/painlessMesh/#/architecture/plugin-system) |
409
419
  | **🎓 Tutorials** | Step-by-step examples and patterns | [📖 Tutorials](https://alteriom.github.io/painlessMesh/#/tutorials/basic-examples) |
410
420
  | **🛠️ Troubleshooting** | Common issues and solutions | [📖 Help](https://alteriom.github.io/painlessMesh/#/troubleshooting/common-issues) |
package/RELEASE_GUIDE.md CHANGED
@@ -13,9 +13,12 @@ This document provides comprehensive instructions for releasing new versions of
13
13
  # 2. Update CHANGELOG.md with your changes
14
14
  # Add your changes under the new version section
15
15
 
16
- # 3. Commit and trigger release
16
+ # 3. Run the Release Agent to validate readiness
17
+ ./scripts/release-agent.sh
18
+
19
+ # 4. If all checks pass, commit and trigger release
17
20
  git add library.properties library.json package.json CHANGELOG.md
18
- git commit -m "release: v1.6.1"
21
+ git commit -m "release: v1.7.9 - Brief description"
19
22
  git push origin main
20
23
  ```
21
24
 
@@ -76,7 +79,7 @@ version=1.6.1
76
79
 
77
80
  The release workflow triggers on commits to `main` that:
78
81
  1. Modify `library.properties`, `library.json`, `package.json`, or `CHANGELOG.md`
79
- 2. Have a commit message starting with `release:`
82
+ 2. Have version files modified OR commit message starting with `release:`
80
83
 
81
84
  ### What Gets Automated
82
85
 
@@ -277,6 +280,43 @@ Note: Manual changes may be overwritten by automatic synchronization.
277
280
 
278
281
  ## 🔧 Scripts Reference
279
282
 
283
+ ### `./scripts/release-agent.sh` ⭐ NEW
284
+
285
+ **Comprehensive release validation and quality assurance.**
286
+
287
+ The Release Agent performs 21+ automated checks to ensure release readiness:
288
+
289
+ - ✅ Version consistency across all package files
290
+ - ✅ CHANGELOG completeness and format validation
291
+ - ✅ Build system configuration
292
+ - ✅ Dependency validation
293
+ - ✅ Git tag existence check
294
+ - ✅ Release workflow configuration
295
+ - ✅ Documentation link validation
296
+ - ✅ Test suite status (when available)
297
+
298
+ **Usage:**
299
+ ```bash
300
+ ./scripts/release-agent.sh # Full validation
301
+ ./scripts/release-agent.sh --help # Show help
302
+ ./scripts/release-agent.sh --version # Show version
303
+ ```
304
+
305
+ **Benefits:**
306
+ - 🎯 Catches issues before they reach CI/CD
307
+ - 📊 Clear, color-coded output for easy scanning
308
+ - 🔧 Specific solutions for each type of issue
309
+ - 🚀 Comprehensive validation in under 5 seconds
310
+ - ✨ Professional release summary with next steps
311
+
312
+ **When to Use:**
313
+ - Before every release commit
314
+ - After making version changes
315
+ - When troubleshooting release issues
316
+ - As part of your local release workflow
317
+
318
+ **See Also:** `.github/agents/release-agent.md` for complete documentation
319
+
280
320
  ### `./scripts/bump-version.sh`
281
321
  Updates version in all library files with consistency checks.
282
322
 
@@ -346,17 +386,26 @@ npm whoami
346
386
 
347
387
  **NPM/GitHub Packages Not Published Automatically**
348
388
 
349
- If the automated release ran but NPM and GitHub Packages weren't published, it's likely due to the commit message not matching the required pattern.
389
+ The automated workflow triggers a release in two ways:
390
+
391
+ 1. **Automatic (Recommended)**: When version files are updated in a commit
392
+ - The workflow detects changes to `library.properties`, `library.json`, or `package.json`
393
+ - Automatically creates tag, release, and publishes packages when these files are modified
394
+ - Works seamlessly with PR merges and direct commits
395
+
396
+ 2. **Manual trigger**: Commit message starts with `release:` (lowercase with colon):
350
397
 
351
- The automated workflow requires the commit message to start with `release:` (lowercase with colon):
352
398
  ```bash
353
- # ✅ Correct - Will trigger NPM/GitHub Packages publishing
399
+ # ✅ Correct - Will trigger full release
354
400
  git commit -m "release: v1.7.7 - Complete mqtt-schema implementation"
355
401
 
356
- # Wrong - Will create tag/release but skip NPM publishing
357
- git commit -m "Release v1.7.7 - Complete mqtt-schema implementation"
402
+ # Also works - Version file changes detected automatically
403
+ # (No special commit message needed when library.properties/json/package.json are modified)
404
+ git commit -m "Bump version to 1.7.8"
358
405
  ```
359
406
 
407
+ **Note**: If version files weren't modified and commit message doesn't start with "release:", the workflow will skip publishing.
408
+
360
409
  **Solution: Use Manual Publishing Workflow**
361
410
 
362
411
  If this happens, you can manually publish packages: