v2.0.31 — WebSocket session leak fix + web upload fix
What's new
Fix: WebSocket session leak (crash prevention)
ws_send_job_fn and ws_send_str cleared the fd from the local tracking array on send failure but never called httpd_sess_trigger_close(). The underlying httpd session (socket slot + lwIP buffer) stayed allocated until LRU eviction, accumulating over hours of continuous operation until max_open_sockets was exhausted and the server entered ENOMEM — producing the socket error storm observed in logs.
Both send-failure paths now call httpd_sess_trigger_close() immediately after clearing the slot, so the httpd session is released promptly.
Fix: web file upload creates parent directories
api_upload_web_post called fopen(path, "w") without creating intermediate directories. LittleFS does not auto-create them. If the directory tree was missing (e.g. after a failed web UI update), all file uploads returned 500. The handler now walks the path and calls mkdir() for each component before opening the file.
Commits
10d0a1dfix: create parent directories in web upload handler20c7e65fix: close httpd session when WebSocket send fails
Full Changelog: v2.0.30...v2.0.31
First-time flash via ESP-IDF web upload tool
Select the full.bin for your board — this is a single merged image (bootloader + partition table + app + web UI) that can be flashed to address 0x0.
| Board | Full image |
|---|---|
| Heltec ESP32 | heltec-v2.0.31-full.bin |
| LilyGo LoRa32 V1.6.1 (ESP32) | lilygo-lora32-v2.0.31-full.bin |
| LilyGo T3-S3 (ESP32-S3) | lilygo-t3s3-v2.0.31-full.bin |
- Open the ESP-IDF web flash tool
- Connect the ESP32 via USB and put it in flash mode (hold BOOT, press EN/RESET, release BOOT)
- Click Connect and select the serial port
- Set address to
0x0 - Click Choose file and select the
full.binfor your board - Click Program — flashing takes about 30 seconds
- Press EN/RESET to boot
After the first serial flash, all subsequent updates can be done wirelessly via the device web UI (OTA tab → select the firmware.bin for your board).