Repository navigation
IoT Sensor Gateway Firmware v1.0.6
Release v1.0.5 - Enhanced Packet Validation & Emergency Protection
π New Features
Emergency Shutdown System
- Automatic protection against broker flooding with invalid packet detection
- WiFi credential clearing instead of complete shutdown for easier recovery
- AP mode fallback - device becomes configurable after emergency shutdown
- Rate limiting - max 1000 packets/minute to prevent excessive processing
Enhanced Packet Validation
- Comprehensive validation - checks for zero values, FF corruption, unrealistic readings
- Detailed error reporting - shows exactly why packets are rejected in debug mode
- Fixed packet counting - now correctly counts 9-byte packets instead of individual bytes
- Packet statistics - tracks total bytes vs packets, invalid ratios, and rate limits
Debug Mode
- Remote serial output - capture device logs via MQTT diagnostics
- Real-time monitoring - see packet processing, validation errors, and system status
- Configurable logging - enable/disable debug mode remotely
Certificate Management
- OTA certificate updates - update certificates via MQTT without firmware recompile
- Certificate rotation - reset to embedded certificates or update to new ones
- Fallback protection - uses embedded certificates if preferences are empty
π§ Improvements
WiFi Configuration
- Extended AP timeout - increased from 2 minutes to 15 minutes for easier setup
- Better error handling - improved WiFi connection diagnostics
- Cleaner AP mode - proper WiFi mode switching and disconnection
MQTT Reliability
- Automatic reconnection - handles connection drops gracefully
- Enhanced diagnostics - detailed connection and packet statistics
- Emergency alerts - immediate notification of critical issues
Sensor Data Management
- Cache size limits - prevents memory overflow with large sensor counts
- Automatic cleanup - removes oldest sensors when cache is full
- Better validation - filters out corrupted or unrealistic sensor readings
π‘οΈ Security & Stability
Rate Limiting
- Packet rate limits - prevents processing more than 1000 packets/minute
- Invalid packet limits - stops processing if >500 invalid packets/minute
- Emergency shutdown - triggers at 80% invalid packet ratio
Recovery Options
- Remote reset - clear statistics and recover from emergency shutdown
- Firmware updates - OTA updates with improved error handling
- Configuration reset - clear WiFi credentials and restart in AP mode
π New Commands
// Enable debug mode
{"action": "debug_mode", "enabled": true}
// Reset packet statistics
{"action": "reset_stats"}
// Update certificates
{"action": "update_certificates", "rootca": "...", "devicecert": "...", "privatekey": "..."}
// Reset to embedded certificates
{"action": "reset_certificates"}
// Manual emergency shutdown
{"action": "emergency_shutdown", "enabled": true}π Diagnostics
Enhanced diagnostics now include:
- Packet statistics - total bytes, packets, invalid counts, rates
- Emergency status - shutdown state and reasons
- Connection health - WiFi signal, uptime, readings sent
- Debug output - serial logs when debug mode is enabled
π Bug Fixes
- Fixed packet counting - now correctly counts 9-byte packets instead of individual bytes
- Improved UART handling - better noise filtering and packet validation
- Memory management - prevents sensor cache overflow
- WiFi reconnection - more reliable connection recovery
π Performance
- Reduced memory usage - efficient packet processing and validation
- Faster startup - optimized WiFi connection and certificate loading
- Better error recovery - graceful handling of corrupted data and connection issues
Upgrade Instructions:
- Send firmware update command with v1.0.5 binary URL
- Device will automatically update and restart
- Monitor diagnostics for proper operation
- Enable debug mode if needed for troubleshooting
Compatibility: ESP32-C6, Arduino IDE 2.0+, ESP32 Arduino Core 2.0+