Appendix B – Detailed Examples
Multi-Tech Systems, Inc. AT Commands for Wireless Modems with IP Connectivity (S000333D)
75
Uploading an FTP File
This example covers the following: Uploading a file to 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 put a file onto the FTP server, it is necessary to specify the path
and the name of the file that will be created on the remote server.
AT#FTPPUTPATH, FTPPUTFILENAME
FTP file type
This parameter defines if the file is sent in ASCII (A) or binary mode (I).
When set to ASCII all the data sent by the modem to the FTP server is made of 7 bits characters
(NVT-ASCII: the MSB is set to 0). As a consequence binary data containing 8 bits characters will
be corrupted during the transfer if the FTPTYPE is set to ASCII.
AT#FTPTYPE
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:
Starting the upload Once an IP link is established, this command directs the modem to logon to the remote FTP server
and then to start the upload of the specified file by issuing a standard PUT command.
AT#FTPPUT
Data flow
The modem returns the ‘Ok_Info_WaitingForData’ message for indicating to the attached host that
the data connection has been opened for transmitting the file. Then, all the data received from the
serial port is sent during the data connection session without echo.
The [ETX] character is sent by the attached host and echoed to notify that the data connection is
closed (meaning the host has completed the file transfer). As a consequence, an [ETX] character
to be sent within the file must be transmitted on the serial port as a [DLE][ETX] and a [DLE] as a
[DLE][DLE]. The modem then decodes the data received on the serial port and sends [ETX] or
[DLE] in the payload data.
Stopping the
upload
The attached host can stop the transfer by sending an [ETX] character. This character is echoed.
Stopping the
upload
The attached host can stop the transfer by sending an [ETX] character. This character is echoed.
[ETX] CTRL+C sequence in a keyboard.
End of upload
The host indicates to the modem 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, signal whether the file
has been successfully received or not : ‘OK’ or ‘#CME ERROR: Value’
Note:
The user rights for over-writing an existing file in a FTP server depends on the FTP server’s configuration and if
incorrectly set can result in failure of the FTP attempt.
Other AT# Parameters:
FTPSERV, FTPUN, FTPPW, FTPPUTPATH, FTPPUTFILENAME, FTPTYPE, FTPPORT
Other AT# Commands:
FTPPUT