@alteriom/painlessmesh 1.6.1 → 1.7.2
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 +380 -143
- package/LICENSE +674 -674
- package/README.md +477 -434
- package/RELEASE_GUIDE.md +504 -418
- package/docs/DOCUMENTATION_MIGRATION_PLAN.md +175 -175
- package/docs/IMPLEMENTATION_PLAN_MESH_TOPOLOGY.md +1062 -0
- package/docs/MESH_TOPOLOGY_GUIDE.md +992 -0
- package/docs/MESH_TOPOLOGY_PROGRESS.md +422 -0
- package/docs/MQTT_BRIDGE_COMMANDS.md +894 -0
- package/docs/MQTT_BRIDGE_IMPLEMENTATION_SUMMARY.md +324 -0
- package/docs/MQTT_COMMAND_SCHEMA_PROPOSAL.md +576 -0
- package/docs/MQTT_SCHEMA_COMPLIANCE.md +285 -0
- package/docs/MQTT_SCHEMA_PROPOSALS.md +446 -0
- package/docs/MQTT_SCHEMA_REVIEW.md +690 -0
- package/docs/OTA_COMMANDS_REFERENCE.md +554 -0
- package/docs/PHASE1_GUIDE.md +349 -0
- package/docs/PHASE2_GUIDE.md +543 -0
- package/docs/README.md +77 -70
- package/docs/SCHEMA_VALIDATION_CHECKLIST.md +222 -0
- package/docs/alteriom/overview.md +507 -507
- package/docs/api/core-api.md +606 -606
- package/docs/architecture/mesh-architecture.md +378 -378
- package/docs/architecture/plugin-system.md +516 -516
- package/docs/getting-started/first-mesh.md +409 -409
- package/docs/getting-started/installation.md +274 -274
- package/docs/getting-started/quickstart.md +157 -157
- package/docs/improvements/FEATURE_PROPOSALS.md +337 -0
- package/docs/improvements/PHASE1_IMPLEMENTATION.md +325 -0
- package/docs/improvements/PHASE2_IMPLEMENTATION.md +567 -0
- package/docs/improvements/README.md +86 -68
- package/docs/improvements/ota-and-status-enhancements.md +911 -0
- package/docs/improvements/ota-status-architecture-diagrams.md +658 -0
- package/docs/improvements/ota-status-quick-reference.md +284 -0
- package/docs/platformio-publishing.md +255 -0
- package/docs/platformio-setup-summary.md +121 -0
- package/docs/troubleshooting/common-issues.md +520 -520
- package/docs/troubleshooting/faq.md +472 -472
- package/docs/tutorials/basic-examples.md +717 -717
- package/docs/wiki/API-Reference.md +245 -245
- package/docs/wiki/Complete-Documentation.md +122 -122
- package/examples/alteriom/README.md +139 -81
- package/examples/alteriom/alteriom.ino +186 -185
- package/examples/alteriom/alteriom_sensor_package.hpp +240 -127
- package/examples/alteriom/platformio.ini +24 -24
- package/examples/alteriomImproved/alteriom_sensor_package.hpp +224 -0
- package/examples/{alteriom → alteriomImproved}/improved_sensor_node.ino +245 -245
- package/examples/alteriomImproved/platformio.ini +25 -0
- package/examples/alteriomPhase1/alteriom_sensor_package.hpp +224 -0
- package/examples/alteriomPhase1/phase1_features.ino +242 -0
- package/examples/alteriomPhase1/platformio.ini +25 -0
- package/examples/alteriomPhase2/alteriom_sensor_package.hpp +224 -0
- package/examples/alteriomPhase2/phase2_features.ino +186 -0
- package/examples/alteriomPhase2/platformio.ini +25 -0
- package/examples/{alteriom → alteriomSensorNode}/alteriom_sensor_node.ino +183 -183
- package/examples/alteriomSensorNode/alteriom_sensor_package.hpp +224 -0
- package/examples/alteriomSensorNode/platformio.ini +25 -0
- package/examples/basic/basic.ino +66 -66
- package/examples/basic/platformio.ini +25 -25
- package/examples/bridge/bridge.ino +51 -51
- package/examples/bridge/mesh_event_publisher.hpp +253 -0
- package/examples/bridge/mesh_topology_reporter.hpp +303 -0
- package/examples/bridge/mqtt_command_bridge.hpp +459 -0
- package/examples/bridge/mqtt_status_bridge.hpp +519 -0
- package/examples/bridge/platformio.ini +25 -25
- package/examples/echoNode/echoNode.ino +33 -33
- package/examples/echoNode/platformio.ini +25 -25
- package/examples/logClient/logClient.ino +109 -109
- package/examples/logClient/platformio.ini +25 -25
- package/examples/logServer/logServer.ino +81 -81
- package/examples/logServer/platformio.ini +25 -25
- package/examples/meshCommandNode/alteriom_sensor_package.hpp +235 -0
- package/examples/meshCommandNode/meshCommandNode.ino +263 -0
- package/examples/meshCommandNode/platformio.ini +25 -0
- package/examples/mqttBridge/mqttBridge.ino +118 -118
- package/examples/mqttBridge/platformio.ini +26 -26
- package/examples/mqttCommandBridge/alteriom_sensor_package.hpp +235 -0
- package/examples/mqttCommandBridge/mesh_event_publisher.hpp +253 -0
- package/examples/mqttCommandBridge/mesh_topology_reporter.hpp +303 -0
- package/examples/mqttCommandBridge/mqttCommandBridge.ino +252 -0
- package/examples/mqttCommandBridge/mqtt_command_bridge.hpp +459 -0
- package/examples/mqttCommandBridge/platformio.ini +26 -0
- package/examples/mqttStatusBridge/mqttStatusBridge.ino +216 -0
- package/examples/mqttStatusBridge/mqtt_status_bridge.hpp +522 -0
- package/examples/mqttStatusBridge/platformio.ini +26 -0
- package/examples/mqttTopologyTest/README.md +467 -0
- package/examples/mqttTopologyTest/mqttTopologyTest.ino +748 -0
- package/examples/mqttTopologyTest/platformio.ini +26 -0
- package/examples/namedMesh/namedMesh.ino +97 -97
- package/examples/namedMesh/platformio.ini +25 -25
- package/examples/otaReceiver/otaReceiver.ino +79 -79
- package/examples/otaReceiver/platformio.ini +25 -25
- package/examples/otaSender/otaSender.ino +160 -151
- package/examples/otaSender/platformio.ini +25 -25
- package/examples/startHere/platformio.ini +25 -25
- package/examples/startHere/startHere.ino +159 -159
- package/examples/webServer/platformio.ini +27 -27
- package/examples/webServer/webServer.ino +89 -89
- package/keywords.txt +48 -48
- package/library.json +55 -34
- package/library.properties +10 -10
- package/package.json +86 -78
- package/src/AlteriomPainlessMesh.h +97 -97
- package/src/arduino/wifi.hpp +365 -365
- package/src/boost/asynctcp.hpp +279 -279
- package/src/painlessMesh.h +70 -70
- package/src/painlessMeshSTA.cpp +236 -236
- package/src/painlessMeshSTA.h +58 -58
- package/src/painlessTaskOptions.h +4 -4
- package/src/painlessmesh/base64.hpp +111 -111
- package/src/painlessmesh/buffer.hpp +229 -229
- package/src/painlessmesh/callback.hpp +91 -91
- package/src/painlessmesh/configuration.hpp +77 -77
- package/src/painlessmesh/connection.hpp +192 -192
- package/src/painlessmesh/layout.hpp +188 -188
- package/src/painlessmesh/logger.hpp +158 -158
- package/src/painlessmesh/memory.hpp +119 -119
- package/src/painlessmesh/mesh.hpp +761 -560
- package/src/painlessmesh/metrics.hpp +322 -322
- package/src/painlessmesh/ntp.hpp +263 -263
- package/src/painlessmesh/ota.hpp +582 -553
- package/src/painlessmesh/plugin.hpp +188 -188
- package/src/painlessmesh/protocol.hpp +813 -813
- package/src/painlessmesh/router.hpp +322 -322
- package/src/painlessmesh/tcp.hpp +71 -71
- package/src/painlessmesh/validation.hpp +238 -238
- package/src/plugin/performance.hpp +214 -214
- package/src/plugin/remote.hpp +64 -64
- package/src/scheduler.cpp +10 -10
- package/src/wifi.cpp +2 -2
package/library.json
CHANGED
|
@@ -1,34 +1,55 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "
|
|
3
|
-
"keywords": "ethernet, m2m, iot, mesh, alteriom, sensor",
|
|
4
|
-
"description": "painlessMesh is a user-friendly library for creating mesh networks with ESP8266 and ESP32 devices. This Alteriom fork includes additional packages for sensor data (SensorPackage), device commands (CommandPackage), and status monitoring (StatusPackage). It handles routing and network management automatically, so you can focus on your application. The library uses JSON-based messaging and syncs time across all nodes, making it ideal for coordinated behaviour like synchronized light displays or sensor networks reporting to a central node.",
|
|
5
|
-
"repository": {
|
|
6
|
-
"type": "git",
|
|
7
|
-
"url": "https://github.com/Alteriom/painlessMesh"
|
|
8
|
-
},
|
|
9
|
-
"version": "1.
|
|
10
|
-
"frameworks": "arduino",
|
|
11
|
-
"platforms": "espressif8266, espressif32",
|
|
12
|
-
"
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
{ "owner": "
|
|
16
|
-
{ "owner": "
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
{ "name": "
|
|
27
|
-
{ "name": "
|
|
28
|
-
{
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "AlteriomPainlessMesh",
|
|
3
|
+
"keywords": "ethernet, m2m, iot, mesh, alteriom, sensor, esp32, esp8266, json, time-sync, wireless, communication",
|
|
4
|
+
"description": "painlessMesh is a user-friendly library for creating mesh networks with ESP8266 and ESP32 devices. This Alteriom fork includes additional packages for sensor data (SensorPackage), device commands (CommandPackage), and status monitoring (StatusPackage). It handles routing and network management automatically, so you can focus on your application. The library uses JSON-based messaging and syncs time across all nodes, making it ideal for coordinated behaviour like synchronized light displays or sensor networks reporting to a central node.",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "https://github.com/Alteriom/painlessMesh"
|
|
8
|
+
},
|
|
9
|
+
"version": "1.7.2",
|
|
10
|
+
"frameworks": ["arduino"],
|
|
11
|
+
"platforms": ["espressif8266", "espressif32"],
|
|
12
|
+
"srcDir": "src",
|
|
13
|
+
"includeDir": "src",
|
|
14
|
+
"dependencies": [
|
|
15
|
+
{ "owner": "esp32async", "name": "AsyncTCP", "version": "^3.4.7", "platforms" : ["espressif32"] },
|
|
16
|
+
{ "owner": "esp32async", "name": "ESPAsyncTCP", "version": "^2.0.0", "platforms" : ["espressif8266"] },
|
|
17
|
+
{ "owner": "bblanchon", "name": "ArduinoJson", "version": "^7.4.2" },
|
|
18
|
+
{ "owner": "arkhipenko", "name": "TaskScheduler", "version": "^4.0.0" }
|
|
19
|
+
],
|
|
20
|
+
"authors": [
|
|
21
|
+
{ "name": "Scotty Franzyshen" },
|
|
22
|
+
{
|
|
23
|
+
"name": "Coopdis",
|
|
24
|
+
"url": "https://github.com/Coopdis"
|
|
25
|
+
},
|
|
26
|
+
{ "name": "Edwin van Leeuwen" },
|
|
27
|
+
{ "name": "Germán Martín" },
|
|
28
|
+
{ "name": "Maximilian Schwarz" },
|
|
29
|
+
{ "name": "Doanh Doanh" },
|
|
30
|
+
{
|
|
31
|
+
"name": "Alteriom",
|
|
32
|
+
"url": "https://github.com/Alteriom",
|
|
33
|
+
"maintainer": true
|
|
34
|
+
}
|
|
35
|
+
],
|
|
36
|
+
"license": "LGPL-3.0",
|
|
37
|
+
"homepage": "https://github.com/Alteriom/painlessMesh",
|
|
38
|
+
"headers": ["painlessMesh.h", "AlteriomPainlessMesh.h"],
|
|
39
|
+
"examples": [
|
|
40
|
+
"examples/alteriom/alteriom.ino",
|
|
41
|
+
"examples/alteriom/alteriom_sensor_node.ino",
|
|
42
|
+
"examples/alteriom/improved_sensor_node.ino",
|
|
43
|
+
"examples/basic/basic.ino",
|
|
44
|
+
"examples/bridge/bridge.ino",
|
|
45
|
+
"examples/echoNode/echoNode.ino",
|
|
46
|
+
"examples/logClient/logClient.ino",
|
|
47
|
+
"examples/logServer/logServer.ino",
|
|
48
|
+
"examples/mqttBridge/mqttBridge.ino",
|
|
49
|
+
"examples/namedMesh/namedMesh.ino",
|
|
50
|
+
"examples/otaReceiver/otaReceiver.ino",
|
|
51
|
+
"examples/otaSender/otaSender.ino",
|
|
52
|
+
"examples/startHere/startHere.ino",
|
|
53
|
+
"examples/webServer/webServer.ino"
|
|
54
|
+
]
|
|
55
|
+
}
|
package/library.properties
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
name=AlteriomPainlessMesh
|
|
2
|
-
version=1.
|
|
3
|
-
author=Coopdis,Scotty Franzyshen,Edwin van Leeuwen,Germán Martín,Maximilian Schwarz,Doanh Doanh,Alteriom
|
|
4
|
-
maintainer=Alteriom
|
|
5
|
-
sentence=A painless way to setup a mesh with ESP8266 and ESP32 devices with Alteriom extensions
|
|
6
|
-
paragraph=painlessMesh is a user-friendly library for creating mesh networks with ESP8266 and ESP32 devices. This Alteriom fork includes additional packages for sensor data (SensorPackage), device commands (CommandPackage), and status monitoring (StatusPackage). It handles routing and network management automatically, so you can focus on your application. The library uses JSON-based messaging and syncs time across all nodes, making it ideal for coordinated behaviour like synchronized light displays or sensor networks reporting to a central node.
|
|
7
|
-
category=Communication
|
|
8
|
-
url=https://github.com/Alteriom/painlessMesh
|
|
9
|
-
architectures=esp8266,esp32
|
|
10
|
-
includes=
|
|
1
|
+
name=AlteriomPainlessMesh
|
|
2
|
+
version=1.7.2
|
|
3
|
+
author=Coopdis,Scotty Franzyshen,Edwin van Leeuwen,Germán Martín,Maximilian Schwarz,Doanh Doanh,Alteriom
|
|
4
|
+
maintainer=Alteriom
|
|
5
|
+
sentence=A painless way to setup a mesh with ESP8266 and ESP32 devices with Alteriom extensions
|
|
6
|
+
paragraph=painlessMesh is a user-friendly library for creating mesh networks with ESP8266 and ESP32 devices. This Alteriom fork includes additional packages for sensor data (SensorPackage), device commands (CommandPackage), and status monitoring (StatusPackage). It handles routing and network management automatically, so you can focus on your application. The library uses JSON-based messaging and syncs time across all nodes, making it ideal for coordinated behaviour like synchronized light displays or sensor networks reporting to a central node.
|
|
7
|
+
category=Communication
|
|
8
|
+
url=https://github.com/Alteriom/painlessMesh
|
|
9
|
+
architectures=esp8266,esp32
|
|
10
|
+
includes=painlessMesh.h
|
|
11
11
|
depends=ArduinoJson, TaskScheduler
|
package/package.json
CHANGED
|
@@ -1,78 +1,86 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@alteriom/painlessmesh",
|
|
3
|
-
"version": "1.
|
|
4
|
-
"description": "painlessMesh is a user-friendly library for creating mesh networks with ESP8266 and ESP32 devices. This Alteriom fork includes additional packages for sensor data (SensorPackage), device commands (CommandPackage), and status monitoring (StatusPackage). It handles routing and network management automatically, so you can focus on your application. The library uses JSON-based messaging and syncs time across all nodes, making it ideal for coordinated behaviour like synchronized light displays or sensor networks reporting to a central node.",
|
|
5
|
-
"keywords": [
|
|
6
|
-
"arduino",
|
|
7
|
-
"mesh",
|
|
8
|
-
"esp32",
|
|
9
|
-
"esp8266",
|
|
10
|
-
"embedded",
|
|
11
|
-
"iot",
|
|
12
|
-
"wireless",
|
|
13
|
-
"alteriom",
|
|
14
|
-
"sensor",
|
|
15
|
-
"painlessmesh",
|
|
16
|
-
"mcp-server",
|
|
17
|
-
"github-copilot",
|
|
18
|
-
"json",
|
|
19
|
-
"time-sync",
|
|
20
|
-
"mesh-networking"
|
|
21
|
-
],
|
|
22
|
-
"author": {
|
|
23
|
-
"name": "Coopdis",
|
|
24
|
-
"url": "https://github.com/Coopdis"
|
|
25
|
-
},
|
|
26
|
-
"maintainers": [
|
|
27
|
-
{
|
|
28
|
-
"name": "Alteriom",
|
|
29
|
-
"url": "https://github.com/Alteriom"
|
|
30
|
-
}
|
|
31
|
-
],
|
|
32
|
-
"license": "LGPL-3.0",
|
|
33
|
-
"homepage": "https://github.com/Alteriom/painlessMesh",
|
|
34
|
-
"repository": {
|
|
35
|
-
"type": "git",
|
|
36
|
-
"url": "https://github.com/Alteriom/painlessMesh.git"
|
|
37
|
-
},
|
|
38
|
-
"bugs": {
|
|
39
|
-
"url": "https://github.com/Alteriom/painlessMesh/issues"
|
|
40
|
-
},
|
|
41
|
-
"devDependencies": {
|
|
42
|
-
"@
|
|
43
|
-
"
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
"
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
"
|
|
50
|
-
"
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
"
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
"
|
|
71
|
-
"
|
|
72
|
-
"
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
"
|
|
76
|
-
"
|
|
77
|
-
|
|
78
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "@alteriom/painlessmesh",
|
|
3
|
+
"version": "1.7.2",
|
|
4
|
+
"description": "painlessMesh is a user-friendly library for creating mesh networks with ESP8266 and ESP32 devices. This Alteriom fork includes additional packages for sensor data (SensorPackage), device commands (CommandPackage), and status monitoring (StatusPackage). It handles routing and network management automatically, so you can focus on your application. The library uses JSON-based messaging and syncs time across all nodes, making it ideal for coordinated behaviour like synchronized light displays or sensor networks reporting to a central node.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"arduino",
|
|
7
|
+
"mesh",
|
|
8
|
+
"esp32",
|
|
9
|
+
"esp8266",
|
|
10
|
+
"embedded",
|
|
11
|
+
"iot",
|
|
12
|
+
"wireless",
|
|
13
|
+
"alteriom",
|
|
14
|
+
"sensor",
|
|
15
|
+
"painlessmesh",
|
|
16
|
+
"mcp-server",
|
|
17
|
+
"github-copilot",
|
|
18
|
+
"json",
|
|
19
|
+
"time-sync",
|
|
20
|
+
"mesh-networking"
|
|
21
|
+
],
|
|
22
|
+
"author": {
|
|
23
|
+
"name": "Coopdis",
|
|
24
|
+
"url": "https://github.com/Coopdis"
|
|
25
|
+
},
|
|
26
|
+
"maintainers": [
|
|
27
|
+
{
|
|
28
|
+
"name": "Alteriom",
|
|
29
|
+
"url": "https://github.com/Alteriom"
|
|
30
|
+
}
|
|
31
|
+
],
|
|
32
|
+
"license": "LGPL-3.0",
|
|
33
|
+
"homepage": "https://github.com/Alteriom/painlessMesh",
|
|
34
|
+
"repository": {
|
|
35
|
+
"type": "git",
|
|
36
|
+
"url": "git+https://github.com/Alteriom/painlessMesh.git"
|
|
37
|
+
},
|
|
38
|
+
"bugs": {
|
|
39
|
+
"url": "https://github.com/Alteriom/painlessMesh/issues"
|
|
40
|
+
},
|
|
41
|
+
"devDependencies": {
|
|
42
|
+
"@alteriom/mqtt-schema": "^0.5.0",
|
|
43
|
+
"@eslint/js": "^9.0.0",
|
|
44
|
+
"ajv": "^8.17.1",
|
|
45
|
+
"ajv-formats": "^3.0.1",
|
|
46
|
+
"prettier": "^3.0.0"
|
|
47
|
+
},
|
|
48
|
+
"scripts": {
|
|
49
|
+
"test": "run-parts --regex catch_ bin/ || echo 'Tests completed'",
|
|
50
|
+
"dev:build": "cmake -G Ninja . && ninja",
|
|
51
|
+
"dev:prebuild": "git submodule update --init",
|
|
52
|
+
"validate-library": "./scripts/validate-release.sh",
|
|
53
|
+
"prepublishOnly": "npm run validate-library",
|
|
54
|
+
"postpublish": "echo 'Package published successfully to NPM!'"
|
|
55
|
+
},
|
|
56
|
+
"engines": {
|
|
57
|
+
"node": ">=14.0.0"
|
|
58
|
+
},
|
|
59
|
+
"config": {
|
|
60
|
+
"arduino": {
|
|
61
|
+
"library": true,
|
|
62
|
+
"platforms": [
|
|
63
|
+
"arduino",
|
|
64
|
+
"esp32",
|
|
65
|
+
"esp8266"
|
|
66
|
+
]
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
"directories": {
|
|
70
|
+
"example": "examples",
|
|
71
|
+
"test": "test",
|
|
72
|
+
"doc": "docs"
|
|
73
|
+
},
|
|
74
|
+
"files": [
|
|
75
|
+
"src/",
|
|
76
|
+
"examples/",
|
|
77
|
+
"docs/",
|
|
78
|
+
"library.properties",
|
|
79
|
+
"library.json",
|
|
80
|
+
"keywords.txt",
|
|
81
|
+
"README.md",
|
|
82
|
+
"LICENSE",
|
|
83
|
+
"CHANGELOG.md",
|
|
84
|
+
"RELEASE_GUIDE.md"
|
|
85
|
+
]
|
|
86
|
+
}
|
|
@@ -1,98 +1,98 @@
|
|
|
1
|
-
#ifndef ALTERIOM_PAINLESS_MESH_H
|
|
2
|
-
#define ALTERIOM_PAINLESS_MESH_H
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* @file AlteriomPainlessMesh.h
|
|
6
|
-
* @brief Main header file for AlteriomPainlessMesh library
|
|
7
|
-
*
|
|
8
|
-
* This is the primary header file that includes all necessary components
|
|
9
|
-
* for the AlteriomPainlessMesh library, including the core painlessMesh
|
|
10
|
-
* functionality and Alteriom-specific extensions.
|
|
11
|
-
*/
|
|
12
|
-
|
|
13
|
-
// Include the core painlessMesh library
|
|
14
|
-
#include "painlessMesh.h"
|
|
15
|
-
|
|
16
|
-
//
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* @namespace alteriom
|
|
21
|
-
* @brief Namespace containing Alteriom-specific extensions for painlessMesh
|
|
22
|
-
*
|
|
23
|
-
* This namespace includes production-ready packages for common IoT scenarios:
|
|
24
|
-
* - SensorPackage: Environmental sensor data broadcasting
|
|
25
|
-
* - CommandPackage: Device control and configuration
|
|
26
|
-
* - StatusPackage: Device health and operational status
|
|
27
|
-
*/
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
* @brief AlteriomPainlessMesh library version information
|
|
31
|
-
*/
|
|
32
|
-
#define ALTERIOM_PAINLESS_MESH_VERSION "1.6.1"
|
|
33
|
-
#define ALTERIOM_PAINLESS_MESH_VERSION_MAJOR 1
|
|
34
|
-
#define ALTERIOM_PAINLESS_MESH_VERSION_MINOR 6
|
|
35
|
-
#define ALTERIOM_PAINLESS_MESH_VERSION_PATCH 1
|
|
36
|
-
|
|
37
|
-
/**
|
|
38
|
-
* @brief Library description and usage information
|
|
39
|
-
*
|
|
40
|
-
* AlteriomPainlessMesh is an enhanced fork of the popular painlessMesh library
|
|
41
|
-
* that adds production-ready, type-safe packages for common IoT communication
|
|
42
|
-
* patterns. It provides:
|
|
43
|
-
*
|
|
44
|
-
* - Automatic mesh network formation and management
|
|
45
|
-
* - Type-safe messaging with compile-time validation
|
|
46
|
-
* - Pre-built packages for sensors, commands, and status reporting
|
|
47
|
-
* - Cross-platform compatibility (ESP32, ESP8266, desktop)
|
|
48
|
-
* - Time synchronization across all mesh nodes
|
|
49
|
-
*
|
|
50
|
-
* @section quick_start Quick Start
|
|
51
|
-
*
|
|
52
|
-
* @code{.cpp}
|
|
53
|
-
* #include "AlteriomPainlessMesh.h"
|
|
54
|
-
*
|
|
55
|
-
* #define MESH_PREFIX "MyMesh"
|
|
56
|
-
* #define MESH_PASSWORD "MyPassword"
|
|
57
|
-
* #define MESH_PORT 5555
|
|
58
|
-
*
|
|
59
|
-
* Scheduler userScheduler;
|
|
60
|
-
* painlessMesh mesh;
|
|
61
|
-
*
|
|
62
|
-
* void setup() {
|
|
63
|
-
* Serial.begin(115200);
|
|
64
|
-
*
|
|
65
|
-
* mesh.setDebugMsgTypes(ERROR | STARTUP | CONNECTION);
|
|
66
|
-
* mesh.init(MESH_PREFIX, MESH_PASSWORD, &userScheduler, MESH_PORT);
|
|
67
|
-
*
|
|
68
|
-
* mesh.onReceive([](uint32_t from, String& msg) {
|
|
69
|
-
* Serial.printf("Received: %s\n", msg.c_str());
|
|
70
|
-
* });
|
|
71
|
-
* }
|
|
72
|
-
*
|
|
73
|
-
* void loop() {
|
|
74
|
-
* mesh.update();
|
|
75
|
-
* }
|
|
76
|
-
* @endcode
|
|
77
|
-
*
|
|
78
|
-
* @section alteriom_packages Alteriom Packages
|
|
79
|
-
*
|
|
80
|
-
* @code{.cpp}
|
|
81
|
-
* using namespace alteriom;
|
|
82
|
-
*
|
|
83
|
-
* // Send sensor data
|
|
84
|
-
* SensorPackage sensor;
|
|
85
|
-
* sensor.temperature = 25.5;
|
|
86
|
-
* sensor.humidity = 60.0;
|
|
87
|
-
* mesh.sendPackage(&sensor);
|
|
88
|
-
*
|
|
89
|
-
* // Handle received sensor data
|
|
90
|
-
* mesh.onPackage(200, [](protocol::Variant& variant) {
|
|
91
|
-
* SensorPackage data = variant.to<SensorPackage>();
|
|
92
|
-
* Serial.printf("Temperature: %.1f°C\n", data.temperature);
|
|
93
|
-
* return true;
|
|
94
|
-
* });
|
|
95
|
-
* @endcode
|
|
96
|
-
*/
|
|
97
|
-
|
|
1
|
+
#ifndef ALTERIOM_PAINLESS_MESH_H
|
|
2
|
+
#define ALTERIOM_PAINLESS_MESH_H
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* @file AlteriomPainlessMesh.h
|
|
6
|
+
* @brief Main header file for AlteriomPainlessMesh library
|
|
7
|
+
*
|
|
8
|
+
* This is the primary header file that includes all necessary components
|
|
9
|
+
* for the AlteriomPainlessMesh library, including the core painlessMesh
|
|
10
|
+
* functionality and Alteriom-specific extensions.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
// Include the core painlessMesh library
|
|
14
|
+
#include "painlessMesh.h"
|
|
15
|
+
|
|
16
|
+
// Note: Alteriom extensions (alteriom_sensor_package.hpp) are provided as examples
|
|
17
|
+
// and should be included directly in your sketch when needed
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* @namespace alteriom
|
|
21
|
+
* @brief Namespace containing Alteriom-specific extensions for painlessMesh
|
|
22
|
+
*
|
|
23
|
+
* This namespace includes production-ready packages for common IoT scenarios:
|
|
24
|
+
* - SensorPackage: Environmental sensor data broadcasting
|
|
25
|
+
* - CommandPackage: Device control and configuration
|
|
26
|
+
* - StatusPackage: Device health and operational status
|
|
27
|
+
*/
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* @brief AlteriomPainlessMesh library version information
|
|
31
|
+
*/
|
|
32
|
+
#define ALTERIOM_PAINLESS_MESH_VERSION "1.6.1"
|
|
33
|
+
#define ALTERIOM_PAINLESS_MESH_VERSION_MAJOR 1
|
|
34
|
+
#define ALTERIOM_PAINLESS_MESH_VERSION_MINOR 6
|
|
35
|
+
#define ALTERIOM_PAINLESS_MESH_VERSION_PATCH 1
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* @brief Library description and usage information
|
|
39
|
+
*
|
|
40
|
+
* AlteriomPainlessMesh is an enhanced fork of the popular painlessMesh library
|
|
41
|
+
* that adds production-ready, type-safe packages for common IoT communication
|
|
42
|
+
* patterns. It provides:
|
|
43
|
+
*
|
|
44
|
+
* - Automatic mesh network formation and management
|
|
45
|
+
* - Type-safe messaging with compile-time validation
|
|
46
|
+
* - Pre-built packages for sensors, commands, and status reporting
|
|
47
|
+
* - Cross-platform compatibility (ESP32, ESP8266, desktop)
|
|
48
|
+
* - Time synchronization across all mesh nodes
|
|
49
|
+
*
|
|
50
|
+
* @section quick_start Quick Start
|
|
51
|
+
*
|
|
52
|
+
* @code{.cpp}
|
|
53
|
+
* #include "AlteriomPainlessMesh.h"
|
|
54
|
+
*
|
|
55
|
+
* #define MESH_PREFIX "MyMesh"
|
|
56
|
+
* #define MESH_PASSWORD "MyPassword"
|
|
57
|
+
* #define MESH_PORT 5555
|
|
58
|
+
*
|
|
59
|
+
* Scheduler userScheduler;
|
|
60
|
+
* painlessMesh mesh;
|
|
61
|
+
*
|
|
62
|
+
* void setup() {
|
|
63
|
+
* Serial.begin(115200);
|
|
64
|
+
*
|
|
65
|
+
* mesh.setDebugMsgTypes(ERROR | STARTUP | CONNECTION);
|
|
66
|
+
* mesh.init(MESH_PREFIX, MESH_PASSWORD, &userScheduler, MESH_PORT);
|
|
67
|
+
*
|
|
68
|
+
* mesh.onReceive([](uint32_t from, String& msg) {
|
|
69
|
+
* Serial.printf("Received: %s\n", msg.c_str());
|
|
70
|
+
* });
|
|
71
|
+
* }
|
|
72
|
+
*
|
|
73
|
+
* void loop() {
|
|
74
|
+
* mesh.update();
|
|
75
|
+
* }
|
|
76
|
+
* @endcode
|
|
77
|
+
*
|
|
78
|
+
* @section alteriom_packages Alteriom Packages
|
|
79
|
+
*
|
|
80
|
+
* @code{.cpp}
|
|
81
|
+
* using namespace alteriom;
|
|
82
|
+
*
|
|
83
|
+
* // Send sensor data
|
|
84
|
+
* SensorPackage sensor;
|
|
85
|
+
* sensor.temperature = 25.5;
|
|
86
|
+
* sensor.humidity = 60.0;
|
|
87
|
+
* mesh.sendPackage(&sensor);
|
|
88
|
+
*
|
|
89
|
+
* // Handle received sensor data
|
|
90
|
+
* mesh.onPackage(200, [](protocol::Variant& variant) {
|
|
91
|
+
* SensorPackage data = variant.to<SensorPackage>();
|
|
92
|
+
* Serial.printf("Temperature: %.1f°C\n", data.temperature);
|
|
93
|
+
* return true;
|
|
94
|
+
* });
|
|
95
|
+
* @endcode
|
|
96
|
+
*/
|
|
97
|
+
|
|
98
98
|
#endif // ALTERIOM_PAINLESS_MESH_H
|