@alteriom/painlessmesh 1.8.15 → 1.9.1

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