Universal File System
This feature is included in every precompiled binary with flash size >1M
For ESP8266 modules that have more than 1MB of flash memory (NodeMCU, Wemos-D1) you can build a variant with a universal file system or UFS and store your files there (data, images, commands, etc). There are some special files that you can upload and use to execute actions.
The file partition DOES NOT get erased by reset commands. Only a complete flash erase will remove it.
UFS in the Web GUI~
After compiling and flashing you will find a new entry in Tasmota webUI: Consoles - Manage File system
The "Manage File System" page provides:
- On top, the total size of the file system and the free size
- A button to upload a file from the host (1st select the file with the
Choose Filebutton, then
- A list of available files with timestamp of upload and size in bytes
- The 'fire' icon allows to delete the file without any confirmation
- The 'memo' icon allows to edit the file and the "Create and edit new file" button launches the editor with a new file.
The file editor allows to edit the content of a text file online, save it back to the UFS. By changing the name at the top, it will be saved-as the new name (original file remains unchanged). Changes can be discarded by clicking on the button "Manage File System" to returns to the manager.
Complete list of UFS commands
Also look into Berry scripting language for ESP32 which works with UFS.
Stores commands that will be executed at every boot, similar to the backlog commands in rules trigger at
Almost any command can be used in the file. However, avoid commands that will make the device reboot, such as: changing Wifi setting, MQTT settings, Templates & GPIO, etc. Commands that triggers reboot will create a boot loop which will force Tasmota to automatically disable
autoexec.bat and other settings. See SetOption36 for more details.
Commands must be kept one command per line and they will be executed sequentially. Lines starting with semicolon are ignored as comments.
Stores data that will be displayed at every boot, similar to the DisplayText commands in rules trigger at
System#Init (as long as you have a display driver initializated).
; clr screen [z] ; draw full screen picture - corona.rgb file must exist in UFS storage [x0y0P/corona.rgb] ; define index color [dc19:31000] ; draw transparent text with new index color [x60y30f2Ci19D2]Tasmota
For ESP32 with Berry scripting language,
autoexec.be file will be automatically loaded and executed at boot.
Compiling for Universal File System~
For ESP8266 boards, activate by removing the
; in front of one of the below lines:
board = esp8266_4M3Mfor 3Mb universal file system
board = esp8266_4M2Mfor 2Mb universal file system
board = esp8266_2M1Mfor 1Mb universal file system
ESP32 boards with default 4MB flash only support a file system limited to 320KB. You need a board with more than 4MB to enable a larger file system.
Extending file system size on ESP32 is performed through the
board_build.partitions setting. There are preconfigured settings for 4M, 8M and 16MB ESP32 devices. The are enabled in
platformio_override.ini like for the ESP8266. Comment the standard setting and uncomment the variant you want.
; Build variant ESP32 4M Flash, Tasmota 1856k Code/OTA, 320k LITTLEFS (UFS) (default) board = esp32_4M ; Build variant ESP32 8M Flash, Tasmota 2944k Code/OTA, 2112k LITTLEFS (UFS) ;board = esp32_8M ; Build variant ESP32 16M Flash, Tasmota 2944k Code/OTA, 10M LITTLEFS (UFS) ;board = esp32_16M