0% found this document useful (0 votes)
152 views24 pages

SIM800 Series IP Application Note V1.05-1

Uploaded by

pamparamparm
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
152 views24 pages

SIM800 Series IP Application Note V1.05-1

Uploaded by

pamparamparm
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

SIM800 Series_IP

_Application Note
GPRS Module

SIMCom Wireless Solutions Limited


Building B, SIM Technology Building, No.633, Jinzhong Road
Changning District, Shanghai P.R. China
Tel: 86-21-31575100
[email protected]
www.simcom.com
SIM800 Series_IP_Application Note_V1.05

Document Title: SIM800 Series_IP_Application Note


Version: 1.05
Date: 2020.6.15
Status: Released

GENERAL NOTES

SIMCOM OFFERS THIS INFORMATION AS A SERVICE TO ITS CUSTOMERS, TO SUPPORT


APPLICATION AND ENGINEERING EFFORTS THAT USE THE PRODUCTS DESIGNED BY SIMCOM.
THE INFORMATION PROVIDED IS BASED UPON REQUIREMENTS SPECIFICALLY PROVIDED TO
SIMCOM BY THE CUSTOMERS. SIMCOM HAS NOT UNDERTAKEN ANY INDEPENDENT SEARCH
FOR ADDITIONAL RELEVANT INFORMATION, INCLUDING ANY INFORMATION THAT MAY BE IN THE
CUSTOMER’S POSSESSION. FURTHERMORE, SYSTEM VALIDATION OF THIS PRODUCT
DESIGNED BY SIMCOM WITHIN A LARGER ELECTRONIC SYSTEM REMAINS THE RESPONSIBILITY
OF THE CUSTOMER OR THE CUSTOMER’S SYSTEM INTEGRATOR. ALL SPECIFICATIONS
SUPPLIED HEREIN ARE SUBJECT TO CHANGE.

COPYRIGHT

THIS DOCUMENT CONTAINS PROPRIETARY TECHNICAL INFORMATION WHICH IS THE PROPERTY


OF SIMCOM WIRELESS SOLUTIONS LIMITED COPYING, TO OTHERS AND USING THIS DOCUMENT,
ARE FORBIDDEN WITHOUT EXPRESS AUTHORITY BY SIMCOM. OFFENDERS ARE LIABLE TO THE
PAYMENT OF INDEMNIFICATIONS. ALL RIGHTS RESERVED BY SIMCOM IN THE PROPRIETARY
TECHNICAL INFORMATION ,INCLUDING BUT NOT LIMITED TO REGISTRATION GRANTING OF A
PATENT , A UTILITY MODEL OR DESIGN. ALL SPECIFICATION SUPPLIED HEREIN ARE SUBJECT TO
CHANGE WITHOUT NOTICE AT ANY TIME.

SIMCom Wireless Solutions Limited


Building B, SIM Technology Building, No.633 Jinzhong Road, Changning District, Shanghai P.R. China
Tel: +86 21 31575100
Email: [email protected]

For more information, please visit:


https://www.simcom.com/download/list-863-en.html

For technical support, or to report documentation errors, please visit:


https://www.simcom.com/ask/ or email to: [email protected]

Copyright © 2020 SIMCom Wireless Solutions Limited All Rights Reserved.

www.simcom.com 2 / 24
SIM800 Series_IP_Application Note_V1.05

About Document

Version History

Version Date Owner What is new


V1.00 2013.8.01 Hanjun.Liu First Release
Chapter 3.16, change "AT+FTPRESET=20" to
V1.01 2013.10.28 Hanjun.Liu
"AT+FTPREST=20"
V1.02 2014.6.30 Hanjun.Liu Chapter Scope,Add project
V1.03 2016.11.17 Wenjie.Lai Scope
V1.04 2019.9.18 Wenjie.Lai Chapter 3.9,Add example of “AT+HTTPGETHEAD”
Liuyang.Zhang
V1.05 2020.6.15 All
/Wenjie.Lai

