For one of my current projects, I'm doing datalogging on an SD card, but because of how everything is mounted, I don't have physical access to the card. This means I can't just pop it into my PC when I have to access the data, delete files, etc.
To get around this problem, I've developed a terminal style interface that allows you to execute certain file management functions on your SD card through a serial interface (such as the Serial Montior or Putty).
The interface is a library can can be found here. It will soon be listed in the Arduino IDE's Libraries Manager under "SdTerminal.h".
Here are the supported functions:
- ">" - Create file if it doesn't already exist.
- ap - Append a line to an existing file.
- cd - Change present working directory.
- cp - Copy a file to another location.
- echo - Turn on or off echoing user commands.
- help - Provide info on commands. Can specify a specific command for help.
- ls - List the contents of the card. Can specify a specific dir for listing.
- mkdir - Make a new directory at a specific location.
- mv - Move or rename a file.
- print - Print the contents of the given file.
- pwd - Print the present working directory.
- rm - Remove a file or dir.
As of release 0.2.1, all of the commands work except for "cp", which will do deep copies for directories. That I will tackle soon... [Edit: Fixed as of release 1.0.0]
I'm not very experienced with interfacing with SD cards so if anyone notices any bugs or notices a better way to implement one of the lib's features, please let me know! Also, if there is a feature you would like to see, please post those requests either here in this thread, or as an issue in the repo.