Added MQTT Heartbeat and changed Firware Versioning System

This commit is contained in:
2025-12-03 18:22:17 +02:00
parent a7f1bd1667
commit b04590d270
9 changed files with 304 additions and 24 deletions

View File

@@ -62,16 +62,18 @@
* 👨‍💻 AUTHOR: BellSystems bonamin
*/
#define FW_VERSION "1.3"
#define FW_VERSION "131"
/*
* ═══════════════════════════════════════════════════════════════════════════════
* 📅 VERSION HISTORY:
* ═══════════════════════════════════════════════════════════════════════════════
* v0.1 - Vesper Launch Beta
* v1.2 - Added Log Level Configuration via App/MQTT
* v1.3 - Added Telemtry Reports to App, Various Playback Fixes
* v0.1 (100) - Vesper Launch Beta
* v1.2 (120) - Added Log Level Configuration via App/MQTT
* v1.3 (130) - Added Telemetry Reports to App, Various Playback Fixes
* ═══════════════════════════════════════════════════════════════════════════════
* NOTE: Versions are now stored as integers (v1.3 = 130)
* ═══════════════════════════════════════════════════════════════════════════════
*/
@@ -219,6 +221,18 @@ void setup()
// ═══════════════════════════════════════════════════════════════════════════════
// Update firmware version (this is the ONLY identity field that can be set)
// 🔥 MIGRATION: Convert old float-style version to integer format
String currentVersion = configManager.getFwVersion();
if (currentVersion.indexOf('.') != -1) {
// Old format detected (e.g., "1.3"), convert to integer ("130")
float versionFloat = currentVersion.toFloat();
uint16_t versionInt = (uint16_t)(versionFloat * 100.0f);
configManager.setFwVersion(String(versionInt));
configManager.saveDeviceConfig();
LOG_INFO("⚠️ Migrated version format: %s -> %u", currentVersion.c_str(), versionInt);
}
configManager.setFwVersion(FW_VERSION);
LOG_INFO("Firmware version: %s", FW_VERSION);