diff --git a/VERSION b/VERSION index eea55cf..f60acf7 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.9.17 +1.9.18 diff --git a/changelog.json b/changelog.json index 3861db5..3378e16 100644 --- a/changelog.json +++ b/changelog.json @@ -1,5 +1,18 @@ { "versions": [ + { + "version": "1.9.18", + "date": "2026-06-01", + "changes": { + "features": [], + "improvements": [], + "fixes": [ + "OTA update: appel manquant à sqlite/create_db.py dans update_firmware.sh et update_firmware_from_file.sh. Conséquence: les MAJ qui ajoutaient une nouvelle table (data_S88, data_NOISE.noise_status, etc.) laissaient les timers tourner mais chaque écriture échouait silencieusement avec 'no such table'. Désormais create_db.py est appelé en step 2 juste avant set_config.py — idempotent (CREATE IF NOT EXISTS + ALTER ADD COLUMN in try/except), safe à chaque OTA." + ], + "compatibility": [] + }, + "notes": "Fix self-bootstrap: dès qu'un capteur fait une OTA après cette version, create_db.py s'exécute et crée toutes les tables manquantes. Pour les capteurs déjà sur v1.9.13–v1.9.17 qui ont activé S88 sans table data_S88, la prochaine OTA résoudra automatiquement." + }, { "version": "1.9.17", "date": "2026-06-01", diff --git a/update_firmware.sh b/update_firmware.sh index dd8f127..12d083f 100755 --- a/update_firmware.sh +++ b/update_firmware.sh @@ -62,9 +62,16 @@ if [ -f "/var/www/nebuleair_pro_4g/VERSION" ]; then print_status "Firmware version: $(cat /var/www/nebuleair_pro_4g/VERSION)" fi -# Step 2: Update database configuration +# Step 2: Update database (schema migration + config keys) +# create_db.py is idempotent (CREATE TABLE IF NOT EXISTS + ALTER TABLE ADD COLUMN +# wrapped in try/except). Required to add tables introduced after the sensor was +# initially provisioned (e.g. data_S88, data_NOISE.noise_status, ...). +# Without this step, OTA updates that add a new sensor table leave the timer running +# but every write fails with "no such table". print_status "" -print_status "Step 2: Updating database configuration..." +print_status "Step 2: Updating database (schema migration + config keys)..." +/usr/bin/python3 /var/www/nebuleair_pro_4g/sqlite/create_db.py +check_status "Database schema migration" /usr/bin/python3 /var/www/nebuleair_pro_4g/sqlite/set_config.py check_status "Database configuration update" diff --git a/update_firmware_from_file.sh b/update_firmware_from_file.sh index 32bd08e..8f6d030 100644 --- a/update_firmware_from_file.sh +++ b/update_firmware_from_file.sh @@ -98,9 +98,14 @@ print_status "Fixing ownership..." chown -R www-data:www-data "$TARGET_DIR/" check_status "Ownership fix (chown)" -# Step 3: Update database configuration +# Step 3: Update database (schema migration + config keys) +# create_db.py is idempotent; required to add tables introduced after the sensor +# was provisioned. Without it, OTA leaves new-sensor timers running but every +# write fails with "no such table". print_status "" -print_status "Step 3: Updating database configuration..." +print_status "Step 3: Updating database (schema migration + config keys)..." +/usr/bin/python3 "$TARGET_DIR/sqlite/create_db.py" +check_status "Database schema migration" /usr/bin/python3 "$TARGET_DIR/sqlite/set_config.py" check_status "Database configuration update"