@alteriom/painlessmesh 1.7.2 → 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 (37) hide show
  1. package/CHANGELOG.md +58 -4
  2. package/README.md +17 -3
  3. package/docs/README.md +62 -10
  4. package/docs/archive/DOCUSAURUS_DEPLOYMENT.md +166 -0
  5. package/docs/archive/LIBRARY_JSON_FIX.md +98 -0
  6. package/docs/archive/LIBRARY_STRUCTURE_FIX.md +215 -0
  7. package/docs/archive/RELEASE_SUMMARY.md +173 -0
  8. package/docs/archive/SCONS_BUILD_FIX.md +313 -0
  9. package/docs/archive/TRIGGER_RELEASE.md +280 -0
  10. package/docs/archive/VECTOR_INCLUDE_FIX.md +129 -0
  11. package/docs/development/ARDUINO_COMPLIANCE_SUMMARY.md +71 -0
  12. package/docs/development/CODE_REFACTORING_RECOMMENDATIONS.md +1011 -0
  13. package/docs/development/DOCKER_TESTING.md +196 -0
  14. package/docs/development/PLATFORMIO_USAGE.md +180 -0
  15. package/docs/development/TESTING_SUMMARY.md +126 -0
  16. package/docs/development/contributing.md +301 -0
  17. package/docs/development/documentation.md +583 -0
  18. package/docs/improvements/FUTURE_PROPOSALS.md +1016 -0
  19. package/docs/improvements/IMPLEMENTATION_HISTORY.md +1091 -0
  20. package/docs/improvements/OTA_STATUS_ENHANCEMENTS.md +709 -0
  21. package/docs/improvements/README.md +171 -46
  22. package/docs/releases/FEATURE_HISTORY.md +543 -0
  23. package/docs/releases/PATCH_v1.7.3.md +262 -0
  24. package/docs/releases/PHASE1_SUMMARY.md +246 -0
  25. package/docs/releases/PHASE2_SUMMARY.md +499 -0
  26. package/docs/releases/RELEASE_NOTES_1.7.0.md +539 -0
  27. package/docs/troubleshooting/debugging.md +455 -0
  28. package/library.json +1 -1
  29. package/library.properties +1 -1
  30. package/package.json +1 -1
  31. package/src/painlessmesh/router.hpp +35 -19
  32. /package/docs/{improvements → archive}/FEATURE_PROPOSALS.md +0 -0
  33. /package/docs/{improvements → archive}/PHASE1_IMPLEMENTATION.md +0 -0
  34. /package/docs/{improvements → archive}/PHASE2_IMPLEMENTATION.md +0 -0
  35. /package/docs/{improvements → archive}/ota-and-status-enhancements.md +0 -0
  36. /package/docs/{improvements → archive}/ota-status-architecture-diagrams.md +0 -0
  37. /package/docs/{improvements → archive}/ota-status-quick-reference.md +0 -0
@@ -1,87 +1,212 @@
1
- # painlessMesh Library Improvements
1
+ # painlessMesh Improvements Documentation
2
2
 
3
- This document outlines the comprehensive improvements made to the painlessMesh library to enhance performance, security, and maintainability.
3
+ This directory contains documentation for improvements made to painlessMesh, including completed features (Phases 1-2) and proposed enhancements (Phase 3+).
4
+
5
+ ---
4
6
 
5
7
  ## Overview
6
8
 
7
9
  The improvements focus on four key areas:
10
+
8
11
  1. **Performance Optimization** - Memory management and processing efficiency
9
12
  2. **Security & Robustness** - Input validation and attack prevention
10
13
  3. **Monitoring & Diagnostics** - Performance metrics and health monitoring
