페이지 선택
Generic selectors
Exact matches only
Search in title
Search in content
Search in pages
AT Commands For FTPS

 

Command Description
AT+CFTPSSTART Start FTP(S) service
AT+CFTPSSTOP Stop FTP(S) Service
AT+CFTPSLOGIN Login to a FTP(S)server
AT+CFTPSLOGOUT Logout FTP(S) server
AT+CFTPSMKD Create a new directory on FTP(S) server
AT+CFTPSRMD Delete a directory on FTP(S) server
AT+CFTPSDELE Delete a file on FTP(S) server
AT+CFTPSCWD Delete a file on FTP(S) server
AT+CFTPSPWD Get the current directory on FTP(S) server
AT+CFTPSTYPE set the transfer type on FTP(S) serve
AT+CFTPSLIST List the items in the directory on FTP(S) server
AT+CFTPSGETFILE Get a file from FTP(S) server to module
AT+CFTPSPUTFILE Put a file from module to FTP(S) server
AT+CFTPSGET Get a file from FTP(S) server to serial port
AT+CFTPSPUT Put a file to FTP(S) server through serial port
AT+CFTPSSINGLEIP Set FTP(S) data socket address type
AT+CFTPSCACHERD Set FTP(S) data socket address type
AT+CFTPSABORT Abort FTP(S) operations
AT+CFTPSSIZE Get the File Size on FTP(S) server

 

 

 

 

AT+CFTPSSTART     Start FTP(S) Service

  

E) AT+CFTPSSTART

OK

+CFTPSSTART: <errcode>

or

+CFTPSSTART: <errcode>

 

OK

or

ERROR

 

 

<errcode>

The result of start FTP(S) service,0 is success, others are failure.

Please refer to chapter 12.3.1.

 

 

Example

AT+CFTPSSTART

OK

 

+CFTPSSTART: 0

 

 

 

 

AT+CFTPSSTOP     Stop FTP(S) Service

  

E) AT+CFTPSSTOP

OK

+CFTPSSTOP: <errcode>

or

+CFTPSSTOP: <errcode>

 

OK

or

ERROR

 

 

<errcode>

The result of stop FTP(S) service,0 is success, others are failure.

Please refer to chapter 12.3.1.

 

 

Example

AT+CFTPSSTOP

OK

 

+CFTPSSTOP: 0

 

 

 

 

AT+CFTPSLOGIN     Login To A FTP(S) Server

  

T) AT+CFTPSLOGIN=?

+CFTPSLOGIN:

“ADDRESS”,(1-65535)[,”USERNAME”,”PASSWORD”[,(0-3)]]

 

OK

W) AT+CFTPSLOGIN=”<host>”,<port>,

”<username>”,”<password>”[<server_type>]

OK

 

+CFTPSLOGIN: <errcode>

or

+CFTPSLOGIN: <errcode>

 

OK

or

+CFTPSLOGIN: <errcode>

 

ERROR

or

ERROR

 

 

<host> Host address, string type, maximum length is 256
<port> The host listening port for FTP(S), the range is from 1 to 65535
<username> FTP(S) user name, string type, maximum length is 256
<password> The user password, string type, maximum length is 256
<server_type>

FTP(S)server type,numeric,from0-3,default is 3

0     FTP server.

1     Explicit FTPS server with AUTH SSL.

2     Explicit FTPS server with AUTH TLS.

3     Implicit FTPS server.

<errcode>

The result code of the FTP/FTPS login. 0 is success.

Others are failure, please refer to chapter 12.3.1.

 

 

Example

AT+CFTPSLOGIN=”112.74.93.163″,21,”tmf”,”t mf123″,0

OK

 

+CFTPSLOGIN: 0

 

 

 

 

AT+CFTPSLOGOUT     Logout FTP(S) Server

  

T) AT+CFTPSLOGOUT=? OK
E) AT+CFTPSLOGOUT

OK

 

+CFTPSLOGOUT: <errcode>

or

+CFTPSLOGOUT: <errcode>

 

OK

or

ERROR

 

 

<errcode>

The result code of the FTP/FTPS logout. 0 is success.

Others are failure, please refer to chapter 12.3.1.

 

 

Example

AT+CFTPSLOGOUT

OK

 

