
AT commands
File system commands
Digi XBee® 3 Cellular LTE-M/NB-IoT Global Smart Modem User Guide
232
File system commands
To access the file system,
and use the following commands. All commands
block the AT command processor until completed and only work from Command mode; they are not
valid for API mode or MicroPython's
xbee.atcmd()
method. Commands are case-insensitive as are file
and directory names. Optional parameters are shown in square brackets (
[]
).
FS
is a command with sub-commands. These sub-commands are arguments to
FS
.
For
FS
commands, you have to type
AT
before the command, for example
ATFS PWD
,
ATFS LS
and so
forth.
Error responses
If a command succeeds it returns information such as the name of the current working directory or a
list of files, or
OK
if there is no information to report. If it fails, you see a detailed error message
instead of the typical
ERROR
response for a failing AT command. The response is a named error code
and a textual description of the error.
Note
The exact content of error messages may change in the future. All errors start with a capital
E
,
followed by one or more uppercase letters and digits, a space, and an description of the error.
If writing your own AT command parsing code, you can determine if an
FS
command response is an
error by checking if the first letter of the response is capital
E
.
ATFS (File System)
When sent without any parameters,
FS
prints a list of supported commands.
ATFS PWD
Prints the current working directory, which always starts with
/
and defaults to
/flash
at startup.
ATFS CD
directory
Changes the current working directory to
directory
. Prints the current working directory or an error
if unable to change to
directory
.
ATFS MD
directory
Creates the directory
directory
. Prints
OK
if successful or an error if unable to create the requested
directory.
ATFS LS [
directory
]
Lists files and directories in the specified directory. The
directory
parameter is optional and defaults
to a period (
.
), which represents the current directory. The list ends with a blank line.
Entries start with zero or more spaces, followed by filesize or the string
<DIR>
for directories, then a
single space character and the name of the entry. Directory names end with a forward slash (
/
) to
differentiate them from files. Secure files end with a hash mark (
#
) and you cannot download them.
<DIR> ./
<DIR> ../
<DIR> cert/