페이지 선택
Generic selectors
Exact matches only
Search in title
Search in content
Post Type Selectors
Search in pages

FTPS 통신연습 – File Download, Resume-from-Break-Point

FTP (File Transfer Protocol) is an application layer protocol.

File Transfer Protocol is a standard protocol for transferring files over a network, using the client/server mode.

 

 

 

1. FTP(S) Characteristics

A control connection is a communication link established between a client protocol interpreter and a server protocol interpreter

for exchanging commands and responses.

 

A data connection is a full-duplex connection for transmitting data.

The transfer of data can occur between DTP for the server data transfer process and DTP for the client,

or between DTP for the two server

 

 

 

 

2. FTP(S) 통신 설정과정 

 

 

 

 

 

3.통신 명령시퀀스 – FTP(S), File Download, Resume-from-Break-Point

Example of uses the resume-from-break-point function of the module to download a file in FTP server to the directory F:/.

 

NO Command Response 설명
1 PDP Context 설정    
2 AT+CFTPSSTART +CFTPSSTART: 0
OK
Activate PDP context to start FTP service
3 AT+CFTPSSINGLEIP=1 OK

Set data connection,

use the same port(address) of control connection

4

AT+CFTPSLOGIN=”xxx.xxx.93.163″,

21,”tmf”,”tmfxxx”,0\r

OK
+CFTPSLOGIN: 0
 
5 AT+FSCD?   Query current client directory
  AT+FSCD=F:/   Change current directory to “F:/”
  AT+FSLS   List all items in directory “F:/”
6 AT+CFTPSSIZE=”test0129″    
7 AT+CFTPSGETFILE=”test0129″,1,3  

The file exists in the ftp server,

while not in the file system of the module,

in this case, if use the parameter

//<offset>, <err_code> 7 will be returned

8 AT+CSHELL=”sync”  

This command is used to output the data

in buffer to the disk of module.

It is not mandatory, only used for test,

avoiding the data lost.

9 Reset Module   Reset the module by HW or SW
10 AT+FSCD?    
  AT+FSCD=F:    
  AT+FSLS    
11 AT+FSATTRI=”test0129″  

Query the size of the file “test0129”

which has been downloaded last time.

12 AT+CFTPSSTART   Start FTP service
13

AT+CFTPSLOGIN=”xxx.xxx.93.163″,

21,”tmf”,”tmfxxx”,0

  Login server
14

AT+CFTPSGETFILE=”test0129″,

1,401408

 

Use resume-from-break-point, the <offset>

should be the size of download file

15 AT+FSATTRI=”test0129″  

The file is successfully downloaded,

query the size of the file,

it’s the same size as the file e in ftp server

16 AT+CFTPSSIZE=”test0129   Get file size
17 AT+CFTPSLOGOUT OK
+CFTPSLOGOUT: 0
Logout FTP server
18 AT+CFTPSSTOP +CFTPSSTOP: 0
OK
Stop FTP service

 

 

 

 

Adsense

EMW3070

Viewed Page List