Scope

This document presents the AT command of HTTP&FTP operation and application examples. This
document can apply to SIM800 series modules with HTTP and FTP function.

www.simcom.com 3 / 24
SIM800 Series_IP_Application Note_V1.05

Contents

About Document .................................................................................................................... 3


Version History .................................................................................................................................... 3
Scope .................................................................................................................................................... 3
Contents ................................................................................................................................. 4
1 Introduction ...................................................................................................................... 5
1.1 Purpose of the document ............................................................................................................ 5
1.2 Related documents ..................................................................................................................... 5
1.3 Conventions and abbreviations ................................................................................................... 5
2 AT commands .................................................................................................................. 6
3 IP Examples ..................................................................................................................... 8
3.1 Bearer Configure......................................................................................................................... 8
3.2 HTTP GET Method ..................................................................................................................... 8
3.3 HTTP POST Method ................................................................................................................... 9
3.4 HTTP HEAD Method ................................................................................................................... 9
3.5 Set Proxy HTTP Server............................................................................................................. 10
3.6 HTTP Redirection Parameter .................................................................................................... 10
3.7 Set HTTP Download Break Point Parameter ............................................................................ 11
3.8 Get HTTP Current Status .......................................................................................................... 12
3.9 Show HTTP Header Information ............................................................................................... 12
3.10 FTP GET Method ...................................................................................................................... 13
3.11 FTP PUT Method ...................................................................................................................... 14
3.12 FTP Time out ............................................................................................................................ 15
3.13 FTP Error .................................................................................................................................. 15
3.14 FTP Operation Error ................................................................................................................. 16
3.15 FTP READ and WRITE Error .................................................................................................... 16
3.16 Set FTP Download Break Point Parameter ............................................................................... 17
3.17 FTP DELE Method .................................................................................................................... 17
3.18 FTP SIZE Method ..................................................................................................................... 18
3.19 FTP MKD and RMD Method ..................................................................................................... 18
3.20 FTP LIST Session ..................................................................................................................... 19
3.21 FTP Extend PUT Method .......................................................................................................... 20
3.22 FTPGETTOFS Method ............................................................................................................. 20
3.23 FTPPUTFRMFS Method ........................................................................................................... 21
3.24 FTPEXTGET Method ................................................................................................................ 22
3.25 FTPFILEPUT Method................................................................................................................ 23
3.26 HTTP Redirection Parameter .................................................................................................... 23

www.simcom.com 4 / 24
SIM800 Series_IP_Application Note_V1.05

1 Introduction

This chapter introduces the IP application features of SIM800 series modules.

1.1 Purpose of the document

SIM800 series modules support Hyper Text Transfer Protocol application. which provides a mode to
alternate of HTTP server. The basic application contains GET, POST, HEAD methods; it also supports proxy
server, redirection, broken transfer resuming functions.
SIM800 series modules support File Transfer Protocol application. which provides a mode to interact with
FTP server. The basic application contains GET, PUT methods, it also supports broken transfer resuming
function. PUT method supports APPE, STOR and other modes.

1.2 Related documents

[1] SIM800 Series_AT Command Manual

1.3 Conventions and abbreviations

Abbreviation Description
FTP File Transfer Protocol
HTTP Hypertext Transfer Protocol
APN Access Point Name
GPRS General Packet Radio Service
PDP Packet Data Protocol

www.simcom.com 5 / 24
SIM800 Series_IP_Application Note_V1.05

2 AT commands

