OTA_STATUS_ENHANCEMENTS - Alteriom/painlessMesh GitHub Wiki
OTA and Status Enhancements Reference
Document Type: Feature Reference & Decision Guide
Status: Phases 1-2 Complete β
| Phase 3 Proposed π
Last Updated: October 2025
Overview
This document provides a comprehensive reference for OTA distribution and status monitoring enhancements in painlessMesh. Use this guide to understand available options, make implementation decisions, and plan deployments.
Quick Links:
- Implementation History - Technical details of completed Phases 1-2
- Future Proposals - Phase 3+ roadmap
- Feature History (User Docs) - Migration guides and usage
Table of Contents
- OTA Distribution Options
- Status Monitoring Options
- Implementation Status
- Decision Guide
- Performance Expectations
- Architecture Diagrams
OTA Distribution Options
Summary Matrix
| Option | Status | Speed | Memory | Complexity | Best For |
|---|---|---|---|---|---|
| 1E: Compression | β v1.6.x | ββββ | +4-8KB | Low | Everyone (40-60% faster) |
| 1A: Broadcast | β v1.7.0 | βββββ | +2-5KB | Medium | Medium-large meshes |
| 1B: Progressive | π Phase 3 | ββ | +3-7KB | High | Production safety |
| 1C: Peer-to-Peer | π Phase 3 | βββββ | +200KB | Very High | Very large meshes (50+) |
| 1D: MQTT Bridge | π Phase 3 | βββ | +5-10KB | Medium | MQTT infrastructure |
Option 1E: Compressed OTA Transfer β IMPLEMENTED
Status: β Available in v1.6.x+ (Phase 1)
Description: Infrastructure support for compressed firmware transfers. Flag propagates through OTA message chain to prepare for future compression library integration.
Key Features:
- Compressed flag in Announce/DataRequest/Data messages
- Backward compatible (defaults to uncompressed)
- State persistence across reboots
- Ready for compression library (heatshrink/miniz)
Usage:
// Enable compression flag
mesh.offerOTA("sensor", "ESP32", md5, parts, false, false, true);
// ^^^^^ ^^^^^ ^^^^
// forced bcast compress
Performance Impact:
- Speed: 40-60% faster updates (when compression library integrated)
- Bandwidth: 50% reduction
- Memory: +4-8KB for compression buffers
Implementation Details: IMPLEMENTATION_HISTORY.md#compressed-ota-transfer
Option 1A: Broadcast OTA β IMPLEMENTED
Status: β Available in v1.7.0 (Phase 2)
Description: True mesh-wide firmware distribution where chunks are broadcast to all nodes simultaneously, eliminating sequential node-by-node updates.
Key Features:
- Automatic broadcast routing when
broadcasted=true - All nodes receive chunks in parallel
- Fallback to unicast for missed chunks
- 98% traffic reduction for large meshes
Usage:
// Enable broadcast OTA
mesh.offerOTA("sensor", "ESP32", md5, parts, false, true, false);
// ^^^^^ ^^^^
// forced broadcast
// Combine with compression
mesh.offerOTA("sensor", "ESP32", md5, parts, false, true, true);
Architecture:
Unicast Mode (Phase 1):
Root β Node1: chunk 0 β Node2: chunk 0 β Node3: chunk 0
[N Γ F transmissions where N=nodes, F=chunks]
Broadcast Mode (Phase 2):
Root β All Nodes: chunk 0 (received by all simultaneously)
[F transmissions only - 98% reduction for 50 nodes]
Performance Impact:
- 50 nodes, 150 chunks: 7,500 β 150 transmissions (98% reduction)
- Update time: O(NΓF) β O(F) (parallel vs sequential)
- Scales to 50-100 nodes efficiently
Implementation Details: IMPLEMENTATION_HISTORY.md#broadcast-ota
Option 1B: Progressive Rollout OTA π PROPOSED
Status: π Proposed for Phase 3
Description: Deploy firmware in controlled waves (canary β early adopters β all) with health monitoring and automatic rollback on failures.
Key Features:
- Phased rollout (5% β 20% β 100%)
- Health checks between phases
- Automatic rollback on failures
- Zero-downtime updates
Target Use Cases:
- Production deployments requiring safety
- Critical infrastructure
- Risk-averse organizations
Proposal Details: FUTURE_PROPOSALS.md#option-1b-progressive-rollout
Option 1C: Peer-to-Peer Distribution π PROPOSED
Status: π Proposed for Phase 3
Description: Viral propagation where updated nodes become distribution sources, enabling exponential scaling for very large meshes.
Key Features:
- Updated nodes redistribute firmware
- Exponential distribution speed
- Requires sufficient flash storage (+200-500KB)
- Best for meshes with 50+ nodes
Target Use Cases:
- Very large deployments (100+ nodes)
- ESP32 with sufficient flash
- Scenarios where update speed is critical
Proposal Details: FUTURE_PROPOSALS.md#option-1c-peer-to-peer
Option 1D: MQTT-Integrated OTA π PROPOSED
Status: π Proposed for Phase 3
Description: Standardized MQTT interface for triggering and managing OTA operations, enabling cloud-based firmware management.
Key Features:
- MQTT command interface
- Cloud-managed updates
- Integration with existing MQTT infrastructure
- Remote OTA triggering
Target Use Cases:
- Existing MQTT infrastructure
- Cloud-based management
- External OTA tools integration
Proposal Details: FUTURE_PROPOSALS.md#option-1d-mqtt-integrated
Status Monitoring Options
Summary Matrix
| Option | Status | Real-time | Overhead | Complexity | Best For |
|---|---|---|---|---|---|
| 2A: Enhanced Package | β v1.6.x | βββ | Low | Low | Simple integration |
| 2E: MQTT Bridge | β v1.7.0 | βββ | Low | Low | Cloud integration |
| 2B: Status Service | π Phase 3 | βββ | Medium | Medium | Centralized control |
| 2C: Telemetry Stream | π Phase 3 | βββββ | Very Low | High | Real-time monitoring |
| 2D: Health Dashboard | π Phase 3 | βββββ | Medium | Very High | User-facing apps |
Option 2A: Enhanced StatusPackage β IMPLEMENTED
Status: β Available in v1.6.x+ (Phase 1)
Description: Extended Alteriom StatusPackage with 18 comprehensive fields covering device health, mesh statistics, and performance metrics.
Key Features:
- Device health (uptime, memory, WiFi, firmware)
- Mesh statistics (nodes, connections, messages)
- Performance metrics (latency, packet loss, throughput)
- Alert system with bit flags
- ~500 bytes per status report
Usage:
#include "examples/alteriom/alteriom_sensor_package.hpp"
alteriom::EnhancedStatusPackage status;
status.uptime = millis() / 1000;
status.freeMemory = ESP.getFreeHeap() / 1024;
status.nodeCount = mesh.getNodeList().size();
status.alertFlags = checkSystemAlerts();
mesh.sendBroadcast(status.toJsonString());
18 Fields:
// Device Health (6 fields)
uint8_t deviceStatus, wifiStrength;
uint32_t uptime;
uint16_t freeMemory;
TSTRING firmwareVersion, firmwareMD5;
// Mesh Statistics (5 fields)
uint16_t nodeCount;
uint8_t connectionCount;
uint32_t messagesReceived, messagesSent, messagesDropped;
// Performance Metrics (3 fields)
uint16_t avgLatency;
uint8_t packetLossRate;
uint16_t throughput;
// Alerts (2 fields)
uint8_t alertFlags;
TSTRING lastError;
Alert Flags:
#define ALERT_LOW_MEMORY (1 << 0) // Free heap < 10KB
#define ALERT_HIGH_LATENCY (1 << 1) // Avg latency > 500ms
#define ALERT_PACKET_LOSS (1 << 2) // Loss rate > 10%
#define ALERT_CONNECTION_LOST (1 << 3) // Lost connection to root
#define ALERT_OTA_FAILED (1 << 4) // OTA update failed
#define ALERT_SENSOR_ERROR (1 << 5) // Sensor malfunction
#define ALERT_WIFI_WEAK (1 << 6) // WiFi RSSI < -80dBm
#define ALERT_REBOOT_LOOP (1 << 7) // Multiple reboots detected
Implementation Details: IMPLEMENTATION_HISTORY.md#enhanced-statuspackage
Option 2E: MQTT Status Bridge β IMPLEMENTED
Status: β Available in v1.7.0 (Phase 2)
Description: Publish mesh status to MQTT topics at configurable intervals, enabling integration with professional monitoring tools like Grafana and InfluxDB.
Key Features:
- Periodic publishing (default 30s)
- Multiple topics (nodes, topology, metrics, alerts)
- Configurable features (enable/disable topics)
- ~5-8KB memory overhead
Usage:
#include "examples/bridge/mqtt_status_bridge.hpp"
MqttStatusBridge bridge(mesh, mqttClient);
bridge.setPublishInterval(30000); // 30 seconds
bridge.setTopicPrefix("alteriom/mesh/");
bridge.enablePerNode(false); // Disable high-traffic per-node
bridge.begin();
MQTT Topics:
mesh/status/nodes - Node list and count (~200 bytes)
mesh/status/topology - Mesh structure (1-5KB)
mesh/status/metrics - Performance stats (~300 bytes)
mesh/status/alerts - Active alerts (~400 bytes)
mesh/status/node/{id} - Per-node status (optional, high traffic)
Integration Examples:
Grafana:
1. Install MQTT datasource plugin
2. Configure broker connection
3. Create panels for:
- Node count over time
- Memory usage trends
- Alert timeline
- Topology visualization
InfluxDB:
1. Install Telegraf with MQTT consumer
2. Configure topic subscriptions
3. Parse JSON payloads
4. Store time-series data
Home Assistant:
mqtt:
sensor:
- name: "Mesh Node Count"
state_topic: "mesh/status/metrics"
value_template: "{{ value_json.nodeCount }}"
Scalability Recommendations:
| Mesh Size | Features | Interval | Traffic/Hour |
|---|---|---|---|
| 1-10 nodes | All enabled | 30s | ~400KB |
| 10-50 nodes | Disable per-node | 60s | ~200KB |
| 50+ nodes | Metrics + alerts only | 120s | ~100KB |
Implementation Details: IMPLEMENTATION_HISTORY.md#mqtt-status-bridge
Option 2B: Mesh Status Service π PROPOSED
Status: π Proposed for Phase 3
Description: Query-based status collection with centralized aggregation, providing on-demand mesh-wide status via RESTful API.
Target Use Cases:
- Centralized monitoring
- On-demand queries
- Dashboard applications
Proposal Details: FUTURE_PROPOSALS.md#option-2b-status-service
Option 2C: Telemetry Stream π PROPOSED
Status: π Proposed for Phase 3
Description: Continuous low-bandwidth telemetry with delta encoding, anomaly detection, and proactive alerting for real-time critical monitoring.
Target Use Cases:
- Real-time monitoring requirements
- Large-scale deployments (50+ nodes)
- Proactive alerting systems
Proposal Details: FUTURE_PROPOSALS.md#option-2c-telemetry-stream
Option 2D: Health Dashboard π PROPOSED
Status: π Proposed for Phase 3
Description: Complete web-based monitoring solution with embedded web server, real-time visualization, and interactive topology display.
Target Use Cases:
- User-facing applications
- Visual monitoring requirements
- Local network management
Proposal Details: FUTURE_PROPOSALS.md#option-2d-health-dashboard
Implementation Status
β Phase 1 (v1.6.x) - COMPLETE
Features:
- β Compressed OTA infrastructure (Option 1E)
- β Enhanced StatusPackage (Option 2A)
Achievements:
- 40-60% OTA speed improvement (when compression library integrated)
- Standardized status reporting with 18 fields
- 80 test assertions passing
- Full backward compatibility
Release: v1.6.0 (December 2024)
β Phase 2 (v1.7.0) - COMPLETE
Features:
- β Broadcast OTA (Option 1A)
- β MQTT Status Bridge (Option 2E)
Achievements:
- 98% traffic reduction for large meshes (50 nodes)
- Cloud integration via MQTT
- Grafana/InfluxDB compatibility
- Scales to 50-100 nodes
Release: v1.7.0 (March 2025)
π Phase 3 (Future) - PROPOSED
Proposed Features:
- π Progressive Rollout OTA (Option 1B)
- π Peer-to-Peer Distribution (Option 1C)
- π MQTT-Integrated OTA (Option 1D)
- π Mesh Status Service (Option 2B)
- π Telemetry Stream (Option 2C)
- π Health Dashboard (Option 2D)
Timeline: TBD based on community feedback
Decision Guide
"Which OTA option should I use?"
Start with: 1E (Compression) + 1A (Broadcast)
- Both available in v1.7.0
- Universal benefits (faster, less bandwidth)
- Works with existing infrastructure
Decision Tree:
Do you have 1-10 nodes?
ββ Yes: Use Compression (1E) only
ββ No: Use Compression (1E) + Broadcast (1A)
Do you need production-safe deployments?
ββ Yes: Wait for Progressive Rollout (1B) - Phase 3
ββ No: Use Broadcast (1A) - Available now
Do you have 50+ nodes with ESP32?
ββ Yes: Consider Peer-to-Peer (1C) - Phase 3
ββ No: Broadcast (1A) is sufficient
Do you use MQTT infrastructure?
ββ Yes: Consider MQTT OTA (1D) - Phase 3
ββ No: Use native broadcast (1A)
"Which status option should I use?"
Start with: 2A (Enhanced StatusPackage) + 2E (MQTT Bridge)
- Both available in v1.7.0
- Easy integration
- Professional monitoring
Decision Tree:
Do you need cloud monitoring?
ββ Yes: Use MQTT Bridge (2E) - Available now
ββ No: Use Enhanced StatusPackage (2A) - Available now
Do you use Grafana/InfluxDB?
ββ Yes: Use MQTT Bridge (2E) with Telegraf
ββ No: Use Enhanced StatusPackage (2A)
Do you need real-time monitoring (<1s latency)?
ββ Yes: Wait for Telemetry Stream (2C) - Phase 3
ββ No: MQTT Bridge (2E) is sufficient (30s interval)
Do you need web-based UI?
ββ Yes: Wait for Health Dashboard (2D) - Phase 3
ββ No: Use Grafana with MQTT Bridge (2E)
Performance Expectations
OTA Performance by Phase
| Phase | Features | 10 Nodes | 50 Nodes | Bandwidth |
|---|---|---|---|---|
| Base | Unicast only | 60-120s | 300-600s | N Γ Size |
| Phase 1 | + Compression | 35-70s | 180-360s | 0.5 Γ N Γ Size |
| Phase 2 | + Broadcast | 20-30s | 30-50s | 0.5 Γ Size |
| Phase 3 | + Progressive | 40-60s | 60-100s | 0.5 Γ Size |
Key Insights:
- Phase 1 (Compression): 40% faster, universal benefit
- Phase 2 (Broadcast): 75% faster for large meshes, scales to 100 nodes
- Phase 3 (Progressive): Slower but safer, zero-downtime
Status Monitoring Performance
| Option | Traffic/Node | Overhead | Latency | Scalability |
|---|---|---|---|---|
| Enhanced Package | ~500 bytes | Low | 30-60s | 1-50 nodes |
| MQTT Bridge | ~1KB | Low | 30-60s | 1-100 nodes |
| Status Service | ~1.5KB | Medium | 5-15s | 1-100 nodes |
| Telemetry Stream | ~200 bytes | Very Low | <1s | 1-200+ nodes |
| Health Dashboard | ~2KB | Medium | 1-5s | 1-50 nodes |
Memory Impact Summary
| Feature | ESP8266 | ESP32 | Notes |
|---|---|---|---|
| Compressed OTA | +4-8KB | +4-8KB | Compression buffers |
| Broadcast OTA | +2-5KB | +2-5KB | Chunk assembly |
| Enhanced Status | +500B | +500B | Per status report |
| MQTT Bridge | +5-8KB | +5-8KB | Root node only |
| Combined Phase 2 | +7-13KB | +7-13KB | All features |
ESP8266 Constraints:
- Total RAM: ~80KB
- After mesh core: ~30-40KB free
- Phase 2 features: ~7-13KB
- Remaining: ~20-30KB for application
ESP32 Constraints:
- Total RAM: ~320KB
- After mesh core: ~200-250KB free
- Phase 2 features: ~7-13KB
- Remaining: ~180-240KB for application
Architecture Diagrams
Broadcast OTA Flow
βββββββββββββββ
β Root Node β
β (Sender) β
ββββββββ¬βββββββ
β
β 1. Broadcast Announce (periodic, every 60s)
ββββββββββββββββββββββββββββββββββββββββΊ
β β
β βΌ
β ββββββββββββββββ
β β All Nodes β
β β Check MD5 β
β ββββββββ¬ββββββββ
β β
β 2. Root requests chunk 0 (triggers broadcast)
ββββββββββββββββββββββββββββββββββββββββ€
β β
β 3. Broadcast Data (chunk 0) β
βββββββββββββββββββββββββββββββββββββββΊ
β β
β All nodes receive simultaneously β
β β
β 4. Broadcast Data (chunk 1) β
βββββββββββββββββββββββββββββββββββββββΊ
β β
β ... continue for all chunks ... β
β β
β 5. Broadcast Data (chunk N) β
βββββββββββββββββββββββββββββββββββββββΊ
β β
β βΌ
β ββββββββββββββββ
β β All Nodes β
β β Reboot β
β ββββββββββββββββ
Key Benefits:
- F transmissions instead of NΓF (where N=nodes, F=chunks)
- All nodes update in parallel
- 98% traffic reduction for 50-node mesh
MQTT Status Bridge Flow
ββββββββββββββββ
β painlessMesh β
β - Nodes β
β - Topology β
β - Metrics β
ββββββββ¬ββββββββ
β (periodic read)
βΌ
ββββββββββββββββββββ
β MqttStatusBridge β
β - Collect β
β - Format JSON β
β - Publish β
ββββββββ¬ββββββββββββ
β (MQTT publish)
βΌ
ββββββββββββββββββββ βββββββββββββββ
β MQTT Broker ββββββββββΊβ Grafana β
β mesh/status/* β β Dashboards β
ββββββββββββββββββββ βββββββββββββββ
β
β
βΌ
ββββββββββββββββββββ
β InfluxDB β
β Time-series DB β
ββββββββββββββββββββ
Topics:
mesh/status/nodes- Node list (~200B every 30s)mesh/status/topology- Mesh structure (1-5KB every 60s)mesh/status/metrics- Performance stats (~300B every 30s)mesh/status/alerts- Active alerts (~400B every 30s)
Phase 1-2-3 Evolution
PHASE 1 (v1.6.x):
βββββββββββββββ
β Unicast OTA β βββΊ Compressed flag added
βββββββββββββββ (40-60% faster when library integrated)
βββββββββββββββ
β Basic Statusβ βββΊ Enhanced StatusPackage
βββββββββββββββ (18 comprehensive fields)
PHASE 2 (v1.7.0):
βββββββββββββββ
β Broadcast β βββΊ True mesh-wide distribution
β OTA β (98% traffic reduction)
βββββββββββββββ
βββββββββββββββ
β MQTT Bridge β βββΊ Cloud integration
β β (Grafana/InfluxDB)
βββββββββββββββ
PHASE 3 (Future):
βββββββββββββββ
β Progressive β βββΊ Canary deployments
β Rollout β (Zero-downtime updates)
βββββββββββββββ
βββββββββββββββ
β Telemetry β βββΊ Real-time monitoring
β Stream β (Sub-second latency)
βββββββββββββββ
βββββββββββββββ
β P2P OTA β βββΊ Viral propagation
β β (100+ node meshes)
βββββββββββββββ
Related Documentation
User Documentation
- Feature History - User-facing docs, migration guides
- Phase 1 Guide - Complete Phase 1 usage guide
- Phase 2 Guide - Complete Phase 2 usage guide
Technical Documentation
- Implementation History - Technical implementation details
- Future Proposals - Phase 3+ roadmap
Examples
examples/alteriom/phase1_features.ino- Phase 1 demonstrationexamples/alteriom/phase2_features.ino- Phase 2 demonstrationexamples/bridge/mqtt_bridge_example.ino- MQTT integration exampleexamples/otaSender/otaSender.ino- OTA sender implementationexamples/otaReceiver/otaReceiver.ino- OTA receiver implementation
Contributing
Interested in implementing Phase 3 features or improving existing ones?
- Review FUTURE_PROPOSALS.md for detailed feature specifications
- Check GitHub Issues for active discussions
- Read Contributing Guide for development workflow
- Open an issue to discuss your implementation plan
- Submit a pull request with implementation and tests
Questions & Support
- GitHub Issues: https://github.com/Alteriom/painlessMesh/issues
- Discussions: https://github.com/Alteriom/painlessMesh/discussions
- Documentation: https://alteriom.github.io/painlessMesh/
Document Version: 1.0
Last Updated: October 2025
Status: Living document - updated as features are implemented