|
FILES
Commands that allow operations on files:
|
|
APPEND TO SYSTEM LOG FILE
Adds a custom record to system log file.
|
Command
|
AT#LOG=<text>
|
|
Response
|
OK
COMMAND ACCEPTED
ERROR
COMMAND REJECTED
|
|
PARAMETERS
|
<text>
TEXT TO APPEND, MAY INCLUDE TAGS
|
Example:
AT#LOG="My custom text"
OK
Current date/time are automatically added to the beginning of the record.
|
|
APPEND TO FILE
Appends content to the end of an existing file by specifying its full path. Only text files are supported; if the file doesn't exist, it will be created.
|
Command
|
AT#AFILE=<name>,<type>,<text>
|
|
Response
|
OK
COMMAND ACCEPTED
ERROR
COMMAND REJECTED
|
|
PARAMETERS
|
<name>
COMPLETE PATH AND NAME OF THE FILE
<type>
FILE TYPE
T : TEXT
<text>
TEXT TO APPEND, MAY INCLUDE TAGS
TEXT WITHIN DOUBLE QUOTES IF MORE THAN ONE WORD
|
To append a text to a user file:
AT#AFILE=D:SYSTEM/note.txt,T,UPDATED
OK
To append timestamp and average analog measure to a user log file:
AT#AFILE=S:LOGS/mylog.txt,T,"$D14$D15 : $A12"
OK
The operation will fail if the path does not exist or if there is not enough space to save the file.
If there is no space available in the device folders, no file system operations will be possible.
For this reason, while you can create user files in device folders, it is strongly recommended that you create them only in the S folder.
|
|
LIST FILES
Returns the list of files stored in the specified folder.
|
Command
|
AT#LFILE=<path>
|
|
Response
|
...
...
COMMAND ACCEPTED, LIST OF FILES
ERROR
COMMAND REJECTED
|
|
PARAMETERS
|
<path>
PATH OF THE FOLDER TO LIST
|
|
|
READ FILE
Returns the contents of the file in the specified path.
|
Command
|
AT#RFILE=<name>
|
|
Response
|
...
...
COMMAND ACCEPTED, FILE CONTENT
ERROR
COMMAND REJECTED
|
|
PARAMETERS
|
<name>
COMPLETE PATH AND NAME OF THE FILE
|
|
|
WRITE FILE
Write a file by specifying the full path. If the file doesn't exist, it will be created; if it does exist, its contents will be overwritten.
|
Command
|
AT#WFILE=<name>,<type>,<payload>
|
|
Response
|
OK
COMMAND ACCEPTED
CONNECT
WAITING TO RECEIVE BINARY FILE
ERROR
COMMAND REJECTED
|
|
PARAMETERS
|
<name>
COMPLETE PATH AND NAME OF THE FILE
<type>
FILE TYPE
T : TEXT
B : BINARY
<payload>
FILE LENGTH FOR TYPE BINARY
FILE CONTENT FOR TYPE TEXT
TEXT WITHIN DOUBLE QUOTES IF MORE THAN ONE WORD
|
To write a text file:
AT#WFILE=D:SYSTEM/note.txt,T,"System start"
OK
To write a 250 byte binary (audio) file to PLMN module:
AT#WFILE=P:message.wav,B,250
CONNECT
..........
OK
|
|
COPY FILE
Copy existing file.
|
Command
|
AT#CFILE=<source>,<destination>
|
|
Response
|
OK
COMMAND ACCEPTED
ERROR
COMMAND REJECTED
|
|
PARAMETERS
|
<source>
COMPLETE PATH AND NAME OF THE ORIGINAL FILE
<destination>
COMPLETE PATH AND NAME OF THE COPY FILE
|
|
SOURCE AND DESTINATION FOLDERS MUST EXIST
DESTINATION FILE IS CREATED (IF IT DOES NOT EXIST) OR OVERWRITTEN
|
To copy a text file:
AT#CFILE=S:LOGS/myLog.txt,S:COPYLOGS/myCopyFile.txt
OK
|
|
DELETE FILE
Deletes a file in the specified path.
|
Command
|
AT#DFILE=<name>
|
|
Response
|
OK
COMMAND ACCEPTED
ERROR
COMMAND REJECTED
|
|
PARAMETERS
|
<name>
COMPLETE PATH AND NAME OF THE FILE
|
|
be careful with delete command
if you delete system files the unit will stop working properly
|
|
|
DELETE DIRECTORY
Delete a folder in the specified path.
|
COMMAND
|
AT#DDIR=<name>
|
|
RESPONSE
|
OK
COMMAND ACCEPTED
ERROR
COMMAND REJECTED
|
|
PARAMETERS
|
<name>
COMPLETE PATH AND FOLDER NAME
|
|
To delete all files in folder UT (phone users):
AT#DDIR=U:UT
OK
To remove the folder LOGS and all its content:
AT#DDIR=S:LOGS
OK
|
|
THIS COMMAND DOES NOT REMOVE SYSTEM FOLDERS, JUST THEIR CONTENT
be careful with delete command, if you delete system files (D folder) the unit will stop working properly
|
|
|
HTTP DOWNLOAD
Downloads a remote file directly into the device's internal storage via HTTP/HTTPS.
A data connection must be available prior to executing this command.
|
Command
|
AT#HTTP=DWL,<url>,<destination>
|
|
Response
|
OK
COMMAND ACCEPTED
ERROR
COMMAND REJECTED
|
|
PARAMETER
|
<url>
The complete remote URL of the file to download:
<destination>
The full destination path and filename on the local file system
|
STORAGE PARTITIONS & PATH DIRECTIVES
Files must be saved to their dedicated locations based on file type:
- User Custom Files (S: Partition)
All general user files should always be stored in the S: drive, which provides up to 10 MB of available storage. Example: AT#HTTP=DWL,https://mysite.com/data.json,S:/data.json
- Audio Files (P: Partition)
Audio files must be downloaded directly into the P: drive. Example: AT#HTTP=DWL,https://mysite.com/alert.mp3,P:/alert.mp3
- Certificates & System Configurations (D:/SYSTEM)
Certificates and system configurations must be saved specifically in the D:/SYSTEM/ directory. Example: AT#HTTP=DWL,https://mysite.com/cert.pem,D:/SYSTEM/cert.pem
CRITICAL WARNING
File system operations carry a high risk of corrupting or bricking the device. Overwriting critical system files or using incorrect paths can cause unrecoverable operational failure. Ensure path accuracy and file integrity before executing downloads.
EXECUTION & ADVANCED FEATURES
- Response Handling: The downloaded response body is written directly to the specified local file.
- Header Execution (X-command): If the server response header includes a custom X-command tag, the device will attempt to execute any command value contained within it upon receipt.
The response returned by the server is always ignored. It is possible to include a custom tag X-command within the header of the response, any command found in its value will be executed.
SECURITY NOTE (Cybersecurity Compliance)
When performing downloads over https://, the device creates a secure connection using TLS (Transport Layer Security). The device automatically enforces strict validation of the server's certificate chain through a trusted Certificate Authority (CA), guaranteeing server authenticity and encrypting data in transit.
- Transmission Security: The device is responsible solely for establishing and maintaining the secure encrypted tunnel during download.
- Payload & Storage Compliance: Secure handling, processing, and long-term storage of the downloaded payload fall under the responsibility of the System Integrator. The System Integrator must ensure that all stored data and downstream processing comply with local privacy regulations (e.g., GDPR) and applicable cybersecurity standards.
|