Keep the HTTP session alive between weather polls (TODO #1). Re-creating the client each time forced a fresh TLS handshake inside the window where the UI is frozen. Measured on hardware: the fetch went from ~1.3s to ~80ms, so the pause is no longer long enough to matter once thermostat controls exist. The timeout drops from 30s to 10s once a session is warm, since only a cold handshake needs the longer budget. Any transport error or non-200 tears the session down so a half-open connection cannot poison every later poll. The response buffer is now reset per request rather than on HTTP_EVENT_ON_CONNECTED -- a kept-alive connection does not re-fire that event, so the buffer would have accumulated across polls. Indicate stale readings (TODO #2). After two consecutive failures the temperature dims and the status line shows the age. Age comes from tick counts, not weather_data_t.last_update: there is no SNTP client here, so time(NULL) starts at the epoch and any age derived from it is meaningless. Gate the touch readout behind UI_DEBUG_TOUCH, default off (TODO #3). Kept the note about LVGL not bubbling events to parents -- it documents a real trap. Delete main/utils (TODO #4); it had no callers outside itself. Also refreshed project_structure.txt, which was additionally missing i2c_bus and backlight. Lay out two 4MB OTA slots (TODO #5) while no devices are fielded, and document in the README that an OTA download cannot run while the panel is scanning -- the flash write faults the bounce-buffer ISR. Log the truncation warning once per response instead of once per chunk, and record the weather task's stack high-water mark (TODO #6): ~2400 bytes spare of 6144. Co-Authored-By: Claude <noreply@anthropic.com>
1.2 KiB
1.2 KiB
| 1 | # Partition table for ESP32-S3-WROOM-1-N16R8 (16MB flash | 8MB octal PSRAM) | ||||
|---|---|---|---|---|---|---|
| 2 | # | |||||
| 3 | # Two 4MB OTA slots. The app is ~1.1MB | so this is generous -- but the layout | ||||
| 4 | # is fixed once devices are in the field | and re-partitioning later means | ||||
| 5 | # reflashing each one over USB. Laying the slots out now costs nothing. | |||||
| 6 | # | |||||
| 7 | # NOTE: writing an OTA image is a flash write | and the panel's bounce-buffer | ||||
| 8 | # refill ISR reads PSRAM | which shares the cache with flash on the S3. An OTA | ||||
| 9 | # for the download+write | or reboot into a dedicated updater mode first. See | ||||
| 10 | # | |||||
| 11 | # The former 12MB SPIFFS partition was dropped -- nothing mounted it. ~7.9MB | |||||
| 12 | # is left unallocated for a filesystem or a third slot if either is ever | |||||
| 13 | # needed; adding a partition to free space is safe | moving one is not. | ||||
| 14 | # | |||||
| 15 | # Name | Type | SubType | Offset | Size | Flags |
| 16 | nvs | data | nvs | 0x9000 | 0x6000 | |
| 17 | otadata | data | ota | 0xf000 | 0x2000 | |
| 18 | phy_init | data | phy | 0x11000 | 0x1000 | |
| 19 | ota_0 | app | ota_0 | 0x20000 | 0x400000 | |
| 20 | ota_1 | app | ota_1 | 0x420000 | 0x400000 |