Skip to content

File System

The RoArm-M2-S uses the ESP32’s SPIFFS (SPI Flash File System) to store configuration files, mission sequences, and WiFi credentials. You can manage these files through JSON commands.

List all files stored in flash:

{"T":200}

Returns a list of filenames with their sizes.

Create a new file with initial content:

{"T":201,"name":"config.txt","content":"initial content here"}

Read the entire contents of a file:

{"T":202,"name":"config.txt"}

Read a single line by line number:

{"T":207,"name":"config.txt","lineNum":3}

Add content to the end of a file:

{"T":204,"name":"config.txt","content":"new line at end"}

Insert a new line at a specific position:

{"T":205,"name":"config.txt","lineNum":3,"content":"inserted content"}

Overwrite a specific line:

{"T":206,"name":"config.txt","lineNum":3,"content":"replacement content"}

Remove a specific line:

{"T":208,"name":"config.txt","lineNum":3}

Remove a file from flash:

{"T":203,"name":"config.txt"}

Check available storage:

{"T":601}

The firmware uses these files internally:

FilenamePurpose
wifiConfig.jsonWiFi mode, SSID, and password
Mission filesNamed by user (e.g., pick_place)
T-CodeCommandDescription
200Scan filesList all files and sizes
201Create fileNew file with content
202Read fileFull file contents
203Delete fileRemove file
204Append lineAdd to end of file
205Insert lineInsert at line number
206Replace lineOverwrite at line number
207Read lineRead single line
208Delete lineRemove single line
601Free spaceCheck available flash

File system reference from firmware source json_cmd.h.