@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
|
@@ -1,123 +1,123 @@
|
|
|
1
|
-
# Complete Documentation
|
|
2
|
-
|
|
3
|
-
Welcome to the complete documentation for Alteriom painlessMesh Library!
|
|
4
|
-
|
|
5
|
-
## 📖 Documentation Sections
|
|
6
|
-
|
|
7
|
-
### Getting Started
|
|
8
|
-
- [Installation Guide](Installation) - Set up the library in your development environment
|
|
9
|
-
- [Quick Start](https://github.com/Alteriom/painlessMesh/blob/main/docs/getting-started/quickstart.md) - Your first mesh network
|
|
10
|
-
- [First Mesh Tutorial](https://github.com/Alteriom/painlessMesh/blob/main/docs/getting-started/first-mesh.md) - Step-by-step guide
|
|
11
|
-
|
|
12
|
-
### API Documentation
|
|
13
|
-
- [API Reference](API-Reference) - Complete class and method documentation
|
|
14
|
-
- [Core API](https://github.com/Alteriom/painlessMesh/blob/main/docs/api/core-api.md) - painlessMesh core functionality
|
|
15
|
-
- [Plugin System](https://github.com/Alteriom/painlessMesh/blob/main/docs/architecture/plugin-system.md) - Extensible architecture
|
|
16
|
-
|
|
17
|
-
### Examples and Tutorials
|
|
18
|
-
- [Examples](Examples) - Working code examples
|
|
19
|
-
- [Basic Examples](https://github.com/Alteriom/painlessMesh/blob/main/docs/tutorials/basic-examples.md) - Fundamental usage patterns
|
|
20
|
-
- [Alteriom Extensions](https://github.com/Alteriom/painlessMesh/blob/main/docs/alteriom/overview.md) - SensorPackage, CommandPackage, StatusPackage
|
|
21
|
-
|
|
22
|
-
### Architecture
|
|
23
|
-
- [Mesh Architecture](https://github.com/Alteriom/painlessMesh/blob/main/docs/architecture/mesh-architecture.md) - How the mesh network works
|
|
24
|
-
- [Plugin System](https://github.com/Alteriom/painlessMesh/blob/main/docs/architecture/plugin-system.md) - Extensible package system
|
|
25
|
-
|
|
26
|
-
### Troubleshooting
|
|
27
|
-
- [FAQ](https://github.com/Alteriom/painlessMesh/blob/main/docs/troubleshooting/faq.md) - Frequently asked questions
|
|
28
|
-
- [Common Issues](https://github.com/Alteriom/painlessMesh/blob/main/docs/troubleshooting/common-issues.md) - Solutions to common problems
|
|
29
|
-
|
|
30
|
-
### Development
|
|
31
|
-
- [Contributing Guidelines](Contributing) - How to contribute to the project
|
|
32
|
-
- [Release Guide](https://github.com/Alteriom/painlessMesh/blob/main/RELEASE_GUIDE.md) - Release process documentation
|
|
33
|
-
|
|
34
|
-
## 🚀 Quick Links
|
|
35
|
-
|
|
36
|
-
### Installation
|
|
37
|
-
```bash
|
|
38
|
-
# Arduino Library Manager
|
|
39
|
-
Tools → Manage Libraries → Search "Alteriom PainlessMesh"
|
|
40
|
-
|
|
41
|
-
# PlatformIO
|
|
42
|
-
lib_deps = alteriom/painlessMesh@^1.6.1
|
|
43
|
-
|
|
44
|
-
# NPM
|
|
45
|
-
npm install @alteriom/painlessmesh
|
|
46
|
-
```
|
|
47
|
-
|
|
48
|
-
### Basic Usage
|
|
49
|
-
```cpp
|
|
50
|
-
#include "painlessMesh.h"
|
|
51
|
-
|
|
52
|
-
#define MESH_PREFIX "YourMeshName"
|
|
53
|
-
#define MESH_PASSWORD "YourPassword"
|
|
54
|
-
#define MESH_PORT 5555
|
|
55
|
-
|
|
56
|
-
Scheduler userScheduler;
|
|
57
|
-
painlessMesh mesh;
|
|
58
|
-
|
|
59
|
-
void setup() {
|
|
60
|
-
Serial.begin(115200);
|
|
61
|
-
mesh.init(MESH_PREFIX, MESH_PASSWORD, &userScheduler, MESH_PORT);
|
|
62
|
-
mesh.onReceive([](uint32_t from, String& msg) {
|
|
63
|
-
Serial.printf("Received: %s from %u\n", msg.c_str(), from);
|
|
64
|
-
});
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
void loop() {
|
|
68
|
-
mesh.update();
|
|
69
|
-
}
|
|
70
|
-
```
|
|
71
|
-
|
|
72
|
-
## 📦 Package Types
|
|
73
|
-
|
|
74
|
-
### SensorPackage (Type 200)
|
|
75
|
-
For environmental sensor data collection:
|
|
76
|
-
- Temperature, humidity, pressure measurements
|
|
77
|
-
- Battery level monitoring
|
|
78
|
-
- Timestamp synchronization
|
|
79
|
-
|
|
80
|
-
### CommandPackage (Type 201)
|
|
81
|
-
For device control and automation:
|
|
82
|
-
- Remote device commands
|
|
83
|
-
- Parameter passing via JSON
|
|
84
|
-
- Command acknowledgment tracking
|
|
85
|
-
|
|
86
|
-
### StatusPackage (Type 202)
|
|
87
|
-
For system health monitoring:
|
|
88
|
-
- Device operational status
|
|
89
|
-
- Memory usage tracking
|
|
90
|
-
- Network connectivity metrics
|
|
91
|
-
|
|
92
|
-
## 🌟 Key Features
|
|
93
|
-
|
|
94
|
-
- **Automatic Mesh Formation** - Nodes discover and connect automatically
|
|
95
|
-
- **JSON-Based Messaging** - Easy to use and extend
|
|
96
|
-
- **Time Synchronization** - Coordinated behaviors across nodes
|
|
97
|
-
- **Multi-Platform Support** - ESP32, ESP8266
|
|
98
|
-
- **Alteriom Extensions** - Enhanced packages for common use cases
|
|
99
|
-
- **Comprehensive Testing** - Full CI/CD pipeline with automated testing
|
|
100
|
-
|
|
101
|
-
## 📚 External Resources
|
|
102
|
-
|
|
103
|
-
- **GitHub Repository**: https://github.com/Alteriom/painlessMesh
|
|
104
|
-
- **NPM Package**: https://www.npmjs.com/package/@alteriom/painlessmesh
|
|
105
|
-
- **PlatformIO Registry**: https://registry.platformio.org/libraries/alteriom/painlessMesh
|
|
106
|
-
- **Issue Tracker**: https://github.com/Alteriom/painlessMesh/issues
|
|
107
|
-
- **Discussions**: https://github.com/Alteriom/painlessMesh/discussions
|
|
108
|
-
|
|
109
|
-
## 📝 License
|
|
110
|
-
|
|
111
|
-
This project is licensed under LGPL-3.0 - see the [LICENSE](https://github.com/Alteriom/painlessMesh/blob/main/LICENSE) file for details.
|
|
112
|
-
|
|
113
|
-
## 🤝 Contributing
|
|
114
|
-
|
|
115
|
-
We welcome contributions! Please see our [Contributing Guidelines](Contributing) for details on:
|
|
116
|
-
- Code style and standards
|
|
117
|
-
- Pull request process
|
|
118
|
-
- Issue reporting
|
|
119
|
-
- Feature requests
|
|
120
|
-
|
|
121
|
-
---
|
|
122
|
-
|
|
1
|
+
# Complete Documentation
|
|
2
|
+
|
|
3
|
+
Welcome to the complete documentation for Alteriom painlessMesh Library!
|
|
4
|
+
|
|
5
|
+
## 📖 Documentation Sections
|
|
6
|
+
|
|
7
|
+
### Getting Started
|
|
8
|
+
- [Installation Guide](Installation) - Set up the library in your development environment
|
|
9
|
+
- [Quick Start](https://github.com/Alteriom/painlessMesh/blob/main/docs/getting-started/quickstart.md) - Your first mesh network
|
|
10
|
+
- [First Mesh Tutorial](https://github.com/Alteriom/painlessMesh/blob/main/docs/getting-started/first-mesh.md) - Step-by-step guide
|
|
11
|
+
|
|
12
|
+
### API Documentation
|
|
13
|
+
- [API Reference](API-Reference) - Complete class and method documentation
|
|
14
|
+
- [Core API](https://github.com/Alteriom/painlessMesh/blob/main/docs/api/core-api.md) - painlessMesh core functionality
|
|
15
|
+
- [Plugin System](https://github.com/Alteriom/painlessMesh/blob/main/docs/architecture/plugin-system.md) - Extensible architecture
|
|
16
|
+
|
|
17
|
+
### Examples and Tutorials
|
|
18
|
+
- [Examples](Examples) - Working code examples
|
|
19
|
+
- [Basic Examples](https://github.com/Alteriom/painlessMesh/blob/main/docs/tutorials/basic-examples.md) - Fundamental usage patterns
|
|
20
|
+
- [Alteriom Extensions](https://github.com/Alteriom/painlessMesh/blob/main/docs/alteriom/overview.md) - SensorPackage, CommandPackage, StatusPackage
|
|
21
|
+
|
|
22
|
+
### Architecture
|
|
23
|
+
- [Mesh Architecture](https://github.com/Alteriom/painlessMesh/blob/main/docs/architecture/mesh-architecture.md) - How the mesh network works
|
|
24
|
+
- [Plugin System](https://github.com/Alteriom/painlessMesh/blob/main/docs/architecture/plugin-system.md) - Extensible package system
|
|
25
|
+
|
|
26
|
+
### Troubleshooting
|
|
27
|
+
- [FAQ](https://github.com/Alteriom/painlessMesh/blob/main/docs/troubleshooting/faq.md) - Frequently asked questions
|
|
28
|
+
- [Common Issues](https://github.com/Alteriom/painlessMesh/blob/main/docs/troubleshooting/common-issues.md) - Solutions to common problems
|
|
29
|
+
|
|
30
|
+
### Development
|
|
31
|
+
- [Contributing Guidelines](Contributing) - How to contribute to the project
|
|
32
|
+
- [Release Guide](https://github.com/Alteriom/painlessMesh/blob/main/RELEASE_GUIDE.md) - Release process documentation
|
|
33
|
+
|
|
34
|
+
## 🚀 Quick Links
|
|
35
|
+
|
|
36
|
+
### Installation
|
|
37
|
+
```bash
|
|
38
|
+
# Arduino Library Manager
|
|
39
|
+
Tools → Manage Libraries → Search "Alteriom PainlessMesh"
|
|
40
|
+
|
|
41
|
+
# PlatformIO
|
|
42
|
+
lib_deps = alteriom/painlessMesh@^1.6.1
|
|
43
|
+
|
|
44
|
+
# NPM
|
|
45
|
+
npm install @alteriom/painlessmesh
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
### Basic Usage
|
|
49
|
+
```cpp
|
|
50
|
+
#include "painlessMesh.h"
|
|
51
|
+
|
|
52
|
+
#define MESH_PREFIX "YourMeshName"
|
|
53
|
+
#define MESH_PASSWORD "YourPassword"
|
|
54
|
+
#define MESH_PORT 5555
|
|
55
|
+
|
|
56
|
+
Scheduler userScheduler;
|
|
57
|
+
painlessMesh mesh;
|
|
58
|
+
|
|
59
|
+
void setup() {
|
|
60
|
+
Serial.begin(115200);
|
|
61
|
+
mesh.init(MESH_PREFIX, MESH_PASSWORD, &userScheduler, MESH_PORT);
|
|
62
|
+
mesh.onReceive([](uint32_t from, String& msg) {
|
|
63
|
+
Serial.printf("Received: %s from %u\n", msg.c_str(), from);
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
void loop() {
|
|
68
|
+
mesh.update();
|
|
69
|
+
}
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
## 📦 Package Types
|
|
73
|
+
|
|
74
|
+
### SensorPackage (Type 200)
|
|
75
|
+
For environmental sensor data collection:
|
|
76
|
+
- Temperature, humidity, pressure measurements
|
|
77
|
+
- Battery level monitoring
|
|
78
|
+
- Timestamp synchronization
|
|
79
|
+
|
|
80
|
+
### CommandPackage (Type 201)
|
|
81
|
+
For device control and automation:
|
|
82
|
+
- Remote device commands
|
|
83
|
+
- Parameter passing via JSON
|
|
84
|
+
- Command acknowledgment tracking
|
|
85
|
+
|
|
86
|
+
### StatusPackage (Type 202)
|
|
87
|
+
For system health monitoring:
|
|
88
|
+
- Device operational status
|
|
89
|
+
- Memory usage tracking
|
|
90
|
+
- Network connectivity metrics
|
|
91
|
+
|
|
92
|
+
## 🌟 Key Features
|
|
93
|
+
|
|
94
|
+
- **Automatic Mesh Formation** - Nodes discover and connect automatically
|
|
95
|
+
- **JSON-Based Messaging** - Easy to use and extend
|
|
96
|
+
- **Time Synchronization** - Coordinated behaviors across nodes
|
|
97
|
+
- **Multi-Platform Support** - ESP32, ESP8266
|
|
98
|
+
- **Alteriom Extensions** - Enhanced packages for common use cases
|
|
99
|
+
- **Comprehensive Testing** - Full CI/CD pipeline with automated testing
|
|
100
|
+
|
|
101
|
+
## 📚 External Resources
|
|
102
|
+
|
|
103
|
+
- **GitHub Repository**: https://github.com/Alteriom/painlessMesh
|
|
104
|
+
- **NPM Package**: https://www.npmjs.com/package/@alteriom/painlessmesh
|
|
105
|
+
- **PlatformIO Registry**: https://registry.platformio.org/libraries/alteriom/painlessMesh
|
|
106
|
+
- **Issue Tracker**: https://github.com/Alteriom/painlessMesh/issues
|
|
107
|
+
- **Discussions**: https://github.com/Alteriom/painlessMesh/discussions
|
|
108
|
+
|
|
109
|
+
## 📝 License
|
|
110
|
+
|
|
111
|
+
This project is licensed under LGPL-3.0 - see the [LICENSE](https://github.com/Alteriom/painlessMesh/blob/main/LICENSE) file for details.
|
|
112
|
+
|
|
113
|
+
## 🤝 Contributing
|
|
114
|
+
|
|
115
|
+
We welcome contributions! Please see our [Contributing Guidelines](Contributing) for details on:
|
|
116
|
+
- Code style and standards
|
|
117
|
+
- Pull request process
|
|
118
|
+
- Issue reporting
|
|
119
|
+
- Feature requests
|
|
120
|
+
|
|
121
|
+
---
|
|
122
|
+
|
|
123
123
|
**Need Help?** Check the [FAQ](https://github.com/Alteriom/painlessMesh/blob/main/docs/troubleshooting/faq.md) or [open an issue](https://github.com/Alteriom/painlessMesh/issues).
|
|
@@ -1,82 +1,140 @@
|
|
|
1
|
-
# Alteriom painlessMesh Extensions
|
|
2
|
-
|
|
3
|
-
This directory contains Alteriom-specific extensions and examples for the painlessMesh library.
|
|
4
|
-
|
|
5
|
-
## Package Types
|
|
6
|
-
|
|
7
|
-
### SensorPackage (Type 200)
|
|
8
|
-
Broadcast package for sharing environmental sensor data across the mesh.
|
|
9
|
-
|
|
10
|
-
**Fields:**
|
|
11
|
-
- `temperature` - Temperature in Celsius
|
|
12
|
-
- `humidity` - Relative humidity percentage
|
|
13
|
-
- `pressure` - Atmospheric pressure in hPa
|
|
14
|
-
- `sensorId` - Unique sensor identifier
|
|
15
|
-
- `timestamp` - Unix timestamp of measurement
|
|
16
|
-
- `batteryLevel` - Battery level percentage (0-100)
|
|
17
|
-
|
|
18
|
-
### CommandPackage (Type 201)
|
|
19
|
-
Single-destination package for sending commands to specific nodes.
|
|
20
|
-
|
|
21
|
-
**Fields:**
|
|
22
|
-
- `command` - Command type identifier
|
|
23
|
-
- `targetDevice` - Target device ID
|
|
24
|
-
- `parameters` - Command parameters as JSON string
|
|
25
|
-
- `commandId` - Unique command identifier for tracking
|
|
26
|
-
|
|
27
|
-
### StatusPackage (Type 202)
|
|
28
|
-
Broadcast package for sharing device health and status information.
|
|
29
|
-
|
|
30
|
-
**Fields:**
|
|
31
|
-
- `deviceStatus` - Device status flags
|
|
32
|
-
- `uptime` - Device uptime in seconds
|
|
33
|
-
- `freeMemory` - Free memory in KB
|
|
34
|
-
- `wifiStrength` - WiFi signal strength (0-100)
|
|
35
|
-
- `firmwareVersion` - Current firmware version string
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
-
|
|
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
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
1
|
+
# Alteriom painlessMesh Extensions
|
|
2
|
+
|
|
3
|
+
This directory contains Alteriom-specific extensions and examples for the painlessMesh library.
|
|
4
|
+
|
|
5
|
+
## Package Types
|
|
6
|
+
|
|
7
|
+
### SensorPackage (Type 200)
|
|
8
|
+
Broadcast package for sharing environmental sensor data across the mesh.
|
|
9
|
+
|
|
10
|
+
**Fields:**
|
|
11
|
+
- `temperature` - Temperature in Celsius
|
|
12
|
+
- `humidity` - Relative humidity percentage
|
|
13
|
+
- `pressure` - Atmospheric pressure in hPa
|
|
14
|
+
- `sensorId` - Unique sensor identifier
|
|
15
|
+
- `timestamp` - Unix timestamp of measurement
|
|
16
|
+
- `batteryLevel` - Battery level percentage (0-100)
|
|
17
|
+
|
|
18
|
+
### CommandPackage (Type 201)
|
|
19
|
+
Single-destination package for sending commands to specific nodes.
|
|
20
|
+
|
|
21
|
+
**Fields:**
|
|
22
|
+
- `command` - Command type identifier
|
|
23
|
+
- `targetDevice` - Target device ID
|
|
24
|
+
- `parameters` - Command parameters as JSON string
|
|
25
|
+
- `commandId` - Unique command identifier for tracking
|
|
26
|
+
|
|
27
|
+
### StatusPackage (Type 202)
|
|
28
|
+
Broadcast package for sharing device health and status information.
|
|
29
|
+
|
|
30
|
+
**Fields:**
|
|
31
|
+
- `deviceStatus` - Device status flags
|
|
32
|
+
- `uptime` - Device uptime in seconds
|
|
33
|
+
- `freeMemory` - Free memory in KB
|
|
34
|
+
- `wifiStrength` - WiFi signal strength (0-100)
|
|
35
|
+
- `firmwareVersion` - Current firmware version string
|
|
36
|
+
|
|
37
|
+
### EnhancedStatusPackage (Type 203) - Phase 1
|
|
38
|
+
Extended status package with comprehensive health metrics (18 fields).
|
|
39
|
+
|
|
40
|
+
**Additional Fields:**
|
|
41
|
+
- `firmwareMD5` - Firmware hash for OTA verification
|
|
42
|
+
- `nodeCount`, `connectionCount` - Mesh statistics
|
|
43
|
+
- `messagesReceived`, `messagesSent`, `messagesDropped` - Message counters
|
|
44
|
+
- `avgLatency`, `packetLossRate`, `throughput` - Performance metrics
|
|
45
|
+
- `alertFlags`, `lastError` - Alert system
|
|
46
|
+
|
|
47
|
+
## Examples
|
|
48
|
+
|
|
49
|
+
### `alteriom_sensor_node.ino`
|
|
50
|
+
Complete Arduino sketch demonstrating:
|
|
51
|
+
- Periodic sensor data broadcasting
|
|
52
|
+
- Command handling
|
|
53
|
+
- Status reporting
|
|
54
|
+
- Message type discrimination
|
|
55
|
+
- Integration with painlessMesh
|
|
56
|
+
|
|
57
|
+
### `phase1_features.ino` (NEW)
|
|
58
|
+
Phase 1 OTA enhancement example demonstrating:
|
|
59
|
+
- Compressed OTA transfer infrastructure
|
|
60
|
+
- Enhanced status reporting with comprehensive metrics
|
|
61
|
+
- Alert system implementation
|
|
62
|
+
- Usage patterns for Phase 1 features
|
|
63
|
+
|
|
64
|
+
## Usage
|
|
65
|
+
|
|
66
|
+
```cpp
|
|
67
|
+
#include "alteriom_sensor_package.hpp"
|
|
68
|
+
using namespace alteriom;
|
|
69
|
+
|
|
70
|
+
// Create and send sensor data
|
|
71
|
+
SensorPackage sensor;
|
|
72
|
+
sensor.temperature = 25.0;
|
|
73
|
+
sensor.humidity = 60.0;
|
|
74
|
+
// ... set other fields
|
|
75
|
+
mesh.sendBroadcast(sensor.toJsonString());
|
|
76
|
+
|
|
77
|
+
// Handle incoming commands
|
|
78
|
+
void handleMessage(String& msg) {
|
|
79
|
+
auto doc = parseJson(msg);
|
|
80
|
+
if (doc["type"] == 201) {
|
|
81
|
+
CommandPackage cmd(doc.as<JsonObject>());
|
|
82
|
+
processCommand(cmd);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
## Building
|
|
88
|
+
|
|
89
|
+
### Arduino IDE
|
|
90
|
+
1. Open any `.ino` file in Arduino IDE
|
|
91
|
+
2. Select your board (ESP32 or ESP8266)
|
|
92
|
+
3. Install required libraries via Library Manager:
|
|
93
|
+
- AlteriomPainlessMesh
|
|
94
|
+
- ArduinoJson
|
|
95
|
+
- TaskScheduler
|
|
96
|
+
- AsyncTCP (ESP32) or ESPAsyncTCP (ESP8266)
|
|
97
|
+
4. Compile and upload
|
|
98
|
+
|
|
99
|
+
### PlatformIO
|
|
100
|
+
Build all examples with PlatformIO:
|
|
101
|
+
|
|
102
|
+
```bash
|
|
103
|
+
# Build for ESP32
|
|
104
|
+
cd examples/alteriom
|
|
105
|
+
pio run -e esp32
|
|
106
|
+
|
|
107
|
+
# Build for ESP8266
|
|
108
|
+
pio run -e esp8266
|
|
109
|
+
|
|
110
|
+
# Build for both platforms
|
|
111
|
+
pio run
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
The `platformio.ini` file in this directory configures both ESP32 and ESP8266 platforms with all required dependencies.
|
|
115
|
+
|
|
116
|
+
### Docker (Alteriom Docker Images)
|
|
117
|
+
For automated builds using Alteriom's Docker images:
|
|
118
|
+
|
|
119
|
+
```bash
|
|
120
|
+
# Using alteriom-docker-images for PlatformIO builds
|
|
121
|
+
docker run --rm -v $(pwd):/project alteriom/platformio:latest \
|
|
122
|
+
pio run -d /project/examples/alteriom -e esp32
|
|
123
|
+
|
|
124
|
+
# Or use the CI test script
|
|
125
|
+
bash ../../test/ci/test_platformio.sh --example alteriom
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
## Testing
|
|
129
|
+
|
|
130
|
+
Run the Alteriom package tests:
|
|
131
|
+
```bash
|
|
132
|
+
./bin/catch_alteriom_packages
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
This validates:
|
|
136
|
+
- JSON serialization/deserialization
|
|
137
|
+
- Package type consistency
|
|
138
|
+
- Field preservation
|
|
139
|
+
- Edge case handling
|
|
82
140
|
- Integration with painlessMesh plugin system
|