Command Description
AT+HTTPINIT Initialize HTTP service
AT+HTTPTERM Terminate HTTP service
AT+HTTPPARA Set HTTP parameters value
AT+HTTPDATA Input HTTP data
AT+HTTPACTION Http method action
AT+HTTPREAD Read the HTTP server response
AT+HTTPSCONT Save HTTP application context
AT+HTTPSTATUS Read HTTP status
AT+FTPPORT Set FTP control port
AT+FTPMODE Set active or passive FTP mode
AT+FTPTYPE Set the type of data to be transferred
AT+FTPPUTOPT Set FTP put type
AT+FTPCID Set FTP bearer profile identifier
AT+FTPREST Set resume broken download
AT+FTPSERV Set FTP server address
AT+FTPUN Set FTP user name
AT+FTPPW Set FTP password
AT+FTPGETNAME Set download file name
AT+FTPGETPATH Set download file path
AT+FTPPUTNAME Set upload file name
AT+FTPPUTPATH Set upload file path
AT+FTPGET Download file
AT+FTPPUT Set upload file
AT+FTPSCONT Save FTP application context
AT+FTPDELE Delete specified file in FTP server
AT+FTPSIZE Get the size of specified file in FTP server
AT+FTPSTATE Get the FTP state
AT+FTPEXTPUT Extend upload file
AT+FTPMKD Make directory on the remote machine
AT+FTPRMD Remove directory on the remote machine
AT+FTPLIST List contents of directory on the remote machine
AT+FTPGETTOFS Download file and save in file system
AT+FTPPUTFRMFS Upload file from file system

www.simcom.com 6 / 24
SIM800 Series_IP_Application Note_V1.05

AT+FTPEXTGET Extend download file


AT+FTPFILEPUT Load file in RAM from file system then upload with FTPPUT
AT+FTPQUIT Quit current FTP session

www.simcom.com 7 / 24
SIM800 Series_IP_Application Note_V1.05

3 IP Examples

3.1 Bearer Configure

//Bearer configure
AT+SAPBR=3,1,"Contype","GPRS" //Configure bearer profile 1
OK
AT+SAPBR=3,1,"APN","CMNET"
OK
AT+SAPBR=1,1 //To open a GPRS context.
OK
AT+SAPBR=2,1 //To query the GPRS context.
+SAPBR:1,1,"10.89.193.1"

OK
AT+SAPBR=0,1 //To close a GPRS context.
OK

3.2 HTTP GET Method

// Download data from HTTP server.


//Init HTTP service
AT+HTTPINIT
OK
AT+HTTPPARA="CID",1 //Set parameters for HTTP session
OK
AT+HTTPPARA="URL","www.sim.co
m"
OK
AT+HTTPACTION=0 //GET session start
OK
+HTTPACTION: 0,200,1000 //GET successfully
AT+HTTPREAD Read the data of HTTP server
+HTTPREAD: 1000
….
OK

www.simcom.com 8 / 24
SIM800 Series_IP_Application Note_V1.05

AT+HTTPTERM //Terminate HTTP service


OK

3.3 HTTP POST Method

// Upload data to HTTP server.


AT+HTTPINIT //Init HTTP service
OK
AT+HTTPPARA="CID",1 //Set parameters for HTTP session
OK
AT+HTTPPARA="URL","www.sim.co
m"
OK
AT+HTTPDATA=100,10000 //POST the data whose size is 100 Bytes and the maximum
DOWNLOAD latency time for inputting is 10000 ms. It is recommended to
set the latency time long enough to allow downloading all the
…… data.
It is ready to receive data from UART, and DCD has been set
OK to low.
All data has been received over, and DCD is set to high
AT+HTTPACTION=1 //POST session start
OK
+HTTPACTION: 1,200,0 //POST successfully
AT+HTTPTERM //Terminate HTTP service
OK

3.4 HTTP HEAD Method

//Get HTTP head information


AT+HTTPINIT //Init HTTP service
OK
AT+HTTPPARA="CID",1 //Set parameters for HTTP session
OK
AT+HTTPPARA="URL","www.sim.co
m"
OK
AT+HTTPACTION=2 //HEAD session start
OK

www.simcom.com 9 / 24
SIM800 Series_IP_Application Note_V1.05

