Technical information
Chapter 1: Product Features
August 5, 2008 AT Commands Reference Manual 1-11
Manage FTP Connection
AT+FTPOPEN command is used to open a FTP connection with a remote FTP server. When
G24 performs FTP connection establish procedure, it allocates two TCP sockets. One of them is
used for FTP control channel, the other - for FTP data channel (listen mode). FTP control channel
port has default identification number (ID) - 21 for source (client) and destination (server) sides,
but the user is able to configure control channel port ID for client as well as for server by passing
new source control port and/or new destination control port id as AT+FTPOPEN command
optional parameters. This is applicable when a remote FTP server is able to accept FTP
connection over non-standard (other then 21) ports. FTP data channel port has a default
identification number (ID) - 20 for source (client) side, but the user is able to configure data
channel port id by passing a new source data port id as AT+FTPOPEN command optional
parameter. This is applicable when the remote FTP server is unable to establish data connection to
some port IDs. The following example show how to use AT+FTPOPEN command in various
situations.
• To open a FTP connection with a remote FTP server, use the following settings:
AT+FTPOPEN = "someftpsite.com","anonymous","qwerty@somemail.com",,,,
• To open a FTP connection with a remote FTP server, use the same mandatory settings, but
customize source control and data ports id:
AT+FTPOPEN = "someftpsite.com","anonymous","qwerty@somemail.com",,1300,,1302
When FTP connection is establish, G24 remains in command mode. This mode is used for
performing most of the FTP AT commands. Only AT+FTPLIST, AT+FTPSTOR and
AT+FTPRETR commands switch G24 to online data mode. Generally, G24 returns to command
mode after the data mode caused command execution is finished, but the user is able to interrupt
online data mode (and close actual FTP connection) by changing the DTR line status from ON to
OFF, when AT&D settings = 2 or 3.
destination URL = someftpsite.com (mandatory)
user = anonymous (mandatory)
password = qwerty@email.com (mandatory)
account = "" (optional, default value)
source control port id = 21 (optional, default value)
destination control port id = 21 (optional, default value)
source data port id = 20 (optional, default value)
source control port id = 1300 (optional, custom value)
destination control port id = 21 (optional, default value)
source data port id = 1302 (optional, custom value)