+CFTPSLOGOUT: 0

 

 

 

 

 AT+CFTPSMKD     Create A New Directory On FTP(S) Server

  

T) AT+CFTPSMKD=?

+CFTPSMKD: “DIR”

 

OK

W) AT+CFTPSMKD=”<dir>”

OK

 

+CFTPSMKD: 0

or

OK

 

+CFTPSMKD: <errcode>

 

or

ERROR

or

+CFTPSMKD: <errcode>

 

ERROR

 

 

<dir> The directory to be created, string type, maximum length is 256.
<errcode> The result of create directory, 0 is success, others are failure, please refer to chapter 12.3.1.

 

 

Example

AT+CFTPSMKD=”TEST”

OK

 

+CFTPSMKD: 0

 

 

 

 

AT+CFTPSRMD     Delete A Directory On FTP(S) Server

  

T) AT+CFTPSRMD=?

+CFTPSRMD: “DIR”

 

OK

W) AT+CFTPSRMD=”<dir>”

1) if delete the directory successfully:

OK

 

+CFTPSRMD: 0

 

2) if delete the directory failed:

OK

 

+CFTPSRMD: <errcode>

 

3)   if parameter format or any errors:

ERROR

 

 

 <dir>

The directory to be removed. If the directory contains non-ASCII characters, the <dir> parameter

should contain a prefix of {non-ascii}.String type, maximum length is 256.

<errcode> The result of remove directory, 0 is success, others are failure, please refer to chapter 12.3.1.

 

 

Example

AT+CFTPSRMD=”test”

OK

 

+CFTPSRMD: 0

 

 

 

 

AT+CFTPSDELE     Delete A File On FTP(S) Server

 

T) AT+CFTPSDELE=?

+CFTPSDELE: “FILENAME”

 

OK

W) AT+CFTPSDELE=”<filename>”

1) if delete file successfully:

OK

 

+CFTPSDELE: 0

 

2) if failed:

OK

 

+CFTPSDELE: <errcode>

 

3) if parameter format or any other errors:

ERROR

 

 

<filename>

The name of the file to be deleted. If the file name contains non-ASCII characters, the <filename>

parameter should contain a prefix of {non-ascii}.String type,the maximum length is 256.

<errcode> The result of delete a file, 0 is success, others are failure,please refer to chapter 12.3.1.

 

 

Example

AT+CFTPSDELE=”TEST.txt”

OK

 

+CFTPSDELE: 0

 

 

 

 

AT+CFTPSCWD     Change The Current Directory On FTP(S) Server 

 

T) AT+CFTPSCWD=?

+CFTPSCWD: “DIR”

 

OK

W) AT+CFTPSCWD=”<dir>”

1)if delete file successfully::

OK

 

+CFTPSCWD: 0

 

2)if failed:

OK

 

+CFTPSCWD: <errcode>

 

2)if failed:

+CFTPSCWD: <errcode>

 

ERROR

 

3)if parameter format or any other errors:

ERROR

 

 

 <dir>

The directory to be changed. If the directory contains non-ASCII characters, the <dir> parameter

should contain a prefix of {non-ascii}.String type,the maximum length is 256.

<errcode> The result of change the current directory, 0 is success, others are failure, please refer to chapter 12.3.1.

 

 

Example

AT+CFTPSCWD=”/lu.liu/TEST7600″

OK

 

+CFTPSCWD: 0

 

 

 

 

AT+CFTPSPWD     Get The Current Directory On FTPS Server

  

E) AT+CFTPSPWD

OK

+CFTPSPWD: ”<dir>”

or

+CFTPSPWD: ”<dir>”

 

OK

or

+CFTPSPWD: <errcode>

 

ERROR

or

OK

 

+CFTPSPWD: <errcode>

or

ERROR

 

 

 <dir>

The name of the file to be deleted. If the file name contains non-ASCII characters, the

<filename> parameter should contain a prefix of {non-ascii}.

String type, the maximum length is 256.

<errcode>

The result of change current directory, 0 is success, others are failure,

please refer to chapter 12.3.1.

 

 

Example

AT+CFTPSPWD

OK

 

+CFTPSPWD: “/test12”

 

 

 

 

AT+CFTPSTYPE     Set The Transfer Type On FTP(S) Server

  

T) AT+CFTPSTYPE=?

