FAQ
TL;DR: Increasing LittleFS cache from 16 B to 128 B sped up writes by 6×, and “large uploads now work after adding a 5 ms RTOS delay” [Elektroda, p.kaczmarek2, #21589234; #20941452]. Use ≤200 KB partitions, minify .vue files, and firmware ≥1.17.432 for stable on-device WebApp hosting.
Why it matters: you can keep Logs and Filesystem tools available on a closed network without breaking OTA or exhausting heap.
Quick Facts
• Default LittleFS partition: 32 KB (0x8000) [Elektroda, jkwim, post #20928161]
• Reliable size on BK7231T/N: 200 KB (0x32000); 256 KB may reboot N chips [Elektroda, Angel0fDeath, post #20931925]
• Each file uses whole 4 KB blocks; real usage = ceil(size/4096)×4096 [Elektroda, Angel0fDeath, post #20930090]
• Cache 128 B vs 16 B lowers write time by ~6× [Elektroda, p.kaczmarek2, post #21589234]
• Heap-low warning appears when LittleFS ≥212 KB on 4 MB flash [Elektroda, jkwim, post #20931820]
1. What is the factory-set LittleFS size and how do I expand it?
OpenBeken ships with a 32 KB LittleFS partition. Enlarge it with lfs_format <bytes>
; e.g., lfs_format 0x32000
creates a 200 KB filesystem [Elektroda, jkwim, #20928161; Angel0fDeath, #20930090].
2. Does enlarging LittleFS endanger OTA updates?
LittleFS lives after the application image. If the new size stays below the OTA start address, OTA still works; contents are wiped but firmware installs normally [Elektroda, p.kaczmarek2, post #20928195]
3. Why did my device reboot when uploading a 92 KB file?
Firmware <1.17.432 lacked an RTOS delay in the upload loop, causing watchdog resets during long writes. Update to the delay-patched build or newer and the reboot disappears [Elektroda, p.kaczmarek2, #20941452; Angel0fDeath, #20942411].
4. How do I safely change LittleFS size?
- Run
lfs_format <newSizeHex>
.
- Reboot immediately.
- Upload files, starting with the largest one first.
This prevents stale mounts and spreads blocks efficiently [Elektroda, Angel0fDeath, post #20930090]
5. Which firmware contains the large-upload fix?
Builds ≥1.17.432 (merge ca445c8) include the 5 ms delay; earlier versions need the test RBL from PR #1056 [Elektroda, Angel0fDeath, post #20942411]
6. How much LittleFS space does a file really consume?
LittleFS allocates whole 4 KB blocks, so a 123 B file occupies 4096 B. Formula: used = ((size÷4096)+1)×4096 [Elektroda, Angel0fDeath, post #20930090]
7. Can I host the WebApp (Logs tab only) on the device itself?
Yes. Copy vue.min.js, httpVueLoader.min.js, startup.js, logs.min.vue and indexdevice.html into LittleFS, then point “Configure WebApp” to http://IP/api/lfs/indexdevice.html
[Elektroda, jkwim, post #20944917]
8. How do I shrink .vue and .js files to fit 200 KB?
Minify <script>
sections with a JS minifier and <style>
with a CSS minifier; jkwim cut httpVueLoader from 10.9 KB to 5.8 KB and entire package to 196 KB [Elektroda, jkwim, post #20946139]
9. What happens to LittleFS during OTA?
OTA erases the partition area; keep a tar backup via Web-FS, then restore after flashing [Elektroda, p.kaczmarek2, post #20928195]
10. Why does 256 KB work on BK7231T but fail on BK7231N?
BK7231N’s application+OTA layout leaves less contiguous space; formatting at 0x40000 triggers heap depletion and reboots [Elektroda, Angel0fDeath, #20931925; jkwim, #20931820].
11. What edge case should I watch?
Power-save or any active driver can interrupt large uploads; disable drivers and PowerSave before writing big files [Elektroda, Angel0fDeath, post #20941264]
12. How can I move LittleFS to external SPI flash?
A branch adds software-SPI support; compile with USE_EXT_SPI_LFS
in obk_config.h and wire a SOIC-8 NOR flash (e.g., W25Q32) to four GPIOs. Early tests wrote 600 KB successfully albeit slowly [Elektroda, p.kaczmarek2, post #21587455]
13. Is SD-card storage available?
Not yet. SD over SPI is on the roadmap; community interest logged in posts #21587304 and #21587412 [Elektroda, insmod, post #21587304]
14. How do I back up and restore LittleFS quickly?
Use Web-FS “Download TAR”. To restore large sets, upload the biggest files first, then the main tar to avoid heap exhaustion [Elektroda, jkwim, post #20944917]
15. What performance gain will I see from enlarging cache?
Raising LFS cache from 16 B to 128 B cut 600 KB upload time from ~110 s to ~18 s, a 6× speed-up [Elektroda, p.kaczmarek2, post #21589234]
16. The log shows “Low heap warning!”. Safe to ignore?
A single warning appears when LittleFS ≥212 KB on 4 MB flash. If functions run and no resets occur, operation remains stable [Elektroda, jkwim, post #20931820]