+HTTPACTION: 2,200,0 //HEAD successfully

AT+HTTPTERM //Terminate HTTP service


OK

3.5 Set Proxy HTTP Server

It provides the method to use proxy HTTP server.

//use proxy HTTP serve


//Init HTTP service
AT+HTTPINIT
OK
AT+HTTPPARA="CID",1 //Set parameters for HTTP session
OK
AT+HTTPPARA="URL","www.sim.co
m"
OK
AT+HTTPPARA="PROIP","10.0.0.172 //Set proxy server IP address
"
OK
AT+HTTPPARA="PROPORT",80 //Set proxy server port
OK
AT+HTTPACTION=0 //GET session start
OK
+HTTPACTION: 0,200,1000 //GET successfully
AT+HTTPREAD //Read the data of HTTP server.
+HTTPREAD: 1000 //Output the data to UART
….
OK
AT+HTTPTERM //Terminate HTTP service
OK

3.6 HTTP Redirection Parameter

It provides the method to use HTTP redirection function.

// use HTTP redirection function.


AT+HTTPINIT //Init HTTP service
OK

www.simcom.com 10 / 24
SIM800 Series_IP_Application Note_V1.05

AT+HTTPPARA="CID",1 //Set parameters for HTTP session


OK
AT+HTTPPARA="REDIR",1 //Set the redirection parameter
OK
AT+HTTPPARA="URL","www.sim.co //Set the URL
m/abcde"
OK
AT+HTTPACTION=0 //GET session start
OK
+HTTPACTION: 0,200,1000 //GET successfully
AT+HTTPREAD //Read the response of HTTP server
+HTTPREAD: 1000 //Output the data to UART
….
OK
AT+HTTPTERM //Terminate HTTP service
OK

3.7 Set HTTP Download Break Point Parameter

It provides the method to use HTTP broken download resuming function..

// use HTTP broken download


//Init HTTP service
AT+HTTPINIT
OK
AT+HTTPPARA="CID",1 //Set parameters for HTTP session
OK
AT+HTTPPARA="URL","HTTP://www //Set the URL, the size of gif is 16384 bytes
.sim.com/img/sim_logo_jr_1003_38.
gif"
OK
AT+HTTPPARA="BREAK",2000 //Set the break point
OK
AT+HTTPACTION=0 //GET session start, get data from 2000 to 16384
OK
+HTTPACTION: 0,200,14384 //GET successfully
AT+HTTPREAD //Read the data of HTTP server
+HTTPREAD: 14384 //Output the data to UART
….
OK
AT+HTTPTERM //Terminate HTTP service
OK

www.simcom.com 11 / 24
SIM800 Series_IP_Application Note_V1.05

3.8 Get HTTP Current Status

//get http current status


//Init HTTP service
AT+HTTPINIT
OK
AT+HTTPPARA="CID",1 //Set parameters for HTTP session
OK
AT+HTTPPARA="URL","www.baidu //Set the URL
.com"
OK
AT+HTTPACTION=0 //Get session start
OK
AT+HTTPSTATUS? //The status of getting session is in progress
+HTTPSTATUS: GET,1,1440,7915

OK
+HTTPACTION: 0,200,9335 //GET successfully
AT+HTTPSTATUS? //The status of getting session is over
+HTTPSTATUS: GET,0,0,0

OK
AT+HTTPACTION=1 //POST session start
OK
AT+HTTPSTATUS? //The status of posting session is in progress
+HTTPSTATUS: POST,2,1440,608

OK //POST successfully
+HTTPACTION: 1,200,0
AT+HTTPSTATUS? //The status of posting session is over
+HTTPSTATUS: POST,0,0,0

OK
AT+HTTPTERM //Terminate HTTP service
OK

3.9 Show HTTP Header Information

//show http header information


//Init HTTP service
AT+HTTPINIT
OK

www.simcom.com 12 / 24
SIM800 Series_IP_Application Note_V1.05