+CFTPSTYPE: (A,I)

 

OK

R) AT+CFTPSTYPE?

+CFTPSTYPE: <type>

 

OK

W) AT+CFTPSTYPE=<type>

a)if set type successfully:

OK

 

+CFTPSTYPE: 0

 

b)if set type failed:

OK

 

+CFTPSTYPE: <errcode>

 

 

 <type>

The type of transferring:

A     ASCII.

I     Binary

<errcode> The result of set type, 0 is success, others are failure, please refer to chapter 12.3.1.

 

 

Example

AT+CFTPTYPE=A

OK

 

+CFTPSTYPE: 0

 

 

 

 

AT+CFTPSLIST     List The Items In The Directory On FTP(S) Server

  

W) AT+CFTPSLIST[=”<dir>”]

a)if set type successfully:

OK

 

+CFTPSLIST: DATA,<len>

+CFTPSLIST: 0

 

b) if set type failed:

OK

 

+CFTPSLIST: <errcode>

 

c) if parameter format or any other errors:

ERROR

 

 

 <dir>

The directory to be listed. If the directory contains non-ASCII characters, the <dir> parameter

should contain a prefix of {non-ascii}.String type, the maximum length is 256

 <errcode> The result code of the listing.0 is success, others are failure, please refer to chapter12.3.1.

 

 

Example

AT+CFTPSLIST=”/”

OK

 

+CFTPSLIST: DATA,1480

-rw-r–r– 1 ftp ftp                                                                10 Mar 19

13:51 111.TXT

-rw-r–r– 1 ftp ftp                                                                  7 Mar 18

10:39 1111.txt

-rw-r–r– 1 ftp ftp                                                          10240 Mar 23

10:20 112.txt

-rw-r–r– 1 ftp ftp                                                                10 Mar 16

15:26 11K4.txt

-rw-r–r– 1 ftp ftp                                                             1434 Mar 18

10:47 1434B.txt

-rw-r–r– 1 ftp ftp                                                         307200 Mar 18

10:40 300K.txt

-rw-r–r– 1 ftp ftp                                                                   9 Mar 18

10:53 333.txt

-rw-r–r– 1 ftp ftp                                                                 16 Mar 17

14:11 36.txt

 

+CFTPSLIST: 0

 

 

 

 

AT+CFTPSGETFILE     Get A File From FTP(S) Server To Module

 

T) AT+CFTPSGETFILE=?

+CFTPSGETFILE: [{non-ascii}]”FILEPATH”[,(1-4)]

 

OK

W) AT+CFTPSGETFILE=”<filepath>”[,<dir>[,<offset>]]

a)  if download file successfully :

OK

 

+CFTPSGETFILE: 0

 

b)  if failed:

OK

 

+CFTPSGETFILE: <errcode>

 

c)   if parameter format or any other errors:

ERROR

 

 

<filepath>

The remote file path. When the file path doesn’t contain”/”, this command transfers file from the current

remote FTPS directory. If the file path contains non-ASCII characters, the file path parameter should

contain a prefix of {non-ascii}.String type, maximum length is 256.

<dir>

The directory to save the downloaded file.Numeric type, range is 1-4, default is 1(/cache)

1     F:/ (/cache)

2     D:/(sd card)

3     E:/ (/data/media/)

4     /mssl_cert/(this is for CA file downloading)

<offset> Integer     type,     the     download      start     position     used     for resume-from-break-point.
<errcode>

The result code of download file from FTP(s) server.0 is success, others are failure,

please refer to chapter 12.3.1.

 

 

Example

AT+CFTPSGETFILE=”settings.dat”,3

OK

 

+CFTPSGETFILE: 0

 

 

 

 

AT+CFTPSPUTFILE     Put A File From Module To FTP(S) Server

 

T) AT+CFTPSPUTFILE=?

+CFTPSPUTFILE:

[{non-ascii}]”FILEPATH”[,(1-3),(0-2147483647)]

 

OK

W) AT+CFTPSPUTFILE=”<filepath>”[,<dir>[,<rest_size>]]

a) if upload file successfully :

OK

 

+CFTPSPUTFILE: 0

 

b) if failed:

OK

 

+CFTPSPUTFILE: <errcode>

 

 

<filepath>

The remote file path.

