Quectel EC2x&EG9x&EM05 FTP (S) AT Commands Manual V1.0
Quectel EC2x&EG9x&EM05 FTP (S) AT Commands Manual V1.0
Quectel EC2x&EG9x&EM05 FTP (S) AT Commands Manual V1.0
AT Commands Manual
Rev. EC2x&EG9x&EM05_FTP(S)_AT_Commands_Manual_V1.0
Date: 2017-11-22
Status: Released
www.quectel.com
LTE Module Series
EC2x&EG9x&EM05 FTP(S) 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. 2017. All rights reserved.
EC2x&EG9x&EM05_FTP(S)_AT_Commands_Manual 1 / 48
LTE Module Series
EC2x&EG9x&EM05 FTP(S) AT Commands Manual
History
Revision Date Author Description
Duke XIN/
1.0 2017-11-22 Initial
Mayra XU
EC2x&EG9x&EM05_FTP(S)_AT_Commands_Manual 2 / 48
LTE Module Series
EC2x&EG9x&EM05 FTP(S) AT Commands Manual
Contents
1 Introduction .......................................................................................................................................... 6
1.1. The Process of Using FTP AT Commands ............................................................................. 6
1.2. Description of Data Mode ........................................................................................................ 8
3 Examples ............................................................................................................................................ 32
3.1. Login to FTP Server .............................................................................................................. 32
3.2. Login to FTPS Server ............................................................................................................ 33
3.3. Folder Operation.................................................................................................................... 34
3.4. File Operation ........................................................................................................................ 34
3.5. List File Information or File Names ....................................................................................... 35
3.6. Upload a File to FTP(S) Server ............................................................................................. 36
3.7. Download a File from FTP(S) Server .................................................................................... 39
3.8. Log out from FTP(S) Server .................................................................................................. 41
EC2x&EG9x&EM05_FTP(S)_AT_Commands_Manual 3 / 48
LTE Module Series
EC2x&EG9x&EM05 FTP(S) AT Commands Manual
EC2x&EG9x&EM05_FTP(S)_AT_Commands_Manual 4 / 48
LTE Module Series
EC2x&EG9x&EM05 FTP(S) AT Commands Manual
Table Index
EC2x&EG9x&EM05_FTP(S)_AT_Commands_Manual 5 / 48
LTE Module Series
EC2x&EG9x&EM05 FTP(S) AT Commands Manual
1 Introduction
EC2x&EG9x&EM05 modules provide FTP(S) application to FTP(S) server. This document is a reference
guide to all the AT commands defined for FTP(S).
As EC2x&EG9x&EM05 modules support FTP(S) protocol, file and directory on FTP(S) server can be
operated via FTP(S) AT commands. The general process is as follows:
EC2x&EG9x&EM05_FTP(S)_AT_Commands_Manual 6 / 48
LTE Module Series
EC2x&EG9x&EM05 FTP(S) AT Commands Manual
a) Execute AT+QFTPCFG="ssltype",1.
b) Execute AT+QFTPCFG="sslctxid",<sslctxid> to select a <sslctxid>.
c) Execute AT+QSSLCFG to configure the selected <sslctxid>. For more details, please refer
to Quectel_EC2x&EG9x&EM05_SSL_AT_Commands_Manual.
EC2x&EG9x&EM05_FTP(S)_AT_Commands_Manual 7 / 48
LTE Module Series
EC2x&EG9x&EM05 FTP(S) AT Commands Manual
The COM port of EC2x&EG9x&EM05 modules 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 module exit from data mode.
To prevent the “+++” from being misinterpreted as data, the following sequence should be followed:
When AT+QFTPPUT, AT+QFTPGET, AT+QFTPLIST and AT+QFTPNLST are executed, if the local file
path is “COM:”, which means data will be received from or outputted to COM port, the COM port will enter
into data mode. Customers can exit from data mode by inputting “+++” or changing DTR level from low to
high. In addition, customers can reenter data mode by executing ATO command after AT+QFTPGET,
AT+QFTPLIST and AT+QFTPNLST are executed. And customers cannot reenter data mode via ATO
when after AT+QFTPPUT is executed.
EC2x&EG9x&EM05_FTP(S)_AT_Commands_Manual 8 / 48
LTE Module Series
EC2x&EG9x&EM05 FTP(S) AT Commands Manual
The command is used to configure FTP(S) server, user account, file type, transfer mode and context ID. If
the Write Command only executes one parameter, it will query the current settings.
OK
Write Command Response
AT+QFTPCFG="account"[,<usernam If <username> and <password> are not omitted:
e>,<password>] OK
Or
+CME ERROR: <err>
OK
Write Command Response
AT+QFTPCFG="filetype"[,<file_type>] If <file_type> is not omitted:
OK
Or
+CME ERROR: <err>
EC2x&EG9x&EM05_FTP(S)_AT_Commands_Manual 9 / 48
LTE Module Series
EC2x&EG9x&EM05 FTP(S) AT Commands Manual
OK
Write Command Response
AT+QFTPCFG="transmode"[,<transm If <transmode> is not omitted:
ode>] OK
Or
+CME ERROR: <err>
OK
Write Command Response
AT+QFTPCFG="contextid"[,<contextI If <contextID> is not omitted:
D>] OK
Or
+CME ERROR: <err>
OK
Write Command Response
AT+QFTPCFG="rsptimeout"[,<timeou If <timeout> is not omitted:
t>] OK
Or
+CME ERROR: <err>
OK
Write Command Response
AT+QFTPCFG="ssltype"[,<ssltype>] If <ssltype> is not omitted:
OK
Or
+CME ERROR: <err>
OK
EC2x&EG9x&EM05_FTP(S)_AT_Commands_Manual 10 / 48
LTE Module Series
EC2x&EG9x&EM05 FTP(S) AT Commands Manual
OK
Write Command Response
AT+QFTPCFG="data_address"[,<data If <data_address> is not omitted:
_address>] OK
Or
+CME ERROR: <err>
OK
Parameter
<username> String type. The user name for authentication. The maximum size of the parameter is
255 bytes.
<password> String type. The password for authentication. The maximum size of the parameter is
255 bytes.
<contextID> Integer type. The PDP context ID. The range is 1-16, and the default value is 1. It
should be activated by AT+QIACT before using QFTPOPEN. For more details,
please refer to Quectel_EC2x&EG9x&EM05_TCP(IP)_AT_Commands_Manual.
<file_type> Integer type. The type of transferred data.
0 Binary
1 ASCII
<transmode> Integer type. Whether the FTP(S) server or client listens on a port for data connection.
0 Active mode, the module will listen on a port for data connection
1 Passive mode, FTP(S) server will listen on a port for data connection
<timeout> Integer type. The range is 20-180, and the default value is 90. Unit: second.
Generally, it is the timeout value for most +QFTPXXX: xx,xx commands after the “OK”
result code is returned, except AT+QFTPPUT/QFTPGET/QFTPLST/QFTPNLST
commands. The rules for these four commands are shown as below:
a) When the command has been sent, but “CONNECT” has not been outputted yet,
this parameter indicates the maximum interval time for “CONNECT” to be
outputted after the command has been sent.
b) When the module has entered into data mode, this parameter indicates the
EC2x&EG9x&EM05_FTP(S)_AT_Commands_Manual 11 / 48
LTE Module Series
EC2x&EG9x&EM05 FTP(S) AT Commands Manual
NOTE
During FTPS operation, <transmode> must be set into 1 because FTPS does not support active mode
currently.
The command is used to login to FTP(S) server. The PDP context should be activated by AT+QIACT first.
“+QFTPOPEN: <err>,<protocol_error>” indicates the operation result of AT+QFTPOPEN and it should be
outputted within <timeout> configured by AT+QFTPCFG.
OK
Write Command Response
AT+QFTPOPEN=<hostname>[,<port> OK
]
+QFTPOPEN: <err>,<protocol_error>
Or
+CME ERROR: <err>
Parameter
<hostname> String type. The IP address or domain name of the FTP(S) server. The maximum
EC2x&EG9x&EM05_FTP(S)_AT_Commands_Manual 12 / 48
LTE Module Series
EC2x&EG9x&EM05 FTP(S) AT Commands Manual
Example
AT+QFTPOPEN="101.95.183.122",21 //Login to FTP server.
OK
+QFTPOPEN: 0,0
AT+QFTPOPEN="quectel.3322.org",990 //Login to FTPS server.
OK
+QFTPOPEN: 0,0
NOTE
Please note that the ports of FTPS and FTP server are different. The port of FTPS server depends on
FTPS server provider, and it is 990 usually.
The command is used to configure the current directory on FTP(S) server. If “OK” is returned,
“+QFTPCWD: <err>,<protocol_error>” should be outputted within <timeout> configured by AT+QFTPCFG.
All the files and directory operation will be configured in the current directory.
OK
Write Command Response
AT+QFTPCWD=<path_name> OK
+QFTPCWD: <err>,<protocol_error>
Or
+CME ERROR: <err>
EC2x&EG9x&EM05_FTP(S)_AT_Commands_Manual 13 / 48
LTE Module Series
EC2x&EG9x&EM05 FTP(S) AT Commands Manual
Parameter
<path_name> String type. A directory path on FTP(S) server. The maximum size of the
parameter is 255 bytes. The root path of FTP(S) server is “/”.
<err> Integer type. The error code of the operation. Please refer to Chapter 5.
<protocol_error> Integer type. For reference only. Indicates the original error code from FTP(S)
server which is defined in FTP(S) protocol. For more details, please refer to
Chapter 6. If it is 0, it is invalid.
The command is used to get the current directory on FTP(S) server. If “OK” is returned, “+QFTPPWD:
0,<path_name>” or “+QFTPPWD: <err>,<protocol_error>” should be outputted within <timeout>
configured by AT+QFTPCFG.
Parameter
<path_name> String type. A directory path on FTP(S) server. The maximum size of the
parameter is 255 bytes. The root path of FTP(S) server is “/”.
<err> Integer type. The error code of the operation. Please refer to Chapter 5.
<protocol_error> Integer type. For reference only. Indicates the original error code from FTP(S)
server which is defined in FTP(S) protocol. For more details, please refer to
Chapter 6. If it is 0, it is invalid.
EC2x&EG9x&EM05_FTP(S)_AT_Commands_Manual 14 / 48
LTE Module Series
EC2x&EG9x&EM05 FTP(S) AT Commands Manual
The command is used to upload a file to FTP(S) server. The file data can be uploaded via COM port, and
then the module will enter into data mode. Inputting “+++” can abort the file uploading. A local file can be
uploaded to FTP(S) server and the file can be RAM, UFS or SD files. A file can be uploaded to RAM, UFS
or SD by AT+QFUPL, and then uploaded to FTP(S) server via AT+QFTPPUT command. After a file is
uploaded successfully, the file can be deleted by AT+QFDEL. For more details, please refer to
Quetel_EC2x&EG9x&EM05_FILE_AT_Commands_Manual.
A file can be uploaded from specified file position by <startpos> parameter. If the <local_name> is “COM:”,
“CONNECT” should be outputted within <timeout> configured by AT+QFTPCFG. If the <local_name> is
not “COM:”, “OK” will be outputted first, and then “+QFTPPUT: 0,<transferlen>” will be outputted after
data has been transferred completely.
If the module has entered into data mode or the <local_name> is not “COM:”, the <timeout> configured by
AT+QFTPCFG indicates the maximum interval time between two packets of received/transmitted data.
OK
Write Command Response
AT+QFTPPUT=<file_name>,"COM:" CONNECT
[,<startpos>[,<uploadlen>,<beof>]] <Input file data>
OK
EC2x&EG9x&EM05_FTP(S)_AT_Commands_Manual 15 / 48
LTE Module Series
EC2x&EG9x&EM05 FTP(S) AT Commands Manual
Or
+CME ERROR: <err>
Parameter
<file_name> String type. The file name on FTP(S) server. The maximum size of the parameter
is 255 bytes.
<local_name> String type. The local file name. The maximum size of the parameter is 60 bytes. If
it is “COM:”, the data will be inputted via COM port. If it is not “COM:”, the data will
be saved to RAM, UFS or SD. After being uploaded successfully, the file
should be deleted by AT+QFDEL. For details, please refer to
Quetel_EC2x&EG9x&EM05_FILE_AT_Commands_Manual.
<startpos> Integer type. The start position of the file to be uploaded. The default value is 0. If
<uploadlen> and <beof> are specified, <startpos> should be the position where
the data continues to be uploaded to the same file.
<uploadlen> Integer type. The length of data to be uploaded. It is valid only if <local_name> is
“COM:”. When the length of data uploaded via COM port reaches <uploadlen>,
the module will exit from data mode. Unit: byte.
<beof> Integer type. Whether it is the last packet of data to be uploaded.
0 Not the last packet of data. When the data length reaches <uploadlen>, the
module will exit from data mode, and “+QFTPPUT: 0,<transferlen>” will be
outputted. In such case, please do not disconnect data connection, as the
remained data needs to be uploaded to the same file on FTP.
1 The last packet of data. When the data length reaches <uploadlen>, the
module will exit from data mode and data connection can be disconnected,
then “+QFTPPUT: 0,<transferlen>” will be outputted.
<transferlen> Integer type. The length of successfully transferred data. Unit: byte.
<err> Integer type. The error code of the operation. Please refer to Chapter 5.
<protocol_error> Integer type. For reference only. Indicates the original error code from FTP(S)
server which is defined in FTP(S) protocol. For more details, please refer to
Chapter 6. If it is 0, it is invalid.
Example
//Upload a file via COM port to FTP(S) server.
+QFTPPUT: 0,1000
//Upload a file via COM port to FTP(S) server twice in 1024 bytes each time.
EC2x&EG9x&EM05_FTP(S)_AT_Commands_Manual 16 / 48
LTE Module Series
EC2x&EG9x&EM05 FTP(S) AT Commands Manual
+QFTPPUT: 0,1024
AT+QFTPPUT="test.txt","COM:",1024,1024,1 //It is the last 1024 bytes of “test.txt”.
CONNECT
<Input file data>
OK //Data length reaches 1024 bytes.
+QFTPPUT: 0,1024
OK
AT+QFLST="RAM:*"
+QFLST: "RAM:test1.txt",1000
OK
AT+QFTPPUT="test.txt","RAM:test1.txt",0 //Upload “RAM:test1.txt” to FTP(S) server, the file will be
saved as “test.txt” on FTP(S) server.
OK
+QFTPPUT: 0,1000
AT+QFDEL="RAM:test1.txt"
OK
The command is used to download a file from FTP(S) server. The file can be outputted via COM port by
AT+QFTPGET="filename","COM:". The module will enter into data mode on receiving data from server.
After the data is transferred completely, the module will exit from data mode automatically and output
“QFTPGET: 0,<transferlen>”. The file can be saved to RAM, UFS or SD by
EC2x&EG9x&EM05_FTP(S)_AT_Commands_Manual 17 / 48
LTE Module Series
EC2x&EG9x&EM05 FTP(S) AT Commands Manual
AT+QFTPGET="filename","RAM:localname", AT+QFTPGET="filename","UFS:localname" or
AT+QFTPGET="filename","SD:localname". After the file has been transferred completely, the module will
output “+QFTPGET: 0,<transferlen>”.
If the module has entered into data mode or the <local_name> is not “COM:”, the <timeout> configured by
AT+QFTPCFG indicates the maximum interval time between two packets of received/transmitted data.
OK
Write Command Response
AT+QFTPGET=<file_name>,"COM:"[, CONNECT
<startpos>[,<downloadlen>]] <Output file data>
OK
Parameter
<file_name> String type. The file name on FTP(S) server. The maximum size of the parameter is
EC2x&EG9x&EM05_FTP(S)_AT_Commands_Manual 18 / 48
LTE Module Series
EC2x&EG9x&EM05 FTP(S) AT Commands Manual
255 bytes.
<local_name> String type. The local file name. The maximum size of the parameter is 60 bytes. If it
is “COM:”, the file data will be outputted via COM port. If it is not “COM:”, the data
will be saved to RAM, UFS or SD. It is strongly recommended to save the file in RAM,
UFS or SD. Then the file can be read by AT+QFREAD. For more details, please refer
to Quetel_EC2x&EG9x&EM05_FILE_AT_Commands_Manual.
<startpos> Integer type. The start position of the file to be downloaded. The default value is 0.
<downloadlen> Integer type, the length of data to be downloaded. It is valid only if <local_name> is
“COM:”. If this parameter is specified, the module will output <downloadlen> bytes to
COM port and exit from data mode. And data can be downloaded from <startpos> by
the same AT command if there is any data left. Unit: byte.
<transferlen> Integer type. The length of actually transferred data. If it is less than <downloadlen>,
it means the whole file is transferred completely. Unit: byte.
<err> Integer type. The error code of the operation. Please refer to Chapter 5.
<protocol_error> Integer type. For reference only. Indicates the original error code from FTP(S) server
which is defined in FTP(S) protocol. For more details, please refer to Chapter 6. If it
is 0, it is invalid.
Example
//Download a file and the file is outputted via COM port.
AT+QFTPGET="test.txt","COM:",0
CONNECT
<Output file data>
OK
+QFTPGET: 0,1000
//Download a file and the file is outputted via COM port twice in 500 bytes each time.
AT+QFTPGET="test.txt","COM:",0,500 //The size of “test.txt” is 1000 bytes, download the first 500
bytes.
CONNECT
<Output file data>
OK
+QFTPGET: 0,500
AT+QFTPGET="test.txt","COM:",500,500 //Download the left 500 bytes.
CONNECT
<Output file data>
OK
+QFTPGET: 0,500
EC2x&EG9x&EM05_FTP(S)_AT_Commands_Manual 19 / 48
LTE Module Series
EC2x&EG9x&EM05 FTP(S) AT Commands Manual
AT+QFTPGET="test.txt","RAM:test2.txt",0
OK
+QFTPGET: 0,1000
AT+QFLST="RAM:*"
+QFLST: "RAM:test2.txt",1000
OK
The command is used to get the file size on FTP(S) server. If “OK” is returned, “+QFTPSIZE:
0,<file_size>” or “+QFTPSIZE: <err>,<protocol_error>” should be outputted within <timeout> configured
by AT+QFTPCFG. Otherwise, the FTP(S) connection should be disconnected, and the network should be
deactivated and reactivated.
OK
Write Command Response
AT+QFTPSIZE=<file_name> OK
Parameter
<file_name> String type. The file name on FTP(S) server. The maximum size of the
parameter is 255 bytes.
<file_size> Integer type. The size of file on FTP(S) server. Unit: byte.
<err> Integer type. The error code of the operation. Please refer to Chapter 5.
<protocol_error> Integer type. For reference only. Indicates the original error code from FTP(S)
server which is defined in FTP(S) protocol. For more details, please refer to
Chapter 6. If it is 0, it is invalid.
EC2x&EG9x&EM05_FTP(S)_AT_Commands_Manual 20 / 48
LTE Module Series
EC2x&EG9x&EM05 FTP(S) AT Commands Manual
The command is used to delete a specified file on FTP(S) server. If “OK” is returned, “+QFTPDEL:
<err>,<protocol_error>” should be outputted within <timeout> configured by AT+QFTPCFG. Otherwise,
the FTP(S) connection should be disconnected, and the network should be deactivated and reactivated.
OK
Write Command Response
AT+QFTPDEL=<file_name> OK
+QFTPDEL: <err>,<protocol_error>
Or
+CME ERROR: <err>
Parameter
<file_name> String type. The file name on FTP(S) server. The maximum size of the parameter
is 255 bytes.
<err> Integer type. The error code of the operation. Please refer to Chapter 5.
<protocol_error> Integer type. For reference only. Indicates the original error code from FTP(S)
server which is defined in FTP(S) protocol. For more details, please refer to
Chapter 6. If it is 0, it is invalid.
The command is used to create a folder on FTP(S) server. If “OK” is returned, “+QFTPMKDIR:
<err>,<protocol_error>” should be outputted within <timeout> configured by AT+QFTPCFG. Otherwise,
the FTP(S) connection should be disconnected, and the network should be deactivated and reactivated.
OK
Write Command Response
AT+QFTPMKDIR=<folder_name> OK
EC2x&EG9x&EM05_FTP(S)_AT_Commands_Manual 21 / 48
LTE Module Series
EC2x&EG9x&EM05 FTP(S) AT Commands Manual
+QFTPMKDIR: <err>,<protocol_error>
Or
+CME ERROR: <err>
Parameter
<folder_name> String type. The folder name on FTP(S) server. The maximum size of the
parameter is 255 bytes.
<err> Integer type. The error code of the operation. Please refer to Chapter 5.
<protocol_error> Integer type. For reference only. Indicates the original error code from FTP(S)
server which is defined in FTP(S) protocol. For more details, please refer to
Chapter 6. If it is 0, it is invalid.
The command is used to delete a specified folder on FTP(S) server. If “OK” is returned, “+QFTPRMDIR:
<err>,<protocol_error>” should be outputted within <timeout> configured by AT+QFTPCFG. Otherwise,
the FTP(S) connection should be disconnected and the network should be deactivated and reactivated.
OK
Write Command Response
AT+QFTPRMDIR=<folder_name> OK
+QFTPRMDIR: <err>,<protocol_error>
Or
+CME ERROR: <err>
Parameter
<folder_name> String type .The folder name on FTP(S) server. The maximum size of the
parameter is 255 bytes.
<err> Integer type. The error code of the operation. Please refer to Chapter 5.
<protocol_error> Integer type. For reference only. Indicates the original error code from FTP(S)
server which is defined in FTP(S) protocol. For more details, please refer to
Chapter 6. If it is 0, it is invalid.
EC2x&EG9x&EM05_FTP(S)_AT_Commands_Manual 22 / 48
LTE Module Series
EC2x&EG9x&EM05 FTP(S) AT Commands Manual
The command is used to list content of a directory on FTP(S) server. If the <local_name> is “COM:”,
“CONNECT” should be outputted within <timeout> configured by AT+QFTPCFG. If the <local_name> is
not “COM:”, “OK” will be returned first. And then “+QFTPLIST: 0,<transfer_size>” will be outputted after
the content has been transferred completely.
If the module has entered into data mode or the <local_name> is not “COM:”, the <timeout> configured by
AT+QFTPCFG indicates the maximum interval time between two packets of received/transmitted data.
OK
Write Command Response
AT+QFTPLIST=<dirname>[,"COM:"] CONNECT
<Output content data>
OK
Parameter
<dirname> String type. The folder name on FTP(S) server. The maximum size of the
parameter is 255 bytes. If it is “.”, it will list the content of current directory
EC2x&EG9x&EM05_FTP(S)_AT_Commands_Manual 23 / 48
LTE Module Series
EC2x&EG9x&EM05 FTP(S) AT Commands Manual
configured by AT+QFTPCWD.
<local_name> String type. The local storage location of the data from FTP(S) server. The
maximum size of the parameter is 60 bytes. The default value is “COM:”. If it is
“COM:”, the data will be outputted to COM port. If it is not “COM:”, the data will be
saved to RAM, UFS or SD. Then the file can be read via AT+QFREAD. For more
details, please refer to Quetel_EC2x&EG9x&EM05_FILE_AT_Commands_
Manual.
<transfer_size> Integer type. The size of transferred data from FTP(S) server. Unit: byte.
<err> Integer type. The error code of the operation. Please refer to Chapter 5.
<protocol_error> Integer type. For reference only. Indicates the original error code from FTP(S)
server which is defined in FTP(S) protocol. For more details, please refer to
Chapter 6. If it is 0, it is invalid.
Example
//Get the content of current directory on FTP(S) server and the data is outputted via COM port.
AT+QFTPLIST="."
CONNECT
<Output content data>
OK
+QFTPLIST: 0,1000
//Get the content of a specified directory on FTP(S) server and save it to RAM.
AT+QFTPLIST="TESTDIR","RAM:test2.txt"
OK
+QFTPLIST: 0,1000
AT+QFLST="RAM:*"
+QFLST: "RAM:test2.txt",1000
OK
The command is used to list file names of a directory on FTP(S) server. If the <local_name> is “COM:”,
“CONNECT” should be outputted within <timeout> configured by AT+QFTPCFG. If the <local_name> is
not “COM:”, “OK” will be returned first. And then “+QFTPNLST: 0,<transfer_size>” will be outputted after
file names have been transferred completely.
EC2x&EG9x&EM05_FTP(S)_AT_Commands_Manual 24 / 48
LTE Module Series
EC2x&EG9x&EM05 FTP(S) AT Commands Manual
If the module has entered into data mode or the <local_name> is not “COM:”, the <timeout> configured by
AT+QFTPCFG indicates the maximum interval time between two packets of received/transmitted data.
OK
Write Command Response
AT+QFTPNLST=<dirname>[,"COM:"] CONNECT
<Output content data>
OK
Parameter
<dirname> String type. The folder name on FTP(S) server. The maximum size of the
parameter is 255 bytes. If it is “.”, it will list the file names of current directory
configured by AT+QFTPCWD.
<local_name> String type. The local storage location of the data from FTP(S) server. The
maximum size of the parameter is 60 bytes. The default value is “COM:”. If it is
“COM:”, the data will be outputted to COM port. If it is not “COM:”, the data will be
saved to RAM, UFS or SD. Then the file can be read via AT+QFREAD. For more
details, please refer to Quetel_EC2x&EG9x&EM05_FILE_AT_Commands_
Manual.
<transfer_size> Integer type. The size of transferred data from FTP(S) server. Unit: byte.
<err> Integer type. The error code of the operation. Please refer to Chapter 5.
EC2x&EG9x&EM05_FTP(S)_AT_Commands_Manual 25 / 48
LTE Module Series
EC2x&EG9x&EM05 FTP(S) AT Commands Manual
<protocol_error> Integer type. For reference only. Indicates the original error code from FTP(S)
server which is defined in FTP(S) protocol. For more details, please refer to
Chapter 6. If it is 0, it is invalid.
Example
//Get the file name of current directory on FTP(S) server and the data is outputted via COM port.
AT+QFTPNLST="."
CONNECT
<Output content data>
OK
+QFTPNLST: 0,1000
//Get the file name of a specified directory on FTP(S) server and save it to RAM.
AT+QFTPNLST="TESTDIR","RAM:test2.txt"
OK
+QFTPNLST: 0,1000
AT+QFLST="RAM:*"
+QFLST: "RAM:test2.txt",1000
OK
The command is used to list standardized file and directory information on FTP(S) server. If the
<local_name> is “COM:”, “CONNECT” should be outputted within <timeout> configured by AT+QFTPCFG.
If the <local_name> is not “COM:”, “OK” will be returned first. And then “+QFTPMLSD: 0,<transfer_size>”
will be outputted after the content has been transferred completely.
If the module has entered into data mode or the <local_name> is not “COM:”, the <timeout> configured by
AT+QFTPCFG indicates the maximum interval time between two packets of received/transmitted data.
OK
Write Command Response
AT+QFTPMLSD=<dirname>[,"COM:"] CONNECT
EC2x&EG9x&EM05_FTP(S)_AT_Commands_Manual 26 / 48
LTE Module Series
EC2x&EG9x&EM05 FTP(S) AT Commands Manual
Parameter
<dirname> String type. The folder name on FTP(S) server. The maximum size of the
parameter is 255 bytes. If it is “.”, it will list standardized file and directory
information configured by AT+QFTPCWD.
<local_name> String type. The local storage location of the data from FTP(S) server. The
maximum size of the parameter is 60 bytes. The default value is “COM:”. If it is
“COM:”, the data will be outputted to COM port. If it is not “COM:”, the data will be
saved to RAM, UFS or SD. Then the file can be read via AT+QFREAD. For more
details, please refer to Quetel_EC2x&EG9x&EM05_FILE_AT_Commands_
Manual.
<transfer_size> Integer type. The size of transferred data from FTP(S) server. Unit: byte.
<err> Integer type. The error code of the operation. Please refer to Chapter 5.
<protocol_error> Integer type. For reference only. Indicates the original error code from FTP(S)
server which is defined in FTP(S) protocol. For more details, please refer to
Chapter 6. If it is 0, it is invalid.
Example
//Get standardized file and directory information on FTP(S) server and the data is outputted via COM port.
AT+QFTPMLSD="."
CONNECT
EC2x&EG9x&EM05_FTP(S)_AT_Commands_Manual 27 / 48
LTE Module Series
EC2x&EG9x&EM05 FTP(S) AT Commands Manual
+QFTPMLSD: 0,1000
//Get standardized file and directory information on FTP(S) server and save them to RAM.
AT+QFTPMLSD="TESTDIR","RAM:test2.txt"
OK
+QFTPMLSD: 0,1000
AT+QFLST="RAM:*"
+QFLST: "RAM:test2.txt",1000
OK
The command is used to get the file modification time on FTP(S) server. If “OK” is returned,
“+QFTPMDTM: 0,<modify_time>” or “+QFTPMDTM: <err>,<protocol_error>” should be outputted within
<timeout> configured by AT+QFTPCFG. Otherwise, the FTP(S) connection should be disconnected, and
the network should be deactivated and reactivated.
OK
Write Command Response
AT+QFTPMDTM=<file_name> OK
Parameter
<file_name> String type. The file name on FTP(S) server. The maximum size of the parameter
EC2x&EG9x&EM05_FTP(S)_AT_Commands_Manual 28 / 48
LTE Module Series
EC2x&EG9x&EM05 FTP(S) AT Commands Manual
is 255 bytes.
<modify_time> String type. The file modification time on FTP(S) server. The format is
“YYYYMMDDHHMMSS” or “YYYYMMDDHHMMSS.NNN”.
<err> Integer type. The error code of the operation. Please refer to Chapter 5.
<protocol_error> Integer type. For reference only. Indicates the original error code from FTP(S)
server which is defined in FTP(S) protocol. For more details, please refer to
Chapter 6. If it is 0, it is invalid.
The command is used to rename a file or folder on FTP(S) server. If “OK” is returned, “+QFTPRENAME:
<err>,<protocol_error>” should be outputted within <timeout> configured by AT+QFTPCFG. Otherwise,
the FTP(S) connection should be disconnected, and the network should be deactivated and reactivated.
OK
Write Command Response
AT+QFTPRENAME=<old_name>,<ne OK
w_name>
+QFTPRENAME: <err>,<protocol_error>
Or
+CME ERROR: <err>
Parameter
<old_name> String type. The old file name or folder name on FTP(S) server. The maximum size of
the parameter is 255 bytes.
<new_name> String type. The new file name or folder name on FTP(S) server. The maximum size
of the parameter is 255 bytes.
<err> Integer type. The error code of the operation. Please refer to Chapter 5.
<protocol_error> Integer type. For reference only. Indicates the original error code from FTP(S) server
which is defined in FTP(S) protocol. For more details, please refer to Chapter 6. If it
is 0, it is invalid.
EC2x&EG9x&EM05_FTP(S)_AT_Commands_Manual 29 / 48
LTE Module Series
EC2x&EG9x&EM05 FTP(S) AT Commands Manual
The command is used to get the length of transferred data on FTP(S) server.
+QFTPLEN: 0,<transferlen>
Or
+CME ERROR: <err>
Parameter
<transferlen> Integer type. The length of transferred data on FTP(S) server. When executing
AT+QFTPPUT, AT+QFTPGET, AT+QFTPNLST or AT+QFTPLIST command, the
length of transferred data can be queried by AT+QFTPLEN. Unit: byte.
<err> Integer type. The error code of the operation. Please refer to Chapter 5.
+QFTPSTAT: 0,<ftpstat>
Or
+CME ERROR: <err>
Parameter
EC2x&EG9x&EM05_FTP(S)_AT_Commands_Manual 30 / 48
LTE Module Series
EC2x&EG9x&EM05 FTP(S) AT Commands Manual
The command is used to log out from FTP(S) server. If “OK” is returned, “+QFTPCLOSE:
<err>,<protocol_error>” should be outputted within <timeout> configured by AT+QFTPCFG. Otherwise,
the network should be deactivated and reactivated.
+QFTPCLOSE: <err>,<protocol_error>
Or
+CME ERROR: <err>
Parameter
<err> Integer type. The error code of the operation. Please refer to Chapter 5.
<protocol_error> Integer type. For reference only. Indicates the original error code from FTP(S)
server which is defined in FTP(S) protocol. For more details, please refer to
Chapter 6. If it is 0, it is invalid.
EC2x&EG9x&EM05_FTP(S)_AT_Commands_Manual 31 / 48
LTE Module Series
EC2x&EG9x&EM05 FTP(S) AT Commands Manual
3 Examples
OK
AT+QFTPCFG="contextid",1 //Configure the PDP context ID as 1. The PDP context
ID must be activated first.
OK
AT+QFTPOPEN="quectel.3322.org",21
OK
+QFTPOPEN: 0,0
EC2x&EG9x&EM05_FTP(S)_AT_Commands_Manual 32 / 48
LTE Module Series
EC2x&EG9x&EM05 FTP(S) AT Commands Manual
OK
AT+QIACT=1 //Activate PDP context 1.
OK //Activated successfully.
AT+QIACT? //Query the state of PDP context.
+QIACT: 1,1,1,"10.7.157.1"
OK
AT+QFTPCFG="contextid",1 //Configure the PDP context ID as 1. The PDP context ID
must be activated first.
OK
OK
AT+QFTPCFG="sslctxid",1 //Select SSL context 1.
OK
AT+QSSLCFG="ciphersuite",1, 0xffff //Configure SSL cipher suite type as 0xffff, which supports all
cipher suite type.
OK
AT+QSSLCFG="seclevel",1,0 //Configure SSL security level as 0, which means the SSL CA
certificate is not needed .
OK
AT+QSSLCFG="sslversion",1,1 //Configure SSL version as 1, which means TLS1.0.
OK
OK
+QFTPOPEN: 0,0
EC2x&EG9x&EM05_FTP(S)_AT_Commands_Manual 33 / 48
LTE Module Series
EC2x&EG9x&EM05 FTP(S) AT Commands Manual
+QFTPCWD: 0,0
AT+QFTPPWD //Query current directory.
OK
+QFTPPWD: 0,/
AT+QFTPMKDIR="TEST" //Create a folder as “TEST” on FTP(S) server.
OK
+QFTPMKDIR: 0,0
AT+QFTPRENAME="TEST","TEST_NEW" //Rename a folder.
OK
+QFTPRENAME: 0,0
AT+QFTPRMDIR="TEST_NEW" //Delete a folder.
OK
+QFTPRMDIR: 0,0
+QFTPCWD: 0,0
AT+QFTPPWD //Query current directory.
OK
+QFTPPWD: 0,"/"
AT+QFTPSIZE=“test_my1.txt” //Query the size of “test_my1.txt” on FTP(S) server.
OK
+QFTPSIZE:0, 1000
AT+QFTPRENAME="test_my1.txt","test_new.txt" //Rename a file.
OK
+QFTPRENAME: 0,0
EC2x&EG9x&EM05_FTP(S)_AT_Commands_Manual 34 / 48
LTE Module Series
EC2x&EG9x&EM05 FTP(S) AT Commands Manual
+QFTPMDTM: 0,"20140708110039"
AT+QFTPDEL="test_new.txt" //Delete “test_new.txt” on FTP(S) server.
OK
+QFTPDEL: 0,0
+QFTPCWD: 0,0
AT+QFTPLIST="." //List the content of current directory and the data is outputted to
COM port.
CONNECT
<Output content data>
OK
+QFTPLIST: 0,1000
AT+QFTPLIST=".","RAM:list.txt" //List the content of current directory and the data is outputted to
“RAM:list.txt”.
OK
+QFTPLIST: 0,1000
AT+QFTPLIST="TEST_2","COM:" //List the content of “/TEST_2” and the data is outputted to COM
port.
CONNECT
<Output content data>
OK
+QFTPLIST: 0,1000
AT+QFTPNLST="." //List file names of current directory and the data is outputted to
COM port.
CONNECT
<Output content data>
OK
+QFTPNLST: 0,1000
AT+QFTPNLST=".","RAM:nlst.txt" //List file names of current directory and the data is outputted to
“RAM:nlst.txt”.
EC2x&EG9x&EM05_FTP(S)_AT_Commands_Manual 35 / 48
LTE Module Series
EC2x&EG9x&EM05 FTP(S) AT Commands Manual
OK
+QFTPNLST: 0,1000
AT+QFTPNLST="TEST_2","COM:" //List file names of “/TEST_2” and the data is outputted via COM
port.
CONNECT
<Output content data>
OK
+QFTPNLST: 0,1000
AT+QFTPMLSD="." //List standardized file and directory information of current directory
and the data is outputted via COM port.
CONNECT
<Output content data>
OK
+QFTPMLSD: 0,1000
AT+QFTPMLSD=".","RAM:nlst.txt" //List standardized file and directory information of current directory
and the data is outputted to “RAM:nlst.txt”.
OK
+QFTPMLSD: 0,1000
AT+QFTPMLSD="TEST_2","COM:" //List standardized directory information of “/TEST_2” and the data
is outputted via COM port.
CONNECT
<Output content data>
OK
+QFTPMLSD: 0,1000
AT+QFTPCWD="/"
OK
+QFTPCWD: 0,0
AT+QFTPSTAT
+QFTPSTAT: 0,1
OK
EC2x&EG9x&EM05_FTP(S)_AT_Commands_Manual 36 / 48
LTE Module Series
EC2x&EG9x&EM05 FTP(S) AT Commands Manual
CONNECT
<Input file data>
<+++>
OK
+QFTPPUT: 0,1000
AT+QFTPLEN
OK
+QFTPLEN: 0,1000
AT+QFTPSIZE="test_my1.txt"
OK
+QFTPSIZE: 0,1000
//Upload a file via COM port and the start position is 1000.
+QFTPPUT: 0,500
AT+QFTPSIZE="test_my1.txt"
OK
+QFTPSIZE: 0,1500
//Solution 1: Upload a file via COM port to FTP(S) server twice in 1024 bytes each time.
+QFTPPUT: 0,1024
AT+QFTPPUT="test_my1.txt","COM: ",1024,1024,1 //It is the last 1024 bytes of “test_my1.txt”.
CONNECT
<Input file data>
OK //Data length reaches 1024 bytes.
+QFTPPUT: 0,1024
EC2x&EG9x&EM05_FTP(S)_AT_Commands_Manual 37 / 48
LTE Module Series
EC2x&EG9x&EM05 FTP(S) AT Commands Manual
OK
AT+QFLST="RAM:*"
+QFLST: "RAM:test_ram.txt",1000
OK
AT+QFTPPUT="test_my1.txt","RAM:test_ram.txt",0 //Upload “RAM:test_ram.txt” to FTP(S) server
and save as “test_my1.txt” on FTP(S) server.
OK
+QFTPPUT: 0,1000
OK
AT+QFLST="UFS:*"
+QFLST: "UFS:test_ufs.txt",1000
OK
AT+QFTPPUT="test_my1.txt","UFS:test_ufs.txt",0 //Upload “UFS:test_ufs.txt” to FTP(S) server and
save as “test_my1.txt” on FTP(S) server.
OK
+QFTPPUT: 0,1000
EC2x&EG9x&EM05_FTP(S)_AT_Commands_Manual 38 / 48
LTE Module Series
EC2x&EG9x&EM05 FTP(S) AT Commands Manual
OK
AT+QFLST=SD:*”
+QFLST: "SD:test_sd.txt",1000
OK
AT+QFTPPUT="test_my1.txt","SD:test_sd.txt",0 //Upload “SD:test_sd.txt” to FTP(S) server and
save as “test_my1.txt” on FTP(S) server.
OK
+QFTPPUT: 0,1000
AT+QFTPLEN
OK
+QFTPLEN: 0,1000
AT+QFTPSIZE="test_my1.txt"
OK
+QFTPSIZE: 0,1000
AT+QFDEL="RAM:test_ram.txt" //Delete local RAM file.
OK
AT+QFTPCWD="/"
OK
+QFTPCWD: 0,0
//Download a file from FTP(S) server and the data is outputted via COM port.
AT+QFTPGET="test_my.txt","COM:"
CONNECT
<Output file data>
OK
EC2x&EG9x&EM05_FTP(S)_AT_Commands_Manual 39 / 48
LTE Module Series
EC2x&EG9x&EM05 FTP(S) AT Commands Manual
+QFTPGET: 0,1000
//Download a file and the data is outputted via COM port twice in 500 bytes each time.
+QFTPGET: 0,500
AT+QFTPGET="test.txt","COM:",500,500 //Download the left 500 bytes.
CONNECT
<Output file data>
OK
+QFTPGET: 0,500
+QFTPGET: 0,1000
AT+QFLST="RAM:*"
+QFLST: RAM:test.txt,1000
OK
//Download a file from FTP(S) server and save it to RAM, the start position is 450.
+QFTPGET: 0,550
+QFTPGET: 0,1000
AT+QFLST="UFS:*"
+QFLST: UFS:test.txt,1000
EC2x&EG9x&EM05_FTP(S)_AT_Commands_Manual 40 / 48
LTE Module Series
EC2x&EG9x&EM05 FTP(S) AT Commands Manual
OK
//Download a file from FTP(S) server and save it to UFS, the start position is 450.
+QFTPGET: 0,550
+QFTPGET: 0,1000
AT+QFLST="SD:*"
+QFLST: SD:test.txt,1000
OK
//Download a file from FTP(S) server and save it to SD, the start position is 450.
+QFTPGET: 0,550
AT+QFTPLEN
OK
+QFTPLEN: 0,550
AT+QFLST="RAM:*"
+QFLST: RAM:test.txt,1000
+QFLST: RAM:test1.txt,550
OK
+QFTPCLOSE: 0,0
AT+QIDEACT=1 //Deactivate the PDP context which was activated for FTP(S).
OK
EC2x&EG9x&EM05_FTP(S)_AT_Commands_Manual 41 / 48
LTE Module Series
EC2x&EG9x&EM05 FTP(S) AT Commands Manual
4 Error Handling
When executing FTP(S) AT commands, if “ERROR” response is received from the module, please check
whether the U(SIM) card is inserted and whether it is “+CPIN: READY” returned when executing
AT+CPIN?.
If it is failed to activate a PDP context by AT+QIACT command, please check the following configurations:
1. Query whether the PS domain is attached or not by AT+CGATT? command, if not, please execute
AT+CGATT=1 command to attach the PS domain.
2. Query the PS domain status by AT+CGREG? command and make sure the PS domain has been
registered.
3. Query the PDP context parameters by AT+QICSGP command and make sure the APN of the
specified PDP context has been set.
4. Make sure the specified PDP context ID is neither used by PPP nor activated via AT+CGACT
command.
5. According to 3GPP specifications, the module only supports three PDP contexts activated
simultaneously, so customers please must make sure the number of activated PDP contexts is less
than 3.
If all above configurations are correct, but activating the PDP context by AT+QIACT command still fails,
please reboot the module to resolve this issue. After rebooting the module, please check the
configurations mentioned above for at least three times and each time at an interval of 10 minutes to
avoid frequently rebooting the module.
EC2x&EG9x&EM05_FTP(S)_AT_Commands_Manual 42 / 48
LTE Module Series
EC2x&EG9x&EM05 FTP(S) AT Commands Manual
When executing AT+QFTPOPEN command, if “+QFTPOPEN: 604,0” is returned, please check the
following aspects:
If the <protocol_error> in “+QFTPXX: <err>,<protocol_error>” is not 0, it indicates the error code replied
from FTP(S) server.
Customers can check the issue depending on the protocol error code. For example, if <protocol_error> is
530 (not logged in), it indicates <username> or <password> may be wrong. If <protocol_error> is 550
(requested action not taken: file unavailable.), it means the file or directory may not exist. For more details,
please refer to the document RFC959 (File Transfer Protocol).
EC2x&EG9x&EM05_FTP(S)_AT_Commands_Manual 43 / 48
LTE Module Series
EC2x&EG9x&EM05 FTP(S) AT Commands Manual
0 Operation successful
EC2x&EG9x&EM05_FTP(S)_AT_Commands_Manual 44 / 48
LTE Module Series
EC2x&EG9x&EM05 FTP(S) AT Commands Manual
EC2x&EG9x&EM05_FTP(S)_AT_Commands_Manual 45 / 48
LTE Module Series
EC2x&EG9x&EM05 FTP(S) AT Commands Manual
<protocol_error> Meaning
EC2x&EG9x&EM05_FTP(S)_AT_Commands_Manual 46 / 48
LTE Module Series
EC2x&EG9x&EM05 FTP(S) AT Commands Manual
7 Appendix A References
EC2x&EG9x&EM05 TCP/IP
[2] Quectel_EC2x&EG9x&EM05_TCP(IP)_AT_Commands_Manual
AT Commands Manual
EC2x&EG9x&EM05 FILE
[3] Quectel_EC2x&EG9x&EM05_FILE_AT_Commands_Manual
AT Commands Manual
EC21&EC25 AT Commands
[4] Quectel_EC21&EC25_AT_Commands_Manual
Manual
EC2x&EG9x&EM05 SSL AT
[7] Quectel_EC2x&EG9x&EM05_SSL_AT_Commands_Manual
Commands Manual
Abbreviation Description
ACK Acknowledgement
ID Internet Protocol
EC2x&EG9x&EM05_FTP(S)_AT_Commands_Manual 47 / 48
LTE Module Series
EC2x&EG9x&EM05 FTP(S) AT Commands Manual
PS Packet Switching
SD Secure Digital
EC2x&EG9x&EM05_FTP(S)_AT_Commands_Manual 48 / 48