AT+HTTPPARA="CID",1 //Set parameters for HTTP session


OK
AT+HTTPPARA="URL","www.baidu //Set the URL
.com"
OK
AT+HTTPGETHEAD=1 //Set option
OK
AT+HTTPACTION=2 //HEAD session start
OK
+HTTPACTION: 2,200,9335 //HEAD successfully
AT+HTTPREAD //Read the information of HTTP Header
+HTTPREAD: 9335
….
OK
AT+HTTPTERM //Terminate HTTP service
OK

3.10 FTP GET Method

Download data from FTP server

// Download data from FTP server


//Set parameters for FTP session.
AT+FTPCID=1
OK
AT+FTPSERV="116.228.221.52"
OK
AT+FTPUN="sim.cs1"
OK
AT+FTPPW="******"
OK
AT+FTPGETNAME="1K.txt"
OK
AT+FTPGETPATH="/"
OK
AT+FTPGET=1 //Open the FTP get session.
OK
+FTPGET: 1,1 //Data are available.
AT+FTPGET=2,1024 //Request to read 1024 bytes, but
+FTPGET: 2,50 Only 50 bytes are now available.
012345678901234567890123456789
01234567890123456789
OK

www.simcom.com 13 / 24
SIM800 Series_IP_Application Note_V1.05

AT+FTPGET=2,1024 //Request to read 1024 bytes again.


+FTPGET: 2,0 No byte is now available, but it is not the end of session.

OK //If the module receives data but user do not input


+FTPGET: 1,1 "AT+FTPGET: 2,<reqlength>" to read data, "+FTPGET: 1,1"
will be shown again in a certain time.
AT+FTPGET=2,1024 Request to read 1024 bytes.
+FTPGET: 2,1024 1024 bytes are now available.
012345678901234567890123456789
012345678901234567890…..1234
OK //Data transfer finished. The connection to the FTP server is
+FTPGET:1,0 closed.

3.11 FTP PUT Method

Upload data to FTP server.

// Upload data to FTP server


//Set parameters for FTP session.
AT+FTPCID=1
OK
AT+FTPSERV="116.228.221.52"
OK
AT+FTPUN="sim.cs1"
OK
AT+FTPPW="******"
OK
AT+FTPPUTNAME="1K.txt"
OK
AT+FTPPUTPATH="/"
OK
AT+FTPPUT=1 //Open the FTP put session.
OK
+FTPPUT: 1,1,1360 //FTP session is ready for uploading. 1360 is the max length of
data which can be sent at a time. It depends on the network
status.
AT+FTPPUT=2,100 //Client requests to send 100 bytes.
+FTPPUT: 2,100 //Response indicates that user must input 100 bytes for
transferring now.
…… //It is ready to receive data from UART, and DCD has been set
to low.
OK //All data has been received over, and DCD is set to high.
URC indicates that the FTP session is ready to transfer more
+FTPPUT: 1,1,1360 data.

www.simcom.com 14 / 24
SIM800 Series_IP_Application Note_V1.05

AT+FTPPUT=2,0 //No more data will be uploaded, the FTP session will be
OK closed
+FTPPUT: 1,0 //Data transfer is finished. The connection to the FTP server is
closed..

During FTP session, different failure may occur because of bad network environment or other reasons.
Some common failure includes timeout failure and wrong password failure.

3.12 FTP Time out

Time out occurs during FTP session because of different reasons.

//ftp time out


//Open the FTP Get session.
AT+FTPGET=1
OK //If the status of the network is poor, it may be time out.
+FTPGET: 1,64 //The connection to the FTP server is closed.
AT+FTPGET=1 //Open the FTP Get session.
OK
+FTPGET: 1,1 //Data are available.
+FTPGET: 1,1 //If customer does not use "AT+FTPGET: 2,<reqlength>" to
…….. read data, "+FTPGET: 1,1" will be shown again in a certain
+FTPGET: 1,1 time.
+FTPGET: 1,64 //If the user does not read data for a long time, the session will
time out. The connection to the FTP server is closed.