When the file path doesn’t contain “/”, this command transfers file to the current remote FTPS directory.

If the file path contains non-ASCII characters, the file path parameter should contain a prefix of {non-ascii}.

String type, maximum length is 256.

<dir>

The directory that contains the uploaded file. Numeric type, range is 1-3, default is 1(/cache)

1     F:/ (/cache)

2     D:/(sd card)

3     E:/ (/data/media/)

<rest_size>

The value for FTP “REST” command which is used for broken transfer when transferring failed last time.   

Numeric type, the range is from 0 to 2147483647.

<errcode> The result code of upload file to FTP(S)server.0 is success, others are failure, please refer to chapter12.3.1.

 

 

Example

AT+CFTPSPUTFILE=”/LK/LM/sim_ZXX.TXT”

OK

 

+CFTPSPUTFILE: 0

 

 

 

 

AT+CFTPSGET     Get A File From FTP(S) Server To Serial Port

  

T) AT+CFTPSGET=?

+CFTPSGET: [{non-ascii}]”FILEPATH”[,<rest_size>[(0,1)]]

 

OK

W) AT+CFTPSGET=”<filepath>”[,<rest_size>[,<using_cache>]]

a) if<using_cache> is 0(default),and get file successfully :

 

OK

 

+CFTPSGET: DATA,<len>

+CFTPSGET: DATA, <len>

+CFTPSGET: 0

 

b)   if <using_cache> is 1 and get file successfully:

OK

 

+CFTPS: RECV EVENT

 

AT+CFTPSCACHERD?

//you can use this command to check the size of the received data

+CFTPSCACHERD: 102400

 

OK

 

//output cached data now:

AT+CFTPSCACHERD

+CFTPSGET: DATA,<len>

……

OK

……

+CFTPSGET: 0

 

c)if failed:

OK

 

+CFTPSGET: <errcode>

 

  

<filepath>

The remote file path.

When the file path doesn’t contain ”/” ,   this command transfer file from the current remote FTPS

directory.

If the file path contains non-ASCII characters, the file path parameter should contain a prefix of {non-ascii}.

String type, maximum length is 256.

<rest_size>

The value for FTP “REST” command which is used for broken transfer when transferring failed last time.

Numeric type, the range is from 0 to 2147483647

<using_cache>

Numeric, rang is 0-1

0     Do not use cache, module will output the items data to serial port when list successfully.

1     Use cache, module will report “+CFTPS: RECV EVENT” when list successfully (Data will be

output using AT+CFTPSCACHERD command)

<errcode>

The result code of download file from FTP(s) server.0 is success, others are failure,

please refer to chapter 12.3.1.

 

 

Example

AT+CFTPSGET=”/BBB.TXT”

OK

 

+CFTPSGET: DATA,110

FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF

FFFFFFFFFFFFFFFHHHHHHHHHHHHHHHH

HHHHHHHHHHHHHHHHHHHHHHHHHHHHH

HHHHHHHHHHHHHHH

+CFTPSGET: 0

 

 

 

 

AT+CFTPSPUT     Put A File To FTP(S) Server Through Serial Port

 

T) AT+CFTPSPUT=?

+CFTPSPUT: [{non-ascii}]”FILEPATH”[,<data_len>[,<rest_size>]]

 

OK

W) AT+CFTPSPUT=”<filepath>”[

,<data_len>[,<rest_size>]]

a)if upload file through serial port successfully:

OK

 

+CFTPSPUT: 0

 

b)if failed before input data:

+CFTPSPUT: <errcode>

 

ERROR

 

c)if failed after input data:

OK

 

+CFTPSPUT: <errcode>

 

d)if parameter format i or any other errors:

ERROR

 

 

<filepath>

The remote file path.

When the file path doesn’t contain “/”, this command transfers file to the current remote FTPS directory.

If the file path contains non-ASCII characters, the file path parameter should contain a prefix of {non-ascii}.

String type, maximum length is 256.

<data_len>

Numeric type, The length of the data to send, the maximum length is 2048.

if parameter<data_len> is omitted, Each <Ctrl+Z>character present in the data flow of serial port when

downloading FTP data will be coded as <ETX><Ctrl+Z>.

Each <ETX> character will be coded as <ETX><ETX>.

