Technical Information MOTOROLA G24 DEVELOPER’S GUIDE U SING FTP Title Page ENGLISH JULY 15, 2007 NA WITH G24
SPECIFICATIONS SUBJECT TO CHANGE WITHOUT NOTICE Notice While reasonable efforts have been made to assure the accuracy of this document, Motorola, Inc. assumes no liability resulting from any inaccuracies or omissions in this document, or from use of the information obtained herein. The information in this document has been carefully checked and is believed to be entirely reliable. However, no responsibility is assumed for inaccuracies or omissions. Motorola, Inc.
Trademarks MOTOROLA and the Stylized M Logo are registered in the US Patent & Trademark Office. All other product or service names are the property of their respective owners. ©Copyright 2007 Motorola, Inc.
Table of Contents Manual Scope . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . iii Target Audience . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . iii Manual Organization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . iii Applicable Documents . . . . . . . . . . . .
Table of Contents Chapter 2: ii AT Commands Reference for FTP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-1 FTP AT Commands Alphabetical Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-1 FTP (File Transfer Protocol) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-3 Session Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Preface Manual Scope This manual introduces the G24 AT commands, and describes how software developers can use these commands to communicate with the G24 device, and to create software applications that communicate with the G24 using these commands. Note: The integrator should read the corresponding SW release notes for the G24 version he is using to get information about differences from this manual.
Text Conventions M2M.CustomerCare@motorola.com Motorola appreciates feedback from the users of our information. Text Conventions The following special paragraphs are used in this guide to point out information that must be read. This information may be set-off from the surrounding text, but is always preceded by a bold title in capital letters: Note Note: Presents additional, helpful, noncritical information that you can use.
Preface General Safety Remember!. . . safety depends on you! The following general safety precautions must be observed during all phases of operation, service, and repair of the equipment described in this manual. Failure to comply with these precautions or with specific warnings elsewhere in this manual violates safety standards of design, manufacture, and intended use of the equipment. Motorola, Inc. assumes no liability for the customer’s failure to comply with these requirements.
Caring for the Environment Do not substitute parts or modify equipment Because of the danger of introducing additional hazards, do not install substitute parts or perform any unauthorized modification of equipment. Contact Motorola Warranty and Repair for service and repair to ensure that safety features are maintained. Dangerous procedure warnings Warnings, such as the example below, precede potentially dangerous procedures throughout this manual. Instructions contained in the warnings must be followed.
Preface Disposal of Motorola equipment in non-EU countries In non-EU countries, dispose of Motorola Networks equipment in accordance with national and regional regulations.
How to Get Warranty Service? have had of the Product since it was delivered. This warranty will expire at the end of the Warranty Term. This is the complete and exclusive warranty for a Motorola OEM module and accessories and in lieu of all other warranties, terms and conditions, whether express or implied. Where you purchase the product other than as a consumer, Motorola disclaims all other warranties, terms and conditions express or implied, such as fitness for purpose and satisfactory quality.
Preface Conditions This warranty will not apply if the type or serial numbers on the Product has been altered, deleted, duplicated, removed, or made illegible. Motorola reserves the right to refuse free-of-charge warranty service if the requested documentation can not be presented or if the information is incomplete, illegible or incompatible with the factory records.
Installed Data 9. All plastic surfaces and all other externally exposed parts that are scratched or damaged due to customer normal use. Depending on operating conditions and your usage habits, wear and tear might take place of components including mechanical problems related to Product housing, paint, assembly, subassemblies, displays and keyboards and any accessories which are not part of the Product's in-box configuration.
Preface Revision History Manual Number NA Manual Title Using FTP with G24 Version Information The following table lists the manual version, date of version, and remarks about the version.
Chapter 1: Using FTP with G24 FTP Connection Overview G24 implements FTP connection feature, based on RFC959 standard, and operates as a FTP client. When connected to a remote FTP server, G24 is able to receive information about remote file system, manage it and perform files transfer operations. 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.
FTP Connection • To open a FTP connection with a remote FTP server, use the same mandatory settings, but customize source control and data ports id: source control port id = 1300 (optional, custom value) destination control port id = 21 (optional, default value) source data port id = 1302 (optional, custom value) AT+FTPOPEN = "someftpsite.com","anonymous","qwerty@somemail.com",,1300,,1302 When FTP connection establish, G24 remains in command mode.
Chapter1: File Transfer Operations The file transfer operation allows the user to transfer a file over an established FTP connection. To avoid end-of-file detection problem for user in download case and for G24 in upload case, G24 implements a special format of transferred files over FTP connection. The format proposed "escaping" one of ASCII symbols from file context and using the "escaped" symbol as end-of-file marker. An escaping algorithm described below.
FTP Connection Interaction with Other MIP Commands Interaction with +MIPODM Command The external ODM session is prohibit when FTP feature executed, because FTP feature data connection based on socket, opened for ODM (internal ODM session), so when G24 receives +MIPODM command within FTP connection, the error code: 302 (FTP session is active) returns to user.
Chapter 2: AT Commands Reference for FTP FTP AT Commands Alphabetical Summary The following table contains an alphabetical list of all the G24 FTP AT commands. Table 2-1: FTP AT Commands (Alphabetical) AT Command July 15, 2007 Description Page +FTPCDUP This command causes the G24 to request the remote FTP server to change the working directory up. Page 2-12 +FTPCLOSE This command causes G24 to close FTP connection.
FTP AT Commands Alphabetical Summary Table 2-1: FTP AT Commands (Alphabetical) (Cont.) AT Command 2-2 Description Page +FTPREN This command causes the G24 to request the remote FTP server to rename a file. Page 2-13 +FTPRETR This command causes the G24 to request the remote FTP server to send a file to the G24. Page 2-21 +FTPRMD This command causes the G24 to request the remote FTP server to remove a directory.
Chapter 2: AT Commands Reference for FTP FTP (File Transfer Protocol) Session Commands +FTPOPEN, Open FTP Connection Between G24 (FTP client) and Remote FTP Server This command causes G24 to open a FTP connection with a remote FTP server, based on given parameters. Notes: • Only one FTP connection can be in progress at the same time. • FTP connection is based on two TCP sockets: one of them configured for Online Data Mode.
FTP (File Transfer Protocol) The following table shows the +FTPOPEN parameters. Table 2-2: +FTPOPEN Parameters Description Range IP address in dotted decimal notation form: XXX.XXX.XXX.XXX. destination_ip/url1 IP or URL of remote FTP site. username2 Username for FTP login procedure. ASCII chars, max length is 255 octets. password3 Password for FTP login procedure. ASCII chars, max length is 255 octets. account4 User Account for FTP login procedure.
Chapter 2: AT Commands Reference for FTP Example The first example illustrates FTP connection open success case. AT+FTPOPEN="someftpsite.com","anonymous","qwerty@somemail.com",,,, OK +FTPOPEN: 1 The second example illustrates FTP connection open error case, because another FTP connection is already opens. The AT+CMEE=2 command enables verbose error report. AT+CMEE=2 OK AT+FTPOPEN="someftpsite.com","anonymous","qwerty@somemail.com",,,, OK +FTPOPEN: 1 AT+FTPOPEN="anotherftpsite.
FTP (File Transfer Protocol) AT+CMEE=2 OK AT+FTPCLOSE +CME ERROR: FTP session is inactive +FTPINFO, FTP Unsolicited Indication Enable/Disable This command causes the G24 to enable or disable FTP unsolicited indication to the user. FTP unsolicited indication is used for debugging the FTP session and, when the indication is enabled, the G24 will show to user all FTP commands, send to remote site and all FTP responses received from the remote side.
Chapter 2: AT Commands Reference for FTP Example The example illustrates FTP connection open success case, when FTP unsolicited indication is enabled. AT+FTPINFO=1 OK AT+FTPOPEN="someftpsite.com","anonymous","qwerty@somemail.com",,,, OK +FTPINFO: 220+FTPINFO: 220-Welcome to someftpsite.com! +FTPINFO: 220+FTPINFO: 220 someftpsite.com FTP server (SecureMb FTP Version 1.0) ready. +FTPINFO: USER anonymous +FTPINFO: 331 Guest login ok, send your complete e-mail address as password.
FTP (File Transfer Protocol) The following table shows the +FTPCWD parameters. Table 2-4: +FTPCWD Parameters Directory name Description Name of directory to be changed on the remote side. Range String, max length is 255 octets. Example The first example illustrates change in working directory success case. AT+FTPCWD="data" OK +FTPCWD: 1 The second example illustrates change working directory fail case; because the given directory name was not found on the remote server.
Chapter 2: AT Commands Reference for FTP +FTPMKD, Make Directory This command causes the G24 to request the remote FTP server to create a new directory in accordance to a given name. Command Type Set Syntax Response/Action +FTPMKD= OK +FTPMKD: Remarks parameter consists of the directory name as well as the directory path (optional).
FTP (File Transfer Protocol) +FTPRMD, Remove Directory This command causes the G24 to request the remote FTP server to remove a directory in accordance to a given name. Command Type Set Syntax Response/Action +FTPRMD= OK +FTPRMD: Remarks parameter consists of the directory name as well as the directory path (optional).
Chapter 2: AT Commands Reference for FTP +FTPINFO: 550 1: No such file or directory. +FTPRMD: 0 +FTPPWD, Print Working Directory This command causes G24 to request the remote FTP server to return the working directory name. Command Type Set Syntax +FTPPWD Response/Action Remarks OK ... +FTPPWD: [,] parameter consists of the directory name as well as the directory path (optional).
FTP (File Transfer Protocol) +FTPCDUP, Change Directory Up This command causes the G24 to request the remote FTP server to change the working directory up. Command Type Set Syntax +FTPCDUP Response/Action OK ...
Chapter 2: AT Commands Reference for FTP The following table shows the +FTPDEL parameters. Table 2-7: +FTPDEL Parameters Description File name Name of file to be deleted on the remote side. Range String, max length is 255 octets. Example The example illustrates delete file success case. AT+FTPDEL="somefile" OK +FTPDEL: 1 +FTPREN, Rename File This command causes the G24 to request the remote FTP server to rename a file, in accordance to given parameters.
FTP (File Transfer Protocol) The following table shows the +FTPREN parameters. Table 2-8: +FTPREN Parameters Description Range File name from Old name of file to be renamed on the remote side. String, max length is 255 octets. File name to New name of file to be renamed on the remote side. String, max length is 255 octets. Example The first example illustrates rename file success case. AT+FTPREN="somefile.name","anotherfile.
Chapter 2: AT Commands Reference for FTP +FTPLIST, Request List This command causes the G24 to request the remote FTP server to send a list, in accordance to a given parameter. Command Type Set Syntax Response/Action +FTPLIST [=] Remarks OK ... +FTPLIST: ... +FTPLIST: Parameter consists of the file/directory name as well as the file/directory path (optional).
FTP (File Transfer Protocol) +FTPLIST: 1 The second example illustrates get list for all files success case. AT+FTPLIST="*.*" OK +FTPLIST: 2 -rw-rw-r-- 1 1001 129886 Mar 23 06:20 somefile1.name -rw-rw-r-- 1 1001 4968 Jan 8 07:57 somefile2.name -rw-rw-r-- 1 1001 23948 Jan 8 07:32 somefile3.name -rw-rw-r-- 1 1001 0 Feb 7 01:56 somefile4.name -rw-rw-r-- 1 1001 204673 Jan 10 02:28 somefile5.name -rw-rw-r-- 1 1001 9348 Jul 19 2006 somefile6.
Chapter 2: AT Commands Reference for FTP The following table shows the +FTPSTAT parameters. Table 2-10: +FTPSTAT Parameters Description File/directory name Name of file or directory on the remote side for status request. Range String, max length is 255 octets. Example When the user enters +FTPSTAT command without parameters, the last requested status within actual FTP connection returns.
FTP (File Transfer Protocol) The fourth example illustrates using +FTPSTAT command with a parameter containing an illegal file name. In this case, the remote server returns error and FTP connection is closed by the remote side. AT+FTPSTAT="." OK +FTPSTAT: 0 +FTPCLOSE: 1 The fifth example illustrates using +FTPSTAT command for receiving the status of all files in the actual working directory. AT+FTPSTAT="*.
Chapter 2: AT Commands Reference for FTP Example The example illustrates the command execution. AT+FTPSYST OK +FTPSYST: 2, UNIX Type: L8 +FTPSYST: 1 +FTPNOOP, No Operation This command causes the G24 to request the remote FTP server to do nothing (possible use for PING). Command Type Set Syntax +FTPNOOP Response/Action OK ...
FTP (File Transfer Protocol) +FTPSTOR, Store File On Remote FTP Server This command causes the G24 to request the remote FTP server to store a file, sent by the G24. Command Type Set Syntax Response/Action +FTPSTOR=, [] Remarks OK ... +FTPSTOR: parameter consists of the file name as well as the file path (optional). or parameter is optional. Default value is 1 (binary).
Chapter 2: AT Commands Reference for FTP Example The example illustrates the command execution. Requested file type is binary. AT+FTPSTOR="somefile.name",1 +FTPSTOR: 2 The user sends a file with here +FTPSTOR: 1 +FTPRETR, Retrieve a File From a Remote FTP Server This command causes the G24 to request the remote FTP server to send a file to the G24. Command Type Set Syntax +FTPRETR=, [] Response/Action Remarks OK ...
FTP (File Transfer Protocol) The following table shows the +FTPRETR parameters. Table 2-12: +FTPRETR Parameters Description Range File name Name of file to be retrieved from the remote side. String, max length is 255 octets. File type Type of file (ASCII or Binary). Numeric, in the range of 0-1 (0 = ASCII, 1 = Binary). Example The example illustrates the command execution. Requested file type is binary. AT+FTPRETR="somefile.name",1 +FTPRETR: 2 .... .... ....
Back Page (Bar Code) MOTOROLA and the Stylized M Logo are registered in the US Patent & Trademark Office. All other product or service names are the property of their respective owners. ©Copyright 2007 Motorola, Inc. Java™ Technology and/or J2ME™ : Java and all other Java–based marks are trademarks or registered trademarks of Sun Microsystems, Inc. in the U.S. and other countries. UNIX® : UNIX is a registered trademark of The Open Group in the United States and other countries.