3.13 FTP Error

Error occurs during FTP applications because of wrong parameter setting

//ftp error
//Set wrong password
AT+FTPPW="3214567"
OK
AT+FTPGET=1 //Open the FTP Get session
OK //FTP session password error. The connection to the FTP
+FTPGET: 1,72 server is closed.

www.simcom.com 15 / 24
SIM800 Series_IP_Application Note_V1.05

3.14 FTP Operation Error

Error occurs during FTP applications because of wrong operating.

//ftp operation error


AT+FTPGET=1 //Open the FTP Get session.
OK //The parameter of "get file name" is empty. It shows ftp
+FTPGET: 1,64 operation error.
AT+FTPPUT=1 //Open the FTP PUT session.
OK
AT+FTPPUT=1 //Open the FTP PUT session again. Show ftp operation error.
OK

+FTPPUT: 1,66

3.15 FTP READ and WRITE Error

Error occurs before FTP applications because of operating in wrong state.

//ftp read and write error


//Open the FTP Get session.
AT+FTPGET=1
OK
AT+FTPGET=2,1000 //Read data before "+FTPGET: 1,1" is shown.
ERROR
+FTPGET: 1,1 //Data are available
AT+FTPGET=2,1000 //Read data after "+FTPGET: 1,1" is shown.
+FTPGET: 2,50
012345678901234567890123456789
01234567890123456789
OK //Data transfer finished. The connection to the FTP server is
+FTPGET: 1,0 closed.
AT+FTPGET=2,1000 //Read data after FTP session is stopped.
ERROR
AT+FTPPUT=1 //Open the FTP PUT session.
OK
AT+FTPPUT=2,1000 //Write data before "+FTPPUT: 1,1,1360" is shown.
ERROR
+FTPPUT: 1,1,1360 //FTP session is ready for uploading.
AT+FTPPUT=2,100 //Write data after "+FTPPUT: 1,1,1360" is shown.
+FTPPUT: 2,100
……
OK

www.simcom.com 16 / 24
SIM800 Series_IP_Application Note_V1.05

AT+FTPPUT=2,0 //No more data will be uploaded, the FTP session will be
OK closed.
AT+FTPPUT=2,100 //Write data after FTP session is stopped.
ERROR

3.16 Set FTP Download Break Point Parameter

It provides the method to use FTP broken download resuming function

//Set ftp download break


//Open the FTP Get session.
AT+FTPGET=1
OK /Data are available.
+FTPGET: 1,1
AT+FTPGET=2,1024 /Get data of FTP server.
+FTPGET: 2,29
wodeceshijieguo,zhgeshigeshia
OK //Data transfer finished. The connection to the FTP server is
+FTPGET: 1,0 closed.
AT+FTPREST=20 //Set the broken point.
OK
AT+FTPGET=1 //Open the FTP Get session.
OK
+FTPGET: 1,1 //Data are available.
AT+FTPGET=2,1024 //Get the data begin from the broken point.
+FTPGET: 2,9
shigeshia
OK //Data transfer is finished. The connection to the FTP server is
+FTPGET: 1,0 closed.

3.17 FTP DELE Method

Delete the specified file in FTP server.

// Delete the specified file in FTP


AT+FTPCID=1
//Set parameters for FTP session.
OK
AT+FTPSERV="116.228.221.52"
OK
AT+FTPUN="sim.cs1"
OK

www.simcom.com 17 / 24
SIM800 Series_IP_Application Note_V1.05

AT+FTPPW="******"
OK
AT+FTPGETNAME="1K.txt"
OK
AT+FTPGETPATH="/"
OK
AT+FTPDELE //Open the FTP DELE session.
OK
+FTPDELE: 1,0 //Delete file finished. The connection to the FTP server is
closed.

