Quectel EC2x&EG25-G&EG9x&EM05 FILE AT Commands Manual V1.0
Quectel EC2x&EG25-G&EG9x&EM05 FILE AT Commands Manual V1.0
EM05 FILE
AT Commands Manual
Date: 2019-07-05
Status: Released
www.quectel.com
LTE Standard Module Series
EC2x&EG25-G&EG9x&EM05 FILE AT Commands Manual
Our aim is to provide customers with timely and comprehensive service. For any
assistance, please contact our company headquarters:
GENERAL NOTES
QUECTEL OFFERS THE INFORMATION AS A SERVICE TO ITS CUSTOMERS. THE INFORMATION
PROVIDED IS BASED UPON CUSTOMERS’ REQUIREMENTS. QUECTEL MAKES EVERY EFFORT
TO ENSURE THE QUALITY OF THE INFORMATION IT MAKES AVAILABLE. QUECTEL DOES NOT
MAKE ANY WARRANTY AS TO THE INFORMATION CONTAINED HEREIN, AND DOES NOT ACCEPT
ANY LIABILITY FOR ANY INJURY, LOSS OR DAMAGE OF ANY KIND INCURRED BY USE OF OR
RELIANCE UPON THE INFORMATION. ALL INFORMATION SUPPLIED HEREIN IS SUBJECT TO
CHANGE WITHOUT PRIOR NOTICE.
COPYRIGHT
THE INFORMATION CONTAINED HERE IS PROPRIETARY TECHNICAL INFORMATION OF
QUECTEL WIRELESS SOLUTIONS CO., LTD. TRANSMITTING, REPRODUCTION, DISSEMINATION
AND EDITING OF THIS DOCUMENT AS WELL AS UTILIZATION OF THE CONTENT ARE
FORBIDDEN WITHOUT PERMISSION. OFFENDERS WILL BE HELD LIABLE FOR PAYMENT OF
DAMAGES. ALL RIGHTS ARE RESERVED IN THE EVENT OF A PATENT GRANT OR
REGISTRATION OF A UTILITY MODEL OR DESIGN.
Copyright © Quectel Wireless Solutions Co., Ltd. 2019. All rights reserved.
EC2x&EG25-G&EG9x&EM05_FILE_AT_Commands_Manual 1 / 26
LTE Standard Module Series
EC2x&EG25-G&EG9x&EM05 FILE AT Commands Manual
History
Revision Date Author Description
Wayne WEI/
1.0 2019-07-05 Asa WANG/ Initial
Mandy WANG
EC2x&EG25-G&EG9x&EM05_FILE_AT_Commands_Manual 2 / 26
LTE Standard Module Series
EC2x&EG25-G&EG9x&EM05 FILE AT Commands Manual
Contents
1 Introduction .......................................................................................................................................... 5
1.1. Applicable Modules ................................................................................................................. 5
1.2. The Process of Using File AT Commands .............................................................................. 6
1.3. Description of Data Mode ........................................................................................................ 6
3 Examples ............................................................................................................................................ 21
3.1. Upload and Download a File .............................................................................................. 21
3.1.1. Upload a File .................................................................................................................. 21
3.1.1.1. Non ACK Mode ..................................................................................................... 21
3.1.1.2. ACK Mode ............................................................................................................ 21
3.1.2. Download a File ............................................................................................................. 22
3.2. Write and Read a File .......................................................................................................... 22
3.2.1. Write and Read a UFS File ............................................................................................ 22
3.2.2. Write and Read a RAM File ........................................................................................... 22
5 Appendix A Reference....................................................................................................................... 26
EC2x&EG25-G&EG9x&EM05_FILE_AT_Commands_Manual 3 / 26
LTE Standard Module Series
EC2x&EG25-G&EG9x&EM05 FILE AT Commands Manual
Table Index
EC2x&EG25-G&EG9x&EM05_FILE_AT_Commands_Manual 4 / 26
LTE Standard Module Series
EC2x&EG25-G&EG9x&EM05 FILE AT Commands Manual
1 Introduction
Quectel EC2x&EG25-G&EG9x&EM05 modules provide AT commands to operate files on different
physical storage mediums. This document is a reference guide to these commands.
UFS: User File Storage directory. It is a special directory on the flash file system.
SD: SD card directory.
RAM: Random Access Memory. It is faster but much smaller than the UFS. And the files in RAM will
be lost when rebooting the module.
The file name will indicate the storage location. When the file name begins with “RAM:”, it means that the
file is stored in RAM. When the file name begins with “SD:”, it means that the file is stored in SD card. If
there are no prefix characters in the file name, then the file is stored in UFS.
NOTE
EC2x&EG25-G&EG9x&EM05_FILE_AT_Commands_Manual 5 / 26
LTE Standard Module Series
EC2x&EG25-G&EG9x&EM05 FILE AT Commands Manual
The following procedures can be followed to create, read and write a file in the storage:
1. A file can be uploaded to the storage by AT+QFUPL, and can be outputted/downloaded through the
serial interface by AT+QFDWL.
2. Open the file by AT+QFOPEN, and then the file can be written or read at any time and any location
until the file is closed by AT+QFCLOSE.
When the file is opened by AT+QFOPEN, it can be set as overwrite mode, read-only mode or
other modes by the parameter <mode>. (For more information about <mode>, please refer to
Chapter 2.6). After the file is opened, a parameter <filehandle> is assigned to it. Then the file
can be operated by <filehandle>.
After the file is opened, it can be written by AT+QFWRITE and can be read by AT+QFREAD
from the current file position.
The file position can be set by AT+QFSEEK and the current file position can be queried by
AT+QFPOSITION.
AT+QFTUCAT is used to truncate a file from the file pointer.
AT+QFCLOSE is used to close the file, after which the <filehandle> becomes meaningless any
more.
The COM port of EC2x/EG25-G/EG9x/EM05 module has two working modes: AT command mode and
data mode. In AT command mode, the inputted data via COM port will be treated as AT command. While
in data mode, it will be treated as data.
Inputting “+++” or pulling up DTR (AT&D1 should be set first) can make the COM port exit from data mode.
To prevent the “+++” from being misinterpreted as data, the following sequence should be followed:
EC2x&EG25-G&EG9x&EM05_FILE_AT_Commands_Manual 6 / 26
LTE Standard Module Series
EC2x&EG25-G&EG9x&EM05 FILE AT Commands Manual
When AT+QFUPL, AT+QFDWL, AT+QFREAD and AT+QFWRITE are executed, the COM port will enter
data mode. If customers are using “+++” or DTR to make the port exit from data mode, the executing
procedure of these commands will be interrupted before the response is returned. In such case, the COM
port cannot reenter data mode by executing ATO command.
EC2x&EG25-G&EG9x&EM05_FILE_AT_Commands_Manual 7 / 26
LTE Standard Module Series
EC2x&EG25-G&EG9x&EM05 FILE AT Commands Manual
OK
OK
Parameter
EC2x&EG25-G&EG9x&EM05_FILE_AT_Commands_Manual 8 / 26
LTE Standard Module Series
EC2x&EG25-G&EG9x&EM05 FILE AT Commands Manual
for details.
Example
AT+QFLDS="RAM" //Query the space information of RAM.
+QFLDS: 2616320,2621440
OK
AT+QFLDS="UFS" //Query the space information of UFS.
+QFLDS: 49180672,49205248
OK
AT+QFLDS="SD" //Query the space information of SD card.
+QFLDS: 251920384,253132800
OK
The command lists the information of a single file or all files in the specified storage.
OK
OK
EC2x&EG25-G&EG9x&EM05_FILE_AT_Commands_Manual 9 / 26
LTE Standard Module Series
EC2x&EG25-G&EG9x&EM05 FILE AT Commands Manual
Parameter
Example
AT+QFLST="*" //List all the file in UFS.
+QFLST: "UFS:F_M12-1.bmp",562554
+QFLST: "UFS:F_M12-10.bmp",562554
+QFLST: "UFS:F_M12-11.bmp",562554
OK
AT+QFLST="RAM:*" //List all the files in RAM.
+QFLST: "RAM:F_EM05-1.bmp",56554
+QFLST: "RAM:F_EM05-10.bmp",56554
+QFLST: "RAM:F_EM05-11.bmp",56554
OK
AT+QFLST="SD:*" //List all the files in SD card.
+QFLST: "SD:10b.txt",10
+QFLST: "SD:50K.txt",51209
+QFLST: "SD:94k.jpg",95811
OK
EC2x&EG25-G&EG9x&EM05_FILE_AT_Commands_Manual 10 / 26
LTE Standard Module Series
EC2x&EG25-G&EG9x&EM05 FILE AT Commands Manual
The command deletes a single file or all the files in the specified storage.
OK
Write Command Response
AT+QFDEL=<filename> OK
Parameter
<filename> Name of the file to be deleted. The max length is 80 bytes.
“*” Delete all the files in UFS (not delete the directory).
“<filename>” Delete the specified file <filename> in UFS.
“RAM:*” Delete all the files in RAM.
“RAM:<filename>” Delete the specified file <filename> in RAM.
“SD:*” Delete all the files in SD card (not delete the directory).
“SD:<filename>” Delete the specified file <filename> in SD card.
<err> The code of an error relating to ME or network. Please refer to Chapter 4
for details.
Example
AT+QFDEL="*"
OK
AT+QFLST="RAM:*"
OK
AT+QFLST="SD:*"
OK
The command uploads a file to storage. If there is any file in the storage which has the same name with
the file to be uploaded, an error will be reported.
EC2x&EG25-G&EG9x&EM05_FILE_AT_Commands_Manual 11 / 26
LTE Standard Module Series
EC2x&EG25-G&EG9x&EM05 FILE AT Commands Manual
After executing the Write Command and “CONNECT” returns, the module will switch to data mode. When
the uploaded data reaches <file_size>, or there is no any data inputted when <timeout> reaches, then it
will exit from data mode automatically. During data transmission, customers can use “+++” or DTR to
make the module exit from data mode, and more details are provided in Chapter 1.2.
OK
Write Command Response
AT+QFUPL=<filename>[,<file_size>[, CONNECT
<timeout>[,<ackmode>]]] TA switches to the data mode (transparent access mode), and
the binary data of file can be inputted. When the total size of
the inputted data reaches <file_size> (unit: byte), TA will
return to command mode and reply the following codes:
+QFUPL: <upload_size>,<checksum>
OK
Parameter
<freesize> The free space size of <name_pattern>. Please refer to AT+QFLDS command for
more details of <name_pattern>.
<filename> Name of the file to be uploaded. The maximum length is 80 bytes.
“<filename>” Name of the file to be uploaded to UFS.
“RAM:<filename>” Name of the file to be uploaded to RAM.
“SD:<filename>” Name of the file to be uploaded to SD card.
<file_size> The file size expected to be uploaded.
The default value is 10240. Unit: byte.
<upload_size> The actual size of the uploaded data. Unit: byte.
<timeout> The time waiting for data to be inputted to USB/UART. The default value is 5. Unit: s.
<ackmode> Whether to use ACK mode.
0 Turn off the ACK mode by default.
1 Turn on the ACK mode.
<checksum> The checksum of the uploaded data.
<err> The code of an error relating to ME or network. Please refer to Chapter 4
for details.
EC2x&EG25-G&EG9x&EM05_FILE_AT_Commands_Manual 12 / 26
LTE Standard Module Series
EC2x&EG25-G&EG9x&EM05 FILE AT Commands Manual
NOTES
1. It is strongly recommended to use DOS 8.3 file name format for <filename>.
2. <checksum> is a 16 bit checksum based on bitwise XOR.
If the number of the characters is odd, set the last character as the high 8 bit, and the low 8 bit as 0,
and then use an XOR operator to calculate the checksum. “+++” sequence will cause TA to end the
command and switch to command mode. However, the data previously uploaded will be preserved
into the file.
3. When executing the command, the data must be entered after “CONNECT” is returned.
4. The ACK mode is provided to avoid the loss of data when uploading large files, in case hardware flow
control does not work. The ACK mode works as follows:
1) Run AT+QFUPL=<filename>,<file_size>,<timeout>,1 to enable the ACK mode.
2) The module outputs “CONNECT”.
3) MCU sends 1K bytes data, and then module will respond with an “A”.
4) MCU receives this “A” and then sends the next 1K bytes data;
5) Repeat step 3) and 4) until the transfer is completed.
OK
Write Command Response
AT+QFDWL=<filename> CONNECTTA switches to data mode, and the binary data of
the file will be outputted. When the file is read over, TA will
return to command mode and reply the following codes:
+QFDWL: <download_size>,<checksum>
OK
Parameter
EC2x&EG25-G&EG9x&EM05_FILE_AT_Commands_Manual 13 / 26
LTE Standard Module Series
EC2x&EG25-G&EG9x&EM05 FILE AT Commands Manual
NOTES
1. “+++” sequence will cause TA to end the command and switch to command mode.
2. <checksum> is a 16 bit checksum based on bitwise XOR.
The command opens a file and gets the file handle to be used in commands such as AT+QFREAD,
AT+QFWRITE, AT+QFSEEK, AT+QFPOSITION, AT+QFTUCAT and AT+QFCLOSE.
OK
Read Command Response
AT+QFOPEN? +QFOPEN: <filename>,<filehandle>,<mode>
[+QFOPEN: <filename>,<filehandle>,<mode>
[…]]
OK
Write Command Response
AT+QFOPEN=<filename>[,<mode>] +QFOPEN: <filehandle>
OK
Parameter
EC2x&EG25-G&EG9x&EM05_FILE_AT_Commands_Manual 14 / 26
LTE Standard Module Series
EC2x&EG25-G&EG9x&EM05 FILE AT Commands Manual
The command reads the data of a file which is specified by the file handle. The data starts from the
current position of the file pointer which belongs to the file handle.
OK
Write Command Response
AT+QFREAD=<filehandle>[,<length>] CONNECT <read_length>
TA switches to data mode. When the total size of the data
reaches <length> (unit: byte), TA will return to command
mode, display the result and then reply the following codes:
OK
Parameter
EC2x&EG25-G&EG9x&EM05_FILE_AT_Commands_Manual 15 / 26
LTE Standard Module Series
EC2x&EG25-G&EG9x&EM05 FILE AT Commands Manual
The command writes data into a file. The data starts from the current position of the file pointer which
belongs to the file handle.
OK
Write Command Response
AT+QFWRITE=<filehandle>[,<length> CONNECT
[,<timeout>]] TA switches to data mode. When the total size of the written
data reaches <length> (unit: byte) or the time reaches
<timeout>, TA will return to command mode and reply the
following codes:
+QFWRITE: <written_length>,<total_length>
OK
Parameter
The command sets a file pointer to the specified position. This will decide the starting position of
commands such as AT+QFREAD, AT+QFWRITE, AT+QFPOSITION and AT+QFTUCAT.
EC2x&EG25-G&EG9x&EM05_FILE_AT_Commands_Manual 16 / 26
LTE Standard Module Series
EC2x&EG25-G&EG9x&EM05 FILE AT Commands Manual
OK
Write Command Response
AT+QFSEEK=<filehandle>,<offset>[,< OK
position>]
If there is an error related to ME functionality:
+CME ERROR: <err>
Parameter
NOTES
1. If <position> is 0 and <offset> exceeds the file size, the command will return “ERROR”.
2. If <position> is 1 and the total size of <offset> and the current position of the pointer exceed the file
size, the command will return “ERROR”.
3. If <position> is 2, the handle will move forth.
The command gets the offset of a file pointer from the beginning of the file.
OK
Write Command Response
AT+QFPOSITION=<filehandle> +QFPOSITION: <offset>
EC2x&EG25-G&EG9x&EM05_FILE_AT_Commands_Manual 17 / 26
LTE Standard Module Series
EC2x&EG25-G&EG9x&EM05 FILE AT Commands Manual
OK
Parameter
The command truncates all the file data behind the position that the file pointer indicates.
OK
Write Command Response
AT+QFTUCAT=<filehandle> OK
Parameter
The command closes a file and ends the operation to the file. After that, the file handle is released and
should not be used again, unless the file is opened again by AT+QFOPEN.
EC2x&EG25-G&EG9x&EM05_FILE_AT_Commands_Manual 18 / 26
LTE Standard Module Series
EC2x&EG25-G&EG9x&EM05 FILE AT Commands Manual
OK
Write Command Response
AT+QFCLOSE=<filehandle> OK
Parameter
The command moves a file from one storage to another. It only supports moving the file from UFS or SD
to RAM, not from RAM to UFS or SD.
OK
Write Command Response
AT+QFMOV=<srcfilename>,<destfilen OK
ame>,<copy>,<overwrite>
If there is an error related to ME functionality:
+CME ERROR: <err>
Parameter
EC2x&EG25-G&EG9x&EM05_FILE_AT_Commands_Manual 19 / 26
LTE Standard Module Series
EC2x&EG25-G&EG9x&EM05 FILE AT Commands Manual
NOTE
EC2x&EG25-G&EG9x&EM05_FILE_AT_Commands_Manual 20 / 26
LTE Standard Module Series
EC2x&EG25-G&EG9x&EM05 FILE AT Commands Manual
3 Examples
OK
AT+QFUPL="RAM:test1.txt",10 //Upload the text file RAM:test1.txt to RAM.
CONNECT
<Input file bin data>
+QFUPL: 10,6466 //Get the bytes and the checksum value of the uploaded data.
OK
The ACK mode can make the data transmission more reliable. When transmitting a large file without
hardware flow control, the ACK mode is recommended to be used to prevent the data from being lost. For
more details about ACK mode, please refer to AT+QFUPL command.
EC2x&EG25-G&EG9x&EM05_FILE_AT_Commands_Manual 21 / 26
LTE Standard Module Series
EC2x&EG25-G&EG9x&EM05 FILE AT Commands Manual
OK
OK
OK
AT+QFWRITE=0,10 //Write 10 bytes to the file.
CONNECT
<Write Data>
+QFWRITE: 10,10 //The actual bytes written and the size of the file are returned.
OK
AT+QFSEEK=0,0,0 //Set the file pointer to the beginning of the file.
OK
AT+QFREAD=0,10 //Read 10 bytes from the file.
CONNECT 10
<Read Data>
OK
AT+QFCLOSE=0 //Close the file.
OK
OK
EC2x&EG25-G&EG9x&EM05_FILE_AT_Commands_Manual 22 / 26
LTE Standard Module Series
EC2x&EG25-G&EG9x&EM05 FILE AT Commands Manual
OK
AT+QFWRITE=3000,10 //Write 10 bytes to the file.
CONNECT
<Write Data>
+QFWRITE: 10,10 //The actual written bytes and the size of the file are returned.
OK
AT+QFSEEK=3000,0,0 //Set the file pointer to the beginning of the file.
OK
AT+QFREAD=3000,10 //Read the data.
CONNECT
<Read Data>
OK
AT+QFCLOSE=3000 //Close the file.
OK
EC2x&EG25-G&EG9x&EM05_FILE_AT_Commands_Manual 23 / 26
LTE Standard Module Series
EC2x&EG25-G&EG9x&EM05 FILE AT Commands Manual
<err> Meaning
EC2x&EG25-G&EG9x&EM05_FILE_AT_Commands_Manual 24 / 26
LTE Standard Module Series
EC2x&EG25-G&EG9x&EM05 FILE AT Commands Manual
420 No space
EC2x&EG25-G&EG9x&EM05_FILE_AT_Commands_Manual 25 / 26
LTE Standard Module Series
EC2x&EG25-G&EG9x&EM05 FILE AT Commands Manual
5 Appendix A Reference
Abbreviation Description
ACK Acknowledgement
ME Mobile Equipment
SD Secure Digital
TA Terminal Adapter
XOR Exclusive OR
EC2x&EG25-G&EG9x&EM05_FILE_AT_Commands_Manual 26 / 26