Repository navigation
OTA_STATUS_ENHANCEMENTS
Document Type: Feature Reference & Decision Guide
Status: Phases 1-2 Complete ✅ | Phase 3 Proposed 📋
Last Updated: October 2025
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
- OTA Distribution Options
- Status Monitoring Options
- Implementation Status
- Decision Guide
- Performance Expectations
- Architecture Diagrams
| 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 |
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 compressPerformance 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
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
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
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
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
| 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 |
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 detectedImplementation Details: IMPLEMENTATION_HISTORY.md#enhanced-statuspackage
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
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
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
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
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)
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)
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
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)
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)
| 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
| 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 |
| 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
┌─────────────┐
│ 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
┌──────────────┐
│ 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 (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)
└─────────────┘
- Feature History - User-facing docs, migration guides
- Phase 1 Guide - Complete Phase 1 usage guide
- Phase 2 Guide - Complete Phase 2 usage guide
- Implementation History - Technical implementation details
- Future Proposals - Phase 3+ roadmap
-
examples/alteriom/phase1_features.ino- Phase 1 demonstration -
examples/alteriom/phase2_features.ino- Phase 2 demonstration -
examples/bridge/mqtt_bridge_example.ino- MQTT integration example -
examples/otaSender/otaSender.ino- OTA sender implementation -
examples/otaReceiver/otaReceiver.ino- OTA receiver implementation
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
- 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