Commit Graph

15 Commits

Author SHA1 Message Date
Lago b2e7f1e624 docs: add project README 2026-04-03 23:40:25 +02:00
Lago 5ff72307ed fix: storage label 45deg tilt, smart MB/GB display
- lbl_sd_info: fixed width 280px + LV_TEXT_ALIGN_LEFT
- lbl_sd_pct: fixed width 60px + LV_TEXT_ALIGN_RIGHT
- ui_set_sd: show MB when used < 1024 (e.g. '61 MB / 7.3 GB')
  instead of '0.1 / 7.3 GB'
2026-04-03 23:30:39 +02:00
Lago b90d70bed5 fix: null-guard name in ftpTransferCallback (crash on transfer stop)
SimpleFTPServer passes null for the filename in FTP_TRANSFER_STOP
from closeTransfer(). Using %s with a null pointer crashes vsnprintf.
Guard all name uses with fallback to '?' if null or empty.
2026-04-03 23:19:10 +02:00
Lago d8aadc3735 fix: revert FTP task and calcDirSize (solves timeouts and crashes)
- Remove recursive calcDirSize because it blocks the CPU for several
  seconds during SD card traversal, causing FTP TCP connections to timeout
  before the welcome banner is sent.
- Remove FreeRTOS FTP task entirely. SimpleFTPServer relies on underlying
  Arduino WiFi mechanisms that aren't cleanly isolated into preemptive
  tasks; running it concurrently with LVGL screen updates and SD_MMC
  driver calls caused crashes and starvation.
- Restore tpSrv.handleFTP() to the main loop() as intended by the library.
2026-04-03 23:09:43 +02:00
Lago 715270390f fix: move FTP task to core 1 — core 0 reserved for WiFi stack
FTP task on core 0 at priority 2 starved the WiFi networking stack,
preventing the FTP welcome banner from being sent. Moved to core 1
with 2ms yield to coexist with LVGL rendering.
2026-04-03 23:02:52 +02:00
Lago 95c41bf501 fix: FTP crash on download — increase task stack, guard concurrent SD access
- FTP task stack 8KB → 32KB (SimpleFTPServer file I/O needs deep stack)
- Skip calcDirSize when FTP client connected (prevents concurrent SD_MMC
  access from core 0 + core 1 causing null pointer crash)
2026-04-03 22:46:03 +02:00
Lago 7792d5cc15 fix: make FTP cross-core state vars volatile and bump task priority to 2 2026-04-03 22:35:23 +02:00
Lago 58494cd0a7 fix: run FTP server in dedicated FreeRTOS task to unblock LVGL
Move ftpSrv.handleFTP() from Arduino loop() into a dedicated FreeRTOS
task pinned to core 0, leaving core 1 free for LVGL display updates.

FTP callbacks now only set volatile flags (ftp_ui_dirty, ftp_sd_dirty)
which the main loop polls to safely update UI and NeoPixel from core 1.
This eliminates the 20-second PASV data connection timeouts caused by
handleFTP() competing with display.update() for CPU time.

Also fix pre-existing BLACK constant build error in display_manager.cpp.
2026-04-03 22:14:28 +02:00
Lago 5290f8b4f0 fix: FTP passive mode, battery UI position, SD path traversal
- Add ftpSrv.setLocalIp() for correct PASV response IP (fixes transfers)
- Move battery indicator to WiFi SSID line, right-aligned
- Fix battery label tilt: fixed width + LV_TEXT_ALIGN_RIGHT
- Fix calcDirSize: use f.path() for full path in recursive walk
2026-04-03 21:30:05 +02:00
Lago a328f5ae97 fix: FTP storage type (SD_MMC not FFAT), SD used-space walk
- Define FTP_SERVER_NETWORK_TYPE=6 and STORAGE_TYPE=10 directly to bypass
  FtpServerKey.h platform detection that was overriding storage to FFAT
- Fix calcDirSize: properly close files, use name() for recursive path
- Add SD debug logging for used-space calculation
- This fixes file transfers (read/write) failing via FTP
2026-04-03 20:27:20 +02:00
Lago b31e80a71b feat: battery monitoring, external RTC persistence, SD used-space fix
- Add BQ27220 fuel gauge: reads SOC percentage every 5s
- Add BQ25896 PMIC: detects charging status (pre-charge/fast/done)
- Add MAX31329 external RTC: reads time on boot, syncs from NTP
- Battery UI: icon + percentage in header, cyan when charging
- Fix SD used bytes: fallback to recursive dir walk when usedBytes() returns 0
- Libraries: PMIC_BQ25896, kode_bq27220, kode_MAX31329
2026-04-03 16:25:55 +02:00
Lago 44b6a89b57 fix: FTP storage backend, SD info display, time label alignment
- Fix FTP using FFAT instead of SD_MMC: define both NETWORK_TYPE (6) and
  STORAGE_TYPE (10) with numeric values to bypass FtpServerKey.h guard
- Fix SD capacity showing 'f/f GB': use integer math instead of floats
  (LVGL builtin sprintf lacks %f support)
- Fix time/date labels tilting 45°: set fixed width + LV_TEXT_ALIGN_CENTER
- Switch LVGL sprintf to C stdlib for future float compatibility
2026-04-03 15:41:26 +02:00
Lago 6062083b5e feat: LVGL 9.5 upgrade, FTP server, premium AMOLED UI
- Upgraded LVGL from 8.4 to 9.5.0 (new display/input API)
- Rewrote DisplayManager for LVGL 9 (lv_display_create, tick callback)
- New lv_conf.h for v9.5 with optimized widget selection
- Premium dark AMOLED UI with gradient panels, status dots, storage bar
- Backend: Wi-Fi from SD JSON, NTP Vienna, SimpleFTPServer on SD_MMC
- Removed 6 unused sensor libs, added ArduinoJson + SimpleFTPServer
- Build: 19% RAM, 4.6% Flash — verified compilation success
2026-04-03 15:18:02 +02:00
Lago 4510cfe16c feat: FTP server with Wi-Fi, NTP, LVGL UI — initial working build
- Rewrite main.cpp: SD_MMC mount, Wi-Fi from JSON, NTP Vienna, FTP server
- Add ui.h/ui.cpp: LVGL status screen (IP, FTP status, SD bar, time)
- Add build_framework_libs.py: dynamic ESP32 Core 3.x lib resolution
- Remove unused sensor libs (IMU, magnetometer, fuel gauge, charger)
- Add SimpleFTPServer + ArduinoJson dependencies
- Build succeeds: RAM 19.2%, Flash 4.2%
2026-04-03 14:13:09 +02:00
Lago a3d9840a92 Initial commit: Base Project for Kode Dot (ESP32-S3) 2026-04-03 13:21:23 +02:00