@alteriom/painlessmesh 1.6.1 → 1.7.3

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 (152) hide show
  1. package/CHANGELOG.md +435 -144
  2. package/LICENSE +674 -674
  3. package/README.md +491 -434
  4. package/RELEASE_GUIDE.md +504 -418
  5. package/docs/DOCUMENTATION_MIGRATION_PLAN.md +175 -175
  6. package/docs/IMPLEMENTATION_PLAN_MESH_TOPOLOGY.md +1062 -0
  7. package/docs/MESH_TOPOLOGY_GUIDE.md +992 -0
  8. package/docs/MESH_TOPOLOGY_PROGRESS.md +422 -0
  9. package/docs/MQTT_BRIDGE_COMMANDS.md +894 -0
  10. package/docs/MQTT_BRIDGE_IMPLEMENTATION_SUMMARY.md +324 -0
  11. package/docs/MQTT_COMMAND_SCHEMA_PROPOSAL.md +576 -0
  12. package/docs/MQTT_SCHEMA_COMPLIANCE.md +285 -0
  13. package/docs/MQTT_SCHEMA_PROPOSALS.md +446 -0
  14. package/docs/MQTT_SCHEMA_REVIEW.md +690 -0
  15. package/docs/OTA_COMMANDS_REFERENCE.md +554 -0
  16. package/docs/PHASE1_GUIDE.md +349 -0
  17. package/docs/PHASE2_GUIDE.md +543 -0
  18. package/docs/README.md +130 -71
  19. package/docs/SCHEMA_VALIDATION_CHECKLIST.md +222 -0
  20. package/docs/alteriom/overview.md +507 -507
  21. package/docs/api/core-api.md +606 -606
  22. package/docs/architecture/mesh-architecture.md +378 -378
  23. package/docs/architecture/plugin-system.md +516 -516
  24. package/docs/archive/DOCUSAURUS_DEPLOYMENT.md +166 -0
  25. package/docs/archive/FEATURE_PROPOSALS.md +337 -0
  26. package/docs/archive/LIBRARY_JSON_FIX.md +98 -0
  27. package/docs/archive/LIBRARY_STRUCTURE_FIX.md +215 -0
  28. package/docs/archive/PHASE1_IMPLEMENTATION.md +325 -0
  29. package/docs/archive/PHASE2_IMPLEMENTATION.md +567 -0
  30. package/docs/archive/RELEASE_SUMMARY.md +173 -0
  31. package/docs/archive/SCONS_BUILD_FIX.md +313 -0
  32. package/docs/archive/TRIGGER_RELEASE.md +280 -0
  33. package/docs/archive/VECTOR_INCLUDE_FIX.md +129 -0
  34. package/docs/archive/ota-and-status-enhancements.md +911 -0
  35. package/docs/archive/ota-status-architecture-diagrams.md +658 -0
  36. package/docs/archive/ota-status-quick-reference.md +284 -0
  37. package/docs/development/ARDUINO_COMPLIANCE_SUMMARY.md +71 -0
  38. package/docs/development/CODE_REFACTORING_RECOMMENDATIONS.md +1011 -0
  39. package/docs/development/DOCKER_TESTING.md +196 -0
  40. package/docs/development/PLATFORMIO_USAGE.md +180 -0
  41. package/docs/development/TESTING_SUMMARY.md +126 -0
  42. package/docs/development/contributing.md +301 -0
  43. package/docs/development/documentation.md +583 -0
  44. package/docs/getting-started/first-mesh.md +409 -409
  45. package/docs/getting-started/installation.md +274 -274
  46. package/docs/getting-started/quickstart.md +157 -157
  47. package/docs/improvements/FUTURE_PROPOSALS.md +1016 -0
  48. package/docs/improvements/IMPLEMENTATION_HISTORY.md +1091 -0
  49. package/docs/improvements/OTA_STATUS_ENHANCEMENTS.md +709 -0
  50. package/docs/improvements/README.md +212 -69
  51. package/docs/platformio-publishing.md +255 -0
  52. package/docs/platformio-setup-summary.md +121 -0
  53. package/docs/releases/FEATURE_HISTORY.md +543 -0
  54. package/docs/releases/PATCH_v1.7.3.md +262 -0
  55. package/docs/releases/PHASE1_SUMMARY.md +246 -0
  56. package/docs/releases/PHASE2_SUMMARY.md +499 -0
  57. package/docs/releases/RELEASE_NOTES_1.7.0.md +539 -0
  58. package/docs/troubleshooting/common-issues.md +520 -520
  59. package/docs/troubleshooting/debugging.md +455 -0
  60. package/docs/troubleshooting/faq.md +472 -472
  61. package/docs/tutorials/basic-examples.md +717 -717
  62. package/docs/wiki/API-Reference.md +245 -245
  63. package/docs/wiki/Complete-Documentation.md +122 -122
  64. package/examples/alteriom/README.md +139 -81
  65. package/examples/alteriom/alteriom.ino +186 -185
  66. package/examples/alteriom/alteriom_sensor_package.hpp +240 -127
  67. package/examples/alteriom/platformio.ini +24 -24
  68. package/examples/alteriomImproved/alteriom_sensor_package.hpp +224 -0
  69. package/examples/{alteriom → alteriomImproved}/improved_sensor_node.ino +245 -245
  70. package/examples/alteriomImproved/platformio.ini +25 -0
  71. package/examples/alteriomPhase1/alteriom_sensor_package.hpp +224 -0
  72. package/examples/alteriomPhase1/phase1_features.ino +242 -0
  73. package/examples/alteriomPhase1/platformio.ini +25 -0
  74. package/examples/alteriomPhase2/alteriom_sensor_package.hpp +224 -0
  75. package/examples/alteriomPhase2/phase2_features.ino +186 -0
  76. package/examples/alteriomPhase2/platformio.ini +25 -0
  77. package/examples/{alteriom → alteriomSensorNode}/alteriom_sensor_node.ino +183 -183
  78. package/examples/alteriomSensorNode/alteriom_sensor_package.hpp +224 -0
  79. package/examples/alteriomSensorNode/platformio.ini +25 -0
  80. package/examples/basic/basic.ino +66 -66
  81. package/examples/basic/platformio.ini +25 -25
  82. package/examples/bridge/bridge.ino +51 -51
  83. package/examples/bridge/mesh_event_publisher.hpp +253 -0
  84. package/examples/bridge/mesh_topology_reporter.hpp +303 -0
  85. package/examples/bridge/mqtt_command_bridge.hpp +459 -0
  86. package/examples/bridge/mqtt_status_bridge.hpp +519 -0
  87. package/examples/bridge/platformio.ini +25 -25
  88. package/examples/echoNode/echoNode.ino +33 -33
  89. package/examples/echoNode/platformio.ini +25 -25
  90. package/examples/logClient/logClient.ino +109 -109
  91. package/examples/logClient/platformio.ini +25 -25
  92. package/examples/logServer/logServer.ino +81 -81
  93. package/examples/logServer/platformio.ini +25 -25
  94. package/examples/meshCommandNode/alteriom_sensor_package.hpp +235 -0
  95. package/examples/meshCommandNode/meshCommandNode.ino +263 -0
  96. package/examples/meshCommandNode/platformio.ini +25 -0
  97. package/examples/mqttBridge/mqttBridge.ino +118 -118
  98. package/examples/mqttBridge/platformio.ini +26 -26
  99. package/examples/mqttCommandBridge/alteriom_sensor_package.hpp +235 -0
  100. package/examples/mqttCommandBridge/mesh_event_publisher.hpp +253 -0
  101. package/examples/mqttCommandBridge/mesh_topology_reporter.hpp +303 -0
  102. package/examples/mqttCommandBridge/mqttCommandBridge.ino +252 -0
  103. package/examples/mqttCommandBridge/mqtt_command_bridge.hpp +459 -0
  104. package/examples/mqttCommandBridge/platformio.ini +26 -0
  105. package/examples/mqttStatusBridge/mqttStatusBridge.ino +216 -0
  106. package/examples/mqttStatusBridge/mqtt_status_bridge.hpp +522 -0
  107. package/examples/mqttStatusBridge/platformio.ini +26 -0
  108. package/examples/mqttTopologyTest/README.md +467 -0
  109. package/examples/mqttTopologyTest/mqttTopologyTest.ino +748 -0
  110. package/examples/mqttTopologyTest/platformio.ini +26 -0
  111. package/examples/namedMesh/namedMesh.ino +97 -97
  112. package/examples/namedMesh/platformio.ini +25 -25
  113. package/examples/otaReceiver/otaReceiver.ino +79 -79
  114. package/examples/otaReceiver/platformio.ini +25 -25
  115. package/examples/otaSender/otaSender.ino +160 -151
  116. package/examples/otaSender/platformio.ini +25 -25
  117. package/examples/startHere/platformio.ini +25 -25
  118. package/examples/startHere/startHere.ino +159 -159
  119. package/examples/webServer/platformio.ini +27 -27
  120. package/examples/webServer/webServer.ino +89 -89
  121. package/keywords.txt +48 -48
  122. package/library.json +55 -34
  123. package/library.properties +10 -10
  124. package/package.json +86 -78
  125. package/src/AlteriomPainlessMesh.h +97 -97
  126. package/src/arduino/wifi.hpp +365 -365
  127. package/src/boost/asynctcp.hpp +279 -279
  128. package/src/painlessMesh.h +70 -70
  129. package/src/painlessMeshSTA.cpp +236 -236
  130. package/src/painlessMeshSTA.h +58 -58
  131. package/src/painlessTaskOptions.h +4 -4
  132. package/src/painlessmesh/base64.hpp +111 -111
  133. package/src/painlessmesh/buffer.hpp +229 -229
  134. package/src/painlessmesh/callback.hpp +91 -91
  135. package/src/painlessmesh/configuration.hpp +77 -77
  136. package/src/painlessmesh/connection.hpp +192 -192
  137. package/src/painlessmesh/layout.hpp +188 -188
  138. package/src/painlessmesh/logger.hpp +158 -158
  139. package/src/painlessmesh/memory.hpp +119 -119
  140. package/src/painlessmesh/mesh.hpp +761 -560
  141. package/src/painlessmesh/metrics.hpp +322 -322
  142. package/src/painlessmesh/ntp.hpp +263 -263
  143. package/src/painlessmesh/ota.hpp +582 -553
  144. package/src/painlessmesh/plugin.hpp +188 -188
  145. package/src/painlessmesh/protocol.hpp +813 -813
  146. package/src/painlessmesh/router.hpp +338 -322
  147. package/src/painlessmesh/tcp.hpp +71 -71
  148. package/src/painlessmesh/validation.hpp +238 -238
  149. package/src/plugin/performance.hpp +214 -214
  150. package/src/plugin/remote.hpp +64 -64
  151. package/src/scheduler.cpp +10 -10
  152. package/src/wifi.cpp +2 -2
