diff --git a/src/config.h b/src/config.h index a0516a9..8b92a8f 100644 --- a/src/config.h +++ b/src/config.h @@ -38,7 +38,7 @@ #define NVS_SCHEMA_VERSION 1 // Width of the sync-fail / no-WiFi border, in pixels. -#define BORDER_THICKNESS_PX 16 +#define BORDER_THICKNESS_PX 4 // ── Network ────────────────────────────────────────────────────────────────── #define APP_BASE_URL "https://pictureframe.edholm.me" diff --git a/src/operation.h b/src/operation.h index 1e583ce..da507b0 100644 --- a/src/operation.h +++ b/src/operation.h @@ -77,6 +77,8 @@ void normal_operation_impl(const String& mac, HTTP& http, const String& url, Pre // by treating this boot as if errBorder were set, then bump schema_v so // it doesn't fire again. if (schemaV < NVS_SCHEMA_VERSION) { + Serial.println(String("[op] schema migration v") + String(schemaV) + " -> v" + + String(NVS_SCHEMA_VERSION) + ", forcing one-shot recovery redraw"); errBorder = true; prefs.begin(NVS_NAMESPACE, false); prefs.putInt(NVS_KEY_SCHEMA_V, NVS_SCHEMA_VERSION); @@ -135,6 +137,9 @@ void normal_operation_impl(const String& mac, HTTP& http, const String& url, Pre // (drawNeeded), or a sync-fail border is currently on screen and the // server is healthy again (errBorder) — repaint clean to clear it. if (drawNeeded || errBorder) { + Serial.println(String("[op] 304 with recovery flags (drawNeeded=") + + String((int)drawNeeded) + " errBorder=" + + String((int)errBorder) + ") -> repainting clean from /img.bin"); File r = LittleFS.open(IMAGE_PATH, "r"); if (r) { displayInitialized = true; @@ -145,6 +150,9 @@ void normal_operation_impl(const String& mac, HTTP& http, const String& url, Pre prefs.putInt(NVS_KEY_DRAW_NEEDED, 0); prefs.putInt(NVS_KEY_ERR_BORDER, 0); prefs.end(); + Serial.println("[op] recovery redraw complete; flags cleared"); + } else { + Serial.println("[op] recovery aborted: /img.bin not in LittleFS"); } } } else if (code == 204) { @@ -167,9 +175,13 @@ void normal_operation_impl(const String& mac, HTTP& http, const String& url, Pre epd_init(); File r = LittleFS.open(IMAGE_PATH, "r"); if (r) { + Serial.println(String("[op] sync fail code=") + String(code) + + " -> drawing image with yellow border"); epd_draw_image_with_border(r, COLOR_YELLOW, BORDER_THICKNESS_PX); r.close(); } else { + Serial.println(String("[op] sync fail code=") + String(code) + + " -> no cached image, falling back to full yellow fill"); epd_fill(COLOR_YELLOW); } prefs.begin(NVS_NAMESPACE, false);