11
- 4. **Code Quality** - Bug fixes and maintainability improvements
14
+ 4. **OTA & Status Enhancements** - Advanced firmware distribution and monitoring
15
+
16
+ ---
17
+
18
+ ## Documentation Structure
19
+
20
+ ### 📋 Current State
21
+
22
+ **[OTA_STATUS_ENHANCEMENTS.md](OTA_STATUS_ENHANCEMENTS.md)** - Complete reference guide
23
+ - ✅ **Phase 1 (v1.6.x):** Compressed OTA + Enhanced Status Package
24
+ - ✅ **Phase 2 (v1.7.0):** Broadcast OTA + MQTT Status Bridge
25
+ - 📋 **Phase 3 (Future):** Progressive rollout, P2P distribution, telemetry streams
26
+ - Decision matrices, architecture diagrams, performance expectations
27
+ - Quick reference for choosing implementation options
28
+
29
+ ### 🔧 Technical Details
30
+
31
+ **[IMPLEMENTATION_HISTORY.md](IMPLEMENTATION_HISTORY.md)** - Implementation details for Phases 1-2
32
+ - Technical specifications and code changes
33
+ - Performance analysis and benchmarks
34
+ - Testing documentation (80 assertions passing)
35
+ - Files modified and API changes
36
+ - Memory impact and scalability analysis
12
37
 
13
- ## New Features
38
+ ### 🚀 Future Roadmap
14
39
 
15
- ### 1. Input Validation & Security (`validation.hpp`)
40
+ **[FUTURE_PROPOSALS.md](FUTURE_PROPOSALS.md)** - Proposed Phase 3+ features
41
+ - Progressive Rollout OTA (Option 1B) - Zero-downtime updates
42
+ - Peer-to-Peer Distribution (Option 1C) - Viral propagation for 100+ nodes
43
+ - MQTT-Integrated OTA (Option 1D) - Cloud-based management
44
+ - Mesh Status Service (Option 2B) - RESTful API for status queries
45
+ - Telemetry Stream (Option 2C) - Real-time monitoring with delta encoding
46
+ - Health Dashboard (Option 2D) - Web-based management interface
16
47
 
17
- Comprehensive security framework to protect against malicious or malformed messages.
48
+ ---
18
49
 
19
- - **Message Validation**: JSON schema validation, field type checking, size limits
20
- - **Rate Limiting**: Per-node message rate limiting to prevent spam
21
- - **Secure Random**: Hardware-based random number generation
22
- - **Node ID Validation**: Verify node IDs are within valid ranges
50
+ ## Completed Features
23
51
 
24
- ### 2. Performance Metrics & Monitoring (`metrics.hpp`)
52
+ ### Core Library Improvements
25
53
 
26
- Advanced monitoring capabilities for performance optimization and diagnostics.
54
+ **1. Input Validation & Security (`validation.hpp`)**
55
+ - JSON schema validation and field type checking
56
+ - Per-node rate limiting to prevent spam
57
+ - Hardware-based secure random number generation
58
+ - Node ID validation
27
59
 
28
- - **Message Statistics**: Throughput, latency, error tracking, loss rate calculation
29
- - **Memory Monitoring**: Heap tracking, peak usage, critical alerts
30
- - **Network Topology**: Connection stability, node count tracking, hop analysis
31
- - **JSON Reports**: Detailed status reports for integration with monitoring systems
60
+ **2. Performance Metrics & Monitoring (`metrics.hpp`)**
61
+ - Message statistics (throughput, latency, error tracking)
62
+ - Memory monitoring (heap tracking, peak usage, alerts)
63
+ - Network topology (connection stability, hop analysis)
64
+ - JSON reports for integration with monitoring systems
32
65
 
33
- ### 3. Memory Management Optimization (`memory.hpp`)
66
+ **3. Memory Management Optimization (`memory.hpp`)**
67
+ - Object pooling to minimize allocation overhead
68
+ - Pre-allocated string buffers
69
+ - Memory statistics and leak detection
34
70
 
35
- Efficient memory management to reduce fragmentation and improve performance.
71
+ **4. Protocol Improvements**
72
+ - Issue #521 resolution (protocol::Variant copy operations)
73
+ - Move semantics for efficient operations
74
+ - Enhanced zero-copy buffer operations
36
75
 
37
- - **Object Pooling**: Reuse objects to minimize allocation overhead
38
- - **String Buffers**: Pre-allocated buffers to avoid frequent reallocations
39
- - **Memory Statistics**: Track allocations and detect leaks
76
+ ### OTA & Status Features (Phases 1-2)
40
77
 
41
- ### 4. Protocol Improvements
78
+ **Phase 1 (v1.6.x):**
79
+ - ✅ Compressed OTA infrastructure (40-60% bandwidth reduction)
80
+ - ✅ Enhanced StatusPackage (18 comprehensive fields)
42
81
 