3.18 FTP SIZE Method

Get the size of specified file in FTP server.

// Get the size of specified file


//Set parameters for FTP session.
AT+FTPCID=1
OK
AT+FTPSERV="116.228.221.52"
OK
AT+FTPUN="sim.cs1"
OK
AT+FTPPW="******"
OK
AT+FTPGETNAME="1K.txt"
OK
AT+FTPGETPATH="/"
OK
AT+FTPSIZE //Open the FTP SIZE session.
OK
+FTPSIZE: 1,0,1024 //Get the size of file finished. The connection to the FTP server
is closed.

3.19 FTP MKD and RMD Method

Make and remove directory on the remote machine.

// Make and remove directory


//Set parameters for FTP session.
AT+FTPCID=1
OK

www.simcom.com 18 / 24
SIM800 Series_IP_Application Note_V1.05

AT+FTPSERV="116.228.221.52"
OK
AT+FTPUN="sim.cs1"
OK
AT+FTPPW="******"
OK
AT+FTPGETPATH="/test"
OK
AT+FTPMKD //Open the FTP session.
OK
+FTPMKD: 1,0 //The directory "test" is made on the remote machine
AT+FTPRMD //Open the FTP session
OK
+FTPRMD: 1,0 //The directory "test" is removed from the remote machine

3.20 FTP LIST Session

List contents of remote directory.

// List contents of remote directory.


//Set parameters for FTP session.
AT+FTPCID=1
OK
AT+FTPSERV="116.228.221.52"
OK
AT+FTPUN="sim.cs1"
OK
AT+FTPPW="******"
OK
AT+FTPGETNAME="1K.txt"
OK
AT+FTPGETPATH="/"
OK
AT+FTPLIST=1 //Open the FTP session.
OK
+FTPLIST: 1,1 //Data are available
AT+FTPLIST=2,1024 //Request to read 1024 bytes, but only 126 bytes are now
+FTPLIST: 2,126 available
total 0
drw-rw-rw- 1 user group 0
Oct 12 14:58.
drw-rw-rw- 1 user group 0 Oct
12 14:58…

www.simcom.com 19 / 24
SIM800 Series_IP_Application Note_V1.05

OK
+FTPLIST: 1,0 //Data transfer finished. The connection to the remote machine
is closed

3.21 FTP Extend PUT Method

Extend Upload data to the remote machine.

// Extend Upload data


//Set parameters for FTP session.
AT+FTPCID=1
OK
AT+FTPSERV="116.228.221.52"
OK
AT+FTPUN="sim.cs1"
OK
AT+FTPPW="******"
OK
AT+FTPPUTNAME="1K.txt"
OK
AT+FTPPUTPATH="/"
OK
AT+FTPEXTPUT=1 //Open the FTP session.
OK
AT+FTPEXTPUT=2,0,1024,10000 //Client requests to send 1024 bytes.
+FTPEXTPUT: 0,1024 //Response indicates that user must input 1024 bytes for
transferring. It is saved in the module.
…… //It is ready to receive data from UART, and DCD has been set
to low.
OK //All data has been received over, and DCD is set to high.
AT+FTPPUT=1 //Open the FTP PUT session. Waiting for the module to upload
OK the data to the remote machine.
//Data transfer finished. The connection to the remote machine
+FTPPUT: 1,0 is closed
AT+FTPEXTPUT=0 //Set FTP to normal put method
OK

3.22 FTPGETTOFS Method

Download file and save in file system.

www.simcom.com 20 / 24
SIM800 Series_IP_Application Note_V1.05

//Download file and save in file system


