@alteriom/painlessmesh 1.7.8 → 1.8.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.
- package/CHANGELOG.md +139 -3
- package/README.md +114 -4
- package/RELEASE_GUIDE.md +57 -8
- package/docs/BRIDGE_FAILOVER.md +512 -0
- package/docs/BRIDGE_HEALTH_MONITORING.md +293 -0
- package/docs/CREATE_MISSING_RELEASES.md +321 -0
- package/docs/README.md +2 -1
- package/docs/RELEASE_AGENT_SUMMARY.md +386 -0
- package/docs/releases/RELEASE_SUMMARY_v1.7.8.md +523 -0
- package/docs/releases/RELEASE_SUMMARY_v1.7.9.md +542 -0
- package/docs/troubleshooting/ESP32_C6_COMPATIBILITY.md +157 -0
- package/docs/troubleshooting/common-issues.md +28 -0
- package/examples/alteriom/alteriom_sensor_package.hpp +233 -1
- package/examples/alteriom/platformio.ini +1 -1
- package/examples/alteriomImproved/platformio.ini +1 -1
- package/examples/alteriomMetricsHealth/metrics_health_node.ino +18 -7
- package/examples/alteriomMetricsHealth/platformio.ini +1 -1
- package/examples/alteriomPhase1/platformio.ini +1 -1
- package/examples/alteriomPhase2/platformio.ini +1 -1
- package/examples/alteriomSensorNode/alteriom_sensor_package.hpp +1014 -11
- package/examples/alteriomSensorNode/platformio.ini +1 -1
- package/examples/basic/basic.ino +6 -2
- package/examples/basic/platformio.ini +1 -1
- package/examples/bridge/alteriom_sensor_package.hpp +1170 -0
- package/examples/bridge/bridge.ino +44 -23
- package/examples/bridge/bridge_health_monitoring_example.ino +188 -0
- package/examples/bridge/enhanced_mqtt_bridge.hpp +1 -1
- package/examples/bridge/mqtt_command_bridge.hpp +2 -2
- package/examples/bridge/platformio.ini +2 -1
- package/examples/bridgeAwareSensorNode/alteriom_sensor_package.hpp +1227 -0
- package/examples/bridgeAwareSensorNode/bridgeAwareSensorNode.ino +343 -0
- package/examples/bridgeAwareSensorNode/platformio.ini +26 -0
- package/examples/bridge_failover/README.md +358 -0
- package/examples/bridge_failover/bridge_failover.ino +180 -0
- package/examples/bridge_failover/platformio.ini +27 -0
- package/examples/diagnosticsExample/diagnosticsExample.ino +171 -0
- package/examples/diagnosticsExample/platformio.ini +26 -0
- package/examples/echoNode/platformio.ini +1 -1
- package/examples/logClient/platformio.ini +1 -1
- package/examples/logServer/platformio.ini +1 -1
- package/examples/mqttStatusBridge/platformio.ini +1 -1
- package/examples/namedMesh/platformio.ini +1 -1
- package/examples/ntpTimeSyncBridge/alteriom_sensor_package.hpp +1383 -0
- package/examples/ntpTimeSyncBridge/ntpTimeSyncBridge.ino +81 -0
- package/examples/ntpTimeSyncNode/alteriom_sensor_package.hpp +1383 -0
- package/examples/ntpTimeSyncNode/ntpTimeSyncNode.ino +109 -0
- package/examples/otaReceiver/platformio.ini +1 -1
- package/examples/rtcIntegration/README.md +235 -0
- package/examples/rtcIntegration/rtcIntegration.ino +196 -0
- package/examples/startHere/platformio.ini +1 -1
- package/examples/webServer/platformio.ini +1 -1
- package/library.json +93 -53
- package/library.properties +1 -1
- package/package.json +2 -2
- package/src/arduino/wifi.hpp +581 -0
- package/src/painlessMeshSTA.cpp +68 -0
- package/src/painlessMeshSTA.h +3 -0
- package/src/painlessmesh/mesh.hpp +1127 -4
- package/src/painlessmesh/rtc.hpp +203 -0
package/CHANGELOG.md
CHANGED
|
@@ -7,19 +7,155 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [1.8.0] - 2025-11-09
|
|
11
|
+
|
|
10
12
|
### Added
|
|
11
13
|
|
|
12
|
-
-
|
|
14
|
+
- **Diagnostics API for Bridge Operations** - Comprehensive monitoring and debugging tools
|
|
15
|
+
- New diagnostic methods for bridge state, topology, and connectivity
|
|
16
|
+
- Election history tracking with detailed event logging
|
|
17
|
+
- Network topology visualization with neighbor information
|
|
18
|
+
- Connectivity testing and validation tools
|
|
19
|
+
- Comprehensive diagnostic report generation
|
|
20
|
+
- Minimal overhead when diagnostics enabled
|
|
21
|
+
- Examples: `examples/diagnostics/` directory
|
|
22
|
+
- Documentation: `DIAGNOSTICS_API.md`
|
|
23
|
+
|
|
24
|
+
- **Bridge Health Monitoring & Metrics Collection** - Real-time bridge performance metrics
|
|
25
|
+
- New `BridgeHealthMetrics` struct with connectivity, signal, traffic, and performance data
|
|
26
|
+
- Four API methods: `getBridgeHealthMetrics()`, `resetHealthMetrics()`, `getHealthMetricsJSON()`, `onHealthMetricsUpdate()`
|
|
27
|
+
- Automatic tracking of uptime, disconnects, RSSI, traffic bytes, latency, and packet loss
|
|
28
|
+
- JSON export for integration with MQTT, Prometheus, Grafana, CloudWatch
|
|
29
|
+
- Periodic callback support for automated monitoring
|
|
30
|
+
- Zero overhead when not used
|
|
31
|
+
- Comprehensive unit tests (63 assertions)
|
|
32
|
+
- Example: `examples/bridge/bridge_health_monitoring_example.ino`
|
|
33
|
+
- Documentation: `docs/BRIDGE_HEALTH_MONITORING.md`
|
|
34
|
+
|
|
35
|
+
- **RTC (Real-Time Clock) Integration** - Hardware RTC support for offline timekeeping
|
|
36
|
+
- Support for DS3231, DS1307, and PCF8523 RTC modules
|
|
37
|
+
- Automatic time persistence across reboots and power failures
|
|
38
|
+
- Seamless integration with NTP time sync
|
|
39
|
+
- Comprehensive unit tests for RTC functionality
|
|
40
|
+
- Example sketches demonstrating RTC usage
|
|
41
|
+
|
|
42
|
+
- **Bridge Status Broadcast & Callback (Type 610)** - Real-time Internet connectivity monitoring
|
|
43
|
+
- Bridge nodes automatically broadcast connectivity status every 30 seconds
|
|
44
|
+
- New `onBridgeStatusChanged()` callback for connectivity state changes
|
|
45
|
+
- API methods: `hasInternetConnection()`, `getPrimaryBridge()`, `getBridges()`, `isBridge()`
|
|
46
|
+
- Status includes Internet connectivity, router RSSI, channel, uptime, gateway IP
|
|
47
|
+
- Enable offline mode and message queueing when Internet unavailable
|
|
48
|
+
- Support for bridge failover scenarios
|
|
49
|
+
- Documentation: `BRIDGE_STATUS_FEATURE.md`
|
|
50
|
+
|
|
51
|
+
- **Automatic Bridge Failover with RSSI-Based Election (Types 611, 612)** - High-availability bridge management
|
|
52
|
+
- Distributed bridge election protocol when primary bridge fails
|
|
53
|
+
- RSSI-based node selection for optimal bridge placement
|
|
54
|
+
- New `BridgeElectionPackage` (Type 611) for election coordination
|
|
55
|
+
- New `BridgeTakeoverPackage` (Type 612) for bridge transition announcements
|
|
56
|
+
- API methods: `enableBridgeFailover()`, `setRouterCredentials()`, `onBridgeRoleChanged()`
|
|
57
|
+
- Automatic promotion of best-positioned node to bridge role
|
|
58
|
+
- Tiebreaker rules: uptime, free memory, node ID
|
|
59
|
+
- Split-brain prevention and oscillation protection
|
|
60
|
+
- Graceful handling of multiple sequential failures
|
|
61
|
+
- Critical for production high-availability systems (Issue #64)
|
|
62
|
+
|
|
63
|
+
- **NTP Time Synchronization (Type 614)** - Bridge-to-mesh NTP time distribution
|
|
64
|
+
- New `NTPTimeSyncPackage` for broadcasting NTP time from bridge nodes
|
|
65
|
+
- Bridge nodes with Internet distribute authoritative time to entire mesh
|
|
66
|
+
- Eliminates per-node NTP queries (saves bandwidth and power)
|
|
67
|
+
- Supports RTC synchronization for offline operation
|
|
68
|
+
- Includes accuracy field for time uncertainty tracking
|
|
69
|
+
- Comprehensive unit tests (5 scenarios, 38 assertions)
|
|
70
|
+
- Example sketches: `ntpTimeSyncBridge.ino` and `ntpTimeSyncNode.ino`
|
|
71
|
+
- Documentation: `NTP_TIME_SYNC_FEATURE.md`
|
|
72
|
+
|
|
73
|
+
- **Bridge-Centric Architecture** - New `initAsBridge()` method for automatic channel detection
|
|
74
|
+
- Bridge nodes now connect to router first and auto-detect its channel
|
|
75
|
+
- Mesh network automatically configured on router's channel
|
|
76
|
+
- Eliminates need for manual channel configuration
|
|
77
|
+
- Automatically sets root node flags
|
|
78
|
+
- Graceful fallback to channel 1 if router connection fails
|
|
79
|
+
|
|
80
|
+
- **Auto Channel Detection for Regular Nodes** - Support for `channel=0` in `init()`
|
|
81
|
+
- Regular nodes can now auto-detect mesh channel by scanning all channels
|
|
82
|
+
- Falls back to channel 1 if mesh not found
|
|
83
|
+
- Simplifies multi-node deployments
|
|
84
|
+
|
|
85
|
+
- **Helper Function** - New `scanForMeshChannel()` static method
|
|
86
|
+
- Scans all 13 WiFi channels to find mesh SSID
|
|
87
|
+
- Supports hidden networks
|
|
88
|
+
- Returns detected channel or 0 if not found
|
|
89
|
+
- Detailed logging for troubleshooting
|
|
13
90
|
|
|
14
91
|
### Changed
|
|
15
92
|
|
|
16
|
-
-
|
|
93
|
+
- **Enhanced Documentation** - Updated bridge and basic examples
|
|
94
|
+
- `examples/bridge/bridge.ino` now uses `initAsBridge()` API
|
|
95
|
+
- `examples/basic/basic.ino` demonstrates auto channel detection
|
|
96
|
+
- `BRIDGE_TO_INTERNET.md` rewritten with bridge-centric approach
|
|
97
|
+
- `README.md` includes bridge quick start guide
|
|
98
|
+
|
|
99
|
+
- **StationScan Enhancement** - Modified `stationScan()` to support all-channel scanning
|
|
100
|
+
- When `channel=0`, automatically scans all channels before connecting
|
|
101
|
+
- Auto-updates mesh channel based on detected network
|
|
17
102
|
|
|
18
103
|
### Fixed
|
|
19
104
|
|
|
20
105
|
- TBD
|
|
21
106
|
|
|
22
|
-
|
|
107
|
+
### Backward Compatibility
|
|
108
|
+
|
|
109
|
+
- All existing code continues to work without changes
|
|
110
|
+
- Manual channel configuration (`mesh.init(..., channel)`) still supported
|
|
111
|
+
- Legacy `stationManual()` approach still available
|
|
112
|
+
- No breaking API changes
|
|
113
|
+
|
|
114
|
+
## [1.7.9] - 2025-11-08
|
|
115
|
+
|
|
116
|
+
### Fixed
|
|
117
|
+
|
|
118
|
+
- **CI/CD Pipeline** - Fixed submodule initialization failures and PlatformIO test configuration in GitHub Actions workflows
|
|
119
|
+
- Added explicit `submodules: recursive` to checkout action in CI workflow
|
|
120
|
+
- Added manual `git submodule update --init --recursive` step for robustness
|
|
121
|
+
- Ensures test dependencies (ArduinoJson and TaskScheduler) are properly initialized
|
|
122
|
+
- Fixes build failures where submodules were not available during CI runs
|
|
123
|
+
- Removed redundant matrix strategy from PlatformIO build test (script builds both platforms anyway)
|
|
124
|
+
- Changed PlatformIO tests from random to deterministic (tests critical examples: basic, alteriomSensorNode, alteriomMetricsHealth)
|
|
125
|
+
- Improved concurrency grouping to properly handle PR branch names and prevent premature cancellations
|
|
126
|
+
- Affects all workflows: ci.yml, release.yml, docs.yml
|
|
127
|
+
|
|
128
|
+
- **Workflow Triggers** - Fixed duplicate CI runs and cancellation issues on PR branches
|
|
129
|
+
- Removed unnecessary `copilot/**` pattern from validate-release workflow branches filter
|
|
130
|
+
- Added explicit branch check in validate-release job condition to only run on main/develop
|
|
131
|
+
- Prevents validate-release workflow from running on PR branches
|
|
132
|
+
- Fixed concurrency grouping to use `github.head_ref` for PRs (branch name) instead of `github.ref` (commit SHA)
|
|
133
|
+
- Ensures proper workflow cancellation behavior and prevents confusion from cancelled runs
|
|
134
|
+
|
|
135
|
+
- **Example Code** - Fixed compilation errors in alteriomMetricsHealth example
|
|
136
|
+
- Removed incorrect `userScheduler.size()` call (TaskScheduler API doesn't expose queue size)
|
|
137
|
+
- Replaced non-existent `toJsonString()` methods with proper JSON serialization pattern
|
|
138
|
+
- Updated deprecated `DynamicJsonDocument` to `JsonDocument` for ArduinoJson v7 compatibility
|
|
139
|
+
- Changed `msgType` from `uint8_t` to `uint16_t` to support message types > 255 (400, 604, 605)
|
|
140
|
+
|
|
141
|
+
### Technical Details
|
|
142
|
+
|
|
143
|
+
- GitHub Actions now properly initializes git submodules before build steps
|
|
144
|
+
- Both automated checkout with `submodules: recursive` and manual initialization step included
|
|
145
|
+
- Prevents "No such file or directory" errors for test/ArduinoJson and test/TaskScheduler
|
|
146
|
+
- Critical fix for maintaining CI/CD reliability across all build and test workflows
|
|
147
|
+
- Example code now uses proper serialization: `JsonDocument doc; JsonObject obj = doc.to<JsonObject>(); package.addTo(std::move(obj)); serializeJson(doc, msg);`
|
|
148
|
+
|
|
149
|
+
## [1.7.8] - 2025-11-05
|
|
150
|
+
|
|
151
|
+
### Added
|
|
152
|
+
|
|
153
|
+
- **MQTT Schema v0.7.3 Compliance** - Upgraded from v0.7.2 to v0.7.3
|
|
154
|
+
- Added `message_type` field to SensorPackage (Type 200)
|
|
155
|
+
- Added `message_type` field to StatusPackage (Type 202)
|
|
156
|
+
- Added `message_type` field to CommandPackage (Type 400)
|
|
157
|
+
- All packages now have `message_type` for 90% faster message classification
|
|
158
|
+
- Full alignment with @alteriom/mqtt-schema v0.7.3 specification
|
|
23
159
|
|
|
24
160
|
### Added
|
|
25
161
|
|
package/README.md
CHANGED
|
@@ -97,7 +97,27 @@ This fork includes specialized packages for structured IoT communication:
|
|
|
97
97
|
- Gateway node identification
|
|
98
98
|
- Enables heterogeneous mesh networks
|
|
99
99
|
|
|
100
|
-
|
|
100
|
+
**Bridge Failover & High Availability (v1.8.0):**
|
|
101
|
+
|
|
102
|
+
- **`BridgeStatusPackage`** (Type 610) - Bridge health monitoring (BRIDGE_STATUS per mqtt-schema v0.7.3+)
|
|
103
|
+
- Internet connectivity status
|
|
104
|
+
- Router signal strength (RSSI)
|
|
105
|
+
- Gateway IP and router channel
|
|
106
|
+
- Heartbeat for failure detection
|
|
107
|
+
|
|
108
|
+
- **`BridgeElectionPackage`** (Type 611) - Automatic failover election (BRIDGE_ELECTION per mqtt-schema v0.7.3+)
|
|
109
|
+
- Router RSSI measurement
|
|
110
|
+
- Node uptime and free memory
|
|
111
|
+
- Distributed consensus protocol
|
|
112
|
+
- RSSI-based winner selection
|
|
113
|
+
|
|
114
|
+
- **`BridgeTakeoverPackage`** (Type 612) - Bridge role announcement (BRIDGE_TAKEOVER per mqtt-schema v0.7.3+)
|
|
115
|
+
- New bridge identification
|
|
116
|
+
- Previous bridge tracking
|
|
117
|
+
- Takeover reason and timestamp
|
|
118
|
+
- Seamless failover notification
|
|
119
|
+
|
|
120
|
+
All packages provide type-safe serialization, automatic JSON conversion, and mesh-wide broadcasting or targeted messaging. They align with mqtt-schema v0.7.3+ for enterprise IoT integration.
|
|
101
121
|
|
|
102
122
|
#### 🚀 Phase 2 Features (v1.7.0+)
|
|
103
123
|
|
|
@@ -117,6 +137,38 @@ All packages provide type-safe serialization, automatic JSON conversion, and mes
|
|
|
117
137
|
|
|
118
138
|
See [Phase 2 Guide](docs/PHASE2_GUIDE.md) for complete documentation.
|
|
119
139
|
|
|
140
|
+
#### 🔄 Automatic Bridge Failover (v1.8.0)
|
|
141
|
+
|
|
142
|
+
**High Availability for Critical Systems**
|
|
143
|
+
|
|
144
|
+
- 🎯 **RSSI-Based Election** - Best signal strength wins bridge role
|
|
145
|
+
- 🔍 **Automatic Detection** - 60-second failure detection via heartbeats
|
|
146
|
+
- ⚡ **Fast Failover** - 60-70 second typical recovery time
|
|
147
|
+
- 🌐 **Distributed Consensus** - No single coordinator, deterministic winner selection
|
|
148
|
+
- 🛡️ **Split-Brain Prevention** - State machine prevents concurrent elections
|
|
149
|
+
- 📊 **Tiebreaker Rules** - RSSI → Uptime → Memory → Node ID
|
|
150
|
+
|
|
151
|
+
**Use Cases:**
|
|
152
|
+
- Fish farm alarm systems requiring 24/7 Internet connectivity
|
|
153
|
+
- Industrial IoT networks with critical sensor monitoring
|
|
154
|
+
- Smart building systems needing continuous cloud connectivity
|
|
155
|
+
|
|
156
|
+
**Example:**
|
|
157
|
+
```cpp
|
|
158
|
+
// Enable automatic bridge failover
|
|
159
|
+
mesh.setRouterCredentials(ROUTER_SSID, ROUTER_PASSWORD);
|
|
160
|
+
mesh.enableBridgeFailover(true);
|
|
161
|
+
mesh.onBridgeRoleChanged(&bridgeRoleCallback);
|
|
162
|
+
|
|
163
|
+
void bridgeRoleCallback(bool isBridge, String reason) {
|
|
164
|
+
if (isBridge) {
|
|
165
|
+
Serial.printf("🎯 Promoted to bridge: %s\n", reason.c_str());
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
See [Bridge Failover Guide](docs/BRIDGE_FAILOVER.md) and [bridge_failover example](examples/bridge_failover/) for complete documentation.
|
|
171
|
+
|
|
120
172
|
#### MQTT Bridge Commands
|
|
121
173
|
|
|
122
174
|
The MQTT bridge enables bidirectional communication between MQTT brokers and mesh networks:
|
|
@@ -134,7 +186,7 @@ The MQTT bridge enables bidirectional communication between MQTT brokers and mes
|
|
|
134
186
|
**Examples:**
|
|
135
187
|
|
|
136
188
|
- 🌉 [MQTT Command Bridge](examples/mqttCommandBridge/mqttCommandBridge.ino) - Gateway bridge with bidirectional MQTT-mesh routing
|
|
137
|
-
- 📡 [
|
|
189
|
+
- 📡 [Alteriom Sensor Node](examples/alteriom/alteriom.ino) - Example node using SensorPackage, CommandPackage, and StatusPackage
|
|
138
190
|
|
|
139
191
|
### 🌐 Core Features
|
|
140
192
|
|
|
@@ -187,10 +239,12 @@ painlessMesh makes use of the following libraries, which can be installed throug
|
|
|
187
239
|
- [ArduinoJson](https://github.com/bblanchon/ArduinoJson)
|
|
188
240
|
- [TaskScheduler](https://github.com/arkhipenko/TaskScheduler)
|
|
189
241
|
- [ESPAsyncTCP](https://github.com/me-no-dev/ESPAsyncTCP) (ESP8266)
|
|
190
|
-
- [AsyncTCP](https://github.com/
|
|
242
|
+
- [AsyncTCP](https://github.com/ESP32Async/AsyncTCP) (ESP32) - v3.3.0+ required for ESP32-C6
|
|
191
243
|
|
|
192
244
|
If platformio is used to install the library, then the dependencies will be installed automatically.
|
|
193
245
|
|
|
246
|
+
> **⚠️ 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.
|
|
247
|
+
|
|
194
248
|
## Quick Start with Alteriom Packages
|
|
195
249
|
|
|
196
250
|
### Basic Sensor Node
|
|
@@ -240,6 +294,61 @@ void receivedCallback(uint32_t from, String& msg) {
|
|
|
240
294
|
}
|
|
241
295
|
```
|
|
242
296
|
|
|
297
|
+
### Bridge to Internet (Auto Channel Detection)
|
|
298
|
+
|
|
299
|
+
The new bridge-centric architecture makes it easy to connect your mesh to the Internet via a router. The bridge node automatically detects the router's channel and configures the mesh accordingly.
|
|
300
|
+
|
|
301
|
+
#### Bridge Node
|
|
302
|
+
|
|
303
|
+
```cpp
|
|
304
|
+
#include "painlessMesh.h"
|
|
305
|
+
|
|
306
|
+
#define MESH_PREFIX "MyMeshNetwork"
|
|
307
|
+
#define MESH_PASSWORD "somethingSneaky"
|
|
308
|
+
#define ROUTER_SSID "YourRouterSSID"
|
|
309
|
+
#define ROUTER_PASSWORD "YourRouterPassword"
|
|
310
|
+
|
|
311
|
+
Scheduler userScheduler;
|
|
312
|
+
painlessMesh mesh;
|
|
313
|
+
|
|
314
|
+
void setup() {
|
|
315
|
+
Serial.begin(115200);
|
|
316
|
+
mesh.setDebugMsgTypes(ERROR | STARTUP | CONNECTION);
|
|
317
|
+
|
|
318
|
+
// Single call does everything:
|
|
319
|
+
// 1. Connects to router and detects its channel
|
|
320
|
+
// 2. Initializes mesh on detected channel
|
|
321
|
+
// 3. Sets node as root/bridge
|
|
322
|
+
mesh.initAsBridge(MESH_PREFIX, MESH_PASSWORD,
|
|
323
|
+
ROUTER_SSID, ROUTER_PASSWORD,
|
|
324
|
+
&userScheduler, 5555);
|
|
325
|
+
|
|
326
|
+
mesh.onReceive(&receivedCallback);
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
void loop() { mesh.update(); }
|
|
330
|
+
|
|
331
|
+
void receivedCallback(uint32_t from, String& msg) {
|
|
332
|
+
// Forward mesh data to Internet services (MQTT, HTTP, etc.)
|
|
333
|
+
}
|
|
334
|
+
```
|
|
335
|
+
|
|
336
|
+
#### Regular Nodes (Auto Channel Detection)
|
|
337
|
+
|
|
338
|
+
```cpp
|
|
339
|
+
void setup() {
|
|
340
|
+
Serial.begin(115200);
|
|
341
|
+
|
|
342
|
+
// channel=0 means auto-detect the mesh channel
|
|
343
|
+
mesh.init(MESH_PREFIX, MESH_PASSWORD, &userScheduler, 5555,
|
|
344
|
+
WIFI_AP_STA, 0);
|
|
345
|
+
|
|
346
|
+
mesh.onReceive(&receivedCallback);
|
|
347
|
+
}
|
|
348
|
+
```
|
|
349
|
+
|
|
350
|
+
See [BRIDGE_TO_INTERNET.md](BRIDGE_TO_INTERNET.md) for complete documentation.
|
|
351
|
+
|
|
243
352
|
### Package Types
|
|
244
353
|
|
|
245
354
|
| Type | Class | Purpose | Fields |
|
|
@@ -280,7 +389,7 @@ void receivedCallback(uint32_t from, String& msg) {
|
|
|
280
389
|
- **Home Automation** - Distributed lighting, HVAC control
|
|
281
390
|
- **Industrial Monitoring** - Equipment status, predictive maintenance
|
|
282
391
|
- **Event Coordination** - Synchronized displays, distributed processing
|
|
283
|
-
- **Bridge Networks** - Connect mesh to WiFi/Internet/MQTT
|
|
392
|
+
- **Bridge Networks** - Connect mesh to WiFi/Internet/MQTT - [📖 Bridge Guide](BRIDGE_TO_INTERNET.md)
|
|
284
393
|
|
|
285
394
|
## Development Version: v1.7.8
|
|
286
395
|
|
|
@@ -412,6 +521,7 @@ You can tip me using ko-fi:
|
|
|
412
521
|
| Topic | Description | Link |
|
|
413
522
|
|-------|-------------|------|
|
|
414
523
|
| **🌳 Architecture** | How painlessMesh works internally | [📖 Architecture](https://alteriom.github.io/painlessMesh/#/architecture/mesh-architecture) |
|
|
524
|
+
| **🌉 Bridge to Internet** | Connect mesh to WiFi/Internet/MQTT | [📖 Bridge Guide](BRIDGE_TO_INTERNET.md) |
|
|
415
525
|
| **🔌 Plugin System** | Create custom message packages | [📖 Plugins](https://alteriom.github.io/painlessMesh/#/architecture/plugin-system) |
|
|
416
526
|
| **🎓 Tutorials** | Step-by-step examples and patterns | [📖 Tutorials](https://alteriom.github.io/painlessMesh/#/tutorials/basic-examples) |
|
|
417
527
|
| **🛠️ 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.
|
|
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.
|
|
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
|
|
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
|
-
|
|
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
|
|
399
|
+
# ✅ Correct - Will trigger full release
|
|
354
400
|
git commit -m "release: v1.7.7 - Complete mqtt-schema implementation"
|
|
355
401
|
|
|
356
|
-
#
|
|
357
|
-
|
|
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:
|