@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.
- package/BRIDGE_TO_INTERNET.md +229 -0
- package/CHANGELOG.md +101 -1
- package/CONTRIBUTING.md +79 -0
- package/README.md +69 -144
- package/docs/README.md +1 -0
- package/docs/api/shared-gateway.md +1207 -0
- package/examples/bridge_failover/README.md +113 -0
- package/examples/bridge_failover/bridge_failover.ino +38 -4
- package/examples/sharedGateway/README.md +235 -0
- package/examples/{meshCommandNode → sharedGateway}/platformio.ini +3 -2
- package/examples/sharedGateway/sharedGateway.ino +303 -0
- package/library.json +3 -22
- package/library.properties +1 -1
- package/package.json +3 -6
- package/src/arduino/wifi.hpp +504 -4
- package/src/painlessmesh/gateway.hpp +2120 -0
- package/src/painlessmesh/mesh.hpp +1034 -6
- package/src/painlessmesh/message_tracker.hpp +311 -0
- package/src/painlessmesh/protocol.hpp +6 -0
- package/DOCUMENTATION_INDEX.md +0 -146
- package/RELEASE_NOTES_1.8.15.md +0 -160
- package/RELEASE_READINESS_PLAN.md +0 -323
- package/TESTING_WITH_SIMULATOR.md +0 -259
- package/docs/API_DESIGN_GUIDELINES.md +0 -414
- package/docs/ARDUINO_LIBRARY_MANAGER_SUBMISSION.md +0 -331
- package/docs/BOOLEAN_NAMING_CONVENTION.md +0 -235
- package/docs/BRIDGE_FAILOVER.md +0 -512
- package/docs/BRIDGE_HEALTH_MONITORING.md +0 -293
- package/docs/BRIDGE_INITIALIZATION_FALLBACK.md +0 -357
- package/docs/CHANNEL_SYNCHRONIZATION.md +0 -209
- package/docs/CREATE_MISSING_RELEASES.md +0 -321
- package/docs/DOCUMENTATION_MIGRATION_PLAN.md +0 -176
- package/docs/FAQ_VERSION_NUMBERS.md +0 -152
- package/docs/IMPLEMENTATION_PLAN_MESH_TOPOLOGY.md +0 -1062
- package/docs/MESH_TOPOLOGY_GUIDE.md +0 -992
- package/docs/MESH_TOPOLOGY_PROGRESS.md +0 -422
- package/docs/MQTT_BRIDGE_COMMANDS.md +0 -894
- package/docs/MQTT_BRIDGE_IMPLEMENTATION_SUMMARY.md +0 -324
- package/docs/MQTT_COMMAND_SCHEMA_PROPOSAL.md +0 -576
- package/docs/MQTT_SCHEMA_COMPLIANCE.md +0 -340
- package/docs/MQTT_SCHEMA_PROPOSALS.md +0 -446
- package/docs/MQTT_SCHEMA_REVIEW.md +0 -690
- package/docs/OTA_COMMANDS_REFERENCE.md +0 -554
- package/docs/PHASE1_GUIDE.md +0 -349
- package/docs/PHASE2_GUIDE.md +0 -543
- package/docs/QUICK_REFERENCE_VERSIONING.md +0 -127
- package/docs/RELEASE_AGENT_SUMMARY.md +0 -386
- package/docs/SCHEMA_VALIDATION_CHECKLIST.md +0 -222
- package/docs/SIMULATOR_TESTING.md +0 -408
- package/docs/VERSION_MANAGEMENT.md +0 -213
- package/docs/archive/DOCUSAURUS_DEPLOYMENT.md +0 -166
- package/docs/archive/FEATURE_PROPOSALS.md +0 -337
- package/docs/archive/LIBRARY_JSON_FIX.md +0 -98
- package/docs/archive/LIBRARY_STRUCTURE_FIX.md +0 -215
- package/docs/archive/PHASE1_IMPLEMENTATION.md +0 -325
- package/docs/archive/PHASE2_IMPLEMENTATION.md +0 -567
- package/docs/archive/RELEASE_SUMMARY.md +0 -173
- package/docs/archive/SCONS_BUILD_FIX.md +0 -313
- package/docs/archive/TRIGGER_RELEASE.md +0 -280
- package/docs/archive/VECTOR_INCLUDE_FIX.md +0 -129
- package/docs/archive/ota-and-status-enhancements.md +0 -911
- package/docs/archive/ota-status-architecture-diagrams.md +0 -658
- package/docs/archive/ota-status-quick-reference.md +0 -284
- package/docs/design/.gitkeep +0 -1
- package/docs/design/STATION_CREDENTIALS_DESIGN.md +0 -182
- package/docs/development/ARDUINO_COMPLIANCE_SUMMARY.md +0 -71
- package/docs/development/CODE_REFACTORING_RECOMMENDATIONS.md +0 -1011
- package/docs/development/DOCKER_TESTING.md +0 -196
- package/docs/development/PLATFORMIO_USAGE.md +0 -180
- package/docs/development/TESTING_SUMMARY.md +0 -126
- package/docs/development/contributing.md +0 -301
- package/docs/development/documentation.md +0 -583
- package/docs/features/DIAGNOSTICS_API.md +0 -534
- package/docs/implementation/BRIDGE_ARCHITECTURE_IMPLEMENTATION.md +0 -340
- package/docs/implementation/BRIDGE_HEALTH_MONITORING_IMPLEMENTATION.md +0 -213
- package/docs/implementation/BRIDGE_STATUS_FEATURE.md +0 -635
- package/docs/implementation/DIAGNOSTICS_API_IMPLEMENTATION.md +0 -232
- package/docs/implementation/IMPLEMENTATION_COMPLETE.md +0 -228
- package/docs/implementation/IMPLEMENTATION_NTP_TIME_SYNC.md +0 -325
- package/docs/implementation/IMPLEMENTATION_SUMMARY.md +0 -316
- package/docs/implementation/MESSAGE_QUEUE_IMPLEMENTATION.md +0 -405
- package/docs/implementation/MULTI_BRIDGE_IMPLEMENTATION.md +0 -520
- package/docs/implementation/NTP_TIME_SYNC_FEATURE.md +0 -392
- package/docs/improvements/FUTURE_PROPOSALS.md +0 -1016
- package/docs/improvements/IMPLEMENTATION_HISTORY.md +0 -1091
- package/docs/improvements/OTA_STATUS_ENHANCEMENTS.md +0 -709
- package/docs/improvements/README.md +0 -212
- package/docs/internal/CUSTOM_AGENT_ANALYSIS.md +0 -391
- package/docs/internal/ISSUE_65_VERIFICATION.md +0 -947
- package/docs/internal/ISSUE_66_CLOSURE.md +0 -249
- package/docs/internal/ISSUE_66_STATUS.md +0 -316
- package/docs/internal/PR_SUMMARY.md +0 -315
- package/docs/internal/REVIEW_SUMMARY.md +0 -332
- package/docs/multi-bridge-setup.md +0 -1025
- package/docs/platformio-publishing.md +0 -255
- package/docs/platformio-setup-summary.md +0 -121
- package/docs/releases/ANNOUNCEMENT_v1.8.6.md +0 -63
- package/docs/releases/ANNOUNCEMENT_v1.8.7.md +0 -113
- package/docs/releases/BRIDGE_STATUS_SELF_REGISTRATION_FIX.md +0 -221
- package/docs/releases/FEATURE_HISTORY.md +0 -543
- package/docs/releases/GITHUB_RELEASE_v1.8.6.md +0 -71
- package/docs/releases/GITHUB_RELEASE_v1.8.7.md +0 -90
- package/docs/releases/PATCH_v1.7.2.md +0 -262
- package/docs/releases/PATCH_v1.7.3.md +0 -262
- package/docs/releases/PATCH_v1.7.4.md +0 -219
- package/docs/releases/PHASE1_SUMMARY.md +0 -246
- package/docs/releases/PHASE2_SUMMARY.md +0 -499
- package/docs/releases/PUBLISH_v1.8.0_INSTRUCTIONS.md +0 -163
- package/docs/releases/QUICK_START_RELEASES.md +0 -113
- package/docs/releases/RELEASE_CHECKLIST_1.8.10.md +0 -331
- package/docs/releases/RELEASE_CHECKLIST_1.8.9.md +0 -207
- package/docs/releases/RELEASE_CHECKLIST_v1.7.4.md +0 -253
- package/docs/releases/RELEASE_CHECKLIST_v1.7.5.md +0 -315
- package/docs/releases/RELEASE_CHECKLIST_v1.7.6.md +0 -389
- package/docs/releases/RELEASE_CHECKLIST_v1.8.0.md +0 -331
- package/docs/releases/RELEASE_CHECKLIST_v1.8.2.md +0 -309
- package/docs/releases/RELEASE_NOTES_1.7.0.md +0 -539
- package/docs/releases/RELEASE_NOTES_1.8.10.md +0 -239
- package/docs/releases/RELEASE_NOTES_1.8.9.md +0 -213
- package/docs/releases/RELEASE_NOTES_v1.8.0.md +0 -685
- package/docs/releases/RELEASE_NOTES_v1.8.1.md +0 -221
- package/docs/releases/RELEASE_NOTES_v1.8.2.md +0 -421
- package/docs/releases/RELEASE_NOTES_v1.8.3.md +0 -292
- package/docs/releases/RELEASE_NOTES_v1.8.4.md +0 -277
- package/docs/releases/RELEASE_NOTES_v1.8.6.md +0 -205
- package/docs/releases/RELEASE_NOTES_v1.8.7.md +0 -184
- package/docs/releases/RELEASE_PLAN_v1.7.6.md +0 -816
- package/docs/releases/RELEASE_SUMMARY_1.8.10.md +0 -193
- package/docs/releases/RELEASE_SUMMARY_v1.7.4.md +0 -276
- package/docs/releases/RELEASE_SUMMARY_v1.7.5.md +0 -322
- package/docs/releases/RELEASE_SUMMARY_v1.7.6.md +0 -436
- package/docs/releases/RELEASE_SUMMARY_v1.7.7.md +0 -391
- package/docs/releases/RELEASE_SUMMARY_v1.7.8.md +0 -523
- package/docs/releases/RELEASE_SUMMARY_v1.7.9.md +0 -542
- package/docs/troubleshooting/ARDUINO_IDE_VERSION_FIX_SUMMARY.md +0 -229
- package/docs/troubleshooting/ARDUINO_LIBRARY_NAME_FIX.md +0 -197
- package/docs/troubleshooting/CRASH_QUICK_REF.md +0 -93
- package/docs/troubleshooting/ESP32_C6_COMPATIBILITY.md +0 -157
- package/docs/troubleshooting/FREERTOS_ASSERTION_FAILURE.md +0 -288
- package/docs/troubleshooting/FREERTOS_FIX_IMPLEMENTATION.md +0 -267
- package/docs/troubleshooting/NPM_PUBLISHING_ISSUE_SUMMARY.md +0 -110
- package/docs/troubleshooting/PAINLESSMESH_V1.7.4_COMPILATION_ISSUES.md +0 -547
- package/docs/troubleshooting/QUICK_FIX_FREERTOS.md +0 -164
- package/docs/troubleshooting/SENSOR_NODE_CONNECTION_CRASH.md +0 -264
- package/docs/troubleshooting/common-architecture-mistakes.md +0 -438
- package/docs/troubleshooting/internet-access-faq.md +0 -299
- package/docs/troubleshooting/station-reconnection-issues.md +0 -172
- package/docs/v1.7.7_MQTT_IMPROVEMENTS.md +0 -794
- package/docs/wiki/API-Reference.md +0 -246
- package/docs/wiki/Complete-Documentation.md +0 -123
- package/examples/alteriomImproved/alteriom_sensor_package.hpp +0 -224
- package/examples/alteriomImproved/improved_sensor_node.ino +0 -248
- package/examples/alteriomImproved/platformio.ini +0 -32
- package/examples/alteriomMetricsHealth/alteriom_sensor_package.hpp +0 -796
- package/examples/alteriomMetricsHealth/metrics_health_node.ino +0 -429
- package/examples/alteriomMetricsHealth/platformio.ini +0 -26
- package/examples/alteriomPhase1/alteriom_sensor_package.hpp +0 -224
- package/examples/alteriomPhase1/phase1_features.ino +0 -242
- package/examples/alteriomPhase1/platformio.ini +0 -26
- package/examples/alteriomPhase2/alteriom_sensor_package.hpp +0 -224
- package/examples/alteriomPhase2/phase2_features.ino +0 -186
- package/examples/alteriomPhase2/platformio.ini +0 -26
- package/examples/alteriomSensorNode/alteriom_sensor_node.ino +0 -186
- package/examples/alteriomSensorNode/alteriom_sensor_package.hpp +0 -1227
- package/examples/alteriomSensorNode/platformio.ini +0 -26
- package/examples/bridge/alteriom_sensor_package.hpp +0 -1170
- package/examples/bridge/bridge_health_monitoring_example.ino +0 -188
- package/examples/bridge/enhanced_mqtt_bridge.hpp +0 -610
- package/examples/bridge/enhanced_mqtt_bridge_example.ino +0 -226
- package/examples/bridge/mesh_event_publisher.hpp +0 -253
- package/examples/bridge/mesh_topology_reporter.hpp +0 -303
- package/examples/bridge/mqtt_command_bridge.hpp +0 -459
- package/examples/bridge/mqtt_status_bridge.hpp +0 -519
- package/examples/bridgeAwareSensorNode/alteriom_sensor_package.hpp +0 -1227
- package/examples/bridgeAwareSensorNode/bridgeAwareSensorNode.ino +0 -342
- package/examples/bridgeAwareSensorNode/platformio.ini +0 -26
- package/examples/diagnosticsExample/diagnosticsExample.ino +0 -171
- package/examples/diagnosticsExample/platformio.ini +0 -26
- package/examples/echoNode/echoNode.ino +0 -33
- package/examples/echoNode/platformio.ini +0 -26
- package/examples/meshCommandNode/alteriom_sensor_package.hpp +0 -235
- package/examples/meshCommandNode/meshCommandNode.ino +0 -265
- package/examples/mqttCommandBridge/alteriom_sensor_package.hpp +0 -235
- package/examples/mqttCommandBridge/mesh_event_publisher.hpp +0 -253
- package/examples/mqttCommandBridge/mesh_topology_reporter.hpp +0 -303
- package/examples/mqttCommandBridge/mqttCommandBridge.ino +0 -254
- package/examples/mqttCommandBridge/mqtt_command_bridge.hpp +0 -462
- package/examples/mqttCommandBridge/platformio.ini +0 -27
- package/examples/mqttStatusBridge/mqttStatusBridge.ino +0 -218
- package/examples/mqttStatusBridge/mqtt_status_bridge.hpp +0 -522
- package/examples/mqttStatusBridge/platformio.ini +0 -27
- package/examples/mqttTopologyTest/README.md +0 -467
- package/examples/mqttTopologyTest/mqttTopologyTest.ino +0 -754
- package/examples/mqttTopologyTest/platformio.ini +0 -27
- package/examples/multi_bridge/README.md +0 -346
- package/examples/multi_bridge/primary_bridge.ino +0 -108
- package/examples/multi_bridge/regular_node.ino +0 -141
- package/examples/multi_bridge/secondary_bridge.ino +0 -123
- package/examples/ntpTimeSyncBridge/alteriom_sensor_package.hpp +0 -1383
- package/examples/ntpTimeSyncBridge/ntpTimeSyncBridge.ino +0 -86
- package/examples/ntpTimeSyncNode/alteriom_sensor_package.hpp +0 -1383
- package/examples/ntpTimeSyncNode/ntpTimeSyncNode.ino +0 -109
- package/examples/queued_alarms/README.md +0 -390
- package/examples/queued_alarms/queued_alarms.ino +0 -265
- package/examples/routing_demo/README.md +0 -172
- package/examples/routing_demo/routing_demo.ino +0 -102
- package/examples/rtcIntegration/README.md +0 -294
- package/examples/rtcIntegration/rtcIntegration.ino +0 -210
|
@@ -1,408 +0,0 @@
|
|
|
1
|
-
# Simulator-Based Testing for painlessMesh
|
|
2
|
-
|
|
3
|
-
## Overview
|
|
4
|
-
|
|
5
|
-
painlessMesh includes integration with the [painlessMesh-simulator](https://github.com/Alteriom/painlessMesh-simulator) to enable large-scale testing of examples and firmware without physical hardware.
|
|
6
|
-
|
|
7
|
-
The simulator allows you to:
|
|
8
|
-
- 🚀 Test with 100+ virtual nodes simultaneously
|
|
9
|
-
- 🔧 Validate actual firmware code in a controlled environment
|
|
10
|
-
- 📋 Configure test scenarios with YAML files
|
|
11
|
-
- 🌐 Simulate realistic network conditions (latency, packet loss, partitions)
|
|
12
|
-
- 📊 Collect metrics and analyze performance
|
|
13
|
-
- 🔄 Integrate with CI/CD pipelines
|
|
14
|
-
|
|
15
|
-
## Architecture
|
|
16
|
-
|
|
17
|
-
```
|
|
18
|
-
painlessMesh Repository
|
|
19
|
-
├── src/ # Library code
|
|
20
|
-
├── examples/ # Example sketches
|
|
21
|
-
│ ├── basic/
|
|
22
|
-
│ │ ├── basic.ino # Original Arduino sketch
|
|
23
|
-
│ │ └── test/simulator/ # Simulator tests
|
|
24
|
-
│ │ ├── firmware/ # Firmware adapter
|
|
25
|
-
│ │ ├── scenarios/ # YAML test scenarios
|
|
26
|
-
│ │ └── CMakeLists.txt # Build configuration
|
|
27
|
-
│ └── [other examples]/
|
|
28
|
-
└── test/
|
|
29
|
-
└── simulator/ # painlessMesh-simulator (submodule)
|
|
30
|
-
```
|
|
31
|
-
|
|
32
|
-
## Quick Start
|
|
33
|
-
|
|
34
|
-
### 1. Initialize Simulator Submodule
|
|
35
|
-
|
|
36
|
-
```bash
|
|
37
|
-
cd test
|
|
38
|
-
git submodule update --init simulator
|
|
39
|
-
```
|
|
40
|
-
|
|
41
|
-
### 2. Install Dependencies
|
|
42
|
-
|
|
43
|
-
**Ubuntu/Debian:**
|
|
44
|
-
```bash
|
|
45
|
-
sudo apt-get install cmake ninja-build libboost-dev libboost-program-options-dev libyaml-cpp-dev
|
|
46
|
-
```
|
|
47
|
-
|
|
48
|
-
**macOS:**
|
|
49
|
-
```bash
|
|
50
|
-
brew install cmake ninja boost yaml-cpp
|
|
51
|
-
```
|
|
52
|
-
|
|
53
|
-
**Windows:**
|
|
54
|
-
See [test/simulator/BUILD_WINDOWS_STATUS.md](../test/simulator/BUILD_WINDOWS_STATUS.md)
|
|
55
|
-
|
|
56
|
-
### 3. Run a Test
|
|
57
|
-
|
|
58
|
-
```bash
|
|
59
|
-
cd test/simulator
|
|
60
|
-
mkdir build && cd build
|
|
61
|
-
cmake -G Ninja ..
|
|
62
|
-
ninja
|
|
63
|
-
|
|
64
|
-
# Run basic example test
|
|
65
|
-
bin/painlessmesh-simulator --config ../../../examples/basic/test/simulator/scenarios/basic_mesh_test.yaml
|
|
66
|
-
```
|
|
67
|
-
|
|
68
|
-
## Example Test Structure
|
|
69
|
-
|
|
70
|
-
### Basic Example
|
|
71
|
-
|
|
72
|
-
The `examples/basic/` example includes complete simulator tests:
|
|
73
|
-
|
|
74
|
-
**Files:**
|
|
75
|
-
- `test/simulator/firmware/basic_firmware.hpp` - Firmware adapter
|
|
76
|
-
- `test/simulator/scenarios/basic_mesh_test.yaml` - Test configuration
|
|
77
|
-
- `test/simulator/README.md` - Detailed instructions
|
|
78
|
-
|
|
79
|
-
**Test Scenario (basic_mesh_test.yaml):**
|
|
80
|
-
```yaml
|
|
81
|
-
simulation:
|
|
82
|
-
name: "Basic Example Test"
|
|
83
|
-
duration: 60
|
|
84
|
-
|
|
85
|
-
nodes:
|
|
86
|
-
- template: "basic_example"
|
|
87
|
-
count: 10
|
|
88
|
-
config:
|
|
89
|
-
mesh_prefix: "whateverYouLike"
|
|
90
|
-
mesh_password: "somethingSneaky"
|
|
91
|
-
|
|
92
|
-
validation:
|
|
93
|
-
- check: "all_nodes_connected"
|
|
94
|
-
timeout: 30
|
|
95
|
-
- check: "messages_delivered"
|
|
96
|
-
min_messages_per_node: 5
|
|
97
|
-
```
|
|
98
|
-
|
|
99
|
-
**Run it:**
|
|
100
|
-
```bash
|
|
101
|
-
cd examples/basic/test/simulator
|
|
102
|
-
mkdir build && cd build
|
|
103
|
-
cmake -G Ninja .. && ninja
|
|
104
|
-
bin/painlessmesh-simulator --config ../scenarios/basic_mesh_test.yaml
|
|
105
|
-
```
|
|
106
|
-
|
|
107
|
-
## Creating Tests for Your Example
|
|
108
|
-
|
|
109
|
-
### Step 1: Create Directory Structure
|
|
110
|
-
|
|
111
|
-
```bash
|
|
112
|
-
cd examples/your_example
|
|
113
|
-
mkdir -p test/simulator/firmware test/simulator/scenarios
|
|
114
|
-
```
|
|
115
|
-
|
|
116
|
-
### Step 2: Create Firmware Adapter
|
|
117
|
-
|
|
118
|
-
Create `test/simulator/firmware/your_firmware.hpp`:
|
|
119
|
-
|
|
120
|
-
```cpp
|
|
121
|
-
#pragma once
|
|
122
|
-
#include "simulator/firmware/firmware_base.hpp"
|
|
123
|
-
#include <painlessMesh.h>
|
|
124
|
-
|
|
125
|
-
class YourFirmware : public FirmwareBase {
|
|
126
|
-
public:
|
|
127
|
-
void setup(painlessMesh* mesh, Scheduler* userScheduler) override {
|
|
128
|
-
mesh_ = mesh;
|
|
129
|
-
|
|
130
|
-
// Copy your setup() logic from the .ino file
|
|
131
|
-
mesh_->init("YourPrefix", "password", userScheduler, 5555);
|
|
132
|
-
mesh_->onReceive([this](uint32_t from, String& msg) {
|
|
133
|
-
// Your receive callback
|
|
134
|
-
});
|
|
135
|
-
|
|
136
|
-
// Add your tasks, etc.
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
void loop() override {
|
|
140
|
-
// Copy your loop() logic
|
|
141
|
-
if (mesh_) mesh_->update();
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
const char* getName() const override {
|
|
145
|
-
return "YourExample";
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
private:
|
|
149
|
-
painlessMesh* mesh_;
|
|
150
|
-
};
|
|
151
|
-
```
|
|
152
|
-
|
|
153
|
-
### Step 3: Create Test Scenario
|
|
154
|
-
|
|
155
|
-
Create `test/simulator/scenarios/your_test.yaml`:
|
|
156
|
-
|
|
157
|
-
```yaml
|
|
158
|
-
simulation:
|
|
159
|
-
name: "Your Example Test"
|
|
160
|
-
duration: 60
|
|
161
|
-
|
|
162
|
-
nodes:
|
|
163
|
-
- template: "your_firmware"
|
|
164
|
-
count: 10
|
|
165
|
-
|
|
166
|
-
validation:
|
|
167
|
-
- check: "all_nodes_connected"
|
|
168
|
-
timeout: 30
|
|
169
|
-
```
|
|
170
|
-
|
|
171
|
-
### Step 4: Create CMakeLists.txt
|
|
172
|
-
|
|
173
|
-
Copy from `examples/basic/test/simulator/CMakeLists.txt` and adapt paths.
|
|
174
|
-
|
|
175
|
-
### Step 5: Run Test
|
|
176
|
-
|
|
177
|
-
```bash
|
|
178
|
-
cd test/simulator/build
|
|
179
|
-
bin/painlessmesh-simulator --config ../../../examples/your_example/test/simulator/scenarios/your_test.yaml
|
|
180
|
-
```
|
|
181
|
-
|
|
182
|
-
## Test Scenarios
|
|
183
|
-
|
|
184
|
-
### Available Validations
|
|
185
|
-
|
|
186
|
-
```yaml
|
|
187
|
-
validation:
|
|
188
|
-
# Mesh formation
|
|
189
|
-
- check: "all_nodes_connected"
|
|
190
|
-
timeout: 30
|
|
191
|
-
|
|
192
|
-
# Message delivery
|
|
193
|
-
- check: "messages_delivered"
|
|
194
|
-
min_messages_per_node: 5
|
|
195
|
-
timeout: 60
|
|
196
|
-
|
|
197
|
-
# Time synchronization
|
|
198
|
-
- check: "time_synchronized"
|
|
199
|
-
max_time_diff_ms: 10000
|
|
200
|
-
timeout: 45
|
|
201
|
-
|
|
202
|
-
# Custom metrics
|
|
203
|
-
- check: "custom_metric"
|
|
204
|
-
metric_name: "your_metric"
|
|
205
|
-
min_value: 100
|
|
206
|
-
```
|
|
207
|
-
|
|
208
|
-
### Network Conditions
|
|
209
|
-
|
|
210
|
-
```yaml
|
|
211
|
-
network:
|
|
212
|
-
latency:
|
|
213
|
-
min_ms: 10
|
|
214
|
-
max_ms: 100
|
|
215
|
-
bandwidth_kbps: 256
|
|
216
|
-
packet_loss_percent: 5
|
|
217
|
-
|
|
218
|
-
events:
|
|
219
|
-
# Network partition
|
|
220
|
-
- type: "network_partition"
|
|
221
|
-
time: 30
|
|
222
|
-
duration: 15
|
|
223
|
-
groups: [[0,1,2], [3,4,5]]
|
|
224
|
-
|
|
225
|
-
# Node failures
|
|
226
|
-
- type: "node_crash"
|
|
227
|
-
time: 45
|
|
228
|
-
nodes: [2, 5]
|
|
229
|
-
|
|
230
|
-
# Node recovery
|
|
231
|
-
- type: "node_restart"
|
|
232
|
-
time: 50
|
|
233
|
-
nodes: [2, 5]
|
|
234
|
-
```
|
|
235
|
-
|
|
236
|
-
### Topology Options
|
|
237
|
-
|
|
238
|
-
```yaml
|
|
239
|
-
topology:
|
|
240
|
-
type: "random" # Random connections
|
|
241
|
-
# OR
|
|
242
|
-
type: "ring" # Ring topology
|
|
243
|
-
# OR
|
|
244
|
-
type: "star" # Star topology
|
|
245
|
-
# OR
|
|
246
|
-
type: "mesh" # Full mesh
|
|
247
|
-
# OR
|
|
248
|
-
type: "tree" # Tree topology
|
|
249
|
-
|
|
250
|
-
connectivity: 0.7 # For random: 70% connectivity
|
|
251
|
-
```
|
|
252
|
-
|
|
253
|
-
## Metrics and Analysis
|
|
254
|
-
|
|
255
|
-
### Collected Metrics
|
|
256
|
-
|
|
257
|
-
The simulator automatically collects:
|
|
258
|
-
- Messages sent/received per node
|
|
259
|
-
- Topology changes
|
|
260
|
-
- Connection count
|
|
261
|
-
- Time synchronization drift
|
|
262
|
-
- Custom application metrics
|
|
263
|
-
|
|
264
|
-
### Output Format
|
|
265
|
-
|
|
266
|
-
Results are saved as CSV:
|
|
267
|
-
|
|
268
|
-
```csv
|
|
269
|
-
timestamp,node_id,messages_sent,messages_received,connections,time_drift_ms
|
|
270
|
-
0,6481,0,0,0,150000
|
|
271
|
-
1,6481,1,0,2,145000
|
|
272
|
-
2,6481,1,3,2,140000
|
|
273
|
-
...
|
|
274
|
-
```
|
|
275
|
-
|
|
276
|
-
### Analysis
|
|
277
|
-
|
|
278
|
-
```python
|
|
279
|
-
import pandas as pd
|
|
280
|
-
|
|
281
|
-
df = pd.read_csv('results/test_results.csv')
|
|
282
|
-
|
|
283
|
-
# Messages per node
|
|
284
|
-
print(df.groupby('node_id')['messages_received'].sum())
|
|
285
|
-
|
|
286
|
-
# Average connections
|
|
287
|
-
print(df.groupby('timestamp')['connections'].mean())
|
|
288
|
-
|
|
289
|
-
# Time sync performance
|
|
290
|
-
print(df.groupby('timestamp')['time_drift_ms'].max())
|
|
291
|
-
```
|
|
292
|
-
|
|
293
|
-
## CI/CD Integration
|
|
294
|
-
|
|
295
|
-
### GitHub Actions Integration
|
|
296
|
-
|
|
297
|
-
Simulator tests are integrated into the CI/CD pipeline in `.github/workflows/ci.yml`:
|
|
298
|
-
|
|
299
|
-
**The `simulator-tests` job:**
|
|
300
|
-
- Runs on every push and pull request
|
|
301
|
-
- Builds the simulator from the submodule
|
|
302
|
-
- Executes example test scenarios
|
|
303
|
-
- Uploads results as artifacts
|
|
304
|
-
|
|
305
|
-
**Configuration:**
|
|
306
|
-
```yaml
|
|
307
|
-
simulator-tests:
|
|
308
|
-
name: Simulator Integration Tests
|
|
309
|
-
runs-on: ubuntu-latest
|
|
310
|
-
steps:
|
|
311
|
-
- uses: actions/checkout@v4
|
|
312
|
-
with:
|
|
313
|
-
submodules: recursive
|
|
314
|
-
|
|
315
|
-
- name: Install dependencies
|
|
316
|
-
run: |
|
|
317
|
-
sudo apt-get install cmake ninja-build libboost-dev libboost-program-options-dev libyaml-cpp-dev
|
|
318
|
-
|
|
319
|
-
- name: Build simulator
|
|
320
|
-
run: |
|
|
321
|
-
cd test/simulator
|
|
322
|
-
mkdir build && cd build
|
|
323
|
-
cmake -G Ninja .. && ninja
|
|
324
|
-
|
|
325
|
-
- name: Run tests
|
|
326
|
-
run: |
|
|
327
|
-
cd test/simulator/build
|
|
328
|
-
bin/painlessmesh-simulator --config \
|
|
329
|
-
../../../examples/basic/test/simulator/scenarios/basic_mesh_test.yaml
|
|
330
|
-
```
|
|
331
|
-
|
|
332
|
-
This ensures example sketches are validated on every code change.
|
|
333
|
-
|
|
334
|
-
## Examples with Simulator Tests
|
|
335
|
-
|
|
336
|
-
### Currently Available
|
|
337
|
-
|
|
338
|
-
- ✅ `examples/basic/` - Basic mesh formation and broadcasting
|
|
339
|
-
|
|
340
|
-
### Coming Soon
|
|
341
|
-
|
|
342
|
-
- ⏳ `examples/startHere/` - Getting started example
|
|
343
|
-
- ⏳ `examples/echoNode/` - Echo server/client
|
|
344
|
-
- ⏳ `examples/bridge/` - Internet bridge functionality
|
|
345
|
-
- ⏳ `examples/mqttBridge/` - MQTT integration
|
|
346
|
-
|
|
347
|
-
## Documentation
|
|
348
|
-
|
|
349
|
-
- **Simulator Repository**: https://github.com/Alteriom/painlessMesh-simulator
|
|
350
|
-
- **Getting Started**: [test/simulator/GETTING_STARTED.md](../test/simulator/GETTING_STARTED.md)
|
|
351
|
-
- **Integration Guide**: [test/simulator/docs/INTEGRATING_INTO_YOUR_PROJECT.md](../test/simulator/docs/INTEGRATING_INTO_YOUR_PROJECT.md)
|
|
352
|
-
- **Configuration Reference**: [test/simulator/docs/CONFIGURATION_GUIDE.md](../test/simulator/docs/CONFIGURATION_GUIDE.md)
|
|
353
|
-
|
|
354
|
-
## Troubleshooting
|
|
355
|
-
|
|
356
|
-
### Submodule not initialized
|
|
357
|
-
|
|
358
|
-
```bash
|
|
359
|
-
cd test
|
|
360
|
-
git submodule update --init simulator
|
|
361
|
-
```
|
|
362
|
-
|
|
363
|
-
### Build errors
|
|
364
|
-
|
|
365
|
-
```bash
|
|
366
|
-
# Check dependencies
|
|
367
|
-
sudo apt-get install cmake ninja-build libboost-dev libyaml-cpp-dev
|
|
368
|
-
|
|
369
|
-
# Clean rebuild
|
|
370
|
-
cd test/simulator
|
|
371
|
-
rm -rf build
|
|
372
|
-
mkdir build && cd build
|
|
373
|
-
cmake -G Ninja ..
|
|
374
|
-
ninja
|
|
375
|
-
```
|
|
376
|
-
|
|
377
|
-
### Simulation timeouts
|
|
378
|
-
|
|
379
|
-
Increase timeout in YAML:
|
|
380
|
-
```yaml
|
|
381
|
-
simulation:
|
|
382
|
-
duration: 120 # Increase from 60
|
|
383
|
-
```
|
|
384
|
-
|
|
385
|
-
### Memory issues with large meshes
|
|
386
|
-
|
|
387
|
-
Reduce node count or increase system resources.
|
|
388
|
-
|
|
389
|
-
## Benefits
|
|
390
|
-
|
|
391
|
-
✅ **Fast iteration** - Test in seconds vs hours of hardware testing
|
|
392
|
-
✅ **Reproducible** - Same scenario always produces same results
|
|
393
|
-
✅ **Scalable** - Test with 100+ nodes on a laptop
|
|
394
|
-
✅ **Automated** - Integrate with CI/CD
|
|
395
|
-
✅ **Cost-effective** - No hardware required
|
|
396
|
-
✅ **Realistic** - Same code runs on hardware and simulator
|
|
397
|
-
|
|
398
|
-
## Contributing
|
|
399
|
-
|
|
400
|
-
To add simulator tests for more examples:
|
|
401
|
-
|
|
402
|
-
1. Create test structure in `examples/your_example/test/simulator/`
|
|
403
|
-
2. Adapt the .ino logic into a firmware adapter
|
|
404
|
-
3. Create test scenarios with validation criteria
|
|
405
|
-
4. Document in README.md
|
|
406
|
-
5. Submit pull request
|
|
407
|
-
|
|
408
|
-
See existing examples for patterns to follow.
|
|
@@ -1,213 +0,0 @@
|
|
|
1
|
-
# Version Management in AlteriomPainlessMesh
|
|
2
|
-
|
|
3
|
-
This document explains how versioning works in the AlteriomPainlessMesh library and clarifies common questions about version numbers in different files.
|
|
4
|
-
|
|
5
|
-
## 📋 Version Number Locations
|
|
6
|
-
|
|
7
|
-
The library version is maintained in multiple files across the repository:
|
|
8
|
-
|
|
9
|
-
### 1. **Official Version Files** (Source of Truth)
|
|
10
|
-
|
|
11
|
-
These files define the official library version:
|
|
12
|
-
|
|
13
|
-
- **`library.properties`** - Arduino Library Manager version
|
|
14
|
-
- **`library.json`** - PlatformIO Library Registry version
|
|
15
|
-
- **`package.json`** - NPM package version
|
|
16
|
-
|
|
17
|
-
**All three files must always have the same version number.**
|
|
18
|
-
|
|
19
|
-
### 2. **Header File Version Comments** (Documentation)
|
|
20
|
-
|
|
21
|
-
These are **documentation comments** that indicate when the header file documentation was last updated:
|
|
22
|
-
|
|
23
|
-
- **`src/painlessMesh.h`** - `@version` in header comment
|
|
24
|
-
- **`src/AlteriomPainlessMesh.h`** - `ALTERIOM_PAINLESS_MESH_VERSION` defines
|
|
25
|
-
|
|
26
|
-
**Important:** Version numbers in header file comments reflect the overall library version at the time the header was documented, not file-specific versioning.
|
|
27
|
-
|
|
28
|
-
## ❓ Common Questions
|
|
29
|
-
|
|
30
|
-
### Q: Does the version in `painlessMesh.h` mean the file hasn't changed since that version?
|
|
31
|
-
|
|
32
|
-
**A: No.** The version comment in header files indicates the library version when the header documentation was last reviewed/updated, not the last time the file was modified.
|
|
33
|
-
|
|
34
|
-
**Example:**
|
|
35
|
-
```cpp
|
|
36
|
-
/**
|
|
37
|
-
* @file painlessMesh.h
|
|
38
|
-
* @version 1.8.7
|
|
39
|
-
* @date 2025-11-12
|
|
40
|
-
*/
|
|
41
|
-
```
|
|
42
|
-
|
|
43
|
-
This means:
|
|
44
|
-
- ✅ The library version is 1.8.7
|
|
45
|
-
- ✅ The header documentation is current as of version 1.8.7
|
|
46
|
-
- ❌ It does NOT mean the file hasn't been modified since 1.8.7
|
|
47
|
-
|
|
48
|
-
### Q: Why might header version comments be out of sync?
|
|
49
|
-
|
|
50
|
-
**A:** During rapid development, header file documentation may not be updated every release. The comments are updated when:
|
|
51
|
-
- Significant API changes are made
|
|
52
|
-
- Documentation requires updating
|
|
53
|
-
- Major version milestones are reached
|
|
54
|
-
- Version consistency review is performed
|
|
55
|
-
|
|
56
|
-
### Q: Which version number should I trust?
|
|
57
|
-
|
|
58
|
-
**A:** Always refer to the official version files:
|
|
59
|
-
1. `library.properties` - Official Arduino version
|
|
60
|
-
2. `library.json` - Official PlatformIO version
|
|
61
|
-
3. `package.json` - Official NPM version
|
|
62
|
-
4. GitHub releases - Tagged release versions
|
|
63
|
-
|
|
64
|
-
Header file comments are for documentation reference only.
|
|
65
|
-
|
|
66
|
-
## 🔄 Version Update Process
|
|
67
|
-
|
|
68
|
-
### When Releasing a New Version:
|
|
69
|
-
|
|
70
|
-
1. **Update Official Version Files** (required)
|
|
71
|
-
```bash
|
|
72
|
-
./scripts/bump-version.sh patch # or minor, major
|
|
73
|
-
```
|
|
74
|
-
This updates: `library.properties`, `library.json`, `package.json`
|
|
75
|
-
|
|
76
|
-
2. **Update CHANGELOG.md** (required)
|
|
77
|
-
- Move items from `[Unreleased]` to new version section
|
|
78
|
-
- Add release date
|
|
79
|
-
|
|
80
|
-
3. **Update Header File Comments** (recommended)
|
|
81
|
-
- Update `@version` in `src/painlessMesh.h`
|
|
82
|
-
- Update version defines in `src/AlteriomPainlessMesh.h`
|
|
83
|
-
|
|
84
|
-
4. **Commit and Tag** (required)
|
|
85
|
-
```bash
|
|
86
|
-
git commit -m "release: vX.Y.Z - Brief description"
|
|
87
|
-
git push origin main
|
|
88
|
-
```
|
|
89
|
-
GitHub Actions will automatically create the tag.
|
|
90
|
-
|
|
91
|
-
## 📝 Version Comment Best Practices
|
|
92
|
-
|
|
93
|
-
### In Header Files:
|
|
94
|
-
|
|
95
|
-
**Good Practice:**
|
|
96
|
-
```cpp
|
|
97
|
-
/**
|
|
98
|
-
* @file painlessMesh.h
|
|
99
|
-
* @brief Main header file for Alteriom painlessMesh library
|
|
100
|
-
*
|
|
101
|
-
* @version 1.8.7
|
|
102
|
-
* @date 2025-11-12
|
|
103
|
-
*
|
|
104
|
-
* painlessMesh is a user-friendly library for creating mesh networks...
|
|
105
|
-
*/
|
|
106
|
-
```
|
|
107
|
-
|
|
108
|
-
**What This Means:**
|
|
109
|
-
- The library is at version 1.8.7
|
|
110
|
-
- Header documentation was reviewed/updated on 2025-11-12
|
|
111
|
-
- Always synchronized with library version during releases
|
|
112
|
-
|
|
113
|
-
### In Implementation Files:
|
|
114
|
-
|
|
115
|
-
Implementation files (`.cpp`, `.hpp`) typically do not need version comments. Version information in these files can be misleading and is unnecessary since:
|
|
116
|
-
- Git history tracks all changes with timestamps
|
|
117
|
-
- Version is centrally managed in the official version files
|
|
118
|
-
- Per-file versioning creates maintenance overhead
|
|
119
|
-
|
|
120
|
-
## 🎯 Version Management Workflow
|
|
121
|
-
|
|
122
|
-
### Developer Workflow:
|
|
123
|
-
|
|
124
|
-
1. **Check Current Version**
|
|
125
|
-
```bash
|
|
126
|
-
grep "version=" library.properties
|
|
127
|
-
```
|
|
128
|
-
|
|
129
|
-
2. **Make Changes**
|
|
130
|
-
- Implement features/fixes
|
|
131
|
-
- Update documentation as needed
|
|
132
|
-
- Add entries to CHANGELOG.md under `[Unreleased]`
|
|
133
|
-
|
|
134
|
-
3. **Prepare Release**
|
|
135
|
-
```bash
|
|
136
|
-
./scripts/release-agent.sh # Validate release readiness
|
|
137
|
-
./scripts/bump-version.sh patch # Update version
|
|
138
|
-
```
|
|
139
|
-
|
|
140
|
-
4. **Update Documentation**
|
|
141
|
-
- Review and update header file version comments
|
|
142
|
-
- Ensure CHANGELOG.md has the new version section
|
|
143
|
-
- Verify all documentation references are current
|
|
144
|
-
|
|
145
|
-
5. **Release**
|
|
146
|
-
```bash
|
|
147
|
-
git add library.properties library.json package.json CHANGELOG.md src/*.h
|
|
148
|
-
git commit -m "release: v1.8.7 - Brief description"
|
|
149
|
-
git push origin main
|
|
150
|
-
```
|
|
151
|
-
|
|
152
|
-
### Automated Process:
|
|
153
|
-
|
|
154
|
-
GitHub Actions automatically handles:
|
|
155
|
-
- ✅ Git tag creation
|
|
156
|
-
- ✅ GitHub release with notes
|
|
157
|
-
- ✅ NPM publishing
|
|
158
|
-
- ✅ PlatformIO registry update
|
|
159
|
-
- ✅ Documentation deployment
|
|
160
|
-
|
|
161
|
-
## 🔍 Version History Tracking
|
|
162
|
-
|
|
163
|
-
### To Check File History:
|
|
164
|
-
|
|
165
|
-
Use Git to see actual file modification history:
|
|
166
|
-
|
|
167
|
-
```bash
|
|
168
|
-
# See all commits that modified a file
|
|
169
|
-
git log --oneline -- src/painlessMesh.h
|
|
170
|
-
|
|
171
|
-
# See detailed changes to a file
|
|
172
|
-
git log -p -- src/painlessMesh.h
|
|
173
|
-
|
|
174
|
-
# See when a file was last modified
|
|
175
|
-
git log -1 --format="%ai %an" -- src/painlessMesh.h
|
|
176
|
-
```
|
|
177
|
-
|
|
178
|
-
### To Check Version History:
|
|
179
|
-
|
|
180
|
-
```bash
|
|
181
|
-
# List all version tags
|
|
182
|
-
git tag -l "v*"
|
|
183
|
-
|
|
184
|
-
# See changes in a specific version
|
|
185
|
-
git show v1.8.7
|
|
186
|
-
|
|
187
|
-
# Compare two versions
|
|
188
|
-
git diff v1.8.6..v1.8.7
|
|
189
|
-
```
|
|
190
|
-
|
|
191
|
-
## 📚 Related Documentation
|
|
192
|
-
|
|
193
|
-
- **[CHANGELOG.md](../CHANGELOG.md)** - Complete version history with changes
|
|
194
|
-
- **[RELEASE_GUIDE.md](../RELEASE_GUIDE.md)** - Detailed release process
|
|
195
|
-
- **[GitHub Releases](https://github.com/Alteriom/painlessMesh/releases)** - Official release notes
|
|
196
|
-
|
|
197
|
-
## 🎓 Summary
|
|
198
|
-
|
|
199
|
-
**Key Takeaways:**
|
|
200
|
-
|
|
201
|
-
1. **Official version** = `library.properties` / `library.json` / `package.json`
|
|
202
|
-
2. **Header comments** = Documentation reference, not file-specific versions
|
|
203
|
-
3. **Git history** = Actual source of truth for file modifications
|
|
204
|
-
4. **CHANGELOG.md** = Human-readable version history
|
|
205
|
-
5. **GitHub releases** = Tagged versions with release notes
|
|
206
|
-
|
|
207
|
-
**When in doubt:** Check `library.properties` for the official library version, and use `git log` to see actual file modification history.
|
|
208
|
-
|
|
209
|
-
---
|
|
210
|
-
|
|
211
|
-
**Version Management Process Owner:** @Alteriom
|
|
212
|
-
**Last Updated:** 2025-11-12
|
|
213
|
-
**Document Version:** 1.0
|