FileSystem AT Commands
The default AT firmware does not support the AT commands listed on this page. If you need ESP32 to support FileSystem commands, you can compile the ESP-AT project by following the steps in Compile ESP-AT Project Locally documentation. In the project configuration during the fifth step, make the following selections:
AT FS command support
<type>: only FATFS is currently supported.
0: delete file.
1: write file.
2: read file.
3: query the size of the file.
4: list files in a specific directory. Only root directory is currently supported.
<offset>: apply to writing and reading operations only.
<length>: data length, applying to writing and reading operations only.
This command will automatically mount the filesystem. After the AT+FS filesystem operation is all done, it is strongly recommended to use the AT+FSMOUNT=0 command to unmount the filesystem to free a large amount of RAM space.
If the length of the read data is greater than the actual file length, only the actual data length of the file will be returned.
If the operator is
write, wrap return
>after the write command, then you can send the data that you want to write. The length should be parameter
// delete a file. AT+FS=0,0,"filename" // write 10 bytes to offset 100 of a file. AT+FS=0,1,"filename",100,10 // read 100 bytes from offset 0 of a file. AT+FS=0,2,"filename",0,100 // list all files in the root directory. AT+FS=0,4,"."
AT+FSMOUNT: Mount/Unmount Filesystem
0: Unmount filesystem
1: Mount filesystem
// unmount the filesystem manually AT+FSMOUNT=0 // mount the filesystem manually AT+FSMOUNT=1