43
- Fixed critical issues and enhanced performance of core protocol handling.
82
+ **Phase 2 (v1.7.0):**
83
+ - ✅ Broadcast OTA (98% traffic reduction for 50-node mesh)
84
+ - ✅ MQTT Status Bridge (Grafana/InfluxDB integration)
44
85
 
45
- - **Issue #521 Resolution**: Fixed crashes in protocol::Variant copy operations
46
- - **Move Semantics**: Efficient move constructors and assignment operators
47
- - **Buffer Optimization**: Enhanced zero-copy operations in buffer handling
86
+ ---
48
87
 
49
88
  ## Performance Impact
50
89
 
51
- - **Memory Usage**: 10-20% reduction in memory fragmentation
52
- - **Message Processing**: 5-15% faster validation and processing
53
- - **Network Efficiency**: Reduced retransmissions due to better error handling
54
- - **CPU Usage**: More efficient algorithms reduce processing overhead
90
+ **Core Improvements:**
91
+ - Memory usage: 10-20% reduction in fragmentation
92
+ - Message processing: 5-15% faster validation
93
+ - Network efficiency: Reduced retransmissions
94
+ - CPU usage: More efficient algorithms
95
+
96
+ **OTA Improvements (Phase 1-2):**
97
+ - Update speed: 75% faster (Phase 2 broadcast mode)
98
+ - Network bandwidth: 50% reduction (Phase 1 compression) + 98% reduction (Phase 2 broadcast)
99
+ - Scalability: Proven up to 50-100 nodes
100
+ - Memory overhead: +7-13KB total
101
+
102
+ ---
55
103
 
56
104
  ## Testing & Quality
57
105
 
58
- - **100% Test Pass Rate**: All existing and new tests pass
59
- - **New Test Suites**: Comprehensive tests for validation and metrics
60
- - **Static Analysis**: Code passes all static analysis checks
61
- - **Memory Testing**: No memory leaks detected
106
+ - **100% Test Pass Rate**: All existing and new tests pass
107
+ - **80 Assertions**: Comprehensive Phase 1-2 test coverage
108
+ - **No Regressions**: Backward compatibility maintained
109
+ - **Static Analysis**: Code passes all checks
110
+ - ✅ **Memory Testing**: No leaks detected
111
+
112
+ ---
113
+
114
+ ## Quick Start
115
+
116
+ ### "How do I use the new OTA features?"
117
+
118
+ **Phase 1-2 are available now in v1.7.0:**
119
+
120
+ ```cpp
121
+ // Enable compressed + broadcast OTA (both Phase 1 and 2 features)
122
+ mesh.offerOTA("sensor", "ESP32", md5, parts, false, true, true);
123
+ // ^^^^^ ^^^^ ^^^^
124
+ // forced bcast compress
125
+ ```
126
+
127
+ **See:** [OTA_STATUS_ENHANCEMENTS.md](OTA_STATUS_ENHANCEMENTS.md) for decision guide
128
+
129
+ ### "How do I use the new status monitoring?"
130
+
131
+ **Enhanced StatusPackage (Phase 1):**
132
+
133
+ ```cpp
134
+ #include "examples/alteriom/alteriom_sensor_package.hpp"
135
+
136
+ alteriom::EnhancedStatusPackage status;
137
+ status.uptime = millis() / 1000;
138
+ status.freeMemory = ESP.getFreeHeap() / 1024;
139
+ status.nodeCount = mesh.getNodeList().size();
140
+ mesh.sendBroadcast(status.toJsonString());
141
+ ```
142
+
143
+ **MQTT Bridge (Phase 2):**
144
+
145
+ ```cpp
146
+ #include "examples/bridge/mqtt_status_bridge.hpp"
147
+
148
+ MqttStatusBridge bridge(mesh, mqttClient);
149
+ bridge.setPublishInterval(30000); // 30 seconds
150
+ bridge.begin();
151
+ ```
152
+
153
+ **See:** [OTA_STATUS_ENHANCEMENTS.md](OTA_STATUS_ENHANCEMENTS.md) for detailed usage
154
+
155
+ ---
62
156
 
