
File system
Overview of the file system
Digi XBee3 Cellular LTE-M/NB-IoT Global Smart Modem User Guide
143
Overview of the file system
XBee Smart Modem firmware versions ending in
0B
(for example, 1130B, 100B, 3100B) and later
include support for storing files on an internal 1 MB SPI flash.
CAUTION!
You need to
if upgrading a device that originally shipped
with older firmware. You can use XCTU, AT commands or MicroPython for that initial format
or to erase existing content at any time.
Note
To use XCTU with file system, you need XCTU 6.4.0 or newer.
See
and ensure that the format is complete.
Directory structure
The SPI flash appears in the file system as
/flash
, the only entry at the root level of the file system. It
has a
lib
directory intended for MicroPython modules and a
cert
directory for files used for SSL/TLS
sockets.
Paths
The XBee Smart Modem stores all of its files in the top-level directory
/flash
. On startup, the
ATFS
commands and MicroPython each use that as their current working directory. When specifying the
path to a file or directory, it is interpreted as follows:
n
Paths starting with a forward slash are "absolute" and must start with
/flash
to be valid.
n
All other paths are relative to the current working directory.
n
The directory
..
refers to the parent directory, so an operation on
../filename.txt
that takes
place in the directory
/flash/test
accesses the file
/flash/filename.txt
.
n
The directory
.
refers to the current directory, so the command
ATFS ls .
lists files in the
current directory.
n
Names are case-insensitive, so
FILE.TXT
,
file.txt
and
FiLe.TxT
all refer to the same file.
n
File and directory names are limited to 64 characters, and can only contain letters, numbers,
periods, dashes and underscores. A period at the end of the name is ignored.
n
The full, absolute path to a file or directory is limited to 255 characters.
Secure files
The file system includes support for secure files with the following properties:
n
Created via the
ATFS XPUT
command or in MicroPython using a mode of
*
with the
open()
method.
n
Unable to download via the
ATFS GET
command or MicroPython's
open()
method.
n
SHA256 hash of file contents available from
ATFS HASH
command (to compare with a local
copy of a file).
n
Encrypted on the SPI flash.
n
MicroPython can execute code in secure files.
n
Sockets can use secure files when creating SSL/TLS connections.