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.
Scanning Files
Section titled “Scanning Files”List all files stored in flash:
{"T":200}Returns a list of filenames with their sizes.
Creating Files
Section titled “Creating Files”Create a new file with initial content:
{"T":201,"name":"config.txt","content":"initial content here"}Reading Files
Section titled “Reading Files”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}Modifying Files
Section titled “Modifying Files”Append a Line
Section titled “Append a Line”Add content to the end of a file:
{"T":204,"name":"config.txt","content":"new line at end"}Insert a Line
Section titled “Insert a Line”Insert a new line at a specific position:
{"T":205,"name":"config.txt","lineNum":3,"content":"inserted content"}Replace a Line
Section titled “Replace a Line”Overwrite a specific line:
{"T":206,"name":"config.txt","lineNum":3,"content":"replacement content"}Delete a Line
Section titled “Delete a Line”Remove a specific line:
{"T":208,"name":"config.txt","lineNum":3}Deleting Files
Section titled “Deleting Files”Remove a file from flash:
{"T":203,"name":"config.txt"}Flash Space
Section titled “Flash Space”Check available storage:
{"T":601}System Files
Section titled “System Files”The firmware uses these files internally:
| Filename | Purpose |
|---|---|
wifiConfig.json | WiFi mode, SSID, and password |
| Mission files | Named by user (e.g., pick_place) |
Command Summary
Section titled “Command Summary”| T-Code | Command | Description |
|---|---|---|
| 200 | Scan files | List all files and sizes |
| 201 | Create file | New file with content |
| 202 | Read file | Full file contents |
| 203 | Delete file | Remove file |
| 204 | Append line | Add to end of file |
| 205 | Insert line | Insert at line number |
| 206 | Replace line | Overwrite at line number |
| 207 | Read line | Read single line |
| 208 | Delete line | Remove single line |
| 601 | Free space | Check available flash |
File system reference from firmware source json_cmd.h.