63
157
  ## Examples
64
158
 
65
- See `examples/alteriom/improved_sensor_node.ino` for a complete demonstration of the new features.
159
+ **Core Improvements:**
160
+ - `examples/alteriom/improved_sensor_node.ino` - Demonstrates validation and metrics
161
+
162
+ **Phase 1-2 Features:**
163
+ - `examples/alteriom/phase1_features.ino` - Compressed OTA + Enhanced Status
164
+ - `examples/alteriom/phase2_features.ino` - Broadcast OTA + MQTT Bridge
165
+ - `examples/bridge/mqtt_bridge_example.ino` - MQTT integration example
166
+ - `examples/otaSender/otaSender.ino` - OTA sender implementation
167
+ - `examples/otaReceiver/otaReceiver.ino` - OTA receiver implementation
168
+
169
+ ---
170
+
171
+ ## Related Documentation
172
+
173
+ ### User Documentation
174
+ - [Feature History](../releases/FEATURE_HISTORY.md) - User-facing docs, migration guides, usage patterns
175
+ - [Phase 1 Guide](../PHASE1_GUIDE.md) - Complete Phase 1 usage guide (if exists)
176
+ - [Phase 2 Guide](../PHASE2_GUIDE.md) - Complete Phase 2 usage guide (if exists)
177
+
178
+ ### API Documentation
179
+ - [Core API Reference](../api/core-api.md) - API documentation
180
+ - [Metrics API](../../src/painlessmesh/metrics.hpp) - Performance metrics
181
+ - [Validation API](../../src/painlessmesh/validation.hpp) - Input validation
182
+ - [Alteriom Packages](../../examples/alteriom/alteriom_sensor_package.hpp) - Package definitions
183
+
184
+ ### Architecture
185
+ - [Mesh Architecture](../architecture/mesh-architecture.md) - Core architecture
186
+ - [Plugin System](../architecture/plugin-system.md) - Plugin architecture
66
187
 
67
188
  ---
68
189
 
69
- ## Future Enhancements
190
+ ## Contributing
70
191
 
71
- ### OTA Distribution and Mesh Status Monitoring
192
+ Interested in implementing Phase 3 features or improving existing ones?
72
193
 
73
- Comprehensive proposals for enhancing painlessMesh's OTA and status monitoring capabilities:
194
+ 1. Review [FUTURE_PROPOSALS.md](FUTURE_PROPOSALS.md) for detailed specifications
195
+ 2. Check [GitHub Issues](https://github.com/Alteriom/painlessMesh/issues) for discussions
196
+ 3. Read [Contributing Guide](../development/contributing.md) for workflow
197
+ 4. Open an issue to discuss your implementation plan
198
+ 5. Submit a pull request with implementation and tests
74
199
 
75
- - **[OTA and Status Enhancements - Full Proposal](ota-and-status-enhancements.md)** - Detailed analysis of five OTA distribution options and five mesh status monitoring options, with pros/cons, implementation details, and phased rollout recommendations.
200
+ ---
76
201
 
77
- - **[Quick Reference Guide](ota-status-quick-reference.md)** - TL;DR summary with decision matrices, implementation examples, and performance expectations.
202
+ ## Questions & Support
78
203
 
79
- **Highlights:**
80
- - Multiple OTA options: Broadcast distribution, progressive rollout, peer-to-peer, MQTT integration, and compression
81
- - Multiple status options: Enhanced packages, status service, telemetry streams, dashboards, and MQTT bridges
82
- - Phased implementation strategy starting with quick wins
83
- - Production-ready recommendations for enterprise deployments
204
+ - **GitHub Issues:** <https://github.com/Alteriom/painlessMesh/issues>
205
+ - **Discussions:** <https://github.com/Alteriom/painlessMesh/discussions>
206
+ - **Documentation:** <https://alteriom.github.io/painlessMesh/>
84
207
 
85
208
  ---
86
209
 
87
- For detailed API documentation and usage examples, see the individual header files.
210
+ **Last Updated:** October 2025
211
+ **Current Version:** v1.7.0
212
+ **Status:** Phases 1-2 Complete ✅ | Phase 3 Proposed 📋