//Set parameters for FTP session.
AT+FTPCID=1
OK
AT+FTPSERV="116.228.221.52"
OK
AT+FTPUN="sim.cs1"
OK
AT+FTPPW="******"
OK
AT+FTPGETNAME="test.txt"
OK
AT+FTPGETPATH="/"
OK
AT+FTPGETTOFS=0,"test.txt" //Open the FTP session.
OK
AT+FTPGETTOFS? //Query progress of FTP session
+FTPGETTOFS: 1,174125,163900 //FTP session running, 174125 bytes data has been download,
163900 bytes data has been saved in file system.
OK
+FTPGETTOFS: 0,174125 //File download succeed. Use file system commands to read or
write file.

3.23 FTPPUTFRMFS Method

Upload file from file system

// Upload file from file system


//Set parameters for FTP session.
AT+FTPCID=1
OK
AT+FTPSERV="116.228.221.52"
OK
AT+FTPUN="sim.cs1"
OK
AT+FTPPW="******"
OK
AT+FTPPUTNAME="test.txt"
OK
AT+FTPPUTPATH="/"
OK
AT+FTPPUTFRMFS="c:\user\ftp\tes //Open the FTP session.
t.txt"
OK

www.simcom.com 21 / 24
SIM800 Series_IP_Application Note_V1.05

AT+FTPPUTFRMFS? //Query progress of FTP session


+FTPPUTFRMFS: 1,68160 //FTP session running, 68160 bytes data has been upload.

OK //File upload succeed. Total 174125 bytes data has been


+FTPPUTFRMFS: 0,174125 upload.

3.24 FTPEXTGET Method

Extend Download File

// Extend Download File


//Set parameters for FTP session.
AT+FTPCID=1
OK
AT+FTPSERV="116.228.221.52"
OK
AT+FTPUN="sim.cs1"
OK
AT+FTPPW="******"
OK
AT+FTPGETNAME="test.txt"
OK
AT+FTPGETPATH="/"
OK
AT+FTPEXTGET=1 //Open the FTP session.
OK
AT+FTPEXTGET? //Query progress of FTP session
+FTPEXTGET: 1,64136 //FTP session running, 64136 bytes data has been download.

OK
+FTPEXTGET: 1,0 //File download succeed.
AT+FTPEXTGET=2,"test.txt" //Save download data to "c:\user\ftp\test.txt"
+FTPEXTGET: 2,174125 //Save success, 174125 bytes saved

OK
AT+FTPEXTGET=3,0,174125 //Output receive data from position 0, length 174125
+FTPEXTGET: 3,174125
…… //Output data
OK //Finish output
AT+FTPEXTGET=0 //End FTPEXTGET.
OK

www.simcom.com 22 / 24
SIM800 Series_IP_Application Note_V1.05

3.25 FTPFILEPUT Method

Load file in RAM from file system then upload with FTPPUT

// Load file in RAM //Set parameters for FTP session.

AT+FTPCID=1
OK
AT+FTPSERV="116.228.221.52"
OK
AT+FTPUN="sim.cs1"
OK
AT+FTPPW="******"
OK
AT+FTPPUTNAME="test.txt"
OK
AT+FTPPUTPATH="/"
OK
AT+FTPFILEPUT=1,"c:\user\ftp\test //Load file to RAM
.txt"
OK
AT+FTPPUT=1 //Start FTP session
OK
+FTPPUT: 1,0 //File upload succeed.
AT+FTPFILEPUT=0 //End FTPFILEPUT
OK

3.26 HTTP Redirection Parameter

Quit current FTP session


.
//Quit current FTP session
//Set parameters for FTP session.
AT+FTPCID=1
OK
AT+FTPSERV="116.228.221.52"
OK
AT+FTPUN="sim.cs1"
OK
AT+FTPPW="******"
OK
AT+FTPGETNAME="1K.txt"
OK

www.simcom.com 23 / 24
SIM800 Series_IP_Application Note_V1.05

AT+FTPGETPATH="/"
OK
AT+FTPGET=1 //Open the FTP session.
OK
AT+FTPQUIT //Quit FTP session
OK
+FTPGET: 1,86 //Manual quit FTP session

www.simcom.com 24 / 24

You might also like