A Meshtastic firmware plugin that runs comprehensive tests for the LoFS unified filesystem
LoFS Test is a testing plugin that validates LoFS (LittleFS + SD card File System) functionality. It runs automatically when the module is initialized and provides detailed test results via serial output.
Use our Mesh Forge build profile to flash a LoFS Test-enabled version of Meshtastic to your device.
LoFS Test is a Meshtastic plugin that is automatically discovered and integrated by the Mesh Plugin Manager (MPM). To install LoFS Test:
- Install the Mesh Plugin Manager:
pip install mesh-plugin-manager- Install LoFS Test:
cd /path/to/meshtastic/firmware
mpm init
mpm install lofs-test- Build and flash:
pio run -e t-deck -t uploadThe test suite runs automatically when the module is initialized (during device boot). To view the test results:
- Connect to serial monitor:
pio run -t monitorOr if you're already in the PlatformIO environment:
pio device monitor- Look for the test output:
The test suite will output detailed results starting with:
INFO | ??:??:?? X === LoFS Comprehensive Test Suite ===
The tests run automatically and include:
- Test 1: Filesystem Availability - Checks if LittleFS and SD card are available
- Test 2: Filesystem Space Information - Reports total, used, and free space
- Test 3: Basic File Operations (LittleFS) - Write, read, exists operations
- Test 4: Basic File Operations (SD Card) - Same operations on SD card (if available)
- Test 5: Directory Operations - Create and verify directories
- Test 6: File Size Verification - Tests various file sizes (0 to 2048 bytes)
- Test 7: Cross-Filesystem Operations - Copy files between LittleFS and SD card
- Test 8: Same-Filesystem Rename - Rename operations within same filesystem
- Test 9: Error Cases - Invalid paths, non-existent files, etc.
- Test 10: Cleanup - Removes all test files and directories
All test results are logged with INFO level, making them easy to spot in the serial output. Tests that require SD card functionality will be skipped if no SD card is detected.
INFO | ??:??:?? 2 === LoFS Comprehensive Test Suite ===
INFO | ??:??:?? 2
INFO | ??:??:?? 2 --- Test 1: Filesystem Availability ---
INFO | ??:??:?? 2 LittleFS available: YES
INFO | ??:??:?? 2 SD Card available: NO
INFO | ??:??:?? 2
INFO | ??:??:?? 2 --- Test 2: Filesystem Space Information ---
INFO | ??:??:?? 2 LittleFS - Total: 1572864 bytes (1536.00 KB, 1.50 MB)
...
- The test suite runs once during module initialization (device boot)
- Tests are non-destructive - all test files are cleaned up automatically
- SD card tests require
HAS_SDCARDto be defined in your build configuration - On ESP32, you may see harmless VFS warnings when checking for non-existent files - these can be ignored