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


Esempio:

AT#LOG="My custom text"

OK


Current date/time are automatically added to the beginning of the record.

APPEND TO FILE


Adds content at the end of an existing file by specifying the complete path. Only text files are supported, file will be created if do not exist.


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 be aborted if the path does not exist or there is not enough space left to save the file.

If there is no space left for storage in the device folders it will be impossible to perform any operation on the file system.

For this reason, although it is possible to create user files into the device folders, it is strongly recommended to create users files on SDcard.

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 specifying the complete path. If the file do not exist it will be created, if exists the content 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

CREATE DIRECTORY IN SDCARD


Create a folder in the specified path of the SDcard. To create a subfolder, the top folder must first be created


COMMAND

AT#CDIR=<name>

RESPONSE

OK

COMMAND ACCEPTED


ERROR

COMMAND REJECTED

PARAMETERS

<name>

COMPLETE PATH AND FOLDER NAME


Tor create the folder  foo  (ERROR is reported if already exists):

AT#CDIR=S:foo

OK


To create the subfoldera  bar  inside the existing folder  foo :

AT#CDIR=S:foo/bar

OK

to create a subfolder

the top folder must be created first