logo资料库

移远EC20 TCP/IP AT指令.pdf

第1页 / 共44页
第2页 / 共44页
第3页 / 共44页
第4页 / 共44页
第5页 / 共44页
第6页 / 共44页
第7页 / 共44页
第8页 / 共44页
资料共44页,剩余部分请下载后查看
About the Document
Contents
Table Index
1 Introduction
1.1. The Process of Using TCP/IP AT Commands
1.2. Description of Data Access Modes
2 Description of TCP/IP AT Commands
2.1. Description of AT Commands
2.1.1. AT+QICSGP Configure Parameters of a TCP/IP Context
2.1.2. AT+QIACT Activate a PDP Context
2.1.3. AT+QIDEACT Deactivate a PDP Context
2.1.4. AT+QIOPEN Open a Socket Service
2.1.5. AT+QICLOSE Close a Socket Service
2.1.6. AT+QISTATE Query Socket Service Status
2.1.7. AT+QISEND Send Data
2.1.8. AT+QIRD Retrieve the Received TCP/IP Data
2.1.9. AT+QISENDEX Send Hex String
2.1.10. AT+QISWTMD Switch Data Access Modes
2.1.11. AT+QPING Ping a Remote Server
2.1.12. AT+QNTP Synchronize Local Time with NTP Server
2.1.13. AT+QIDNSCFG Configure Address of DNS Server
2.1.14. AT+QIDNSGIP Get IP Address by Domain Name
2.1.15. AT+QICFG Configure Optional Parameters
2.1.16. AT+QISDE Control Whether to Echo the Data for AT+QISEND
2.1.17. AT+QIGETERROR Query the Last Error Code
2.2. Description of URC
2.2.1. URC of Connection Closed
2.2.2. URC of Incoming Data
2.2.3. URC of Incoming Connection Full
2.2.4. URC of Incoming Connection
2.2.5. URC of PDP Deactivation
3 Examples
3.1. Configure and Activate a Context
3.1.1. Configure a Context
3.1.2. Activate a Context
3.1.3. Deactivate a Context
3.2. TCP Client Works in Buffer Access Mode
3.2.1. Set up a TCP Client Connection and Enter into Buffer Access Mode
3.2.2. Send Data in Buffer Access Mode
3.2.3. Receive Data from Remote Server in Buffer Access Mode
3.2.4. Close a Connection
3.3. TCP Client Works in Transparent Access Mode
3.3.1. Set up a TCP Client Connection and Enter into Transparent Access Mode
3.3.2. Send Data in Transparent Access Mode
3.3.3. Receive Data from Remote Server in Transparent Access Mode
3.3.4. Close a TCP Client
3.4. TCP Client Works in Direct Push Mode
3.4.1. Set up a TCP Client Connection and Enter into Direct Push Mode
3.4.2. Send Data in Direct Push Mode
3.4.3. Receive Data from Remote Server in Direct Push Mode
3.4.4. Close a TCP Client
3.5. TCP Server Works in Buffer Access Mode
3.5.1. Start a TCP Server
3.5.2. Accept TCP Incoming Connection
3.5.3. Receive Data from Incoming Connection
3.5.4. Close a TCP Server
3.6. Example of UDP Service
3.6.1. Start a UDP Service
3.6.2. Send UDP Data to Remote
3.6.3. Receive Data from Remote
3.6.4. Close a UDP Service
3.7. PING
3.8. Synchronize Local Time
3.9. Example of Getting Last Error Code
4 Summary of Error Codes
5 Appendix A Reference
EC20 R2.0 TCP/IP AT Commands Manual LTE Module Series Rev. EC20_R2.0_TCP/IP_AT_Commands_Manual_V1.0 Date: 2017-03-27 www.quectel.com
LTE Module Series EC20 R2.0 TCP/IP AT Commands Manual Our aim is to provide customers with timely and comprehensive service. For any assistance, please contact our company headquarters: Quectel Wireless Solutions Co., Ltd. Office 501, Building 13, No.99, Tianzhou Road, Shanghai, China, 200233 Tel: +86 21 5108 6236 Email: info@quectel.com Or our local office. For more information, please visit: http://www.quectel.com/support/salesupport.aspx For technical support, or to report documentation errors, please visit: http://www.quectel.com/support/techsupport.aspx Or Email to: Support@quectel.com GENERAL NOTES QUECTEL OFFERS THE INFORMATION AS A SERVICE TO ITS CUSTOMERS. THE INFORMATION PROVIDED IS BASED UPON CUSTOMERS’ REQUIREMENTS. QUECTEL MAKES EVERY EFFORT TO ENSURE THE QUALITY OF THE INFORMATION IT MAKES AVAILABLE. QUECTEL DOES NOT MAKE ANY WARRANTY AS TO THE INFORMATION CONTAINED HEREIN, AND DOES NOT ACCEPT ANY LIABILITY FOR ANY INJURY, LOSS OR DAMAGE OF ANY KIND INCURRED BY USE OF OR RELIANCE UPON THE INFORMATION. ALL INFORMATION SUPPLIED HEREIN IS SUBJECT TO CHANGE WITHOUT PRIOR NOTICE. COPYRIGHT THE INFORMATION CONTAINED HERE IS PROPRIETARY TECHNICAL INFORMATION OF QUECTEL CO., LTD. TRANSMITTING, REPRODUCTION, DISSEMINATION AND EDITING OF THIS DOCUMENT AS WELL AS UTILIZATION OF THE CONTENT ARE FORBIDDEN WITHOUT PERMISSION. OFFENDERS WILL BE HELD LIABLE FOR PAYMENT OF DAMAGES. ALL RIGHTS ARE RESERVED IN THE EVENT OF A PATENT GRANT OR REGISTRATION OF A UTILITY MODEL OR DESIGN. Copyright © Quectel Wireless Solutions Co., Ltd. 2017. All rights reserved. EC20_R2.0_TCP/IP_AT_Commands_Manual Confidential / Released 1 / 43 Quectel Confidential
LTE Module Series EC20 R2.0 TCP/IP AT Commands Manual About the Document History Revision Date Author Description 1.0 2017-03-27 Lory DONG Initial EC20_R2.0_TCP/IP_AT_Commands_Manual Confidential / Released 2 / 43 Quectel Confidential
LTE Module Series EC20 R2.0 TCP/IP AT Commands Manual Contents About the Document ................................................................................................................................... 2 Contents ....................................................................................................................................................... 3 Table Index ................................................................................................................................................... 5 1 Introduction .......................................................................................................................................... 6 1.1. The Process of Using TCP/IP AT Commands ............................................................................. 6 1.2. Description of Data Access Modes .............................................................................................. 8 2 Description of TCP/IP AT Commands ............................................................................................. 10 2.1. Description of AT Commands .................................................................................................... 10 2.1.1. AT+QICSGP Configure Parameters of a TCP/IP Context .......................................... 10 2.1.2. AT+QIACT Activate a PDP Context ............................................................................ 11 2.1.3. AT+QIDEACT Deactivate a PDP Context ................................................................... 12 2.1.4. AT+QIOPEN Open a Socket Service .......................................................................... 13 2.1.5. AT+QICLOSE Close a Socket Service ........................................................................ 14 2.1.6. AT+QISTATE Query Socket Service Status ................................................................ 15 2.1.7. AT+QISEND Send Data .............................................................................................. 17 2.1.8. AT+QIRD Retrieve the Received TCP/IP Data ........................................................... 19 2.1.9. AT+QISENDEX Send Hex String ................................................................................ 20 2.1.10. AT+QISWTMD Switch Data Access Modes ................................................................ 21 2.1.11. AT+QPING Ping a Remote Server .............................................................................. 22 2.1.12. AT+QNTP Synchronize Local Time with NTP Server ................................................. 23 2.1.13. AT+QIDNSCFG Configure Address of DNS Server ................................................... 24 2.1.14. AT+QIDNSGIP Get IP Address by Domain Name ...................................................... 24 2.1.15. AT+QICFG Configure Optional Parameters ............................................................... 25 2.1.16. AT+QISDE Control Whether to Echo the Data for AT+QISEND ................................. 27 2.1.17. AT+QIGETERROR Query the Last Error Code .......................................................... 28 2.2. Description of URC .................................................................................................................... 29 2.2.1. URC of Connection Closed ............................................................................................ 29 2.2.2. URC of Incoming Data ................................................................................................... 29 2.2.3. URC of Incoming Connection Full.................................................................................. 30 2.2.4. URC of Incoming Connection ........................................................................................ 30 2.2.5. URC of PDP Deactivation .............................................................................................. 30 3 Examples ............................................................................................................................................ 32 3.1. Configure and Activate a Context .............................................................................................. 32 3.1.1. Configure a Context ....................................................................................................... 32 3.1.2. Activate a Context .......................................................................................................... 32 3.1.3. Deactivate a Context ...................................................................................................... 32 3.2. TCP Client Works in Buffer Access Mode ................................................................................. 33 3.2.1. Set up a TCP Client Connection and Enter into Buffer Access Mode ........................... 33 3.2.2. Send Data in Buffer Access Mode ................................................................................. 33 3.2.3. Receive Data from Remote Server in Buffer Access Mode ........................................... 34 EC20_R2.0_TCP/IP_AT_Commands_Manual Confidential / Released 3 / 43 Quectel Confidential
LTE Module Series EC20 R2.0 TCP/IP AT Commands Manual 3.2.4. Close a Connection ........................................................................................................ 34 3.3. TCP Client Works in Transparent Access Mode ........................................................................ 34 3.3.1. Set up a TCP Client Connection and Enter into Transparent Access Mode ................. 34 3.3.2. Send Data in Transparent Access Mode ....................................................................... 34 3.3.3. Receive Data from Remote Server in Transparent Access Mode ................................. 35 3.3.4. Close a TCP Client ......................................................................................................... 35 3.4. TCP Client Works in Direct Push Mode ..................................................................................... 35 3.4.1. Set up a TCP Client Connection and Enter into Direct Push Mode .............................. 35 3.4.2. Send Data in Direct Push Mode ..................................................................................... 35 3.4.3. Receive Data from Remote Server in Direct Push Mode .............................................. 36 3.4.4. Close a TCP Client ......................................................................................................... 36 3.5. TCP Server Works in Buffer Access Mode ................................................................................ 36 3.5.1. Start a TCP Server ......................................................................................................... 36 3.5.2. Accept TCP Incoming Connection ................................................................................. 37 3.5.3. Receive Data from Incoming Connection ...................................................................... 37 3.5.4. Close a TCP Server ....................................................................................................... 37 3.6. Example of UDP Service ........................................................................................................... 37 3.6.1. Start a UDP Service ....................................................................................................... 37 3.6.2. Send UDP Data to Remote ............................................................................................ 38 3.6.3. Receive Data from Remote ............................................................................................ 38 3.6.4. Close a UDP Service ..................................................................................................... 38 3.7. PING ........................................................................................................................................... 39 3.8. Synchronize Local Time ............................................................................................................. 39 3.9. Example of Getting Last Error Code .......................................................................................... 39 4 Summary of Error Codes .................................................................................................................. 40 5 Appendix A Reference ....................................................................................................................... 42 EC20_R2.0_TCP/IP_AT_Commands_Manual Confidential / Released 4 / 43 Quectel Confidential
LTE Module Series EC20 R2.0 TCP/IP AT Commands Manual Table Index TABLE 1: SUMMARY OF ERROR CODES ...................................................................................................... 40 TABLE 2: TERMS AND ABBREVIATIONS ........................................................................................................ 42 EC20_R2.0_TCP/IP_AT_Commands_Manual Confidential / Released 5 / 43 Quectel Confidential
LTE Module Series EC20 R2.0 TCP/IP AT Commands Manual 1 Introduction Quectel EC20 R2.0 module features embedded TCP/IP stack, which enables the host to access the Internet directly via AT commands. This greatly reduces the dependence on the PPP and TCP/IP protocol stacks and thus minimizes the cost. EC20 R2.0 module provides the following socket services: TCP client, UDP client, TCP server and UDP server. 1.1. The Process of Using TCP/IP AT Commands Through TCP/IP AT commands, the host can configure a PDP context, activate/deactivate the PDP context, start/close socket service and send/receive data via socket service. The following figure illustrates how to use TCP/IP AT commands. EC20_R2.0_TCP/IP_AT_Commands_Manual Confidential / Released 6 / 43 Quectel Confidential
LTE Module Series EC20 R2.0 TCP/IP AT Commands Manual Figure 1: Flow Chart of Using TCP/IP AT Commands EC20_R2.0_TCP/IP_AT_Commands_Manual Confidential / Released 7 / 43 Power on the module Query (U)SIM card status by AT+CPIN?Query (U)SIM Card Status:Execute AT+CPIN. Reboot the module if AT+CPIN? fails to identify (U)SIM card in 20s.Recommended Power on/off:1. Power off: Send AT+QPOWD command, and then cut off power after 12s or more.2. Power on: Keep power key as low for 2s, and then pull it to high. Query CS service by AT+CREG?CS Service:1. If of AT+CREG? equals to 1 or 5, it means that the module has registered on CS domain service.2. Reboot the module if it fails to register on CS domain service in 90s.Activate the PDP context by AT+QIACT=and AT+QIACT?Activate a PDP Context:1. Activate the PDP context byAT+QIACT=.2. Query IP address of the PDP context by AT+QIACT?.Notes:a) All above commands should be executed together in sequence.b) Reboot the module if there is no response for AT+QIACT in 150s.c) If failed to deactivate the PDP context for 3 times continuously, then reboot the module.3. Deactivate the PDP context:reboot the module if there is no response for AT+QIDEACT in 40s.Open connection by AT+QIOPENSend data by AT+QISEND=Query sending ACK by AT+QISEND=,0Close connection by AT+QICLOSE= Deactivate the PDP context by AT+QIDEACT=Register on CS domain service in 60sIf failed to register on CS domain service in 90s, then reboot the module.Identify (U)SIM cardSuccessfully activate PDP contextReboot the module if there is no response in 10s.+QIOPEN: ,Get ACK in 90sPS Service:1. If of AT+CGREG?/AT+CEREG? equals to 1 or 5, it means that the module has registered on PS domain service in UMTS/LTE network.2. Go to next step no matter whether it is registered on PS domain service or not in 60s.If failed to identify (U)SIM card in 20s, then reboot the module.1. Reboot the module if there is no response in 150s.2. If failed to deactivate the PDP context for 3 times continuously, then reboot the module.Notes:1. Please note that you need to wait for the final response (for example OK, CME error, CMS error) of the last AT command you entered before you enter the next AT command. You can reboot the module if the module fails to get response in 60s.2. Reboot the module if the module has not got response of AT+QIACT in 150s or response of AT+QICLOSE in 10s and AT+QIDEACT in 40s.3. It is NOT recommended to frequently reboot the module. When the module has been continuously rebooted for 3 times due to failed AT command execution, it can be rebooted immediately for the first time after that. If it still fails, reboot the module after 10 minutes for the second time, and reboot after 30 minutes for the third time, one hour for the fourth time, etc. Query PS service in 60s by AT+CGREG?/AT+CEREG?Failed to activate the PDP context1. Failed to open connection continuously for 5 times. 2. There is no response in150s.Failed to get ACK in 90sOK The PDP context is deactivated successfullyReboot the module if there is no response in 40s.Open Connection:1. If failed to get response of AT+QIOPEN in 150s, then close connection.2. If failed to open connection for 5 times continuously, deactivate the PDP context first, and then re-activate the PDP context and open connection again. Send AT command and wait for the module to respond OKTCP Connection Maintenance and Detection:1. Send data by AT+QISEND =[,].It is recommended to periodically send a small data packet to the remote end to maintian and detect the TCP connection.2. Query sending ACK by AT+QISEND=,0.If the package is still not acknowledged after two minutes (query every 5 seconds, 24 times in total), the TCP connection may be abnormal. Execute AT+QICLOSE to close the current connection, and then execute AT+QIOPEN to re-establish the TCP connection.Configure the PDP context and Qos by AT+QICSGP/AT+CGQREQ/AT+CGEQREQ/AT+CGQMIN/AT+CGEQMINConfigure a PDP Context:1. Configure APN, user name, password and auth type by AT+QICSGP.2. Configure QoS settings by AT+CGQMIN/AT+CGEQMIN/ AT+CGQREQ/AT+CGEQREQ.Quectel Confidential
分享到:
收藏