Appendix B – Detailed Examples
Multi-Tech Systems, Inc. AT Commands for Wireless Modems with IP Connectivity (S000333D)
73
Downloading an FTP File
This example covers the following: Downloading a file from a remote FTP server.
Configuration:
FTP server
address
Defines the address of the remote FTP server.
AT#FTPSERV
FTP client
authentication
Defines the login / password required to access the FTP server.
AT#FTPUN, FTPPW
FTP file path and
name
Prior to instructing the modem to retrieve a file from a FTP server, it is necessary to specify the
path and the name of the relevant file to download.
AT#FTPGETPATH, FTPGETFILENAME
FTP server ports
For some installations (due to specific firewall, proxy or router configurations) the TCP control port
number used by the remote FTP server may need to be changed.
In most of the cases this is not necessary and the default value for the FTP control port is 21.
AT#FTPPORT
Operation:
Launching the
download
Once an IP link is established, this command instructs the modem to logon to the remote FTP
server and then to start the download of the specified file by issuing a standard GET command.
AT#FTPGET
Data flow
The modem response code ‘Ok_Info_DataBegin’ indicates to the attached equipment that the data
connection is about to be opened for transmitting the file. Then, all of the file data received from
the connection is sent over the serial port without echo.
The [ETX] character is sent by the modem over the serial port to indicate that the data connection
is closed (meaning the file transfer is completed or has been interrupted). As a consequence an
[ETX] character received in the TCP payload data will be transmitted on the serial port as a
[DLE][ETX] and a [DLE] as a [DLE][DLE].
It is the attached host’s responsibility to decode the received data.
End of download
The modem indicates the closing of the data connection by sending an [ETX] character which is
echoed. The response message that follows the data transfer, sent by the modem, signals
whether the file has been successfully received or not.
Other AT# Parameters:
FTPSERV, FTPUN, FTPPW, FTPGETPATH, FTPGETFILENAME, FTPPORT
Other AT# Commands:
FTPGET