Single <Ctrl+Z> means end of the FTP data.<ETX> is 0x03, and <Ctrl+Z> is 0x1A.

<rest_size>

The value for FTP “REST” command which is used for broken transfer when transferring failed last time.

Numeric type, the range is from 0 to 2147483647.

<errcode>

The result code of upload data to FTP(s) server.0 is success, others are failure,

please refer to chapter 12.3.1.

 

 

Example

AT+CFTPSPUT=”/LK/LM/LO.TXT”

>123457860

OK

 

+CFTPSPUT: 0

 

 

 

 

AT+CFTPSSINGLEIP     Set FTP(S) Data Socket Address Type

 

T) AT+CFTPSSINGLEIP=?

+CFTPSSINGLEIP: (0,1)

 

OK

R) AT+CFTPSSINGLEIP?

+CFTPSSINGLEIP: <singleip>

 

OK

W) AT+CFTPSSINGLEIP=<singleip>

If parameter format is right and set successfully:

OK

 

If parameter format is not right or any other error occurs:

ERROR

 

 

<singleip>

The FTPS data socket IP address type:

0     decided by PORT response from FTPS server

1     the same as the control

 

 

Example

AT+CFTPSSINGLEIP=1

OK

 

 

 

 

AT+CFTPSCACHERD     Output Cached Data To MCU

 

R) AT+CFTPSCACHERD?

+CFTPSCACHERD: <len>

 

OK

E) AT+CFTPSCACHERD

If cache data is AT+CFTPSGET, and everything goes well:

 

+CFTPSGET: DATA,<out_len><CR><LF>

 

OK

 

 

<len>

Numeric type, The bytes of data cached in FTPS module. The bytes of data to output.

The maximum value is 1024 for each

<out_len> AT+CFTPSCACHERD calling.

 

 

Example

AT+CFTPSCACHERD?

+CFTPSCACHERD: 21078

 

OK

 

 

 

 

AT+CFTPSABORT     About FTP(S) Operations

  

E) AT+CFTPSABORT

if abort FTP(S) operation successfully:

OK

 

+CFTPSABORT: 0

 

sometimes abort successfully returns:

+CFTPSABORT: 0

OK

 

if failed:

OK

 

+CFTPSABORT: <errcode>

 

if any other error occurs:

ERROR

 

 

<errcode>

The result of abort FTP(S) service,0 is success, others are failure.

Please refer to chapter 12.3.1.

 

 

Example

AT+CFTPSABORT

OK

 

+CFTPSABORT: 0

 

 

 

 

AT+CFTPSSIZE     Get The File Size On FTP(S) Server

 

T) AT+CFTPSSIZE=?

+CFTPSSIZE: “<filepath>”

 

OK

W) AT+CFTPSSIZE=”<filepath>”

OK

 

+CFTPSSIZE: <filesize>

or

OK

 

+CFTPSSIZE: <errcode>

or

ERROR

or

+CFTPSSIZE: <errcode>

 

ERROR

 

 

<filepath> The remote filepath on FTP(S) server.String type,max length is 256
<filesize> Numeric type,size of the remote file on FTP(S) server.
<errcode> The result code of get file size. Please refer to chapter 12.3.1.

 

 

Example

AT+CFTPSSIZE=”TEST.txt”

OK

 

+CFTPSSIZE: 1024

 

 

 

 

 Summary Of Command Result <errcode>

 

0 Success
1 SSL alert
2 Unknown error
3 Busy
4 Connection closed by server
5 Timeout
6 Transfer failed
7 File not exists or any other memory error
8 Invalid parameter
9 Operation rejected by server
10 Network error
11 State error
12 Failed to parse server name
13 Create socket error
14 Connect socket failed
15 Close socket failed
16 SSL session closed
17 File error, file not exist or other error.
421 Server response connection time out, while received error code 421, you need do AT+CFTPSLOGOUT to logout server then AT+CFTPSLOGIN again for further operations.

 

 

 

 

Summary Of Unsolicited Result Codes

 

+CFTPSNOTIFY:PEER CLOSED When client disconnect passively, URC “+CFTPSNOTIFY: PEER CLOSED”          will        be         reported,            then      user       need     to          execute AT+CFTPSLOGOUT and login again.

 

 

 

 

Adsense

EMW3070

Viewed Page List