@@ -1,158 +1,158 @@
1
- # Quick Start Guide
2
-
3
- Get your first painlessMesh network running in just a few minutes! This guide will walk you through creating a simple mesh network with two ESP8266 or ESP32 devices.
4
-
5
- ## What You'll Need
6
-
7
- - 2 or more ESP8266 or ESP32 development boards
8
- - Arduino IDE or PlatformIO
9
- - USB cables for programming
10
-
11
- ## Step 1: Install painlessMesh
12
-
13
- ### Arduino IDE
14
- 1. Open Arduino IDE
15
- 2. Go to **Sketch → Include Library → Manage Libraries**
16
- 3. Search for "painlessMesh"
17
- 4. Install the latest version by "Coopdis"
18
-
19
- ### PlatformIO
20
- Add to your `platformio.ini`:
21
- ```ini
22
- lib_deps =
23
- painlessMesh
24
- ```
25
-
26
- ## Step 2: Basic Mesh Example
27
-
28
- Copy this code to your Arduino IDE or create a new PlatformIO project:
29
-
30
- ```cpp
31
- #include "painlessMesh.h"
32
-
33
- #define MESH_PREFIX "MyMeshNetwork"
34
- #define MESH_PASSWORD "somethingSneaky"
35
- #define MESH_PORT 5555
36
-
37
- Scheduler userScheduler; // to control your personal task
38
- painlessMesh mesh;
39
-
40
- // User stub
41
- void sendMessage(); // Prototype so PlatformIO doesn't complain
42
-
43
- Task taskSendMessage(TASK_SECOND * 1, TASK_FOREVER, &sendMessage);
44
-
45
- void sendMessage() {
46
- String msg = "Hello from node ";
47
- msg += mesh.getNodeId();
48
- mesh.sendBroadcast(msg);
49
- taskSendMessage.setInterval(random(TASK_SECOND * 1, TASK_SECOND * 5));
50
- }
51
-
52
- // Needed for painless library
53
- void receivedCallback(uint32_t from, String &msg) {
54
- Serial.printf("startHere: Received from %u msg=%s\n", from, msg.c_str());
55
- }
56
-
57
- void newConnectionCallback(uint32_t nodeId) {
58
- Serial.printf("--> startHere: New Connection, nodeId = %u\n", nodeId);
59
- }
60
-
61
- void changedConnectionCallback() {
62
- Serial.printf("Changed connections\n");
63
- }
64
-
65
- void nodeTimeAdjustedCallback(int32_t offset) {
66
- Serial.printf("Adjusted time %u. Offset = %d\n", mesh.getNodeTime(),offset);
67
- }
68
-
69
- void setup() {
70
- Serial.begin(115200);
71
-
72
- // Set debug messages before init()
73
- mesh.setDebugMsgTypes(ERROR | STARTUP);
74
-
75
- // Initialize mesh
76
- mesh.init(MESH_PREFIX, MESH_PASSWORD, &userScheduler, MESH_PORT);
77
- mesh.onReceive(&receivedCallback);
78
- mesh.onNewConnection(&newConnectionCallback);
79
- mesh.onChangedConnections(&changedConnectionCallback);
80
- mesh.onNodeTimeAdjusted(&nodeTimeAdjustedCallback);
81
-
82
- // Add task to scheduler
83
- userScheduler.addTask(taskSendMessage);
84
- taskSendMessage.enable();
85
- }
86
-
87
- void loop() {
88
- // it will run the user scheduler as well
89
- mesh.update();
90
- }
91
- ```
92
-
93
- ## Step 3: Upload and Test
94
-
95
- 1. **Upload the code** to your first ESP8266/ESP32 device
96
- 2. **Open Serial Monitor** (115200 baud) to see debug messages
97
- 3. **Upload the same code** to your second device
98
- 4. Watch them automatically discover each other and start exchanging messages!
99
-
100
- ## What You Should See
101
-
102
- In the Serial Monitor, you'll see output like:
103
- ```
104
- startHere: New Connection, nodeId = 123456789
105
- startHere: Received from 123456789 msg=Hello from node 123456789
106
- Changed connections
107
- Adjusted time 1234567. Offset = 12
108
- ```
109
-
110
- ## Key Concepts
111
-
112
- - **Mesh Network**: All nodes automatically discover and connect to each other
113
- - **Broadcasting**: Messages sent to all nodes in the network
114
- - **Node ID**: Each device gets a unique identifier
115
- - **Time Sync**: All nodes automatically synchronize their clocks
116
- - **Self-Healing**: If nodes disconnect, the mesh automatically reorganizes
117
-
118
- ## Next Steps
119
-
120
- Now that you have a basic mesh working:
121
-
122
- 1. **Add more nodes** - Upload the same code to additional devices
123
- 2. **Try different message types** - See [Custom Packages Tutorial](../tutorials/custom-packages.md)
124
- 3. **Add sensors** - Check out the [Sensor Networks Tutorial](../tutorials/sensor-networks.md)
125
- 4. **Explore Alteriom features** - Learn about [Alteriom Extensions](../alteriom/overview.md)
126
-
127
- ## Troubleshooting
128
-
129
- **Nodes not connecting?**
130
- - Make sure MESH_PREFIX and MESH_PASSWORD are identical on all devices
131
- - Check that devices are within WiFi range
132
- - Verify MESH_PORT is the same on all devices
133
-
134
- **Serial output not showing?**
135
- - Check baud rate is set to 115200
136
- - Ensure USB cable supports data transfer
137
- - Try pressing the reset button after upload
138
-
139
- For more help, see our [Troubleshooting Guide](../troubleshooting/common-issues.md).
140
-
141
- ## Configuration Options
142
-
143
- You can customize your mesh network by changing these parameters:
144
-
145
- ```cpp
146
- // Network credentials
147
- #define MESH_PREFIX "YourNetworkName" // Network name (SSID)
148
- #define MESH_PASSWORD "YourPassword" // Network password
149
- #define MESH_PORT 5555 // TCP port for mesh communication
150
-
151
- // Debug levels - combine with | operator
152
- mesh.setDebugMsgTypes(ERROR | STARTUP | CONNECTION);
153
-
154
- // Available debug types:
155
- // ERROR, STARTUP, CONNECTION, SYNC, COMMUNICATION, GENERAL, MSG_TYPES, REMOTE
156
- ```
157
-
1
+ # Quick Start Guide
2
+
3
+ Get your first painlessMesh network running in just a few minutes! This guide will walk you through creating a simple mesh network with two ESP8266 or ESP32 devices.
4
+
5
+ ## What You'll Need
6
+
7
+ - 2 or more ESP8266 or ESP32 development boards
8
+ - Arduino IDE or PlatformIO
9
+ - USB cables for programming
10
+
11
+ ## Step 1: Install painlessMesh
12
+
13
+ ### Arduino IDE
14
+ 1. Open Arduino IDE
15
+ 2. Go to **Sketch → Include Library → Manage Libraries**
16
+ 3. Search for "painlessMesh"
17
+ 4. Install the latest version by "Coopdis"
18
+
19
+ ### PlatformIO
20
+ Add to your `platformio.ini`:
21
+ ```ini
22
+ lib_deps =
23
+ painlessMesh
24
+ ```
25
+
26
+ ## Step 2: Basic Mesh Example
27
+
28
+ Copy this code to your Arduino IDE or create a new PlatformIO project:
29
+
30
+ ```cpp
31
+ #include "painlessMesh.h"
32
+
33
+ #define MESH_PREFIX "MyMeshNetwork"
34
+ #define MESH_PASSWORD "somethingSneaky"
35
+ #define MESH_PORT 5555
36
+
37
+ Scheduler userScheduler; // to control your personal task
38
+ painlessMesh mesh;
39
+
40
+ // User stub
41
+ void sendMessage(); // Prototype so PlatformIO doesn't complain
42
+
43
+ Task taskSendMessage(TASK_SECOND * 1, TASK_FOREVER, &sendMessage);
44
+
45
+ void sendMessage() {
46
+ String msg = "Hello from node ";
47
+ msg += mesh.getNodeId();
48
+ mesh.sendBroadcast(msg);
49
+ taskSendMessage.setInterval(random(TASK_SECOND * 1, TASK_SECOND * 5));
50
+ }
51
+
52
+ // Needed for painless library
53
+ void receivedCallback(uint32_t from, String &msg) {
54
+ Serial.printf("startHere: Received from %u msg=%s\n", from, msg.c_str());
55
+ }
56
+
57
+ void newConnectionCallback(uint32_t nodeId) {
58
+ Serial.printf("--> startHere: New Connection, nodeId = %u\n", nodeId);
59
+ }
60
+
61
+ void changedConnectionCallback() {
62
+ Serial.printf("Changed connections\n");
63
+ }
64
+
65
+ void nodeTimeAdjustedCallback(int32_t offset) {
66
+ Serial.printf("Adjusted time %u. Offset = %d\n", mesh.getNodeTime(),offset);
67
+ }
68
+
69
+ void setup() {
70
+ Serial.begin(115200);
71
+
72
+ // Set debug messages before init()
73
+ mesh.setDebugMsgTypes(ERROR | STARTUP);
74
+
75
+ // Initialize mesh
76
+ mesh.init(MESH_PREFIX, MESH_PASSWORD, &userScheduler, MESH_PORT);
77
+ mesh.onReceive(&receivedCallback);
78
+ mesh.onNewConnection(&newConnectionCallback);
79
+ mesh.onChangedConnections(&changedConnectionCallback);
80
+ mesh.onNodeTimeAdjusted(&nodeTimeAdjustedCallback);
81
+
82
+ // Add task to scheduler
83
+ userScheduler.addTask(taskSendMessage);
84
+ taskSendMessage.enable();
85
+ }
86
+
87
+ void loop() {
88
+ // it will run the user scheduler as well
89
+ mesh.update();
90
+ }
91
+ ```
92
+
93
+ ## Step 3: Upload and Test
94
+
95
+ 1. **Upload the code** to your first ESP8266/ESP32 device
96
+ 2. **Open Serial Monitor** (115200 baud) to see debug messages
97
+ 3. **Upload the same code** to your second device
98
+ 4. Watch them automatically discover each other and start exchanging messages!
99
+
100
+ ## What You Should See
101
+
102
+ In the Serial Monitor, you'll see output like:
103
+ ```
104
+ startHere: New Connection, nodeId = 123456789
105
+ startHere: Received from 123456789 msg=Hello from node 123456789
106
+ Changed connections
107
+ Adjusted time 1234567. Offset = 12
108
+ ```
109
+
110
+ ## Key Concepts
111
+
112
+ - **Mesh Network**: All nodes automatically discover and connect to each other
113
+ - **Broadcasting**: Messages sent to all nodes in the network
114
+ - **Node ID**: Each device gets a unique identifier
115
+ - **Time Sync**: All nodes automatically synchronize their clocks
116
+ - **Self-Healing**: If nodes disconnect, the mesh automatically reorganizes
117
+
118
+ ## Next Steps
119
+
120
+ Now that you have a basic mesh working:
121
+
122
+ 1. **Add more nodes** - Upload the same code to additional devices
123
+ 2. **Try different message types** - See [Custom Packages Tutorial](../tutorials/custom-packages.md)
124
+ 3. **Add sensors** - Check out the [Sensor Networks Tutorial](../tutorials/sensor-networks.md)
125
+ 4. **Explore Alteriom features** - Learn about [Alteriom Extensions](../alteriom/overview.md)
126
+
127
+ ## Troubleshooting
128
+
129
+ **Nodes not connecting?**
130
+ - Make sure MESH_PREFIX and MESH_PASSWORD are identical on all devices
131
+ - Check that devices are within WiFi range
132
+ - Verify MESH_PORT is the same on all devices
133
+
134
+ **Serial output not showing?**
135
+ - Check baud rate is set to 115200
136
+ - Ensure USB cable supports data transfer
137
+ - Try pressing the reset button after upload
138
+
139
+ For more help, see our [Troubleshooting Guide](../troubleshooting/common-issues.md).
140
+
141
+ ## Configuration Options
142
+
143
+ You can customize your mesh network by changing these parameters:
144
+
145
+ ```cpp
146
+ // Network credentials
147
+ #define MESH_PREFIX "YourNetworkName" // Network name (SSID)
148
+ #define MESH_PASSWORD "YourPassword" // Network password
149
+ #define MESH_PORT 5555 // TCP port for mesh communication
150
+
151
+ // Debug levels - combine with | operator
152
+ mesh.setDebugMsgTypes(ERROR | STARTUP | CONNECTION);
153
+
154
+ // Available debug types:
155
+ // ERROR, STARTUP, CONNECTION, SYNC, COMMUNICATION, GENERAL, MSG_TYPES, REMOTE
156
+ ```
157
+
158
158
  Ready to dive deeper? Check out our [Installation Guide](installation.md) for more advanced setup options!