SD Card Commands

sd-dir-create

Creates a new directory.

Usage:

sd-dir-create dirpath [rename]
Parameter Description
dirpath The full path of the directory to create.
[rename] If provided and truthy, will attempt to automatically rename directories of the same name.

sd-dir-del

Deletes the specified directory and any files. Use with caution.

Usage:

sd-dir-del dirpath
Parameter Description
dirpath The path to the directory to delete. The directory and any children files must not be in use!

sd-dir-read

Displays the contents of a specified directory, optionally filtered.

Usage:

sd-dir-read dirpath [files_only] [filter]
Parameter Description
dirpath The path of the directory to read.
[files_only] If provided and truthy, only displays files. (default: dirs and files)
[filter] Optional filter. (e.g. *.txt for only text files.)

sd-file-del

Deletes the specified file. Use with caution.

Usage:

sd-file-del filename [dirpath]
Parameter Description
filename The name of the file to delete. This file must not be in use!
[dirpath] The optional directory the file is located in. (default: "/" (root))

sd-file-info

Prints file information to the command line.

Usage:

sd-file-info filename [dirpath] [include_crc]
Parameter Description
filename The name of the file to read.
[dirpath] The optional directory the file is located in. (default: "/" (root))
[include_crc] If specified and truthy, includes the file crc in the info.

sd-file-read

Outputs the contents of a file.

Usage:

sd-file-read filename [dirpath] [compress]
Parameter Description
filename The name of the file to read.
[dirpath] The optional directory the file is located in. (default: "/" (root))
[compress] If specified and truthy, compresses outgoing data using a modified LZSS algorithm.

sd-file-write

Creates a file from command line input.

Usage:

sd-file-write filename [dirpath] [rename] [silent-mode] [timeout_ms] [decompress] [crc]
Parameter Description
filename The name of the file to create.
[dirpath] The optional directory to create the file in. (default: "/" (root))
[rename] If specified and truthy, the file will be renamed if it already exists.
[silent-mode] If specified and truthy, disables input echo.
[timeout_ms] Amount of idle time (in milliseconds) to trigger end of file write. (default = 3000)
[decompress] If specified and truty, decompresses incoming data using a modified LZSS technique.
[crc] Optional CRC to compare with after writing is finished. Command will fail if CRC does not match.

sd-format

Formats and prepares the SD card. Triggers a reset.

Usage:

sd-format

sd-rename

Renames the specified file or directory.

Usage:

sd-rename current_path new_path
Parameter Description
current_path The path to the file/directory to rename. The file/directory and/or children files must not be in use!
new_path The new path to rename the file/directory.

sd-test

Tests sdcard functionality.

Usage:

sd-test


Example Output:

# sd-test
---------------------------------------------------------------------------------------------------
File           : sdcard.test
Write Speed    : 366.49 Kb/s
Write Time     : 2794
Bytes Written  : 1048576
Read Speed     : 315.75 Kb/s
Read Time      : 3243
Bytes Read     : 1048576
Failed Chunks  : 0
---------------------------------------------------------------------------------------------------

results matching ""

    No results matching ""