555
GS2101M S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 – 2018-01-24

GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

Embed Size (px)

Citation preview

Page 1: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101MS2W Adapter Command

Reference Guide 1VV0301463 Rev. 1.0 – 2018-01-24

Page 2: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

SPECIFICATIONS ARE SUBJECT TO CHANGE WITHOUT NOTICE

NOTICEWhile reasonable efforts have been made to assure the accuracy of this document, Telitassumes no liability resulting from any inaccuracies or omissions in this document, or fromuse of the information obtained herein. The information in this document has been carefullychecked and is believed to be reliable. However, no responsibility is assumed forinaccuracies or omissions. Telit reserves the right to make changes to any products describedherein and reserves the right to revise this document and to make changes from time to timein content hereof with no obligation to notify any person of revisions or changes. Telit does notassume any liability arising out of the application or use of any product, software, or circuitdescribed herein; neither does it convey license under its patent rights or the rights of others.It is possible that this publication may contain references to, or information about Telitproducts (machines and programs), programming, or services that are not announced in yourcountry. Such references or information must not be construed to mean that Telit intends toannounce such Telit products, programming, or services in your country.

COPYRIGHTSThis instruction manual and the Telit products described in this instruction manual may be,include or describe copyrighted Telit material, such as computer programs stored insemiconductor memories or other media. Laws in the Italy and other countries preserve forTelit and its licensors certain exclusive rights for copyrighted material, including the exclusiveright to copy, reproduce in any form, distribute and make derivative works of the copyrightedmaterial. Accordingly, any copyrighted material of Telit and its licensor contained herein or inthe Telit products described in this instruction manual may not be copied, reproduced,distributed, merged or modified in any manner without the express written permission of Telit.Furthermore, the purchase of Telit products shall not be deemed to grant either directly or byimplication, estoppel, or otherwise, any license under the copyrights, patents or patentapplications of Telit, as arises by operation of law in the sale of a product.

COMPUTER SOFTWARE COPYRIGHTSThe Telit and 3rd Party supplied Software (SW) products described in this instruction manual may include copyrighted Telit and other 3rd Party supplied computer programs stored in semiconductor memories or other media. Laws in the Italy and other countries preserve for Telit and other 3rd Party supplied SW certain exclusive rights for copyrighted computer pro-grams, including the exclusive right to copy or reproduce in any form the copyrighted com-puter program. Accordingly, any copyrighted Telit or other 3rd Party supplied SW computer programs contained in the Telit products described in this instruction manual may not be cop-ied (reverse engineered) or reproduced in any manner without the express written permission of Telit or the 3rd Party SW supplier. Furthermore, the purchase of Telit products shall not be deemed to grant either directly or by implication, estoppel, or otherwise, any license under the copyrights, patents or patent applications of Telit or other 3rd Party supplied SW, except for the normal non-exclusive, royalty free license to use that arises by operation of law in the sale of a product.

Page 3: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

USAGE AND DISCLOSURE RESTRICTIONS

I. License Agreements

The software described in this document is the property of Telit and its licensors. It isfurnished by express license agreement only and may be used only in accordance with theterms of such an agreement.

II. Copyrighted Materials

Software and documentation are copyrighted materials. Making unauthorized copies isprohibited by law. No part of the software or documentation may be reproduced, transmitted,transcribed, stored in a retrieval system, or translated into any language or computerlanguage, in any form or by any means, without prior written permission of Telit

III. High Risk Materials

Components, units, or third-party products used in the product described herein are NOTfault-tolerant and are NOT designed, manufactured, or intended for use as on-line controlequipment in the following hazardous environments requiring fail-safe controls: the operationof Nuclear Facilities, Aircraft Navigation or Aircraft Communication Systems, Air TrafficControl, Life Support, or Weapons Systems (High Risk Activities”). Telit and its supplier(s)specifically disclaim any expressed or implied warranty of fitness for such High Risk Activities.

IV. Trademarks

TELIT and the Stylized T Logo are registered in Trademark Office. All other product or servicenames are the property of their respective owners.

V. Third Party Rights

The software may include Third Party Right software. In this case you agree to comply with allterms and conditions imposed on you in respect of such separate software. In addition toThird Party Terms, the disclaimer of warranty and limitation of liability provisions in thisLicense shall apply to the Third Party Right software.

TELIT HEREBY DISCLAIMS ANY AND ALL WARRANTIES EXPRESS OR IMPLIED FROM ANY THIRD PARTIES REGARDING ANY SEPARATE FILES, ANY THIRD PARTY MATERIALS INCLUDED IN THE SOFTWARE, ANY THIRD PARTY MATERIALS FROM WHICH THE SOFTWARE IS DERIVED (COLLECTIVELY “OTHER CODE”), AND THE USE OF ANY OR ALL THE OTHER CODE IN CONNECTION WITH THE SOFTWARE, INCLUDING (WITHOUT LIMITATION) ANY WARRANTIES OF SATISFACTORY QUALITY OR FITNESS FOR A PARTICULAR PURPOSE.NO THIRD PARTY LICENSORS OF OTHER CODE SHALL HAVE ANY LIABILITY FOR ANYDIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIALDAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSEDAND WHETHER MADE UNDER CONTRACT, TORT OR OTHER LEGAL THEORY,ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF THE OTHER CODE ORTHE EXERCISE OF ANY RIGHTS GRANTED UNDER EITHER OR BOTH THIS LICENSEAND THE LEGAL TERMS APPLICABLE TO ANY SEPARATE FILES, EVEN IF ADVISEDOF THE POSSIBILITY OF SUCH DAMAGES.

Page 4: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

PRODUCTGS2101M

Software Release5.5.1

APPLICABILITY TABLE

Page 5: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

Table of Contents

Chapter 1 Getting Started ................................................................................................................ 231.1 Overview ................................................................................................................................231.2 Using SDK Builder .................................................................................................................25

1.2.1 Serial-to-WiFi Module Information ................................................................................25

Chapter 2 Architecture ..................................................................................................................... 272.1 Overview ................................................................................................................................272.2 System Initialization ...............................................................................................................28

2.2.1 Network Configuration ..................................................................................................292.2.2 Profile Definition ...........................................................................................................34

2.3 Command Processing Mode .................................................................................................342.3.1 Auto Connection ...........................................................................................................352.3.2 Auto Connection Operation ..........................................................................................37

2.4 Data Handling ........................................................................................................................382.4.1 Bulk Data Tx and Rx ....................................................................................................402.4.2 Unsolicited/Unassociated/Beacon Mode Data Handling ..............................................402.4.3 Software Flow Control ..................................................................................................412.4.4 Hardware Flow Control ................................................................................................41

2.5 Serial Data Handling ..............................................................................................................422.6 Connection Management ......................................................................................................42

2.6.1 Packet Reception .........................................................................................................422.6.2 Remote Close ..............................................................................................................432.6.3 TCP Server Connections .............................................................................................43

2.7 Wireless Network Management .............................................................................................442.7.1 Scanning ......................................................................................................................442.7.2 Association ...................................................................................................................442.7.3 SSID and Passphrase ..................................................................................................44

Chapter 3 Host Interaction ............................................................................................................... 473.1 Startup Handling ....................................................................................................................48

3.1.1 Single Interface Startup Handling ................................................................................483.1.2 Dual Interface Startup Handling ...................................................................................49

3.2 Interface .................................................................................................................................493.2.1 UART ...........................................................................................................................49

3.2.1.1 UART Parameters ...............................................................................................493.2.1.2 Software Flow Control .........................................................................................513.2.1.3 Hardware Flow Control ........................................................................................52

3.2.2 SPI Interface and Configuration ...................................................................................533.2.2.1 SPI Byte Stuffing (Legacy SPI, SPI-NO-DMA) ....................................................543.2.2.2 SPI Command Response (SPI-DMA) ..................................................................553.2.2.3 Annexure - HI Frame Format (From Host) ...........................................................663.2.2.4 Annexure - HI Frame Response (From GS Node) ..............................................673.2.2.5 Pin Connection for SPI Interface .........................................................................68

3.2.3 SDIO Interface .............................................................................................................693.2.3.1 Capabilities ..........................................................................................................693.2.3.2 SDIO Host Slave Initialization and Communication .............................................703.2.3.3 SDIO Host Recommendations .............................................................................733.2.3.4 Pin Description .....................................................................................................75

3.2.4 Interface Verification ....................................................................................................75

1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24

Page 6: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

Chapter 4 General Operations ......................................................................................................... 774.1 Version ..................................................................................................................................774.2 Time Setting ..........................................................................................................................79

4.2.1 Set System Time ..........................................................................................................794.2.1.1 Manual Setting .....................................................................................................794.2.1.2 Dynamic Setting ...................................................................................................80

4.2.2 Get System Time .........................................................................................................834.3 Profile Setting ........................................................................................................................84

4.3.1 Get Profile ....................................................................................................................844.3.2 Save Profile ..................................................................................................................864.3.3 Load Profile ..................................................................................................................874.3.4 Select Default Profile ....................................................................................................884.3.5 Restore Profile .............................................................................................................894.3.6 Define Profile ................................................................................................................894.3.7 Configure Profile ..........................................................................................................924.3.8 Identification Information ..............................................................................................944.3.9 Nagle Timer ..................................................................................................................954.3.10 Enhanced Asynchronous Notification ........................................................................96

4.4 Reset .....................................................................................................................................984.5 MAC .......................................................................................................................................99

4.5.1 Set MAC Address .........................................................................................................994.5.2 Get MAC Address ......................................................................................................101

Chapter 5 Wireless ....................................................................................................................... 1035.1 Wireless Generic .................................................................................................................103

5.1.1 Regulatory Domain ....................................................................................................1035.1.1.1 Set Regulatory Domain ......................................................................................1035.1.1.2 Get Regulatory Domain .....................................................................................104

5.1.2 Operation Mode .........................................................................................................1055.1.3 MAC Retry .................................................................................................................1085.1.4 Sync Loss Interval ......................................................................................................1095.1.5 Set RTS Threshold .....................................................................................................1105.1.6 Transmit Data Rate ....................................................................................................111

5.1.6.1 Set Transmit Rate ..............................................................................................1115.1.6.2 Get Transmit Rate .............................................................................................113

5.2 Beacon Mode (Unassociated Mode) ...................................................................................1145.2.1 Unassociated/Unsolicited Tx ......................................................................................1145.2.2 Unassociated/Unsolicited Rx .....................................................................................119

5.2.2.1 Examples for Unassociated/Unsolicited Tx and Rx Commands ........................1225.2.3 Unassociated/Unsolicited Rx Stop .............................................................................1235.2.4 Unassociated/Unsolicited Data Encryption ................................................................124

5.3 Station/AP Mode ..................................................................................................................1255.3.1 Scan Time Settings ....................................................................................................125

5.3.1.1 Set Scan Time ...................................................................................................1255.3.1.2 Get Scan Time ...................................................................................................127

5.3.2 Authentication Mode ..................................................................................................1285.3.3 Security Configuration ................................................................................................129

5.3.3.1 Security Setting ..................................................................................................1295.3.3.2 WEP Keys ..........................................................................................................1305.3.3.3 WEP Key Type Configuration ............................................................................1325.3.3.4 WPA-PSK and WPA2-PSK Passphrase ............................................................1345.3.3.5 WPA-PSK and WPA2-PSK Key Calculation ......................................................1355.3.3.6 WPA-PSK and WPA2-PSK Key ........................................................................136

5.3.4 Scanning ....................................................................................................................138

1VV0301463 Rev. 1.0 Page 6 of 12 2018-01-24

Page 7: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

5.3.5 Association .................................................................................................................1405.3.6 Disassociation ............................................................................................................1435.3.7 Connection Maintenance ...........................................................................................143

5.3.7.1 Keep Alive Timer ...............................................................................................1435.3.7.2 WLAN Keep Alive Interval .................................................................................144

5.3.8 Advanced Commands ................................................................................................1465.3.8.1 Get Client Information ........................................................................................146

5.4 WiFi Direct Mode .................................................................................................................1475.4.1 Set Device ..................................................................................................................1475.4.2 Set WPS .....................................................................................................................1495.4.3 Start Find ....................................................................................................................1505.4.4 Stop Find ....................................................................................................................1525.4.5 Provoke ......................................................................................................................1535.4.6 Provision Discovery ....................................................................................................1545.4.7 Group Form (Group Owner Negotiation) ....................................................................156

5.4.7.1 Provision Discovery Request Handling ..............................................................1595.4.8 Client Join ..................................................................................................................1615.4.9 Invitation Procedures .................................................................................................1635.4.10 Disconnect ...............................................................................................................164

5.5 Concurrent Mode (STA Plus AP) ........................................................................................1655.5.1 Enable/Disable Concurrent Mode ..............................................................................1665.5.2 Set the Interface Number ...........................................................................................1675.5.3 Indicating Interface .....................................................................................................1695.5.4 Example Usage of Concurrent Mode .........................................................................170

Chapter 6 Network ......................................................................................................................... 1736.1 Network Interface Filter .......................................................................................................1736.2 Get Network Interface Filter Configuration ..........................................................................1766.3 DHCP Client ........................................................................................................................1766.4 IP Address ...........................................................................................................................1786.5 DHCP Server .......................................................................................................................1806.6 DHCP Server Configuration ................................................................................................1826.7 DNS Server .........................................................................................................................1836.8 DNS Address .......................................................................................................................1846.9 DNS Spoofing ......................................................................................................................185

Chapter 7 Data Transfer ................................................................................................................ 1877.1 Data Transfer Configuration ................................................................................................187

7.1.1 Data Transfer in Bulk Mode .......................................................................................1877.1.2 Data Drop ...................................................................................................................1887.1.3 Connection Status ......................................................................................................1897.1.4 Closing a Connection .................................................................................................1907.1.5 Closing All Connections .............................................................................................1917.1.6 Socket Options Configuration ....................................................................................191

7.2 Security Configuration .........................................................................................................1967.2.1 Certificate Addition .....................................................................................................1967.2.2 Certificate Deletion .....................................................................................................1997.2.3 Certificate Validation ..................................................................................................2007.2.4 Get Certificate Information .........................................................................................2017.2.5 EAP-Configuration .....................................................................................................2017.2.6 EAP Certificate Upload ..............................................................................................2057.2.7 EAP Time Validation ..................................................................................................206

7.3 Network Connection Management (NCM) ...........................................................................2097.3.1 NCM Start/Stop ..........................................................................................................209

1VV0301463 Rev. 1.0 Page 7 of 12 2018-01-24

Page 8: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

7.3.2 Configure NCM ..........................................................................................................2127.3.3 NCM Status Get .........................................................................................................2157.3.4 Enable NCM AP Configuration ...................................................................................217

7.3.4.1 Examples for NCM Commands .........................................................................2187.3.5 Roaming .....................................................................................................................220

7.4 Auto Mode ...........................................................................................................................2227.4.1 Auto Mode (Common) ................................................................................................222

7.4.1.1 Enable Auto Connection ....................................................................................2227.4.1.2 Initiate Auto Connect .........................................................................................2237.4.1.3 Initiate Auto Connect – TCP/UDP Level ............................................................2247.4.1.4 Exit from Auto Connect Data Mode ...................................................................2247.4.1.5 Return to Auto Connect Mode ...........................................................................225

7.4.2 Legacy Auto Mode .....................................................................................................2257.4.2.1 Enable/Disable New Auto Mode ........................................................................225

7.4.3 Examples for Auto Connect Mode .............................................................................2277.4.4 Wireless Parameters ..................................................................................................2307.4.5 Network Parameters ..................................................................................................232

7.5 UDP/TCP .............................................................................................................................2357.5.1 Basic ..........................................................................................................................235

7.5.1.1 Create TCP Clients ............................................................................................2357.5.1.2 Create UDP Client .............................................................................................2387.5.1.3 Start TCP Server ...............................................................................................2397.5.1.4 Start UDP Server ...............................................................................................2437.5.1.5 Store TCP Client Configuration .........................................................................2447.5.1.6 Restore TCP Client Configuration .....................................................................245

7.5.2 Secured (DTLS/SSL) .................................................................................................2467.5.2.1 Open DTLS Client ..............................................................................................2467.5.2.2 Close DTLS Client .............................................................................................2477.5.2.3 Store DTLS Client Configuration .......................................................................2487.5.2.4 Restore DTLS Client Configuration ...................................................................2497.5.2.5 Configure SSL ...................................................................................................2507.5.2.6 Open SSL ..........................................................................................................2557.5.2.7 Close SSL ..........................................................................................................256

7.5.3 Data Handling ............................................................................................................2587.5.3.1 Normal Data Handling .......................................................................................2587.5.3.2 Bulk Data Handling ............................................................................................266

7.6 HTTP ...................................................................................................................................2697.6.1 HTTP(S) Client ...........................................................................................................269

7.6.1.1 Configure HTTP Client .......................................................................................2697.6.1.2 Clear HTTP Client Configuration .......................................................................2727.6.1.3 Open HTTP Client Connection ..........................................................................2737.6.1.4 Configure Receive Response Headers/Status Line ..........................................2797.6.1.5 Exchange/Send Data with HTTP Client .............................................................2817.6.1.6 Store HTTP Client Configuration .......................................................................2837.6.1.7 Restore HTTP Client Configuration ...................................................................2847.6.1.8 Close HTTP Client .............................................................................................285

7.6.2 HTTP(S) Server .........................................................................................................2867.6.2.1 HTTP Server Redirection ...................................................................................2867.6.2.2 Start/Stop Web Server .......................................................................................2877.6.2.3 Web Server Status .............................................................................................288

7.7 MQTT Client ........................................................................................................................2897.7.1 MQTT Client Connect ................................................................................................2897.7.2 MQTT Client Publish ..................................................................................................2917.7.3 MQTT Client Subscribe ..............................................................................................292

1VV0301463 Rev. 1.0 Page 8 of 12 2018-01-24

Page 9: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

7.7.4 MQTT Client Disconnect ............................................................................................2937.7.5 Store MQTT Client .....................................................................................................2947.7.6 Restore MQTT Client .................................................................................................2957.7.7 MQTT Ping .................................................................................................................2967.7.8 Receive MQTT Data ..................................................................................................296

7.8 WebSocket Client ................................................................................................................2987.8.1 WebSocket Client Configuration ................................................................................2987.8.2 Store WebSocket Client Configuration .......................................................................2997.8.3 Restore WebSocket Client Configuration ...................................................................3007.8.4 Clear WebSocket Client Configuration .......................................................................3007.8.5 Open WebSocket Client Connection ..........................................................................3017.8.6 Send Data with WebSocket Client .............................................................................3037.8.7 Receive WebSocket Data ..........................................................................................3047.8.8 Close WebSocket Client ............................................................................................3057.8.9 WebSocket Ping .........................................................................................................3067.8.10 WebSocket Pong .....................................................................................................307

7.9 CoAP Client .........................................................................................................................3077.9.1 CoAP Client Option Configuration ..............................................................................3077.9.2 CoAP Client Option Configuration Removal ..............................................................3097.9.3 CoAP Client Connection Open ...................................................................................3107.9.4 CoAP Client Connection Send ...................................................................................3137.9.5 CoAP Client Connection Close ..................................................................................315

7.10 GSLink ..............................................................................................................................3167.10.1 GSLink with HTTP ...................................................................................................3167.10.2 Receive Request ......................................................................................................3177.10.3 Enable XML Parser ..................................................................................................3187.10.4 Send XML Data ........................................................................................................3187.10.5 Receive XML Data ...................................................................................................3217.10.6 Send Raw HTTP Data ..............................................................................................3227.10.7 Receive Raw HTTP Data .........................................................................................3247.10.8 Enable JSON Data ...................................................................................................3257.10.9 Send JSON Data ......................................................................................................3267.10.10 Receive JSON Data ...............................................................................................3287.10.11 URI Registration (Modification) ..............................................................................3297.10.12 Receive CGI Arguments ........................................................................................3317.10.13 Receive Request Line ............................................................................................3337.10.14 Receive HTTP Headers .........................................................................................334

7.11 Multicast ............................................................................................................................3357.11.1 IP Multicast Join .......................................................................................................3357.11.2 IP Multicast Leave ....................................................................................................3367.11.3 Enable Multicast Reception ......................................................................................337

Chapter 8 Advanced Service ......................................................................................................... 3418.1 Network ...............................................................................................................................341

8.1.1 Ping ............................................................................................................................3418.1.2 Service Discovery Using mDNS .................................................................................343

8.1.2.1 mDNS Module Initialization ................................................................................3438.1.2.2 mDNS Status .....................................................................................................3448.1.2.3 mDNS Host Name Registration .........................................................................3448.1.2.4 mDNS Host Name De-registration .....................................................................3458.1.2.5 mDNS Services Registration .............................................................................3468.1.2.6 mDNS Services De-registration .........................................................................3498.1.2.7 mDNS Services Announce ................................................................................3508.1.2.8 mDNS Service Discover ....................................................................................350

1VV0301463 Rev. 1.0 Page 9 of 12 2018-01-24

Page 10: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

8.1.2.9 mDNS Module De-Initialization ..........................................................................3538.1.2.10 Example for mDNS Commands .......................................................................353

8.1.3 DNS Lookup (Client) ..................................................................................................3558.1.4 ARP ............................................................................................................................357

8.1.4.1 ARP Cache Enable ............................................................................................3578.1.4.2 ARP Cache Delete .............................................................................................3588.1.4.3 ARP Entry Listing ...............................................................................................3588.1.4.4 ARP Entry Set ....................................................................................................3598.1.4.5 ARP Entry Delete ...............................................................................................3608.1.4.6 ARP Learning ....................................................................................................3618.1.4.7 Gratuitous ARP ..................................................................................................3628.1.4.8 ARP Resolve .....................................................................................................362

8.1.5 NAT Functionality .......................................................................................................3648.1.5.1 Enable NAT .......................................................................................................3648.1.5.2 IP Packet Handling ............................................................................................365

8.2 Application Features ............................................................................................................3668.2.1 Firmware Update ........................................................................................................366

8.2.1.1 Over the Air Firmware Upgrade Using Module Flash ........................................3668.2.1.2 Over the Host Firmware Upgrade (OTHFU) ......................................................370

8.2.2 HomeKit .....................................................................................................................3748.2.2.1 Initialize HomeKit ...............................................................................................3748.2.2.2 Add Accessory ...................................................................................................3798.2.2.3 Add Service .......................................................................................................3818.2.2.4 Add Characteristics ............................................................................................3828.2.2.5 Send Data as Response ....................................................................................3848.2.2.6 Erase HomeKit Configuration ............................................................................3858.2.2.7 HomeKit as Link Service ....................................................................................386

8.2.3 Provisioning ................................................................................................................3878.2.3.1 Web Provisioning ...............................................................................................3888.2.3.2 Group Provisioning ............................................................................................3968.2.3.3 Verified Provisioning ..........................................................................................3988.2.3.4 WPS ...................................................................................................................4008.2.3.5 WAC - Apple Wireless Authentication ...............................................................405

8.2.4 TR50 Support .............................................................................................................4078.2.4.1 deviceWISE Configuration .................................................................................4078.2.4.2 deviceWISE Connection ....................................................................................4108.2.4.3 deviceWISE Connection Status .........................................................................4138.2.4.4 Send deviceWISE Data .....................................................................................4158.2.4.5 deviceWISE Enable ...........................................................................................4198.2.4.6 Send Raw deviceWISE Data .............................................................................4228.2.4.7 deviceWISE Ring ...............................................................................................4238.2.4.8 Receive deviceWISE Data .................................................................................4238.2.4.9 Receive Raw deviceWISE Data ........................................................................4268.2.4.10 List of Information on message Pending from deviceWISE server ..................428

Chapter 9 Power Management - Radio and System ..................................................................... 4319.1 Radio Receiver Setting ........................................................................................................431

9.1.1 Active Radio Receive .................................................................................................4319.1.2 Standard Power Save Radio Receive based on DTIM/Listen Interval .......................433

9.1.2.1 IEEE PS Poll Listen Interval ..............................................................................4339.1.3 Custom Power Save Radio Receive ..........................................................................436

9.2 Battery Measurement ..........................................................................................................4379.2.1 Battery Check Start ....................................................................................................4379.2.2 Battery Warning/Standby Level Set ...........................................................................438

1VV0301463 Rev. 1.0 Page 10 of 12 2018-01-24

Page 11: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

9.2.3 Battery Check Set ......................................................................................................4399.2.4 Battery Check Stop ....................................................................................................4409.2.5 Battery Value Get .......................................................................................................440

9.3 System Power Save ............................................................................................................4419.3.1 Hibernate ....................................................................................................................4419.3.2 Standby ......................................................................................................................442

9.3.2.1 Storing or Restoring System Information for Standby .......................................4429.3.2.2 Putting the System in Standby ...........................................................................4459.3.2.3 Enabling Standby Mode Between Beacons .......................................................4479.3.2.4 Configuring Standby Between Beacons ............................................................448

9.3.3 Deep Sleep ................................................................................................................4519.3.4 Power Save in Limited AP ..........................................................................................4539.3.5 Hardware Cryptography .............................................................................................454

Chapter 10 Peripherals .................................................................................................................. 45710.1 I2C Commands ..................................................................................................................457

10.1.1 I2C Configuration .....................................................................................................45710.1.2 I2C Start ...................................................................................................................45910.1.3 I2C Write ..................................................................................................................45910.1.4 I2C Read ..................................................................................................................46010.1.5 I2C Stop ...................................................................................................................460

10.2 PWM Commands ..............................................................................................................46110.2.1 PWM Start ................................................................................................................46110.2.2 PWM Stop ................................................................................................................46410.2.3 PWM Control ............................................................................................................464

10.3 GPIO Commands ..............................................................................................................46510.3.1 GPIO Out HIGH/LOW ..............................................................................................465

10.4 EMU Commands ...............................................................................................................46710.4.1 EMU Get Version .....................................................................................................46710.4.2 EMU Get Supported Module List .............................................................................46710.4.3 EMU Start .................................................................................................................46810.4.4 EMU Stop .................................................................................................................46810.4.5 EMU Mode/Channel Configuration ..........................................................................469

10.4.5.1 Mode Configuration .........................................................................................46910.4.5.2 Channel Configuration .....................................................................................470

10.4.6 EMU Get Configuration ............................................................................................47110.4.7 EMU Get Values ......................................................................................................47210.4.8 EMU Load Control ....................................................................................................47210.4.9 EMU Reset Energy ..................................................................................................47310.4.10 EMU Get Status .....................................................................................................47310.4.11 EMU Get Load Status ............................................................................................474

Chapter 11 Production and Debug ................................................................................................ 47511.1 RF Test ..............................................................................................................................475

11.1.1 Regulatory and Transmit Tests using RF Test Commands .....................................47511.1.1.1 Regulatory Testing ...........................................................................................47511.1.1.2 Transmit Testing ..............................................................................................47511.1.1.3 Gain Control Table ...........................................................................................47611.1.1.4 Start RF Test ...................................................................................................47611.1.1.5 Stop RF Test ....................................................................................................47611.1.1.6 Asynchronous Frame Transmission ................................................................47611.1.1.7 Start Asynchronous Frame Reception .............................................................47811.1.1.8 Stop Asynchronous Frame Reception .............................................................48111.1.1.9 Asynchronous Frame Transmission (TX99 mode) ..........................................482

1VV0301463 Rev. 1.0 Page 11 of 12 2018-01-24

Page 12: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

11.1.1.10 Asynchronous Frame Transmission (TX100 mode) ......................................48711.1.1.11 Carrier Wave Transmission ...........................................................................489

11.2 Live Calibration ..................................................................................................................49011.2.1 Enable Live Calibration ............................................................................................49011.2.2 Erase Live Calibration ..............................................................................................49211.2.3 Start Live Calibration ................................................................................................49311.2.4 For Complete Sequence of Live Calibration ............................................................495

11.3 Debug ................................................................................................................................49511.3.1 Log Level ..................................................................................................................49511.3.2 Echo .........................................................................................................................49611.3.3 Verbose ....................................................................................................................49711.3.4 RSSI .........................................................................................................................49811.3.5 WLAN Status ............................................................................................................49811.3.6 Network Status .........................................................................................................49911.3.7 WLAN Statistics .......................................................................................................501

Appendix A Response Codes ........................................................................................................ 505A.1 Synchronous Messages ......................................................................................................505A.2 Asynchronous & Enhanced Asynchronous Messages ........................................................506

A.3.1 Exception Messages ..................................................................................................509A.3.2 Boot Messages ..........................................................................................................510

Appendix B AT Commands Summary ........................................................................................... 513B.1 Host Interaction ...................................................................................................................513B.2 General Operations .............................................................................................................514B.3 Wireless ..............................................................................................................................516B.4 Network ...............................................................................................................................525B.5 Data Transfer ......................................................................................................................526B.6 Advance Services ...............................................................................................................533B.7 Power Management - Radio and System ...........................................................................538B.8 Peripherals ..........................................................................................................................541B.9 Production and Debug ........................................................................................................543B.10 Default Return Messages ..................................................................................................545B.11 Escape Sequence Commands ..........................................................................................546

Appendix C AT Commands (Alphabetical Order) .......................................................................... 547C.1 ATX[n] .................................................................................................................................547C.2 ATX[n]= ...............................................................................................................................547C.3 AT&X[n] ...............................................................................................................................548C.4 AT+XYZ[n]= ........................................................................................................................548

1VV0301463 Rev. 1.0 Page 12 of 12 2018-01-24

Page 13: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

About This Manual

This manual provides guidelines for using the GainSpan® AT command-line interface to design, configure, and provision the GS2101M series module in a WiFi network, using serial commands.

Refer to the following sections:

• Revision History, page 13

• Audience, page 13

• Standards, page 14

• Documentation Conventions, page 14

• Documentation, page 17

• References, page 18

• Contact Information, Support, page 20

• Returning Products to GainSpan, page 21

• Accessing the GainSpan Portal, page 21

Revision HistoryThis revision history of the GainSpan Serial-to-WiFi Adapter Application Programmer Reference Guide is maintained in the following table:

AudienceThis manual is designed for software engineers who want to evaluate, design, and implement GainSpan Ultra Low Power 802.11 WiFi Modules within their environment. To use this manual you will need a basic understanding of WiFi networks, network principles, and network protocols.

Table 1 Revision History

Version Date Remarks1.0 January2018 Initial Release

1VV0301463 Rev. 1.0 Page 13 of 22 2018-01-24

Page 14: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

StandardsThe standards that are supported by the GainSpan GS module series are:

– IEEE 802.11 b/g/n

Documentation ConventionsThis manual uses the following text and syntax conventions:

– Special text fonts represent particular commands, keywords, variables, or window sessions

– Color text indicates cross-reference hyper links to supplemental information

– Command notation indicates commands, subcommands, or command elements

Table 2, page 14, describes the text conventions used in this manual for software procedures that are explained using the AT command line interface.

Table 2 Document Text Conventions

Convention Type Description

command syntaxmonospaced font

This monospaced font represents command strings entered on a command line and sample source code.

AT XXXX

Proportional fontdescription

Gives specific details about a parameter.

<Data> DATA

UPPERCASEVariable parameter

Indicates user input. Enter a value according to the descriptions that follow. Each uppercased token expands into one or more other token.

lowercaseKeyword parameter

Indicates keywords. Enter values exactly as shown in the command description.

[ ]Square brackets

Enclose optional parameters. Choose none; or select one or more an unlimited number of times each. Do not enter brackets as part of any command.

[parm1|parm2|parm3]

?Question mark

Used with the square brackets to limit the immediately following token to one occurrence.

<ESC>Escape sequence

Each escape sequence <ESC> starts with the ASCII character 27 (0x1B). This is equivalent to the Escape key.

<ESC>C

1VV0301463 Rev. 1.0 Page 14 of 22 2018-01-24

Page 15: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

<CR>Carriage return

Each command is terminated by a carriage return.

<LF>Line feed

Each command is terminated by a line feed.

<CR> <LF>Carriage returnLine feed

Each response is started with a carriage return and line feed with some exceptions.

< >Angle brackets

Enclose a numeric range, endpoints inclusive. Do not enter angle brackets as part of any command.

<SSID>

=Equal sign

Separates the variable from explanatory text. Is entered as part of the command.

PROCESSID = <CID>

.dot (period)

Allows the repetition of the element that immediately follows it multiple times. Do not enter as part of the command.

.AA:NN can be expanded to 1:01 1:02 1:03.

A.B.C.DIP address

IPv4-style address.

10.0.11.123

LINEEnd-to-line input token

Indicates user input of any string, including spaces. No other parameters may be entered after input for this token.

string of words

WORDSingle token

Indicates user input of any contiguous string (excluding spaces).

singlewordnospaces

Table 2 Document Text Conventions (Continued)

Convention Type Description

1VV0301463 Rev. 1.0 Page 15 of 22 2018-01-24

Page 16: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

Table 3, page 16, describes the symbol conventions used in this manual for notification and important instructions.

Table 3 Symbol Conventions

Icon Type Description

NoteProvides helpful suggestions needed in understanding a feature or references to material not available in the manual.

Alert Alerts you of potential damage to a program, device, or system or the loss of data or service.

Caution Cautions you about a situation that could result in minor or moderate bodily injury if not avoided.

Warning Warns you of a potential situation that could result in death or serious bodily injury if not avoided.

Electro-Static Discharge (ESD)

Notifies you to take proper grounding precautions before handling a product.

1VV0301463 Rev. 1.0 Page 16 of 22 2018-01-24

Page 17: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

1VV031VV03

on n

1VV03

he

S or

uide

1VV03

etup e onent d

GS210

i using

1VV03

i using

DocumentationThe GainSpan documentation suite listed in Table 4, page 17 includes the part number, documentation name, and a description of the document. The documents are available from the GainSpan Portal. Refer to Accessing the GainSpan Portal, page 21 for details.

Table 4 Documentation List

Part Number Document Title Description

0145401416

GS2100M Evaluation Board Quick Start GuideGS2101M Evaluation Board Quick Start Guide

Provides an easy to follow guide how to unpack and setup GainSpaGS2000 based module kit for theGS2000 based modules.

01437 GS2K Module Programming User Guide

Provides users steps to program ton-board Flash on the GainSpan GS2000 based modules using DOGraphical User Interface utility provided by GainSpan. The user guses the evaluation boards as a reference example board.

01435 GS2K Module Evaluation Board Hardware User Guide

Provides instructions on how to sand use the GS2000 based modulevaluation board along with compdescription, jumper settings, boarspecifications, and pinouts.

0M-DS-001212 GS2100M Low Power WiFi Module Data Sheet

Provides information to help WiFsystem designers to build systemsGainSpan GS2100M module anddevelop wireless applications.

01395 GS2101M Low Power WiFi Mini-Module Hardware User Guide

Provides information to help WiFsystem designers to build systemsGainSpan GS2101M module anddevelop wireless applications.

1VV0301463 Rev. 1.0 Page 17 of 22 2018-01-24

Page 18: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

1VV03

ers to

pan sed

ware ing

1VV03

that to bug f the

1VV03

Span erent and

Documentation FeedbackWe encourage you to provide feedback, comments, and suggestions so that we can improve the documentation. You can send your comments by logging into Telit Support Portal. If you are using e-mail, be sure to include the following information with your comments:

– Document name

– URL or page number

– Hardware release version (if applicable)

– Software release version (if applicable)

ReferencesThe GainSpan references listed in Table 5, page 19 are available on the GainSpan Portal. Refer to Accessing the GainSpan Portal, page 21 for details.

01438 GS2K SDK Builder User Guide

Allows OEMs and system developconfigure and generate custom firmware binary images for GainSlow power embedded GS2000 baWiFi modules. The SDK Builder supports the GainSpan GEPS softreleased, including the correspondWLAN firmware.

01409 GS2K SDK Quick Start Guide

Provides an easy to follow guide will walk you through easy steps setup, evaluation, develop, and dethe full capabilities and features oGS2100M embedded platform software.

01444 GS2K S2W Use Case Reference GuideProvides references for using GainAT commands and its usage in diffscenarios using different features protocols.

Table 4 Documentation List (Continued)

Part Number Document Title Description

1VV0301463 Rev. 1.0 Page 18 of 22 2018-01-24

Page 19: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

Table 5 Other Documents and References

Title Description

SchematicsGS2000 Based Module Evaluation Board schematics supporting:GS2100MGS2101M

Module Firmware and Programming Utilities

• Serial-to-WiFi (S2W) based firmware• Firmware Release Notes• GSFlashprogram utility for programming the

modules

Software UtilitiesSerial terminal program to evaluate and demonstrate Serial-to-WiFi (S2W) applications such as

– gs2k_flashprogram.exe

1VV0301463 Rev. 1.0 Page 19 of 22 2018-01-24

Page 20: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

Contact Information, SupportFor general contact, technical support services, technical questions and to report documentation errors contact Telit Technical Support at:

[email protected]

We recommend adding “Wi-Fi” in subject of the email. For example, the subject of email can be “Wi-Fi: Your actual issue or question in brief” like “Wi-Fi: SPI Driver Issue”.

Also, in description of your email, please provide details about the issue, product and module including software firmware version, module version and type, application being used, customizations done to application, use case, issue frequency, and ability to recreate it among other things wherever applicable.

Alternatively, for more Technical Support information or assistance, perform the following steps:

1. Visit http://www.telit.com, go to Products> Wi-Fi and Blue-tooth, then scroll down to the Telit Wi- Fi Portal.

2. Click Access the Portal Here icon which will direct you to the GainSpan portal http://www.gainspan/secure/login.com

1. Log in with your customer Email and Password.

2. Select the Location.

3. Select Q&A tab.

4. Select Ask a New Question.

5. Enter your technical support question, product information, and a brief description.

For detailed information about where you can buy the Telit modules or for recommendations on accessories and components visit:

http://www.telit.com

Our aim is to make this guide as helpful as possible. Keep us informed of your comments and suggestions for improvements. Telit appreciates feedback from the users of our information.

1VV0301463 Rev. 1.0 Page 20 of 22 2018-01-24

Page 21: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

Returning Products to GainSpanIf a problem cannot be resolved by GainSpan technical support, a Return Material Authorization (RMA) is issued. This number is used to track the returned material at the factory and to return repaired or new components to the customer as needed.

To return a hardware component:

1. Determine the part number and serial number of the component.

2. Obtain an RMA number from Sales/Distributor Representative.

3. Provide the following information in an e-mail or during the telephone call:

– Part number and serial number of component

– Your name, organization name, telephone number, and fax number

– Description of the failure

4. The support representative validates your request and issues an RMA number for return of the components.

5. Pack the component for shipment.

Guidelines for Packing Components for ShipmentTo pack and ship individual components:

– When you return components, make sure they are adequately protected with packing materials and packed so that the pieces are prevented from moving around inside the carton.

– Use the original shipping materials if they are available.

– Place individual components in electrostatic bags.

– Write the RMA number on the exterior of the box to ensure proper tracking.

Accessing the GainSpan PortalTo find the latest version of GainSpan documentation supporting the GainSpan product release you are interested in, you can search the GainSpan Portal website by performing the following steps:

NOTE: Do not return any components to GainSpan Corporation unless you have first obtained an RMA number. GainSpan reserves the right to refuse shipments that do not have an RMA. Refused shipments will be returned to the customer by collect freight.

CAUTION! Do not stack any of the components.

1VV0301463 Rev. 1.0 Page 21 of 22 2018-01-24

Page 22: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

1. Visit http://www.telit.com, go to Products> Wi-Fi and Blue-tooth, then scroll down the Telit Wi- Fi Portal.

2. Click Access the Portal Here icon which will direct you to the GainSpan portal http://www.gainspan/secure/login.com

3. Log in using your customer Email and Password.

4. Click the Getting Started tab to view a Quick Start tutorial on how to use various features within the GainSpan Portal.

5. Click the Agreements tab to download and upload the SLA for ADK and SDK respectively.

6. Click on the Documents tab to search, download, and print GainSpan product documentation.

7. Click the Software tab to search and download the latest software versions.

8. Click the Kits Purchased tab to view customer account history.

9. Click the Legal Documents tab to view GainSpan Non-Disclosure Agreement (NDA).

10. Click the Certifications tab to view GainSpan certifications.

NOTE: You must first contact GainSpan to set up an account, and obtain a customer user name and password before you can access the GainSpan Portal.

1VV0301463 Rev. 1.0 Page 22 of 22 2018-01-24

Page 23: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

Chapter 1 Getting Started

This chapter describes how to get started.

• Overview, page 23

• Using SDK Builder, page 25

1.1 OverviewThe Serial-to-WiFi stack is used to provide WiFi capability to any device having a serial interface. This approach offloads WLAN, TCP/IP stack and network management overhead to the WiFi chip, allowing a small embedded host (for example an MCU) to communicate with other hosts on the network using a WiFi wireless link. The host processor can use serial commands to configure the Serial-to-WiFi Application and to create wireless and network connections.

OTP stands for One Time Programmable Memory. It is divided into two parts, one for Application firmware and another for WLAN firmware. It contains important system related information for Application and WLAN firmware. For Application firmware, it contains information about MAC address, regularity information, module related information, and so on. For WLAN firmware, it contains information about calibration data.

The user will have to register on GainSpan website, sign the NDA and check with the local sales team for any queries during this procedure. This gives access to all the respective documentation according to the product purchased.

The following is the basic application development sequence for a Serial-to-WiFi user.

1. Evaluate GainSpan hardware and firmware

– Download the software, program, and execute.

– To download the software, go to SDK builder (www.gainspan.com/secure/login), and download all the latest packages including the binary (Refer GS2K SDK Builder User Guide).

– Flash the binary using module programmer user guide on the custom hardware or GS evaluation board and execute in RUN mode. (Refer “GS2K Module Programming User Guide”).

2. Design the custom hardware by following the design guidelines. (Refer GS2xxxM Hardware Design Guidelines)

1VV0301463 Rev. 1.0 Page 23 of 26 2018-01-24

Page 24: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

3. Develop Host firmware

– Following Live Calibrations commands are highly recommended to be issued before doing any Wi-Fi operations:

AT+WLCALERASE

AT+RESET

AT+WLCALSTART=1

– Interface host application using AT commands. (Refer GS2xxxM S2W Adapter Command Reference Guide)

Configure the serial interface (UART/SPI/SDIO) as required, refer UART, page 49, SPI Interface and Configuration, page 53 and SDIO Interface, page 69 for mode, polarity.For software interface, choose Command & Response, Byte stuffing/de-stuffing as “None” for UART and SDIO options.

– Issue general, power save, and security related commands as required.

– Start connection to an Access Point or do provisioning as required.

– Obtain IP Address and Start Data Transfer.

– Select advanced services if any.

4. Debug Host and GainSpan module

– Debug using provided AT commands and other options if required. (Refer GS2xxxM S2W Adapter Command Reference Guide)

– Analyze using Wire shark over wireless. For more details, refer information about AirPcap Nx in http://www.riverbed.com

5. Production Process

– Perform generic recommendations in production line

– Check if Live Calibration needs to be explicitly controlled (rarely used),

– Perform RF tests

NOTE: For desired functionality use appropriate AT Commands. Refer “GS2K S2W Reference Use Case User Guide”

NOTE: Refer to “GS2K S2W Reference Use Case User Guide” document for detailed use cases and examples.

1VV0301463 Rev. 1.0 Page 24 of 26 2018-01-24

Page 25: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

1.2 Using SDK Builder

1.2.1 Serial-to-WiFi Module InformationSelecting the Serial-to-WiFi (Hosted) under the SDK Builder Configuration screen displays the module information that includes the module selected, firmware version, application, SRAM (APP/WLAN/RTC), and Flash (Internal/External) summary information. There are several tabs that allow you to select various features and options to build and configure the Serial-to-WiFi (Hosted) application.

1VV0301463 Rev. 1.0 Page 25 of 26 2018-01-24

Page 26: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

Figure 1 Evaluation Board

The tabular selections to build your Serial-to-WiFi (Hosted) application and firmware are as follows

• Host Interface

• Host Settings

• 802.11 WLAN

• 802 WLRPAN

• ZigBee IP Modes

• Concurrent Modes

• Networking Services

• Energy Measurement

• Provisioning

• Firmware Update

• Clock/Power Setting

• Memory Setting

Once you have completed selecting the options and features for building the Serial-to-WiFi (Hosted) firmware, click the Next button or select the Summary tab. The Build Configuration Summary screen displays a summary of the selected configuration options (e.g., Module Configuration, Host Interface, Host Settings, 802.11 WLAN, etc.).

NOTE: When building Firmware Binary for EVK or AEK Package, it is recommended that you use the Default Evaluation Build. Otherwise, you can build Custom, SDK, or ADK Packages for your environment.

1VV0301463 Rev. 1.0 Page 26 of 26 2018-01-24

Page 27: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

Chapter 2 Architecture

This chapter describes the overview and architecture of Serial-to-WiFi Application.

• Overview, page 27

• System Initialization, page 28

• Command Processing Mode, page 34

• Data Handling, page 38

• Serial Data Handling, page 42

• Connection Management, page 42

• Wireless Network Management, page 44

2.1 OverviewFigure 2, page 27 shows the overall architecture of the Serial-to-WiFi (S2W) interface. Transmit (Tx) and Receive (Rx) Data Handlers pass messages to and from the TCP/IP network Commands related to management of the S2W interface and the network connections are intercepted by a Command Processor. A Serial Data Handler translates data to and from a serial interface (UART/SPI/SDIO).

Figure 2 Operation Modes of the Serial-to-WiFi Application

The Serial-to-WiFi Application consists of the following modules:

• System Initialization, page 28

• Command Processing Mode, page 34

1VV0301463 Rev. 1.0 Page 27 of 46 2018-01-24

Page 28: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

• Data Handling, page 38

• Serial Data Handling, page 42

• Connection Management, page 42

• Wireless Network Management, page 44

The software for the Serial-to-WiFi Application is mainly driven using a state machine. Upon powering on, the required initialization of all the modules is performed and then the state machine is entered. This state machine is event-driven and processes the events received from either the serial port or from the WiFi/Network interface as well as internal events from its own modules. The state machine calls the appropriate handler for a given event per the current state.

The Serial-to-WiFi Application has three distinct operating modes (Figure 3, page 29). In the default command processing operating mode, commands to configure and manage the interface are sent over the serial interface. In the default mode, the node accepts commands entered by the Host CPU and processes each of the commands. All commands are available in this mode. The User can establish a data connection here and send data.

In auto connection mode, data sent over the serial interface is transparently sent over the IP network to a single, pre-configured IP address/port pair, where data from that address is transparently sent over the UART/SPI to the serial host. With Auto mode, the IP Layer connections are already established and the data is sent directly to the target destination. In this mode, the node does not accept all commands. To accept commands the node needs to be brought back to “Command Processing” mode. Auto connection mode is entered using a serial command (see 7.4.1.2 Initiate Auto Connect, page 223) and terminated using a special escape sequence (see 2.4 Data Handling, page 38).

In data processing mode, data can be sent to, or received from, any of 16 possible connections. Each connection consists of a TCP or UDP path to a destination IP address and port.

For each mode, configuration parameters are stored in non-volatile memory. In addition to factory-default parameter values, two user-defined profiles (0 and 1) are available. The parameter set to be used is determined by a user command (see 4.3.4 Select Default Profile, page 88).

2.2 System InitializationUpon startup, the Serial-to-WiFi (S2W) interface performs the following actions as displayed in Figure 3, page 29

– During the initialization process, the module will search for a saved configuration file. The configuration file include the auto connection settings, default profile and profile settings. If a saved configuration file is available, it is loaded from non-volatile memory. If no saved configuration file, the default settings will be applied. If there are no saved parameters, the factory-default configuration is loaded.

1VV0301463 Rev. 1.0 Page 28 of 46 2018-01-24

Page 29: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

– The S2W application is initialized based on the profile settings.

If auto connection is enabled, the interface will attempt to associate with the specified network, previously set by the user (see 7.4.4 Wireless Parameters, page 230). Once associated, it will establish a TCP or UDP connection within the specified parameters. If successful, the interface will enter the Auto Connect mode, where all data received on the serial port is transmitted to the network destination and vice versa.

If auto-connection is disabled or fails, the interface enters the command processing state.

Figure 3 Operating Modes of the Serial-to-WiFi Application

Upon power-up, the UART interface defaults to 9600 baud, using 8 bit characters with no parity bits and one stop bit. Similarly SPI interface defaults to Mode#0 (CPL=0, CPH=0). Any changes to this configuration that were made in a previous session using the ATB command (see 3.2.1.1 UART Parameters, page 49) will be lost when power is lost. To make changes in the UART/SPI parameters that will persist across power cycling, the relevant changes must be saved into the power-on profile using AT&W (see 4.3.2 Save Profile, page 86) and AT&Y (see 4.3.4 Select Default Profile, page 88).

2.2.1 Network ConfigurationOnce associated, the GS node supports instances of four types of network entities: TCP client, TCP server, UDP client and UDP server. Each client, or server, is associated with one or more of a possible 16 Connection Identifiers, where the CID is a single hexadecimal number. More than one such entity can exist simultaneously; and a TCP server can have

1VV0301463 Rev. 1.0 Page 29 of 46 2018-01-24

Page 30: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

multiple connections, each with its own CID. When the GS node is in Auto Connect mode (see 9.3.1 Hibernate, page 441), the entity called for by the Profile is created automatically upon startup. In Command modes, servers and clients are created using specific serial commands.

A TCP client (Figure 4, page 30) is created with the serial command AT+NCTCP (see 7.5.1.1 Create TCP Clients, page 235). The client attempts to create a TCP network connection with the destination IP address and port specified within the command. If successful, it issues a CONNECT response with the CID of the client. Data can then be sent to the remote server using the <ESC>S sequence (see 2.4 Data Handling, page 38) with the appropriate CID. Data from the server is passed back to the Host, with the CID to identify its source.

Figure 4 Creation and Use of a TCP Client

Figure 5, page 31 shows the corresponding sequence for a TCP server. A server is created with the serial command AT+NSTCP; it receives a CID, but listens passively until a remote client requests a connection. If that connection is successfully created, a second CONNECT message and a new CID are provided to the Host. It is this second CID that is used to send data to the remote client and identify received data from that client. A TCP server may support multiple clients, each with a unique CID.

1VV0301463 Rev. 1.0 Page 30 of 46 2018-01-24

Page 31: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

Figure 5 Creation and Use of a TCP Server

1VV0301463 Rev. 1.0 Page 31 of 46 2018-01-24

Page 32: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

A UDP client’s life is depicted in Figure 6, page 32. The client is created with the serial command AT+NCUDP and receives a CID. The UDP client is associated with a specific destination port and address.

Figure 6 Creation and Use of a UDP Client

1VV0301463 Rev. 1.0 Page 32 of 46 2018-01-24

Page 33: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

Figure 7, page 33 shows a UDP server. The server is created with AT+NSUDP and is assigned a CID. Individual clients do not receive unique CIDs; data sent using the UDP server must be accompanied with the destination IP address and port, and data received via the server is modified with the identifying source address and port number.

Figure 7 Creation and Use of a UDP Server

NOTE: When the CID returns for a new TCP/IP connection it should be in ascending order (incremented by 1) even the previous connection does not exists. Once it reaches the maximum connection number (15), it starts from the first (0).

1VV0301463 Rev. 1.0 Page 33 of 46 2018-01-24

Page 34: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

2.2.2 Profile DefinitionThe configuration parameter values that define the behavior of the GS node are grouped into Profiles. These profiles are stored in non-volatile memory when not in use. The GS node supports two Profiles by default.

2.3 Command Processing ModeIn Command mode, the application receives commands over the serial port. Commands are processed line by line.

Verbose Mode is used when referring to commands being executed, refers to the displaying of status of any command executed in ASCII (human readable) format. When the Verbose Mode is disabled, the output will simply be in numeric digits, each digit indicating a particular status. Verbose Mode is enabled by default.

If echo is enabled then each character is echoed back on the serial port.

Each command is terminated with a carriage return <CR> or line feed <LF>.

Each response is started with a carriage return <CR> and line feed<LF>, with the exception of the responses to the following commands:

The response to the following group of commands starts with a line feed <LF> only:

AT+WA

AT+NSTAT

AT+WPAPSK=<SSID>,<Passphrase>

AT+NSET=<IP Address>,<Subnet Mask>,<Gateway IP Address> (valid after association)

AT+PING=<IP Address>

ATA

AT+NDHCP (after association)

The response to the following group of commands starts with a line feed and carriage return: <LF><CR>:

AT+HTTPOPEN=<IP Address>

Unless otherwise specified, if Verbose Mode is enabled, then the response to a successful command is the characters OK. The response to an unsuccessful command is the word ERROR, followed by a detailed error message, if available. If verbose mode is disabled, command responses is numerical with OK having a value of 0 and error codes represented by positive integers.

1VV0301463 Rev. 1.0 Page 34 of 46 2018-01-24

Page 35: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

2.3.1 Auto ConnectionIf auto connection is enabled, then upon startup the GS node will:

1. Attempt to associate to or from the specified network, for a maximum time of Auto Associate Timeout (see 4.3.7 Configure Profile, page 92).

2. On successful association, attempt to establish a network connection based on the specified parameters.

3. On successful connection establishment, enter the pass-through auto connect mode

4. On failure, enter the command processing state.

In TCP client mode, the connection is considered established only when the client successfully connects to the server specified in the parameters. The client address may be fixed or obtained from a DHCP server. The client port is selected at random during creation of the client. The connection is attempted for a maximum time based on the Network Connection Timeout, specified in units of 10 milliseconds (see 4.3.7 Configure Profile, page 92). Data is sent to, and received from, this server. If the connection is terminated, auto-connect mode also terminates and the command processing state is entered (see Figure 8, page 35).

Figure 8 TCP Client Operation in Auto Connect Mode

1VV0301463 Rev. 1.0 Page 35 of 46 2018-01-24

Page 36: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

The TCP server IP address may be fixed in the profile or obtained from DHCP. The port for connection attempts to be made is obtained from the profile. In TCP server mode, the connection is considered established when the first client connects to the server. Data is sent to, and received from, this client. If the client disconnects, the GS node waits for the next client to connect (see Figure 9, page 36).

Figure 9 TCP Server Operation in Auto Connect Mode

In UDP client mode, the connection is considered established when the client is created. The client IP address may be fixed or obtained from DHCP. The client port number is set at random upon creation of the client. Data is sent to and received from the configured server (see Figure 10, page 36).

Figure 10 UDP Client Operation in Auto Connect Mode

In UDP server mode, the connection is considered established when data is received from any client. The UDP server IP address may be fixed or obtained in DHCP. The port is set by the profile. Data received from any client is output on the serial port and data received on the serial port is transmitted to the client based on the last packet received (see Figure 11, page 37).

1VV0301463 Rev. 1.0 Page 36 of 46 2018-01-24

Page 37: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

Figure 11 UDP Server Operation in Auto Connect Mode

In TCP and UDP server mode, even where no connection is established, the serial host may take control of the Serial-to-WiFi interface by issuing a specific escape sequence, described in 2.3.2 Auto Connection Operation, page 37.

2.3.2 Auto Connection OperationThe Auto Connect Mode acts as a cable replacement so that the interface acts like a serial interface. The node automatically establishes the wireless and network connections by using parameter values from the current active Profile and transfers data transparently between the Host and Target in data mode. No status information is sent to the Host. If connection is lost, status is sent to the Host, and host will need to re-initiate the connection to the network.

In auto connection mode the GS node:

– Receives characters from the serial port and transmits them over the WiFi connection

– Receives data from the WiFi connection and transmits it on the serial port

The serial host may gain control of the interface by issuing the escape sequence “+++”, followed by a one-second gap where no characters are received on the serial port or by asserting GPIO8. When this sequence is encountered, the GS node suspends auto connection mode and resumes command processing. The Host then may make changes in the network configuration or other parameters as needed. However, the GS node does not accept any new TCP/UDP client/server or auto connection requests since auto connection exists in the background. The AUTO command (terminated by the ASCII character “O”, not the number 0) is used to return to auto connection mode.

1VV0301463 Rev. 1.0 Page 37 of 46 2018-01-24

Page 38: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

In auto connection mode, the Nagle Algorithm Wait Time (see 4.3.7 Configure Profile, page 92) can be used to buffer any characters to be sent, in order to avoid sending a large number of packets with small payloads onto the network. The wait time is specified in units of 10 milliseconds. This functionality is available for both UDP and TCP connections.

The default Time Out till S2W Application buffers the data from HOST is 100milliseconds which can be configured using ATS Command, refer 4.3.7 Configure Profile, page 92.

In Enhanced Auto Connection, NCM runs in the background so that if there is disconnection on L2/L3/L4, the NCM re-establishes the connection without any message to the host.

Here, the host checks whether the GPIO9 is high to send data via the data pipe created by auto connection.

When L2, L3, or L4 disconnects, GPIO9 goes low and the host stops sending data via the data pipe created by auto connection.

Also the serial to WiFi remains in the data mode irrespective of the L2/L3/L4 failure. With the asynchronous GPIO, the host should check for the data pipe to be ready.

2.4 Data HandlingIn Data Processing Mode, data transfers are managed using various escape sequences. Each escape sequence starts with the ASCII character 27 (0x1B); this is equivalent to the ESC key. The encoding of data and related commands are described in the following pages. This encoding is used for both transmitted and received data.

The process of sending a data packet is depicted in Figure 12, page 39. The sequence ESC S or ESC U is sent to initiate the data transfer. This sequence is followed by a single-digit CID; if the CID is valid, the subsequent characters are assembled into a data stream, terminated by ESC E, ESC C, ESC S or ESC U. With a terminating sequence, the data is sent via the requested network connection and the system either returns to command processing or to further data processing.

Escape <ESC> sequences like ESC H, ESC S, ESC u and ESC U support only ASCII data handling while ESC Z, ESC Y and ESC y supports all types of data (ASCII, Binary etc.) handling.

Refer to B.11 Escape Sequence Commands, page 546 for a complete description of all the Escape <ESC> sequences used for data handling (see Table 6, page 40).

1VV0301463 Rev. 1.0 Page 38 of 46 2018-01-24

Page 39: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

Figure 12 Data Processing Flow

1VV0301463 Rev. 1.0 Page 39 of 46 2018-01-24

Page 40: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

2.4.1 Bulk Data Tx and RxIn Bulk Data Mode, data transfers are managed using escape sequences (ESC Z, ESC Y and ESC y). Each escape sequence starts with the Escape <ESC> key (ASCII character 27 (0x1B)). Encoding is used for both transmitted and received data. Enable bulk data by using command “AT+BDATA=”. For more details, see Bulk Data Handling, page 266

2.4.2 Unsolicited/Unassociated/Beacon Mode Data HandlingIn Unsolicited Data Mode (data transmission without association), data transfer is managed using escape sequences. Each escape sequence starts with the ASCII character 27 (0x1B), equivalent to the Escape <ESC> key. For more details, see 5.2.1 Unassociated/Unsolicited Tx, page 114)

Table 6 Data Handling Responses at Completion

Operation Escape Sequence

Description

Send and Return to Command Mode Sequence

<ESC>C This sequence causes transmission of the data received on the serial interface on a TCP server/client or UDP client connection. After, the currently selected connection is closed and the interface returns to Command mode. Any buffered data is sent before the connection is closed.This can be issued from the serial host once the data transmissions start on a socket using <ESC>S<CID> sequence.

Success Indication

<ESC>O OK: When serial host sends data to any socket, the network validates whether it is an active CID. This sequence is sent to the serial host through UART or SPI-NON DMA interface by the Serial-to-WiFi Application upon successful validation of active CID.Note: Sending <ESC> O has been intentionally removed in SPI DMA and SDIO interface to increase throughput.

Failure Indication

<ESC>F FAILURE: This sequence is sent to the serial host by the Serial-to-WiFi Application through all interfaces (UART, SPI-NON DMA, SPI-DMA) when serial host sends data to any invalid socket.

NOTE: The contents of < > are either a byte or byte stream, except for <ESC>; literals outside brackets are ASCII characters.

1VV0301463 Rev. 1.0 Page 40 of 46 2018-01-24

Page 41: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

2.4.3 Software Flow ControlThe Software Flow Control (for UART interface) works only with ASCII data transfers and cannot be used for binary data. For SPI interface and use of flow control (see 3.2.2 SPI Interface and Configuration, page 53)

If software flow control is enabled, and the interface receives an XOFF character from the serial host, it stops sending to the host until it receives an XON character. If the GS node is receiving data over the wireless connection and the host/mcu sends XOFF character to the GS node to indicate its inability to process the incoming data over UART Interface, then there is a possibility for the receiving wireless buffers to be full on the GS node side and the GS node might drop the data.

If software flow control is enabled, then the interface sends an XOFF character to the host when it will be unable to service the serial port. The XON character is sent when the interface is once again able to accept data over the serial port.

2.4.4 Hardware Flow ControlThe Hardware Flow Control is a handshake mechanism between the Serial host and S2W Application on UART interface, using two additional CTS and RTS connections. This feature prevents the UART hardware FIFO overflow on S2W Application due to high speed data transmission from/to the S2W Application. If hardware flow control is enabled, an RTS/CTS handshake will occur between the serial host and the GS node. This is a hardware feature and available only for UART interface.

The S2W Application uses both CTS and RTS signals as “low” to indicate the readiness to send or receive data from serial host.

NOTE: With initialization, the GS node treats the serial channel as clear with no restrictions on data transmission or reception; no explicit XON by the GS node or required from the Host, even if flow control is enabled.

1VV0301463 Rev. 1.0 Page 41 of 46 2018-01-24

Page 42: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

2.5 Serial Data HandlingThe Serial Data Handler receives and transmits data to and from the hardware serial controller. Data read from the serial port is passed to:

– The command processor in command mode

– The Tx data handler in data mode

– The auto connection mode processor for data transfer in auto connection mode

Then Data is transferred on the serial port from:

– The command processor in order to output responses to commands

– The Tx data handler in order to output incoming packets

– The Rx data handler in order to output incoming packets

– The auto connection handler in order to output incoming data

– The connection manager in order to output status indications

– The wireless connection manager in order to output status indications

When configured in Auto Connection Mode, the GS node enters directly into Data Processing Mode after the completing the connection without sending any status information to the Host.

2.6 Connection ManagementThe Connection Management module is responsible for processing connection-related events. The interface provides UDP and TCP sockets (similar to the familiar BSD network sockets). Each socket may represent either a server or client connection. Each connection has a unique, single-digit hexadecimal value (0 to F), for the CID.

2.6.1 Packet ReceptionWhen a packet is received on any open connection, and the application is not currently in auto-connect mode, the packet is transferred on the UART/SPI in the form described in 2.4 Data Handling, page 38. Received data payloads are encoded with the appropriate Escape <ESC> sequence. The connection ID is used to inform the serial host of the origin of an IP data packet. The source IP address and port are provided along with the data when a UDP packet is received.

If auto-connect mode is enabled and a packet is received on the auto-connected CID, the packet data is sent without modification over the UART/SPI to the serial host.

NOTE: This single pool of CIDs is used for TCP, UDP, Server, and Client connections.

1VV0301463 Rev. 1.0 Page 42 of 46 2018-01-24

Page 43: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

2.6.2 Remote CloseIf a TCP connection is terminated by disconnection from the remote end, an unsolicited ASCII-format response of the form DISCONNECT Connection ID is sent to the serial host, and the specified CID should be considered unavailable. If the connection ends because the remote server has shut down, the unsolicited response ERROR:SOCKET FAILURE Connection ID will be sent to the host.

2.6.3 TCP Server ConnectionsUpon deployment of incoming TCP connections on a socket, the incoming connection is allowed if the limit on the maximum number of connections has not been reached.

There is an unsolicited response of the form:

CONNECT <server CID> <new CID> <ip> <port>, where:

– server CID is the CID of the server where the connection has arrived

– new CID is the CID allocated for this client connections

– ip and port is the IP and Port of the client encoded in the binary encoding used for UDP server data packets described in 2.4 Data Handling, page 38 above is sent to the serial host. The host can use the IP address to ascertain the source of the TCP connection request.The TCP server has no timeout limitation for an incoming connect request. It waits indefinitely, until a CLOSE command is received.

NOTE: A data packet from the remote client or server containing the same ASCII characters CLOSE Connection ID is treated as data rather than a command and forwarded to the serial host.

NOTE: If Verbose mode is disabled (see 11.3.3 Verbose, page 497), the word CONNECT in the unsolicited response is replaced by the number 7.

1VV0301463 Rev. 1.0 Page 43 of 46 2018-01-24

Page 44: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

2.7 Wireless Network Management

2.7.1 ScanningThe Serial-to-WiFi interface can instruct the WiFi radio to scan for access points with a specified SSID, BSSID and/or channel for a specified scan time. Scanning can be performed to find networks with a specific SSID or BSSID, networks operating on a specific radio channel or a combination of these constraints.

2.7.2 AssociationThe Serial-to-WiFi interface performs all the actions required to join an infrastructure IP network:

– Scan for a specific AP (AT+WS) – see 5.3.4 Scanning, page 138

– Authenticate the specified network using the configured authentication mode (AT+WAUTH) – see 5.3.8 Advanced Commands, page 146 for more information

– Associate to the AP (AT+WA) – see 5.3.5 Association, page 140

– Perform security negotiation if required

– Change state to Wireless Connected

– Initialize the networking stack using the configured static IP address or via DHCP (AT+NDHCP) – see 6.3 DHCP Client, page 176

2.7.3 SSID and PassphraseThe following rules apply:

1. The S2W Application accepts the following ASCII characters for SSID and passphrase (see Table 7, page 44).

Note: 1. SP = space.

2. The SSID or Passphrase parameter may be captured within or without double quotation marks (“SSID”).

3. The quotation mark (“) may not be used as the first character of the SSID or passphrase.

Table 7 SSID and Passphrase Characters

Category Accepted CharactersNumerical 0-9Alphabets a-z and A-ZSpecial Characters 1SP ! # $ % & ' ( ) * + , - . / : ; < = > ? @ [ \ ] ^ _ ` { | } ~ ”

1VV0301463 Rev. 1.0 Page 44 of 46 2018-01-24

Page 45: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

4. If comma (,) is a part of the SSID, then SSID parameter needs to be framed with double quotation marks (“SS,ID”) (see Table 8, page 45).

Table 8 Expected and Input SSID

Expected SSID Input SSID RemarksTEST TEST Valid (satisfies rule 2)TEST “TEST” Valid (satisfies rule 2)TE”ST TE”ST Valid (satisfies rule 3)TE”ST “TE”ST” Invalid (breaks rule 3)TE,ST “TE,ST” Valid (satisfies rule 4)TE,ST TES,T Invalid (breaks rule 4)TE,S”T “TE,S”T” Invalid (breaks rule 3 and 4)

1VV0301463 Rev. 1.0 Page 45 of 46 2018-01-24

Page 46: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

1VV0301463 Rev. 1.0 Page 46 of 46 2018-01-24

Page 47: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

Chapter 3 Host Interaction

This chapter describes how a communication interface is established between Host and GS node.

The Serial-to-WiFi Application (GS node) interacts with host using one of the following ways:

• Single interface:

It supports to use one of the following interfaces to communicate with Host.

– UART

– SPI

– SDIO

• Dual interface:

It supports to use a combination of two interfaces to communicate with Host. One interface (Command interface) is used for AT command/response and the other interface (Data interface) is used for data transmission/reception.

The Serial-to-WiFi Application supports the following combinations for dual interface (see Table 9, page 33).

Table 9 Serial-to-WiFi Dual Interface Combinations

Command Interface Data InterfaceUART0 UART1UART0 SPIUART0 SDIO

NOTE: The configuration parameters for the secondary interface should be configured in the SDK Builder when the Serial-to-WiFi Application firmware image is built.

1VV0301463 Rev. 1.0 Page 47 of 76 2018-01-24

Page 48: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

3.1 Startup Handling

3.1.1 Single Interface Startup HandlingFor proper synchronization between Host micro controller (MCU) and GS node (S2W Application), the following steps must be followed:

1. Once the GS node is up, Host MCU needs to first read the complete S2W start-up banner r\nSerial2WiFi<SP>APP\r\n before issuing any command.

2. If the Host MCU misses the startup banner, then it needs to send dummy AT command until it receives \r\nOK\r\n response from GS node (S2W Application).

3. In case of SPI interface, following SPI mechanisms are supported in S2W Application:

– SPI Byte Stuffing

– SPI Command Response (High speed)

Host MCU needs to check the status of host wake-up signal (GPIO37 for GS2000 based modules) after boot up. Once the Host MCU wake-up signal is HIGH, then it needs to read the “r\nSerial2WiFi<SP>APP\r\n” banner which is queued up for transmission at the GS node’s SPI interface.

In case of SPI Byte Stuffing,

Host MCU repeatedly transmit s idle characters (F5) over the SPI line and reads the characters transmitted by GS node (“r\nSerial2WiFi<SP>APP\r\n” banner) until it sees that the host wake-up signal line is LOW which indicates that all the characters transmitted from GS node have been read. At this point, the Host MCU can send any AT commands to the GS node. Host MCU must not issue a reset using the ext_reset_n signal until initialization process is complete.

In case of SPI Command Response,

Host MCU issues READ_REQUEST and waits for READ_RESPONSE. Once the Host MCU receives the READ_RESPONSE from GS node, it reads the DAT_HEADER and the DATA from GS node. Data part will have the boot-up banner “r\nSerial2WiFi<SP>APP\r\n”.

For more information, refer SPI Byte Stuffing (Legacy SPI, SPI-NO-DMA), page 54 and SPI Command Response (SPI-DMA), page 55.

4. In case of SDIO interface, once the Host MCU SDIO interface is initialized and synchronized with the GS node, it reads the boot-up banner “r\nSerial2WiFi<SP>APP\r\n” from GS node.

For more information, refer Host Read Sequence, page 72.

1VV0301463 Rev. 1.0 Page 48 of 76 2018-01-24

Page 49: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

5. If Host MCU gets reset for some reason, then GS node (S2W Application) must be explicitly reset using EXT_RESET pin and the Host MCU should wait for the host wake-up signal to become high in case of SPI interface. However, if reset provision is not available, then Host MCU must continuously send dummy ‘AT’ commands till ‘\r\nOK\r\n’ response is received from GS node (S2W Application).

3.1.2 Dual Interface Startup HandlingFor proper synchronization between host micro controller (MCU) and S2W node, the following steps must be followed:

1. UART interface which is the command interface acts as a control path to issue AT commands and receive responses. Data interface is used for sending and receiving data.

2. Serial-to-WiFi Application sends \r\nSerial2Wifi\r\n message through Command (UART) interface to the host after power cycle, and sends DataInterfaceReady\r\n message on Data interface.

3. Command (UART) interface does not accept any AT commands until the data interface reads DataInterfaceReady\r\n message.

3.2 InterfaceThe embedded host uses one of the interfaces (UART/SPI/SDIO) to connect to the Serial-to-WiFi Application.

3.2.1 UART

3.2.1.1 UART ParametersThis command is used to set the UART parameters. The UART parameters take effect immediately. However, they are stored in RAM and will be lost when power is lost unless they are saved to a profile using AT&W (see 4.3.2 Save Profile, page 86). The profile used in that command must also be set as the power-on profile using AT&Y (see 4.3.4 Select

NOTE: The SPI Host WAKE PIN for GS node is GPIO37.

NOTE: 1.)Since SDIO slave initialization is dependent on HOST SDIO Master, it is mandatory to setup the Host’s SDIO which is the Master before GS node boots-up. If not GS node keeps waiting until SDIO Master initializes. 2.)If GS node is kept waiting until the WATCHDOG timer expires, then it would result in WATCHDOG Reset.

1VV0301463 Rev. 1.0 Page 49 of 76 2018-01-24

Page 50: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

Default Profile, page 88.

Command Syntax ATB=<baudrate>[[,<bitsperchar>][,<parity>][,<stopbits>]]

Usage

Parameter Description

Table 10, page 50 describes the UART interface parameters.

Synchronous Response

Table 11, page 50 describes the synchronous responses and remarks for the UART Parameters command.

Example ATB=9600,8,n,1

OK

NOTE: 1> All standard baud rates are supported. 2> It is strongly recommended to use hardware or software flow control to prevent data loss and data corruption. 3> Software flow control needs to be used for ASCII data transfer up to 115200 baud rate. 4> Hardware flow control needs to be used for ASCII data transfer beyond 115200 baud rate. 5> Hardware flow control is always recommended for binary data transfer at any baud rate.

Table 10 UART Interface Parameters

Parameter Optional/Mandatory Value Description

baudrate Mandatory 9600 (default) 9600, 19200, 38400, 57600, 115200, 230400, 460800, and 921600

bitsperchar Optional 8 (default) 5, 6, 7, or 8

parity Optional no parity (default)n - no parity (default)e - even parityo - odd parity

stopbits Optional 1 (default) 1 or 2 stop bits

Table 11 UART Parameters Responses

Responses RemarksOK Success

ERROR:INVALID INPUT Other than the allowed baud rates or if baud rate is not entered.

1VV0301463 Rev. 1.0 Page 50 of 76 2018-01-24

Page 51: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

3.2.1.2 Software Flow ControlThis command is used to enable or disable software flow control for the UART interface.

Command Syntax AT&Kn

Parameter Description

Table 12, page 51 describes the Software Flow Control parameters.

Synchronous Response

Table 13, page 51 describes the synchronous responses and remarks for the Software Flow Control command.

Table 12 Software Flow Control Parameters

Parameter Optional/Mandatory Value Description

n Mandatory0 (default) Software flow control is disabled.1 Software flow control is enabled.

Table 13 Software Flow Control Synchronous Responses

Responses RemarksOK Success

ERROR:INVALID INPUTIf parameter is not valid.(other than 0 or 1)

1VV0301463 Rev. 1.0 Page 51 of 76 2018-01-24

Page 52: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

3.2.1.3 Hardware Flow ControlThis command is used to enable or disable hardware flow control for the UART interface.

Command Syntax AT&Rn

Parameter Description

Table 14, page 52 describes the Hardware Flow Control parameters.

Synchronous Response

Table 15, page 52 describes the synchronous responses and remarks for the Hardware Flow Control command.

Table 14 Hardware Flow Control Parameters

Parameter Optional/Mandatory Value Description

n Mandatory0 (default) Hardware flow control is disabled.1 Hardware flow control is enabled.

Table 15 Hardware Flow Control Synchronous Responses

Responses RemarksOK Success

ERROR:INVALID INPUTIf parameter is not valid.(other than 0 or 1)

1VV0301463 Rev. 1.0 Page 52 of 76 2018-01-24

Page 53: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

3.2.2 SPI Interface and ConfigurationFor higher throughput application, we make use of SPI interface between MCU and GS node.

SPI mode is a combination of clock polarity and clock phase with respect to the data. There are four types of SPI modes:

• SPI Mode 0

• SPI Mode 1

• SPI Mode 2

• SPI Mode 3

For SPI Mode 0 and SPI Mode 2, the SPI Master should toggle Chip Select (CS) or Slave Select (SS) for every byte.

For SPI Mode 1 and SPI Mode 3, the SPI Master should not toggle Chip Select (CS) or Slave Select (SS) for every byte; but should be toggled for every byte stream.

The following command is used to set the SPI clock polarity and clock phase parameters. The new SPI parameters take effect after node reset/restart. However, they are stored in RAM and will be lost when power is lost unless they are saved to a profile using AT&W (see 4.3.2 Save Profile, page 86). The profile used in that command must also be set as the power-on profile using AT&Y (see 4.3.4 Select Default Profile, page 88).

Command Syntax AT+SPICONF=<clockpolarity>,<clockphase>

Parameter Description

Table 16, page 53 describes the SPI Interface Configuration parameters.

Table 16 SPI Interface Configuration Parameters

Parameter Optional/Mandatory Value Description

clockpolarity Mandatory0 (default) Inactive state of serial clock is low.1 Inactive state of serial clock is high.

clockphase Mandatory

0 (default)Data is captured on the first edge of the serial clock (clock phase zero), after the falling edge of slave select signal.

1Data is captured on the second edge of the serial clock (clock phase 180), after the falling edge of slave select signal.

1VV0301463 Rev. 1.0 Page 53 of 76 2018-01-24

Page 54: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

Table 17, page 54 describes the configuration for clock polarity and clock phase with respect to SPI Mode.

Synchronous Response

Table 18, page 54 describes the synchronous responses and remarks for the SPI Interface Configuration command.

3.2.2.1 SPI Byte Stuffing (Legacy SPI, SPI-NO-DMA)In this method, data is transferred byte by byte between the GS node and MCU. Since SPI data transfer works in full duplex mode, its required to make use of special octet to indicate idle data. Similarly, if host MCU is sending data at higher rate flow control mechanism is required. In order differentiate these special control codes (such as idle pattern, flow control codes and other control octets) from user data, byte stuffing mechanism is incorporated.

SPI transmit data handling procedure:

The SPI data transfer layer makes use of an octet (or byte) stuffing procedure. The Control Escape octet is defined as binary 11111011 (hexadecimal 0xFB), most significant bit first. Each special control pattern is replaced by a two octet sequences consisting of the Control Escape octet followed by the original octet exclusive-or’d (XOR) with hexadecimal 0x20. Receiving implementations must correctly process all Control Escape sequences (Ctrl+ESC key). Escaped data is transmitted on the link as described in Table 19, page 54.

Table 17 SPI Modes, Clock Polarity, and Clock PhaseSPI Mode Clock Polarity Clock Phase

0 0 01 0 12 1 03 1 1

Table 18 SPI Interface Configuration Synchronous Responses

Responses RemarksOK SuccessERROR:INVALID INPUT If parameters are invalid.

Table 19 SPI Transmit Data Handling Link Pattern

Pattern Encoded as Description0xFD 0xFB 0xDD Flow control XON0xFA 0xFB 0xDA Flow control XOFF0x00 0xFB 0x20 Inactive link detection

1VV0301463 Rev. 1.0 Page 54 of 76 2018-01-24

Page 55: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

One dedicated GPIO signal (GS_SPI _HOST_WAKEUP) is available for data ready indications from Slave GS node to Master Host controller. This GS_SPI _HOST_WAKEUP signal is asserted high during valid data transmission period, so that the host (master SPI) starts pulling out data by giving SPI clock and GS_SPI _HOST_WAKEUP signal is de-asserted once transmission is completed. It is only pulled high for the actual data and not for the control characters. Master host controller must provide clock as long as GS_SPI_HOST_WAKEUP signal is active.

Special character (GS_SPI _IDLE) will be transmitted during idle period (if there is no more data to transmit) and must be dropped at the receiving Host.

SPI receive data handling procedure:

Since byte stuffing is used, each Control Escape octet must be removed and the next immediate octet is exclusive-or’d (XOR) with hexadecimal 0x20. If received buffer has reached the upper water mark, then XOFF character will be sent out informing the host to stop transmitting actual data. After receiving XOFF character host must stop transmitting actual data and can send IDLE bytes, until the XON is received. Once the host receives XON, then it may resume the valid data transmissions.

Special control byte IDLE will be dropped at receiver.

3.2.2.2 SPI Command Response (SPI-DMA)This method is used to achieve high throughput over SPI by using:

– Higher clock rate up to 10Mhz (when running @120Mhz)

– DMA access for the data transfer

This interface uses command response handling between GS node (always slave) and any MCU (always master which controls the clock) through SPI interface. MCU issues commands for read/write and waits for the response.

If the response indicates:

– Success: the action is taken

– Failure: the action is deferred and retried after some time or dropped.

Operation sequence: Command > Response > Data phase (if response success) > Command > Response > Data phase (response success).

0xFB 0xFB 0xDB Control ESCAPE0xF5 0xFB 0xD5 IDLE character0xFF 0xFB 0xDF Inactive link detection0xF3 0xFB 0xD3 SPI link ready indication

Table 19 SPI Transmit Data Handling Link Pattern

Pattern Encoded as Description

1VV0301463 Rev. 1.0 Page 55 of 76 2018-01-24

Page 56: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

The HI Format is used for the message exchange. Refer to 3.2.2.3 Annexure - HI Frame Format (From Host), page 66 and 3.2.2.4 Annexure - HI Frame Response (From GS Node), page 67.

Based on MCU capabilities (such as multi threaded application, single threaded application, interrupt supported application, and so on), SPI command response method supports the following methodologies to transfer data between MCU and GS node.

• Interrupt methodology

• Polling methodology

3.2.2.2.1 Interrupt Methodology

This methodology is used if the MCU is running at higher clock speed and run into false detection of GPIO37 status. MCU should configure interrupt on rising edge of the pin connected to GPIO37 in GS.

The following section provides steps involved while transferring data from MCU to GS node using Interrupt based methodology.

Transferring Data from MCU to GS Node

1. MCU sends first four bytes of WRITE_REQUEST to GS node. It waits for minimum of 3.2 microseconds and rearms the interrupt handler which discards all the previous interrupts.

2. GS node receives four bytes of WRITE_REQUEST in SPI FIFO. It triggers an interrupt to pull the GPIO37 low (This step is performed although GPIO37 is low).

NOTE: 1.) The MCU waits for 3.2 microseconds as it is the minimum time required for the hardware and software latency. The following steps describe how an interrupt is processed: a.) SPI FIFO triggers an interrupt as soon as it receives the first four bytes of data from MCU. This ISR will pull down GPIO37 only if the data is READ_REQUEST/WRITE_REQUEST. MCU needs to check or wait for the GPIO37 to go low. b.) Interrupt is sent to the interrupt controller c.) Interrupt controller intimates the APP CPU about the interrupt d.) OS scheduler checks for any pending interrupt and runs the corresponding ISR (Interrupt Service Routine) as ISRs have the highest priority

1VV0301463 Rev. 1.0 Page 56 of 76 2018-01-24

Page 57: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

3. MCU sends the remaining four bytes of the WRITE_REQUEST and waits for the GPIO37 to transit from low to high.

NOTE: 2.) If a race condition occurs when the GS node wants to send data to MCU and MCU wants to send data to GS node at the same time, then this scenario is being handled as follows:

When data is received over the network which is supposed to be sent to MCU, the task that is responsible for making the GPIO37 high can never run ahead of the ISR even though the interrupts are disabled in the system.

Disabling of interrupts is being done by tasks who have a higher priority than the application receive task which makes the GPIO37 high when there is data to be sent to MCU.

While the interrupts are disabled, a thread switch can only happen if there is:

• a message post to a higher priority thread or

• semaphore acquire/release happening or

• any RTOS call that can make thread switch even before the interrupts are enabled.

And in no circumstances, this is happening in our system which avoids the mentioned race condition. In this scenario, a.) GS node first responds to WRITE_REQUEST with proper response. b.) Once MCU WRITE is finished and the MCU receives a response, GPIO37 is made HIGH as GS2000 has some pending data which the MCU has not read. c.) MCU should then READ_REQUEST and read all the data available in GS node.

NOTE: It is recommended to send up to 1400bytes at a time.

1VV0301463 Rev. 1.0 Page 57 of 76 2018-01-24

Page 58: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

Figure 13, page 58 shows the timing diagram from step 1 to step 3.

Figure 13 Transferring data from MCU to GS node

4. GS node receives the four bytes in SPI FIFO. It parses the WRITE_REQUEST and formulates the WRITE_RESPONSE.

5. GS node puts the eight bytes of WRITE_RESPONSE in Ping buffer.

6. MCU detects the GPIO37 as high and sends clock to receive the WRITE_RESPONSE.

7. MCU parses the WRITE_RESPONSE, if it is WRITE_RESPONSE_OK- it learns the amount of data that can be received by GS node and provides eight bytes of Data header to GS node.

8. GS node pulls GPIO37 LOW after receiving DATA_HEADER from the MCU, MCU need not wait for GPIO to go LOW.

NOTE: GS2000 sends WRITE_RESPONSE_NOK, when there is no sufficient buffer to accommodate the length mentioned in the WRITE_REQUEST or if the checksum does not match. Then MCU should wait for a certain time (Ex: 100 msec) and then re-issue the WRITE_REQUEST. In this case, MCU should ensure that it does not drop any data.

1VV0301463 Rev. 1.0 Page 58 of 76 2018-01-24

Page 59: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

9. MCU sends the actual data.

10. When the size of data is less than 1024 bytes, the time GPIO37 takes to become low after step 5 is 16 clock cycles (WRITE_RESPONSE + Data Header). When the size of data is more than 1024 bytes, the time taken wait cycle will be (Data length-1024+16) clocks. This is because the PONG Tx buffer is of 1024 bytes in size and the initial extra bytes (Data length - 1024) are put in PING Tx buffer.

Figure 14, page 59 shows the timing diagram from step 4 to step 8.

Figure 14 Transferring data from MCU to GS node (Contd.)

The following section provides steps involved while transferring data from GS node to MCU using Interrupt based methodology

Transferring Data from GS Node to MCU

1. When GS node has data to be sent to MCU, it makes the GPIO37 high.

2. On receiving an interrupt (which is configured on rising edge of the pin connected to GPIO37), MCU performs the following:

a. Rearms the interrupt handler to detect the low to high transition of GPIO37

b. Sends eight bytes of READ REQUEST to GS node

c. Waits for the low to high transition of GPIO37

1VV0301463 Rev. 1.0 Page 59 of 76 2018-01-24

Page 60: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

3. When GS node receives A first 4bytes of READ_REQUEST in SPI FIFO, it triggers an interrupt to pull the GPIO37 LOW. Here the MCU need not wait for GPIO37 to go HIGH. After receiving the READ_REQUEST, GS node parses the READ REQUEST, formulates the READ RESPONSE, puts the READ RESPONSE along with the Data header in the PING buffer, and pulls the GPIO37 high.

4. MCU detects the GPIO37 as high and sends clock to receive the READ RESPONSE.

5. MCU parses the READ_RESPONSE, if it is READ_RESPONSE_OK then learns the amount of data that will be sent by GS node, and provides clock to receive eight bytes of Data header and actual data. If it is READ_RESPONSE_NOK, when there is no actual data to be sent to MCU.

6. GS node pulls GPIO37 LOW after sending READ_RESPONSE and DATA_HEADER, this is done in PING interrupt.

Points to Remember from MCU Perspective

• GS node performs an automatic soft-reset if pending network data has not been received by the MCU for 32 seconds.

• MCU is not allowed to abort a read/write operation after issuing a READ_REQUEST or WRITE_REQUEST.

• The data length value in the DATA_HEADER should always be identical to the data length value in the respective READ_RESPONSE or WRITE_RESPONSE.

• GS node never uses a data length value of 0 bytes in READ_RESPONSE or WRITE_RESPONSE, and DATA_HEADER. GS node sends NOK If there is no data to read or write.

• MCU should never use a data length value of 0 bytes in DATA_HEADER.

• GS node does not expect any inter-word time between the transmissions of SPI words to receive data. This means, when clock is given by the MCU, the GS node sends data that is available in its SPI buffer and when the clock is stopped, this data stays in the SPI buffer.

• Idle characters are represented by 0xF5.

• MCU should not check for GPIO37 LOW.

NOTE: If MCU requests for the data which is less then what GS node wants to send, then GS node sets “pendingdataflag” in READ_RESPONSE_OK.

NOTE: When the size of data is less than 1024 bytes, the time GPIO37 takes to become low after step 5 is 16 clock cycles (READ RESPONSE + Data Header). When the size of data is more than 1024 bytes, the wait cycle will be (Data length-1024+16) clocks. This is because the PONG Tx buffer is of 1024 bytes in size and the initial extra bytes (Data length - 1024) are put in PING Tx buffer.

1VV0301463 Rev. 1.0 Page 60 of 76 2018-01-24

Page 61: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

3.2.2.2.2 Polling Methodology

This method can only be used if the MCU is not capable to generate the interrupts where the MCU is single threaded. Currently its not recommended to use this mode.

For high speed MCUs, it is always recommended to use interrupt mode.

The following section provides steps involved while transferring data from MCU to GS node using Polling methodology.

Transferring Data from MCU to GS Node

1. MCU provides clock.

2. MCU sends the WRITE_REQUEST to GS node. It uses HI frame with:

a. Class field - WRITE_REQUEST

b. Length is the size of data to be transferred from MCU to GS node.

– The maximum available data size is 2032 (2048-8-8).

– The maximum DMA size allowed on GS2000 is 1024.

– It is recommended to send up to 1400bytes at a time.

3. When GS node receives the WRITE_REQUEST, it pulls GPIO37 LOW (to avoid the race condition when GPIO37 is high and HOST MCU wants to write some data to GS node) and then processes WRITE_REQUEST. It creates WRITE_RESPONSE populating the DMA buffer and then makes the GPIO37 HIGH.

4. GS node pulls the Ready to Send signal (GPIO37) high to inform the MCU when it is ready with the WRITE_RESPONSE.

5. MCU provides the clock to read WRITE_RESPONSE.

6. GS node sends WRITE_RESPONSE to MCU. It uses HI frame with:

NOTE: If a race condition occurs when the GS node wants to send data to MCU and MCU wants to send data to GS node at the same time, then: a.) GS node first responds to the WRITE_REQUEST and provides proper responses. b.) Once MCU WRITE is finished and MCU receives proper response, GPIO37 will be again made HIGH as GS node contains certain pending data which MCU has not read. c.) MCU should send READ_REQUEST and read all the data available in GS node.

NOTE: The MCU must wait for the GPIO37 transition from Low to High before applying the clock.

1VV0301463 Rev. 1.0 Page 61 of 76 2018-01-24

Page 62: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

a. Class field – WRITE_RESPONSE_OK/WRITE_RESPONSE_NOK

b. Length as the size of the data, MCU initiates to send data.

c. The status field is WRITE_RESPONSE_OK if it is ready to receive the data and WRITE_RESPONSE_NOK if it is not ready to receive the data.

7. MCU sends DATA_HEADER, if WRITE_RESPONSE_OK, using HI Frame with:

a. Class field – DATA_FROM_HOST

b. Length as the size of the data should be equal to the length mentioned in the WRITE_REQUEST.

8. MCU sends the actual data.

9. GS node pulls down GPIO37 after receiving data header (this is done in PING interrupt). Here the MCU need not wait for GPIO37 to go LOW.

10. GS node receives all the data from the HOST MCU and pulls down GPIO37 to LOW after receiving complete date (this is done in PONG interrupt). This is a defensive mechanism to maintain GPIO37 toggling.

• MCU should check for GPIO37 for any pending data from GS2000 and:

a. If GPIO is LOW, will stop the clock

b. If GPIO is HIGH, will start the procedure for READ once it is ready to receive

The following section provides steps involved while transferring data from GS node to MCU using Polling methodology.

Transferring Data from the GS Node to MCU

1. GS node pulls up the Ready to Send Signal (GPIO37) high when there is data to send from GS node to MCU.

2. MCU provides clock when it is willing to receive.

NOTE: GS node sends WRITE_RESPONSE_NOK, when there is no sufficient buffer to accommodate the length mentioned in the WRITE_REQUEST or if the checksum does not match. MCU should wait for a certain time (Ex: 100 msec) and then re-issue the WRITE_REQUEST. In this case, MCU should ensure that it does not drop any data.

NOTE: When the size of data is less than 1024 bytes, the time GPIO37 takes to become low after step 7 is 16 clock cycles (WRITE RESPONSE + Data Header). When the size of data is more than 1024 bytes, the wait cycle will be (Data length-1024+16) clocks. This is because the PONG Tx buffer is of 1024 bytes in size and the initial extra bytes (Data length - 1024) are put in PING Tx buffer.

1VV0301463 Rev. 1.0 Page 62 of 76 2018-01-24

Page 63: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

3. MCU sends the command READ_REQUEST to GS node. It uses HI frame with:

a. Class field - READ_REQUEST

b. Length is the size of data that MCU can receive from GS node.

– The maximum available data size is 2032 (2048-8-8).

– The maximum DMA size allowed on GS2000 is 1024.

4. When GS node receives first 4bytes of READ_REQUEST in SPI FIFO, it triggers an interrupt to pull the GPIO37 LOW. Here the MCU need not wait for GPIO37 to go HIGH. After receiving the READ_REQUEST, GS node parses the READ REQUEST, formulates the READ RESPONSE, puts the READ RESPONSE along with the Data header in the PING buffer, and pulls the GPIO37 high.

5. MCU detects the GPIO37 as high and sends clock to receive the READ RESPONSE.

6. MCU parses the READ_RESPONSE. If it is READ_RESPONSE_OK, then MCU learns the amount of data that will be sent by GS node and provides clock to receive eight bytes of Data header and actual data. If it is READ_RESPONSE_NOK, then there is no actual data to be sent to MCU.

7. GS node pulls down the GPIO37 to LOW after sending READ_RESPONSE and DATA_HEADER. This is done in PING interrupt.

8. GS node sends the DATA_HEADER and DATA_HEADER using HI Frame with

a. Class field – DATA to MCU.

b. Length is the size of the data (this length is equal to the length mentioned in the READ_RESPONSE_OK)

GS node sends the actual data to the MCU and the MCU provides clock to read this data.

9. GS node pulls down the GPIO37 to LOW after sending READ_RESPONSE and DATA_HEADER. This is done in PING interrupt.

NOTE: If MCU requests for the data which is less then what GS wants to send, then GS will set “pendingdataflag” in READ_RESPONSE_OK.

NOTE: When the size of data is less than 1024 bytes, the time GPIO37 takes to become low after step 5 is 16 clock cycles (READ RESPONSE + Data Header). When the size of data is more than 1024 bytes, the wait cycle will be (Data length-1024+16) clocks. This is because the PONG Tx buffer is of 1024 bytes in size and the initial extra bytes (Data length - 1024) are put in PING Tx buffer.

1VV0301463 Rev. 1.0 Page 63 of 76 2018-01-24

Page 64: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

10. MCU stops the clock.

11. Once the read process is completed, check for GPIO37

a. If GPIO is HIGH, start read process again.

b. If GPIO is LOW, continue with the application process.

3.2.2.2.3 Timing Diagrams

MCU Write to GS Node

Figure 15, page 64 shows the timing diagram for MCU write (<=1024 Bytes) to GS node.

Figure 15 MCU Write (<=1024 Bytes) to GS Node

NOTE: When the size of data is less than 1024 bytes, the time GPIO37 takes to become low after step 6 is 16 clock cycles (READ RESPONSE + Data Header). When the size of data is more than 1024 bytes, the wait cycle will be (Data length-1024+16) clocks. This is because the PONG Tx buffer is of 1024 bytes in size and the initial extra bytes (Data length - 1024) are put in PING Tx buffer.

1VV0301463 Rev. 1.0 Page 64 of 76 2018-01-24

Page 65: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

Figure 16, page 65 shows the timing diagram for MCU write (>1024 Bytes) to GS node.

Figure 16 MCU Write (>1024 Bytes) to GS Node

MCU Read to GS Node

Figure 17, page 65 shows the timing diagram for MCU Read (<=1024 Bytes) to GS node.

Figure 17 MCU Read (<=1024 Bytes) to GS Node

1VV0301463 Rev. 1.0 Page 65 of 76 2018-01-24

Page 66: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

Figure 18, page 66 shows the timing diagram for MCU Read (>1024 Bytes) to GS node.

Figure 18 MCU Read (>1024 Bytes) to GS Node

3.2.2.3 Annexure - HI Frame Format (From Host)All messages carried over the Host Interface have a common format. They are composed of a HI header, and parameters depending on the header. HI frames are composed, in addition to the HI header and parameters, of a start delimiter and a HI HEADER checksum. This format is defined in Figure 19, page 66.

The Start-of-frame delimiter is the single-byte value 0xA5, used to ensure synchronization at the frame level. The driver starts the reception process when it recognizes the delimiter. The length of the delimiter has been reduced to 1 byte to avoid alignment problems when waiting for the start element. However, no provisions are made to ensure that the subsequent data stream does not contain a byte with value 0xA5, so it is possible for the driver to mistake a data byte for a delimiter. Therefore, a header checksum has been added to ensure correct synchronization. A single checksum byte is used, computed as the 1’s complement of the 8-bit long (modulo-256) sum of all the bytes of the HI HEADER (not including the Start delimiter). Note that each byte is independently added to the sum, as an integer between 0 and 255, without regard for its significance within its own data field.

Figure 19 HI Frame Format (From Host Side)

1VV0301463 Rev. 1.0 Page 66 of 76 2018-01-24

Page 67: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

The format of HI Parameters field is determined by the service class. The service class of each frame is signaled by the value of the first field. Available service class identifiers (see Table 20, page 67).

3.2.2.4 Annexure - HI Frame Response (From GS Node)Figure 20, page 67 shows the HI Frame Response from GS node.

Figure 20 HI Frame Response (from GS Node)

Table 21, page 68 shows the HI Frame Response from GS node

Table 20 HI Parameters Service Class Identifiers

Identifiers DescriptionStart of frame 0xA5

Class0x01 - WRITE_REQUEST from MCU side0x02 - READ_REQUEST from MCU side0x03 - DATA from MCU side

Reserved 0x00Additional Info 0x00,0x00Length Maximum 2032

CheckSum

A single checksum byte is used, computed as the 1’s complement of the 8-bit long (modulo-256) sum of all the bytes of the HI HEADER (not including the Start delimiter).

1VV0301463 Rev. 1.0 Page 67 of 76 2018-01-24

Page 68: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

3.2.2.5 Pin Connection for SPI InterfaceTable 22, page 68 describes the pin connection for the SPI interface.

Table 21 HI Frame Response (from GS Node)

Identifier DescriptionStart of frame 0xA5

Class

0x11 - WRITE_RESPONSE_OK to MCU side0x12 - READ_RESPONSE_OK to MCU side0x13 - WRITE_RESPONSE_NOK to MCU side0x14 - READ_RESPONSE_NOK to MCU side0x15 - DATA to MCU side

Reserved 0x00

Additional Info0x00,0x000x00, 0x01 - Pending Data for transfer from GS2000 to MCU

Length 0 (No Data)

CheckSum

A single checksum byte is used, computed as the 1’s complement of the 8-bit long (modulo-256) sum of all the bytes of the HI HEADER (not including the Start delimiter).

Table 22 Pin Connection for SPI Interface

Host MCU S2W Node RemarksMSPI_DOUT SSPI_DIN N/AMSPI_DIN SSPI_DOUT N/AMSPI_SS SSPI_SS N/AMSPI_CLK SSPI_CLK N/AGPIO GPIO37 Host wake-up signal or Ready to Send. Ground Ground Ground

1VV0301463 Rev. 1.0 Page 68 of 76 2018-01-24

Page 69: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

3.2.3 SDIO InterfaceGS node is supported to be configured as SDIO slave only. It uses the SDIO interface with a maximum clock frequency of 33 MHz.

3.2.3.1 Capabilities1. Block size of 512 bytes

2. Data bus width of 4 bits

3. Maximum clock supported is 33Mhz

4. Support for Direct read/write (IO52) and Extended read/write (IO53) operations

5. IO Signals:

– SDIO_CLK: Clock

– SDIO_CMD: Command line

– SDIO_DAT0: is used for data transfer and busy signaling

– SDIO_DAT1: is used for data transfer and Interrupt signaling

– SDIO_DAT2: is used for data transfer and read_wait

– SDIO_DAT3: is used for data transfer

NOTE: There is no command available to configure SDIO interface. This interface can be only enabled from the SDK Builder while compiling the firmware.

1VV0301463 Rev. 1.0 Page 69 of 76 2018-01-24

Page 70: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

3.2.3.2 SDIO Host Slave Initialization and CommunicationThis section provides initialization steps to be performed by the Host (SDIO Master) after power up.

NOTE: Before the Host powers up, GS node needs to be interfaced with Host via SDIO.

3.2.3.2.4 Host-SDIO Master Initialization

The following steps are performed to initialize Host-SDIO Master:

1. Initialization

– Set the SDIO clock to 400KHz

– Set the bus width to 1

– Set power state to ON

– Enable SDIO clock

– Enable card insert/remove interrupt

2. Wait for the card insert interrupt.

NOTE: Card insert interrupt happens only on a fresh insert. If present during boot, the Host shall not wait for this interrupt.

3. Once step 2 occurs, perform the following: (Refer function io_sd_mount ())

– Set the clock frequency (low speed-400KHz) for card identification

– Wait for card wake up (100 msec/500msec/1sec)

– Send CMD52 to do a card reset (CMD52, fun0, address 0x06, value -> 0x08, write)

– Send CMD5 and check for the error status

– If the above CMD returns no error, check number of IO functions

– Set the supported function number

– Send CMD5 with argument 0 to get OCR (Operations Condition Register), which is used to inquire about the voltage range needed by the I/O card (GS node).

– Send CMD5 to write new voltage and keep sending it (this can be performed in a loop for a maximum of 100 iterations) till it returns success

– Check the response and wait for the card ready.

– Send CMD3 with argument 0 to get RCA (Relative Card Address Register)

– Send CMD7 to change the state

– Read CCR register 0x13 to get the capability

– Depends on the capability enable high/low speed by setting corresponding clock.

1VV0301463 Rev. 1.0 Page 70 of 76 2018-01-24

Page 71: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

– Set the 4bit/1 bit mode depends on the above capability

4. Write the CCR register 0x02 to enable the SDIO card.

5. Write the CCR register 0x04 to enable the card interrupt for a function

6. Write CCR register 0x110 and 0x111 to set the card block size

– Here, initialization at function 0x00 is done.

– Function 1 is used for read/write data from the card.

– Only two function 1 registers are accessible from the host

- One is the interrupt which indicates pending data at 0x05

- Other is the read count bytes at 0x1c -0x1d.

The following table describes the values of SDIO CCR registers before and after initialization for reference.

Table 23 DIO CCR registers before and after initialization

S. No. Address Name Value (Before)

Value (After)

1 0x00 CCCR/SDIO Version 0x32 0x32

2 0x01 SD Specification Revision 0x02 0x02

3 0x02 I/O Enable 0x00 0x024 0x03 I/O Ready 0x00 0x025 0x04 Int Enable 0x00 0x036 0x05 Int Pending 0x00 0x027 0x06 I/O Abort 0x00 0x008 0x07 Bus Interface Control 0x02 0x029 0x08 Card Capability 0x1f 0x1f10 0c09 Common CIS Pointer 0x00 0x0011 0x0a Common CIS Pointer 0x10 0x1012 0x0b Common CIS Pointer 0x00 0x0013 0x0c Bus Suspend 0x00 0x0014 0x0d Function Select 0x00 0x0015 0x0e Exec Flags 0x00 0x0016 0x0f Ready Flags 0x00 0x0017 0x10 FN0 Block Size 0x00 0x0018 0x11 FN0 Block Size 0x00 0x0019 0x12 Power Control 0x01 0x0120 0x13 High Speed 0x03 0x03

1VV0301463 Rev. 1.0 Page 71 of 76 2018-01-24

Page 72: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

3.2.3.2.5 Host Read Sequence

When GS node writes data to the Host, it receives read interrupt. Upon receiving the interrupt following steps should be performed by the HOST.

• Check 'Interrupt Pending' register.

- Read Interrupt Pending register (function 0 address 0x05)

- If value is '0x02', it means there is an interrupt pending.

• Clear interrupt by reading ‘Int Enable’ register

- Read ‘Int Enable’ register (function 1 address 0x04) using CMD52).

• Re-Check 'Interrupt Pending' register to make sure interrupt has been cleared

- Read Interrupt Pending register (function 0 address 0x05)

- If value is '0x00', it means there is no pending interrupt.

• Read the data count (using CMD52).

– Read the value at address 0x1C with function 1, say len1

– Read the value at address 0x1D with function 1, say len2

– Compute the actual data length to be read using the following logic

act_len = len1| (len2 << 8);

• Read the data (using CMD53).

Figure 21 SDIO Block (Multiple) Read Operation

3.2.3.2.6 Host Write Sequence

• Check if the SDIO medium is available or not, by checking the ‘SDIO DAT0’ line.

– If LOW, keep polling till ‘SDIO DAT0’ goes HIGH

1VV0301463 Rev. 1.0 Page 72 of 76 2018-01-24

Page 73: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

– If HIGH, continue with WRITE operation

• Issue CMD53 with respective arguments for writing the data to GS node.

Figure 22 SDIO Block (Multiple) Write Operation

3.2.3.3 SDIO Host RecommendationsFollowing are recommendations which the embedded host (which acts as SDIO Master when interfaced with GS node) needs to follow for efficiently handling specific scenarios, maintaining and restoring the SDIO connection between Host MCU and GS node.

3.2.3.3.7 SDIO_Busy Signal Handling

When SDIO buffer on GS node is full, it cannot receive more data from Host MCU. In such cases, SDIO Slave on GS node pulls the SDIO_Busy line LOW to indicate that it cannot

NOTE: It is strongly recommended to send maximum of 1400 bytes in a single write.

NOTE: 1.)Since SDIO slave initialization is dependent on HOST SDIO Master, it is mandatory to setup the Host’s SDIO which is the Master before GS node boots-up. If not GS node keeps waiting until SDIO Master initializes. 2.)If GS node is kept waiting until the WATCHDOG timer expires, then it would result in WATCHDOG Reset.

1VV0301463 Rev. 1.0 Page 73 of 76 2018-01-24

Page 74: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

receive any more data. At this point, Host MCU cannot perform WRITE and READ operations as the SDIO CMD response returns failure.

To avoid WRITE and READ failures, Host needs to perform the following:

1. Check for SDIO_Busy signal, before initiating SDIO_WRITE.

2. If SDIO medium is busy, keep polling till the SDIO_Busy line is HIGH (SDIO medium ready for communication).

3. If medium is not busy, go ahead with the WRITE.

3.2.3.3.8 Handling Rx interrupt

When GS node has data (Command Response/Data/Asynchronous Message) to be sent to Host MCU, Host needs to perform the following procedure to read data:

1. Interrupt line (DATA_1) goes low to trigger the host interrupt.

2. Host disables the interrupt and clears the interrupt status register.

3. Host reads the data length registers.

4. Host reads number of bytes specified by the data length registers.

5. After this point, DATA_1 goes high.

6. Host enables the interrupt again.

7. If GS node has more data to be sent to the host, interrupt line goes low again, and steps 1 to 6 are repeated.

3.2.3.3.9 Handling GS Reset

As SDIO interface does not support in-band notification from Slave (GS node) to Master when there is an interface tear down (this can happen if the slave is put into an expected or unexpected reset), following mechanism has to be incorporated in the Host MCU (SDIO Master) to determine the event and re-initialize the SDIO block to establish the SYNC with GS node.

The SD_LinkCheck mechanism in the Host MCU needs to perform the following:

1. Read ‘I/O Enable’ bit (addr: 0x02) in the CCR register. If the value is ZERO, then it is a reset.

2. Read ‘I/O Ready’ bit (address: 0x03) in CCR. If the value is ZERO, then it is a reset.

NOTE: Host needs to ensure that it does not drop any data due to Busy signaling.

1VV0301463 Rev. 1.0 Page 74 of 76 2018-01-24

Page 75: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

3.2.3.4 Pin DescriptionThe following are the pin descriptions in GS module:

3.2.4 Interface VerificationThe command AT can be issued to verify that the interface is operating correctly or not.

Command Syntax AT

Synchronous Response

Table 25, page 75 describes the synchronous responses and remarks for the Interface Verification command.

Table 24 Pin Descriptions

Pin DIR DescriptionGPIO_35/SDIO_CLK/SPI0_CLK IN SDIO Clock/ SPI0 ClockGPIO_34/SDIO_CMD/SPI0_DIN IN SD4 bit mode, command line

SD1 bit mode, command lineSPI mode, Data input

GPIO_37/SDIO_DAT1_INT IN/OUT SD4 bit mode, Data line 1/InterruptSD1 bit mode, InterruptSPI mode, Interrupt

GPIO_32/SDIO_DAT2 IN/OUT SD4 bit mode, Data line 2SD1 bit mode, not usedSPI mode, Data input

GPIO_33/SDIO_DAT3/SPI0_CS_n_0 IN/OUT SD4 bit mode, Data line 3SD1 bit mode, not usedSPI mode, Chip Select

GPIO_36/SDIO_DAT0/SPI0_DOUT IN/OUT SD4 bit mode, Data line 0SD1 bit mode, Data lineSPI mode, Data Output

Table 25 Interface Verification Synchronous Responses

Responses RemarksOK Success

No responseFailureInterface not operating correctly.

1VV0301463 Rev. 1.0 Page 75 of 76 2018-01-24

Page 76: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

1VV0301463 Rev. 1.0 Page 76 of 76 2018-01-24

Page 77: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

Chapter 4 General Operations

This chapter describes the commands for generic operations as required by Serial-to-WiFi Application.

• Version, page 77

• Time Setting, page 79

• Profile Setting, page 84

• Reset, page 98

• MAC, page 99

4.1 VersionThis command is used to return version information.

Command Syntax AT+VER=?

Response– Serial-to-WiFi version

– GainSpan Embedded Platform Software version

– WLAN firmware version

Example 1 AT+VER=?S2W APP VERSION=5.1.4S2W GEPS VERSION=5.1.4S2W WLAN VERSION=5.1.4OK

The command to get more details of the S2W version.

AT+VER=??

ResponseThis command returns more information along with the above response of the S2W binary followed by the standard command response to the serial host.

– Serial-to-WiFi version

– GainSpan Embedded Platform Software version

– WLAN firmware version

– Serial-to-WiFi binary type as specified in SDK builder

– Serial-to-WiFi Release type which can be GA or Beta

1VV0301463 Rev. 1.0 Page 77 of 102 2018-01-24

Page 78: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

– Build time

– Build date

– WLAN firmware extension version

– Application firmware extension version

– WLAN feature bitmap

– GEPS firmware extension version

– Module flash ID with storage capacity

Example 2 AT+VER=??S2W APP VERSION=5.1.4S2W GEPS VERSION=5.1.4S2W WLAN VERSION=5.1.4S2W BIN TYPE=5_1_4_Unsolicited_TxS2W RELEASE TYPE=GABUILD TIME=03:33:28BUILD DATE=Jan 27 2015WLAN EXT VERSION=5S2W APP EXT VERSION=1WLAN FEAT BMAP=0000000000000007GEPS EXT VERSION=1FLASH ID=0x000020c2:MICRONIX-4MBOK

1VV0301463 Rev. 1.0 Page 78 of 102 2018-01-24

Page 79: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

4.2 Time Setting

4.2.1 Set System Time

4.2.1.1 Manual SettingThis command is used to set the GS node’s system time to the time specified as the parameters and returns the standard command response. GS node expects either one of the time parameters.

Command Syntax AT+SETTIME=[<dd/mm/yyyy>,<HH:MM:SS>][,System time in milliseconds since epoch (1970)]

Parameter Description

Table 26, page 79 describes the Set System Time parameters.

Synchronous Response

Table 27, page 79 describes the synchronous responses and remarks for the Set System Time command.

Example -1 AT+SETTIME=02/06/2016,15:00:00OK

Example -2 AT+SETTIME=,1493788674000OKAT+GETTIME=?3/5/2017,5:17:58,1493788678792OK

NOTE: This command does not take care of the day light savings. The reference will be with respect to UTC/GMT.

Table 26 Set System Time Parameters

Parameter Optional/Mandatory Descriptiondd/mm/yyyy Mandatory It specifies the date in dd/mm/yyyy format.HH:MM:SS Mandatory It specifies the time in HH:MM:SS format.System time in milliseconds since epoch (1970)

Optional It specifies the system time in milliseconds since epoch (1970).

Table 27 Set System Time Synchronous Responses

Responses RemarksOK SuccessERROR:INVALID INPUT For invalid input

1VV0301463 Rev. 1.0 Page 79 of 102 2018-01-24

Page 80: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

4.2.1.2 Dynamic SettingThis command is used to set the GS node system time using the SNTP.

Command Syntax AT+NTIMESYNC= <Enable>,<Server IP>,<Timeout>,<Periodic>,[<frequency>]

Parameter Description

Table 28, page 80 describes the Set System Time Using SNTP parameters.

NOTE: The time set by this command can be verified using the AT+GETTIME=? command.

Table 28 System Time Using SNTP Parameters

Parameter Optional/Mandatory Value Description

Enable Mandatory 0,1• 0 - stops the time sync• 1 - starts the time sync using SNTP

Server IP Mandatory N/A SNTP server IP

Timeout Mandatory N/A The time to wait for the server response (in seconds).

Periodic Mandatory 0,1

The time sync to be done one time or periodically.• 0 - one time• 1 - periodic

Frequency Optional N/A If the periodic flag is set, the time difference between each time sync (in seconds).

NOTE: 1> Only IP address is accepted here and no DNS names are allowed. In case of DNS name, first resolve the DNS name using AT+DNSLOOKUP command and then use IP address in this command. 2> In case of Periodic Time Sync, make sure that "Frequency" parameter value is greater than "TimeOut" parameter value.

1VV0301463 Rev. 1.0 Page 80 of 102 2018-01-24

Page 81: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

Synchronous Response

Table 29, page 81 describes the synchronous responses and remarks for the Set System Time Using SNTP command.

Example 1 AT+NTIMESYNC=1,80.241.0.72,10,1,60

Example 2 Short Time Sync

Serial2WiFi APP

AT+NDHCP=1OKAT+WWPA=0384124610OKAT+WA=GSDemo IP SubNet Gateway 192.168.1.8:255.255.255.0:192.168.1.1OKAT+DNSLOOKUP=2.asia.pool.ntp.orgIP:103.16.182.23OK

AT+GETTIME=?1/1/1970,0:0:42,42300

OK

AT+NTIMESYNC=1,103.16.182.23,10,0OK

AT+GETTIME=?2/6/2016,9:48:28,1464860908560

OK

Example 3 Periodic Time Sync

AT+NDHCP=1OKAT+WWPA=0384124610OK

Table 29 Set System Time Using SNTP Synchronous Responses

Responses RemarksOK SuccessERROR:INVALID INPUT For invalid input

SNTP Busy If previous time synchronization is not completed.

1VV0301463 Rev. 1.0 Page 81 of 102 2018-01-24

Page 82: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

AT+WA=GSDemo IP SubNet Gateway 192.168.1.8:255.255.255.0:192.168.1.1OKAT+DNSLOOKUP=2.asia.pool.ntp.orgIP:103.16.182.23OK

AT+GETTIME=?1/1/1970,0:0:42,42300

OK

AT+NTIMESYNC=1,103.16.182.23,10,1,60OK

AT+GETTIME=?2/6/2016,9:48:28,1464860908560

OK

1VV0301463 Rev. 1.0 Page 82 of 102 2018-01-24

Page 83: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

4.2.2 Get System TimeThis command is used to receive the current system time in milliseconds since epoch (1970) followed by the standard command response to the serial interface.

Command Syntax AT+GETTIME=?

Synchronous Response

Table 30, page 83 describes the synchronous responses and remarks for the Get System Time command.

Example 1 AT+GETTIME=?2/6/2016,15:0:7,1464879607040

OK

Example 2 Serial2WiFi APPAT+TCERTADD=SSL_comodo,0,1500,1OKOKAT+CERTINFOGET=SSL_comodoERROR: INVALID INPUTAT+CERTINFOGET=SSL_comodocert->not_before: 1263859200cert->not_after: 2147471999valid from: Tue, 19 Jan 2010 00:00:00 GMTvalid till: Fri, 13 Dec 1901 17:31:43 GMTOK

Table 30 Get System Time Synchronous Responses

Responses Remarks

<dd/mm/yyyy>,<HH:MM:SS>SuccessDisplays date and time in the provided format.

ERROR:INVALID INPUT For invalid input

1VV0301463 Rev. 1.0 Page 83 of 102 2018-01-24

Page 84: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

4.3 Profile SettingGS node supports different operating modes with various settings pre-configured to work with the system. A pre-defined set of variables can be stored in a profile. GS node currently supports storing two different profiles (profile0 and profile1).

The following AT commands are sequentially executed for setting a profile:

– AT&V - To view the current profile

– AT&W - To write to profile settings

– ATZn - To load a profile

– AT&Y - To reboot with particular profile

– AT&F - To factory Reset

4.3.1 Get ProfileThis command is used to get the information of current profiles (Profile 0 and Profile 1) and their saved parameter values in ASCII format. The details of profile parameters are described in 4.3.2 Save Profile, page 86.

Command Syntax AT&V

Synchronous Response

Table 31, page 85 describes the synchronous responses and remarks for the Get profile command.

1VV0301463 Rev. 1.0 Page 84 of 102 2018-01-24

Page 85: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

Table 31 Get Profile Synchronous Responses

Responses RemarksACTIVE PROFILEC0 &Y0 E1 V1 B=9600,8,N,1 &K0 &R0+NDHCP=0 +NSET=192.168.1.99,255.255.255.0,192.168.1.1+DNS1=0.0.0.0, +DNS2=0.0.0.0+WM=0 +WAUTO=0,"GSDemoKit",,6+WRETRY=5 +WP=0 +WRXPS=1 +WRXACTIVE=0+NAUTO=0,1,192.168.1.1,8+WAUTH=0 +WWPA="Serial2Wifi"+PSK-valid=0 +SSID=+WWEP1=1234567890 +WWEP2=S0=01000 S1=00500 S2=00500 S3=00003 S4=00010 S5=00150 S6=00050 S7=00020 S8=01400+BDATA=0+WSEC=0+ASYNCMSG=0 STORED PROFILE 1

Success

The number of profiles depends upon the default configuration of the module.

STORED PROFILE 1E1 V1 B=9600,8,N,1 &K0 &R0+NDHCP=0 +NSET=192.168.1.99,255.255.255.0,192.168.1.1+DNS1=0.0.0.0, +DNS2=0.0.0.0+WM=0 +WAUTO=0,"GSDemoKit",,6+WRETRY=5 +WP=0 +WRXPS=1 +WRXACTIVE=0+NAUTO=0,1,192.168.1.1,8+WAUTH=0 +WWPA="Serial2Wifi"+PSK-valid=0 +SSID=+WWEP1=1234567890 +WWEP2=+WWEP3= +WWEP4=S0=01000 S1=00500 S2=00500 S3=00003 S4=00010 S5=00150 S6=00050 S7=00020 S8=01400+BDATA=0+WSEC=0+ASYNCMSG=0 STORED PROFILE 1

E1 V1 B=9600,8,N,1 &K0 &R0+NDHCP=0 +NSET=192.168.1.99,255.255.255.0,192.168.1.1+DNS1=0.0.0.0, +DNS2=0.0.0.0+WM=0 +WAUTO=0,"GSDemoKit",,6+WRETRY=5 +WP=0 +WRXPS=1 +WRXACTIVE=0+NAUTO=0,1,192.168.1.1,8+WAUTH=0 +WWPA="Serial2Wifi"+PSK-valid=0 +SSID=+WWEP1=1234567890 +WWEP2=+WWEP3= +WWEP4=S0=01000 S1=00500 S2=00500 S3=00003 S4=00010 S5=00150 S6=00050 S7=00020 S8=01400+BDATA=0+WSEC=0+ASYNCMSG=0OK

Success

1VV0301463 Rev. 1.0 Page 85 of 102 2018-01-24

Page 86: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

4.3.2 Save Profile

This command is used to save the current profile. Upon deployment of this command, the current configuration settings are stored in non-volatile memory under the specified profile, (profile 0, or profile 1). In order to ensure that these parameters are restored after power cycling the GS node, the command AT&Y must also be issued, using the same profile number selected here.

Command Syntax AT&Wn

Parameter Description

Table 32, page 86 describes the Save Profile parameters.

Synchronous Response

Table 33, page 86 describes the synchronous responses and remarks for the Save Profile command.

Table 32 Save Profile Parameters

Parameter Optional/Mandatory Value Description

n Mandatory0 For profile 01 For profile 1Saves the profile specified by n (0 or 1).

Table 33 Save Profile Synchronous Responses

Responses RemarksOK Success

ERROR:INVALID INPUTIf parameters are not valid.(n value is other than 0 or 1)

NOTE: GS node supports two profiles.

1VV0301463 Rev. 1.0 Page 86 of 102 2018-01-24

Page 87: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

4.3.3 Load ProfileThis command is used to load a profile. Upon deployment of this command, the currently configured settings are overwritten by those stored in non-volatile memory under the specified profile.

Command Syntax ATZn

Parameter Description

Table 34, page 87 describes the Load Profile parameters.

Synchronous Response

Table 35, page 87 describes the synchronous responses and remarks for the Load Profile command.

Table 34 Load Profile Parameters

Parameter Optional/Mandatory Value Description

n Mandatory0 For profile 01 For profile 1Load the profile specified by n (0 or 1).

Table 35 Load Profile Synchronous Responses

Responses RemarksOK Success

ERROR:INVALID INPUTIf parameters are not valid.(n value is other than 0 or 1)

1VV0301463 Rev. 1.0 Page 87 of 102 2018-01-24

Page 88: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

4.3.4 Select Default ProfileThis command is used to select the default profile. The settings from the profile that are chosen as the default profile are loaded from non-volatile memory when the device is started.

Command Syntax AT&Yn

Parameter Description

Table 36, page 88 describes the Select Default Profile parameters.

Synchronous Response

Table 37, page 88 describes the synchronous responses and remarks for the Select Default Profile command.

Example AT&Y0OK

Table 36 Select Default Profile Parameters

Parameter Optional/Mandatory Value Description

n Mandatory0 For profile 01 For profile 1Set default profile to the value n (0 or 1).

Table 37 Select Default Profile Synchronous Responses

Responses RemarksOK Success

ERROR:INVALID INPUTIf parameters are not valid.(n value is other than 0 or 1)

1VV0301463 Rev. 1.0 Page 88 of 102 2018-01-24

Page 89: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

4.3.5 Restore ProfileThis command is used to restore current profile to factory default values. The factory default values are stored in RAM, and will be lost after each power cycle.

Upon deployment of this command, the current configuration variables are reset to the factory defaults. These defaults are defined by macro values in the configuration header. Issuing this command resets essentially all configuration variables.

Command Syntax AT&F

Synchronous Response

Table 38, page 89 describes the synchronous responses and remarks for the Restore Profile command.

4.3.6 Define ProfileThe configuration parameter values that define the behavior of the GS node are grouped into Profiles. These profiles are stored in non-volatile memory when not in use. The default configuration supports single Profile. The contents of a profile are listed in Table 39, page 89.

Table 38 Restore Profile Synchronous Responses

Responses RemarksOK Success

NOTE: The following sequence of AT Commands is used for complete Factory restore: AT&Y0 AT&F AT&W0 AT&Y1 AT&F AT&W1 AT+RESET=1

Table 39 Define Profile Parameters

Parameter Values ReferenceGeneral Wireless Parameter802.11 Operating Mode STA, Limited AP 5.1.2 Operation Mode, page 105Transmit Power Configuration N/A802.11 Transmit Retry Count 5.1.3 MAC Retry, page 108

Power Save Mode Enabled, Disabled 9.1.3 Custom Power Save Radio Receive, page 436

1VV0301463 Rev. 1.0 Page 89 of 102 2018-01-24

Page 90: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

802.11 Radio Mode Enabled, Disabled 9.1.1 Active Radio Receive, page 431Auto Connect Mode, Wireless Interface Settings802.11 Operating Mode STA

7.4.4 Wireless Parameters, page 230Operating Channel 1 to 14SSID Parameter Any valid SSIDBSSID Parameter Any valid BSSIDMaximum 4.3.7 Configure Profile, page 92Auto Connect Mode, Network Interface SettingsMode Server, Client

6.3 DHCP Client, page 176Protocol TCP, UDPServer Port Number Any valid portServer IP Address Any valid IP addressHost Name Valid Domain nameWireless Interface Security ConfigurationAuthentication Mode Open, Shared 5.3.8 Advanced Commands, page 146PSK Valid Valid, Invalid

5.3.3.5 WPA-PSK and WPA2-PSK Key Calculation, page 135PSK-SSID Any valid SSID, used for

PSK key computationWEP Key Configuration 5.3.8 Advanced Commands, page 146

WPA Pass Phrase 5.3.3.4 WPA-PSK and WPA2-PSK Passphrase, page 134

TCP/IP ConfigurationDHCP Mode Enabled, Disabled 6.3 DHCP Client, page 176IP Address Valid IP address

6.4 IP Address, page 178Net Mask Address Valid maskDefault Gateway Address Valid IP addressDNS1 Valid DNS1 IP address

6.8 DNS Address, page 184DNS2 Valid DNS2 IP addressUART ConfigurationEcho Mode Enabled, Disabled 11.3.2 Echo, page 496Verbose Mode Enabled, Disabled 11.3.3 Verbose, page 497Bits Per Character 5, 6, 7, 8

3.2.1.1 UART Parameters, page 49Number of Stop Bits 1, 2Parity Type None, Odd, EvenSoftware Flow Control Mode Enabled, Disabled 3.2.1.2 Software Flow Control, page 51Hardware Flow Control Mode Enabled, Disabled 3.2.1.3 Hardware Flow Control, page 52

Table 39 Define Profile Parameters (Continued)

Parameter Values Reference

1VV0301463 Rev. 1.0 Page 90 of 102 2018-01-24

Page 91: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

Baud Rate 3.2.1.1 UART Parameters, page 49Limits and TimeoutsNetwork Connection Timeout Units of 10 milliseconds

4.3.7 Configure Profile, page 92

Auto Association Timeout Units of 10 millisecondsTCP Connection Timeout Units of 10 millisecondsAssociation Retry Count Units of millisecondsNagle Wait Time Units of 10 milliseconds

Units of millisecondsNCM L4 Reconnect Interval Units of millisecondsNCM L4 Reconnect Count Units of numbersSPI ConfigurationSPI Clock Polarity and Clock Phase 0, 1 3.2.2 SPI Interface and Configuration, page 53

Table 39 Define Profile Parameters (Continued)

Parameter Values Reference

1VV0301463 Rev. 1.0 Page 91 of 102 2018-01-24

Page 92: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

4.3.7 Configure ProfileThis command is used to help configure various MAC layer and network layer configurations. n is the parameter id to set and p is the value to set the parameter to.

Command Syntax ATSn=p

Table 40, page 92 describes the Configure Profile parameters.

Table 40 Configure Profile Parameters

Parameter Name Value Description

2CommandMode-TCP Connection Timeout (for Transport layer or TCP/UDP connection)

Range from 0 - 7500. 0 corresponds to 75 seconds (default)

The maximum amount of time allowed establishing a TCP client connection, in units of 10 milliseconds. Allowed values: 1 to 65535 (but the TCP/IP stack limits the maximum timeout value).

3 Association Retry Count N/A Not currently supported.

4 AutoMode-Nagle Wait Time 10, i.e., 10x10=100 ms (default)

The data which the GS node receives from the MCU will buffer up to this (AutoMode-Nagle Wait Time) or the amount of data is limited by available buffer size (i.e., 1400 bytes). That means if it is any one of these becomes true then that data will be sent over serial interface in units of 10 milliseconds. Allowed values: 1 to 65535 (but the amount of data is limited by available buffer size, i.e., 1400 bytes).

5 CommandMode- (Obsolete) 150 (150 ms) (default)

The maximum time for scanning in one radio channel, in units of milliseconds.This command is deprecated by the new command AT+WST (see 5.3.1.1 Set Scan Time, page 125).Allowed values: 5 to 1200 (but at the high limit a 14-channel scan will consume 16.8 seconds).

6 NcmAutoMode-Transport Layer-Retry Period

50 (50x10=500 msec) (default)

The time in period between each transport layer 4 connection retry with Ncm auto in units of 10 milliseconds.

1VV0301463 Rev. 1.0 Page 92 of 102 2018-01-24

Page 93: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

7 NcmAutoMode-Transport Layer Retry Count 20 (default)

It is the number of TCP connection retries in NCM auto mode. This also includes the original packet.The node sends the first TCP connection request.If the connection is successful, then the node receives CID. If the connection is not successful, then it starts the timer (NcmAutoMode-Transport Layer-Retry Period), waits for it to expire, and then sends the second TCP connection request.Note: To achieve infinite retries in NCM auto mode, set the retry count to 65535.

8 AutoMode-Frame size configuration

1400 bytes. This depends on the S2W Nagle Time (default)

It is the maximum size of the frame that the GS node can buffer from the MCU to be sent to over the serial interface in Auto Connect mode.

9 Maximum data frames per socket1 to 33 (default value)

This option specifies the number of incoming frames to be read continuously per socket before the next socket is read.When there is continuous data on a given socket, three frames would be read by default and given to host before any next open socket is read.

A Auto connection exit sequence (+++) enabled timeout 100 milliseconds

The time to wait to come out of auto mode after the auto connection exit sequence (+++) enabled timeout.The default value for this parameter is 100 milliseconds (1 second). The maximum value for this parameter is 1000 milliseconds (10 seconds). This feature can be disabled by setting the parameter value to 0.

Table 40 Configure Profile Parameters (Continued)

Parameter Name Value Description

1VV0301463 Rev. 1.0 Page 93 of 102 2018-01-24

Page 94: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

Synchronous Response

Table 41, page 94 describes the synchronous responses and remarks for the Configure Profile command.

4.3.8 Identification InformationThis command is used to return various identification information of GS node.

Command Syntax ATIn

Parameter Description

Table 42, page 94 describes the Identification Information parameters.

Synchronous Response

Table 43, page 94 describes the synchronous responses and remarks for the Identification Information command.

Table 41 Configure Profile Synchronous Responses

Responses RemarksOK SuccessERROR:INVALID INPUT If parameters are not valid.

Table 42 Identification Information Parameters

Parameter Optional/Mandatory Value Description

n Mandatory

0 OEM identification1 Hardware version2 Software version

n is the information ID to obtain. These responses are provided as ASCII strings in addition to the standard command response.

Table 43 Identification Information Synchronous Responses

Responses RemarksGainSpan OK SuccessATI1:GSxxxxOK

The hardware version will change whenever the code in the ROM gets changed.

ATI2:x.x.xOK

The software version will change whenever a new feature is added.

ERROR:INVALID INPUTIf parameters are not valid.(n value is other than 0-2)

1VV0301463 Rev. 1.0 Page 94 of 102 2018-01-24

Page 95: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

4.3.9 Nagle Timer

This command is used to enable or disable Nagle timer on a CID.

Command Syntax AT+CIDCONF=<CID>,<n>,<Configuration ID>,<Configuration value>

Parameter Description

Table 44, page 95 describes the Nagle timer configuration parameters.

Example 1 To set Nagle timeout for CID 0 with 1 second, execute the following command:AT+CIDCONF=0,1,1,100

Where,

0: CID

1: Enable

1: Nagle timer

100: Nagle timeout value which is 100*10=1000 milliseconds

Example 2 To disable Nagle timer for CID 0, execute the following command:AT+CIDCONF=0,0,1

Where,

0: CID

0: Disable

1: Nagle timer

Table 44 Nagle Timer Configuration Parameters

Parameter Optional/Mandatory Value Description

CID Mandatory 1-16 It is the allocated connection identifier for a connection in decimal format.

n Mandatory0, 10: Disable1: Enable

It enables or disables Nagle timer on a CID.

Configuration ID Mandatory 1: Nagle timer It supports to allocate Nagle timer on a CID.

Configuration value Optional For Nagle Timer: 10 (default)

It specifies the value that needs to be set for the above Configuration ID.When Configuration ID is set to 1, this parameter specifies the timeout value in 10th of milliseconds.Note: When value is set to 10, the timeout value will be calculated as 10*10= 100 milliseconds

1VV0301463 Rev. 1.0 Page 95 of 102 2018-01-24

Page 96: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

4.3.10 Enhanced Asynchronous NotificationThis command is used to support enhanced asynchronous notification method.

Command Syntax AT+ASYNCMSGFMT=n

Parameter Description

Table 45, page 96 describes the Enhanced Asynchronous Notification parameters.

Synchronous Response

Table 46, page 96 describes the synchronous responses and remarks for Enhanced Asynchronous command.

Table 45 Enhanced Asynchronous Notification Parameters

Parameter Optional/Mandatory Value Description

n Mandatory0 (default) Disable this feature1 Enable this feature

Enabling this feature results with all asynchronous message going to the serial interface with a header. Also during these asynchronous message transfer S2W Application makes the GPIO9 high. Node Start Up Handling.

Format

The asynchronous message format is as shown:<ESC><TYPE><SUBTYPE><LENGTH><MESSAGE><ESC> Escape

TYPE Type of message and the length is one byte. For asynchronous message, it is 0x41 (ASCII value A)

SUBTYPE

Message subtype and the length of this field is:• One byte when the value of this byte is one of the values from 0 to E. • Two bytes when the value of this byte is F where the first byte and the

next byte is read and interpreted as per the table in A.2 Asynchronous & Enhanced Asynchronous Messages, page 506.

LENGTHLength of the asynchronous message in hex. This field length is 2 bytes. See A.2 Asynchronous & Enhanced Asynchronous Messages, page 506.

MESSAGE Exact asynchronous message as string.

Table 46 Enhanced Asynchronous Notification Synchronous Responses

Responses RemarksOK Success

ERROR: INVALID INPUTIf parameters are not valid.(If n value is other than 0 and 1)

1VV0301463 Rev. 1.0 Page 96 of 102 2018-01-24

Page 97: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

Example 1- Asynchronous message CONNECT (When GS node acts as a TCP server)

AT+WA=GainSpanDemoIP SubNet Gateway192.168.1.99:255:255:255.0:192.168.1.1OK

AT+NDHCP=1IP SubNet Gateway192.168.17.4:255:255:255.0:192.168.17.1OK

AT+NSTCP=8000CONNECT 0OK

AT+ASYNCMSGFMT=1OK11eCONNECT0 1 192.168.17.250090

1VV0301463 Rev. 1.0 Page 97 of 102 2018-01-24

Page 98: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

4.4 ResetThis command is used to reset the GS node. When this command is used without parameter (AT+RESET), it forcefully resets the module core and comes out with a fresh boot message “APP Reset-APP SW Reset”.

Command Syntax AT+RESET

Command Syntax AT+RESET=n

Parameter Description

Table 47, page 98 describes the Reset parameters.

NOTE: This command without parameter (AT+RESET) is obsolete and it is retained for backward compatibility.

NOTE: It is recommended to use this command with parameter (AT+RESET=1).

Table 47 Reset Parameters

Parameter Optional/Mandatory Value Description

n OptionalValue range: 1,2Format: Decimal

1:Resets the whole system including the RTC domain.2: Resets and restores the system to factory default setting

1VV0301463 Rev. 1.0 Page 98 of 102 2018-01-24

Page 99: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

4.5 MACAll new GainSpan modules will have “00:21:7E:xx:xx:xx” as MAC address with Telit Organizational Unique Identifier (OUI).

4.5.1 Set MAC Address

This command is used to set a MAC address to the GS node.

The MAC address is used in the 802.11 protocol to identify the various nodes communicating with an Access Point and to route messages within the local area (layer 2) network. Fixed MAC addresses issued to network interfaces are hierarchically structured and are intended to be globally unique. Before issuing a MAC address to a given GS node, ensure that no other local device is using that address.

Command Syntax AT+NMAC=<MAC ADDRESS>

Parameter Description

Table 48, page 99 describes the Selection of Set MAC Address parameters.

Synchronous Response

NOTE: This command is obsolete as GS node uses the MAC address from OTP. It is retained for backward compatibility.

NOTE: 1.) The GS node is stored with two MAC addresses. One when it is in STA mode and the other when it is in AP mode. The MAC address printed on the GS node is for STA mode. STA MAC address + 1 is the MAC address for AP mode. 2.) To set the MAC address for the GS node in STA mode, execute the command AT+WM=0 followed by the AT+NMAC=<MAC ADDRESS> command. 3.) To set the MAC address for the GS node in AP mode, execute the command AT+WM=2 followed by the AT+NMAC=<MAC ADDRESS> command.

Table 48 Set MAC Address Parameters

Parameter Optional/Mandatory Value Description

MAC Address Mandatory xx:xx:xx:xx:xx:xx(17 characters)

The format of the MAC address is a 17 character colon-delimited hexadecimal number. The MAC address supplied is saved to Flash memory, and will be used on each subsequent cold boot (from power Off) or warm boot (from Standby).

1VV0301463 Rev. 1.0 Page 99 of 102 2018-01-24

Page 100: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

Table 49, page 100 describes the synchronous responses and remarks for the Set MAC Address command.

Example 1 To set the MAC address for the GS node in STA mode, execute the following sequence of commands:

AT+WM=0OK

AT+NMAC=00:1d:c9:d0:70:ccOK

AT+NMAC=?00:1d:c9:d0:70:ccOK

Example 2 To set the MAC address for the GS node in AP mode, execute the following sequence of commands:

AT+WM=2OK

AT+NMAC=00:1d:c9:d0:70:ccOK

AT+NMAC=?00:1d:c9:d0:70:ccOK

Table 49 Set MAC Address Synchronous Responses

Responses RemarksOK SuccessERROR:INVALID INPUT If value is not in the valid format.

NOTE: The command AT+WM=2 should not be issued while the AP is already operating as the limited AP stops beaconing.

1VV0301463 Rev. 1.0 Page 100 of 102 2018-01-24

Page 101: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

4.5.2 Get MAC AddressThis command is used to output the current MAC address of the wireless interface to the serial port.

Command Syntax AT+NMAC=?

Synchronous Response

Table 50, page 101 describes the synchronous responses and remarks for the Get MAC Address command.

Example 1 To get the current MAC address for the GS node in STA mode, execute the following sequence of commands:

AT+WM=0OK

AT+NMAC=?00:1d:c9:d0:70:ccOK

Example 2 To get the current MAC address for the GS node in AP mode, execute the following sequence of commands:

AT+WM=2OK

AT+NMAC=?00:1d:c9:d0:70:ccOK

NOTE: 1.) The GS node is stored with two MAC addresses. One when it is in STA mode and the other when it is in AP mode. The MAC address printed on the GS node is for STA mode. STA MAC address + 1 is the MAC address for AP mode. 2.) To get the current MAC address for the GS node in STA mode, execute the command AT+WM=0 followed by the AT+NMAC=? command. 3.) To get the current MAC address for the GS node in AP mode, execute the command AT+WM=2 followed by the AT+NMAC=? command.

Table 50 Get MAC Address Synchronous Responses

Responses RemarksOK Success

1VV0301463 Rev. 1.0 Page 101 of 102 2018-01-24

Page 102: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

1VV0301463 Rev. 1.0 Page 102 of 102 2018-01-24

Page 103: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

Chapter 5 Wireless

This chapter describes commands for configurations and operations related to WLAN layer.

• Wireless Generic, page 103

• Beacon Mode (Unassociated Mode), page 114

• Station/AP Mode, page 125

• WiFi Direct Mode, page 147

• Concurrent Mode (STA Plus AP), page 165

5.1 Wireless Generic

5.1.1 Regulatory Domain

5.1.1.1 Set Regulatory DomainThis command is used to configure the GS node’s parameters to the requested regulatory domain.

Command Syntax AT+WREGDOMAIN=<Regulartory Domain>

Parameter Description

Table 51, page 104 describes the Set Regulatory Domain parameters.

NOTE: We recommend setting the regulatory domain using SDK builder. If it is not set using SDK builder or if it needs to be changed, this should be the first command issued after the Serial-to-WiFi prompt. This will automatically save the information in the profile.

1VV0301463 Rev. 1.0 Page 103 of 172 2018-01-24

Page 104: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

Synchronous Response

Table 52, page 104 describes the synchronous responses and remarks for the Set Regulatory Domain command.

5.1.1.2 Get Regulatory DomainThis command is used to output the current regulatory domain of the wireless interface to the serial port.

Command Syntax AT+WREGDOMAIN=?

Synchronous Response

Table 53, page 104 describes the synchronous responses and remarks for the Get Regulatory Domain command.

Example AT+WREGDOMAIN=?REG_DOMAIN=FCCOK

Where possible values of REG_DOMAIN are: FCC, ETSI, TELEC

Table 51 Set Regulatory Domain Parameters

Parameter Optional/Mandatory

Value Regulatory Domain

Supported Channels

Desired Power Level

Regulatory Domain Mandatory

Internal PA (0 as default)

External PA (2 as default)

0 (default) FCC 1 to 11 0-7 2-151 ETSI 1 to 13 0-7 4-152 TELEC 1 to 14 0-7 2-15The Regulatory domain set is required only once since it is being updated in the Flash.

Table 52 Set Regulatory Domain Synchronous Responses

Responses RemarksOK Success

ERROR:INVALID INPUTIf parameters are not valid.(If Register domain value is other than 0-3)

Table 53 Get Regulatory Domain Synchronous Responses

Responses RemarksREG_DOMAIN=FCCOK

Success

1VV0301463 Rev. 1.0 Page 104 of 172 2018-01-24

Page 105: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

5.1.2 Operation ModeThis command is used to set the wireless mode and related parameters.

Command Syntax AT+WM=<wireless mode>[,<beacon interval in LAP mode>,<broadcast ssid in LAP mode>,<no. of stations allowed in LAP mode>,<DTIM period in LAP mode>,<inactivity timeout in LAP mode>,<reserved>,<rate adaptation-device type>,<rate adaptation-minimum application throughput>]<CR>

Parameter Description

Table 54, page 105 describes the parameters in Mode.

NOTE: Do not issue AT+WA command when GS node is in WiFi direct (P2P) mode. To issue AT+WA command, switch the GS node to either Station mode or Limited-AP mode using AT+WM command.

Table 54 Mode Parameters

Parameter Optional/Mandatory Value Description

wireless mode Mandatory

0: WiFi station mode1: Reserved2: WiFi limited AP mode3: WiFi direct mode(P2P)4: Reserved6: Provisioning AP modeDefault value not applicable

It specifies the wireless mode to be set.Note: When this parameter is set to 3, do not issue AT+WA command. To issue AT+WA command, set this parameter to either 0 (Station mode) or 2 (Limited-AP mode).

beacon interval in LAP mode Optional

50 to 1500Unit: millisecondsDefault value: 100ms

Time between two successive beacon frames transmitted by the Limited AP mode.

broadcast SSID in LAP mode Optional

0, 10: Enable1: DisableDefault value: 0

0- Beacon frames will contain SSID information.1- Beacon frames will not contain SSID information (stealth mode).It specifies whether to broadcast SSID in the beacon frames or not (only applicable in limited AP mode).Note: If WPS Registrar functionality is required, do not disable SSID broadcast.

1VV0301463 Rev. 1.0 Page 105 of 172 2018-01-24

Page 106: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

No. of stations allowed to associate in LAP mode

Optional

1 - 16Minimum value: 1Maximum value: 16Default value: 8

This configures the upper limit on the number of STAs to be allowed to associate when GS2000 is acting as LAP.

DTIM period in LAP mode Optional

Minimum value: 1Maximum value: 255Default value: 3

It specifies the DTIM period in AP mode. Value to be as minimum as possible. Unit is in beacon intervals.For more information, refer 802.11 specification.Note: Recommended to configure this value as small as possible.

inactivity time-out in LAP mode Optional

Minimum value: 1Maximum value: 65535Default value: 360 Unit: seconds

This value specifies the inactivity time out per STA, after which LAP send a NULL/QoS-NULL frame expecting the STA to MAC level acknowledge it.When there is no activity from a connected node, the module waits for 360 seconds and sends a probe to the inactive node. If there is no response, then it disconnects itself from the inactive node.GS2000 does not send disassociation frame to STA.Note: GS2000 doesn't send dis-association frame to STA.

reserved Optional NA NA

rate adaptation-device type

Optional

0,10: Battery powered /Ultra low power profile1: Line powered/Throughput profile0(default)

It helps the WLAN subsystem in fine tuning the chosen rate adaptation.The rate adaptation algorithm depends on the following application profiles:Ultra low power profile: This profile concentrates on saving power as it uses battery powered devices and they have strict battery life.Throughput profile: This profile has a requirement of minimum throughput as it uses line powered or battery powered devices without a stringent battery life. Note:

Table 54 Mode Parameters

Parameter Optional/Mandatory Value Description

1VV0301463 Rev. 1.0 Page 106 of 172 2018-01-24

Page 107: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

Su

Fa

Synchronous Response

Table 55, page 107 describes the synchronous responses and remarks for the Mode command.

Example 1 Configure device in STA mode

AT+WM=0

Configure device in Limited-AP mode (default configuration)AT+WM=2

Example 2 Configure device in Limited-AP mode, with following configuration:

AT+WM=2, , ,16,1, , ,1,5Number of stations allowed to associate in Limited-AP mode = 16DTIM period in LAP mode=1Device type = Line poweredMinimum application throughput = 5mbpsConfigure the device in LAP mode with 10 seconds as inactivityAT+WM,,,,,10

Example 3 Configure the device in P2P modeAt+WM=3

rate adaptation-minimum application throughput

Optional0-22 MbpsDefault value: 0

This is used to derive minimum PHY rate in rate adaptation algorithm.Note: If rate adaptation - device type is chosen as 0, then this parameter should be set to 0.

Note: 1.) Minimum throughput is very much dependent on TCP/UDP.2.) Rate adaptation-device type and rate adaptation-minimum application throughput parameter is to be provided, since both go in pair3.) These parameters are only a guidance to WLAN. The system tries to achieve it but it may not be always achievable due to various circumstances such as WiFi environments, application use case, and so on.

Table 54 Mode Parameters

Parameter Optional/Mandatory Value Description

Table 55 Mode Synchronous Responses

Events Verbose mode Non Verbose mode Remarksccess <CR><LF>OK<CR><LF> <CR><LF>OK<CR><LF> All parameters are valid

ilure <CR><LF>ERROR:<SP>INVALID<SP>INPUT<CR><LF> <CR><LF>2<CR><LF> Parameters are invalid or in

incorrect format.

1VV0301463 Rev. 1.0 Page 107 of 172 2018-01-24

Page 108: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

5.1.3 MAC RetryThis command is used to set the current retry count set to the supplied value.

Command Syntax AT+WRETRY=<n>

Parameter Description

Table 56, page 108 describes the Set Retry Count parameters.

Synchronous Response

Table 57, page 108 describes the synchronous responses and remarks for the Set Retry Count command.

Example AT+WRETRY=5OK

Table 56 Set Retry Count Parameters

Parameter Optional/Mandatory Value Description

n Mandatory1 to 255Default value - 8

The current wireless retry count is set to the supplied value. The transmission retry count determines the maximum number of times a data packet is retransmitted, if an 802.11 ACK is not received.

Note: The count includes the initial transmission attempt.

Table 57 Set Retry Count Synchronous Responses

Responses RemarksOK Success

ERROR:INVALID INPUTIf parameters are not valid(If value is more than 1 to 255)

1VV0301463 Rev. 1.0 Page 108 of 172 2018-01-24

Page 109: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

5.1.4 Sync Loss IntervalThis command is used to set the GS node for sync loss interval for n times the beacon interval so that if the GS node does not receive the beacon for this time, it informs the user this event is “Disassociation event.”

Command Syntax AT+WSYNCINTRL=<n>

Parameter Description

Table 58, page 109 describes the Sync Loss Interval parameters.

Synchronous Response

Table 59, page 109 describes the synchronous responses and remarks for the Sync Loss Interval command.

Asynchronous Response

Table 60, page 110 describes the asynchronous responses and remarks for the Sync Loss Interval command.

Table 58 Sync Loss Interval Parameters

Parameter Optional/Mandatory Value Description

n Mandatory

Value range: 1-63325Default value: 100

This parameter specifies the beacon count. Time difference between two beacons are approximately 100msec.Example: If n=30 and 30 consecutive beacons are missed then, SYNC loss is detected and GS node sends the Disassociation packet to the Access Point.The time taken for detecting sync loss for n=30 is approximately 3seconds (30*100msec).

Table 59 Sync Loss Interval Synchronous Responses

Responses RemarksOK SuccessERROR:INVALID INPUT Invalid parameter (out of range)

1VV0301463 Rev. 1.0 Page 109 of 172 2018-01-24

Page 110: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

Example AT+WSYNCINTRL=500

If 500 consecutive beacons are missed then, SYNC loss is detected and GS node sends the Disassociation packet to the Access Point.

The time taken for detecting sync loss in this case is approximately 50seconds (500 *100msec).

5.1.5 Set RTS ThresholdThis command is used to set the RTS threshold value.

Command Syntax AT+WRTS=<RTSTHRESHOLD>[,TXOP ENABLE]

Parameter Description

Table 61, page 110 describes the RTS Threshold parameters.

Synchronous Response

Table 62, page 111 describes the synchronous responses and remarks for the RTS Threshold command.

Table 60 Sync Loss Interval Asynchronous Responses

Responses Remarks314Disassociation EventWhere,Subtype - 3Length - 14 (ASCII equivalent decimal is 20 characters, i.e., length of the actual message)Actual message - Disassociation EventThe type of message. Length is 1 byte. for asynchronous message, it is 0x41 (ASCII value A).

GS node does not receive beacons for this time informs the user with this message.

Note: <ESC> and Type is not displayed because its Tera Term issue.

Table 61 RTS Threshold Parameters

Parameter Optional/Mandatory Value Description

RTSTHRESHOLD Mandatory0 to 2999 Default value - 0

This parameter specifies the RTS/CTS threshold. When this parameter is set to one of the values from 0 to 2999, it is considered as RTS threshold.Note: When this parameter is set to a value >=3000, self CTS is enabled.

TXOP ENABLE Optional N/A Reserved for future use.

1VV0301463 Rev. 1.0 Page 110 of 172 2018-01-24

Page 111: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

Example AT+WRTS=0OK

5.1.6 Transmit Data Rate

5.1.6.1 Set Transmit RateThis command is used to set the transmit rate.

Command Syntax AT+WRATE=<Transmit rate of data frame>[,<Transmit rate of management frame>,<Transmit rate of control frame>]

Command Note If you want to set the transmission rate to 11Mbps, then you will need to give the value as 22.

Example AT+WRATE=22

Parameter Description

Table 63, page 112 describes the Set Transmit Rate parameters.

Table 62 RTS Threshold Synchronous Responses

Responses RemarksOK Success

NOTE: These commands are obsolete and they are retained for backward compatibility. It is recommended to use the default dynamic rate selection.

NOTE: This command is used for testing and debug purposes only. It is not fully functional and it is not tested for higher rates.

1VV0301463 Rev. 1.0 Page 111 of 172 2018-01-24

Page 112: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

Table 63 Set Transmit Rate Parameters

Parameter Optional/Mandatory Value Corresponding Transmission

Rate

Description

Transmit rate of data frame Mandatory

2 1 MBPS

This parameter specifies the transmission rate for data frames.If only this parameter is provided in the command, then the same value is copied for the remaining parameters Transmit rate of management frame and Transmit rate of control frame.

4 2 MBPS11 5.5 MBPS13 6.5 MBPS12 6 MBPS18 9 MBPS22 11 MBPS24 12 MBPS36 18 MBPS39 19.5 MBPS48 24 MBPS52 26 MBPS72 36 MBPS78 39 MBPS96 48 MBPS104 52 MBPS108 54 MBPS117 58.5 MBPS130 65 MBPS

Transmit rate of management frame

OptionalRefer to the values and corresponding transmission rates in Transmit rate of data frame.

This parameter specifies the transmission rate for management frames.

Transmit rate of control frame Optional

This parameter specifies the transmission rate for control frames.

1VV0301463 Rev. 1.0 Page 112 of 172 2018-01-24

Page 113: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

Synchronous Response

Table 64, page 113 describes the synchronous responses and remarks for the Set Transmit Rate command.

Example AT+WRATE=2OK

5.1.6.2 Get Transmit Rate

This command is used to obtain the current transmit rate (in ASCII format) of the data frame.

Command Syntax AT+WRATE=?

Synchronous Response

Table 65, page 113 describes the synchronous responses and remarks for the Get Transmit Rate command.

Example AT+WRATE=?0OK

Table 64 Set Transmit Rate Synchronous Responses

Responses RemarksOK Success

ERROR:INVALID INPUTIf parameters are not valid(if value is other than above specified value)

NOTE: This command is used for testing and debug purposes only. It is not fully functional and it is not tested for higher rates.

Table 65 Get Transmit Rate Synchronous Responses

Responses RemarksWRATE OKWRATE 0

SuccessModule will return one of the values listed in Table 63, page 112.

1VV0301463 Rev. 1.0 Page 113 of 172 2018-01-24

Page 114: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

5.2 Beacon Mode (Unassociated Mode)Beacon mode or unassociated mode supports to receive and transmit frames on WLAN interface without association.

5.2.1 Unassociated/Unsolicited Tx

This command is used to transmit 802.11 management frames, control frames, or data frames without associating with an Access Point based on the configured parameters.

In Unsolicited Data Mode (data transmission without association), data transfer is managed using escape sequences. Each escape sequence starts with the ASCII character 27 (0x1B), equivalent to the Escape <ESC> key. The encoding of data is described below. This encoding is used for transmitted data only. The unsolicited data transmission command must be issued before sending unsolicited data through the GS node.

The format of an unsolicited data frame is:

<ESC>D/d<Payload>

The Payload contents are byte or byte stream.

Command Syntax AT+UNSOLICITEDTX=<Frame Control>,<Sequence Control>,<Channel>,<Data Rate>,<Power>,<CCA Enable/Disable>,<Frame Length>,<Reception Wait time>,<Address 1>,[<Address 3>], [<Address 4>],[capture transmission timestamp in ticks],[Reception frame type],[Enable/Disable IE filter for reception frames],[Reception IE ID]

After issuing this command, the user needs to send the payload data as follows:

<ESC>D/d<PayLoad of the above Frame length>

Parameter Description

Table 66, page 114 describes the Unassociated/Unsolicited Tx parameters.

NOTE: Size of Payload has to be in multiples of 4.

Table 66 Unassociated/Unsolicited Tx Parameters

Parameter Optional/Mandatory Value Description

Frame Control Mandatory Refer 802.11 specification.

It is the frame control field in the 802.11 frame.For more information, refer the 802.11 specification.

1VV0301463 Rev. 1.0 Page 114 of 172 2018-01-24

Page 115: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

Sequence Control Mandatory 0-65535

This field consists of two fields, 12 bits (LSB) of sequence number and 4 bits of (MSB) fragment number.For more information, refer 802.11 specification.

Channel Mandatory 1-14 It is the channel used to send data.

Data Rate Mandatory Refer 802.11 specification.

It is the data rate used to transmit frames. For more information, refer 802.11 specification.

Power Mandatory Refer Table 67, page 117 It provides a range of power that is used to transmit data.

CCAEnable Mandatory1 or 0• 0: Enable• 1: Disable

It is used to enable or disable clear channel assessment.

Frame Length Mandatory1400 Unit: bytes

It is the length of the payload. The maximum size of the frame is limited to 1400 bytes.

Reception wait time Mandatory

0 - 4294967295Unit: milliseconds• 0: The receiver does not wait for

any frames.• 4294967295: The receiver is

switched on until AT+UNSOLICITEDRXSTOP command is issued.

It is the duration in milliseconds to keep the receiver switched on after transmission to receive other frames of interest.

Address 1 Mandatory Refer 802.11 specification Refer 802.11 specificationAddress 3 Optional Refer 802.11 specification Refer 802.11 specificationAddress 4 Optional Refer 802.11 specification Refer 802.11 specification

Capture transmission time-stamp in ticks

Optional0 or 1• 0: Enable• 1: Disable

It is the captured time-stamp in ticks at the MAC layer after successful frame transmission.Each tick is 25 nano seconds as the reference clock is 40 MHz clock.

Table 66 Unassociated/Unsolicited Tx Parameters (Continued)

Parameter Optional/Mandatory Value Description

1VV0301463 Rev. 1.0 Page 115 of 172 2018-01-24

Page 116: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

Reception frame type Optional

Types of frames with their values are as follows:• 1: Beacon frame• 2: Probe request frame• 4: Probe response frame• 8: Multi cast data frame• 16: Unicast data frame• 32: Unicast frame from

overlapping BSS• 64: Directed management frame

(Note: All directed management frames except probe request, beacon, and probe response)

• 256: Broadcast/multicast management frame

• 512: Overlapping BSS unicast management frame

• 1024: Broadcast/multicast management frame from overlapping BSS

• 2048: Miscellaneous management frames

• 4096: CTS frame• 8192: RTS frame• 16384: Non-directed control

frames• 1073741824: Enable duplicate

frame reception• 2147483648: Pass data to

application with MAC headers

It specifies the type of the frame to be received.

Enable/Disable IE filter for reception frames

Optional1, 0• 1: Enable IE based filtering• 0: Disable IE based filtering

It is used to enable or disable a filter for reception frames based on the frame IDs configured in Reception IE ID parameter.

Reception IE ID Optional Refer 802.11 specification.

It is used to filter a frame based on the configured Information Element (IE) within a frame.Note: • This parameter is valid only when

Enable/Disable IE filter for reception frames is enabled.

• Filtering is applicable for Beacons, Probe request and Probe response frames.

Table 66 Unassociated/Unsolicited Tx Parameters (Continued)

Parameter Optional/Mandatory Value Description

1VV0301463 Rev. 1.0 Page 116 of 172 2018-01-24

Page 117: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

Table 67, page 117 provides the transmission rate and the corresponding input value range for Power in Unassociated/unsolicited Tx command.

Synchronous Response

Table 68, page 117 describes the synchronous responses and remarks for Unassociated/Unsolicited Tx command.

Example 1 Table 69, page 118provides the examples for Unassociated/unsolicited Tx.

Table 67 Transmission Rate and input value range for Power

Transmission Rate Input Value Range for Power1 1 to 82 1 to 4

5.5 1 to 76 1 to 13

6.5 1 to 139 1 to 1311 1 to 512 1 to 1318 1 to 13

19.5 1 to 1324 1 to 1326 1 to 1336 1 to 1239 1 to 1248 1 to 1254 1 to 9

58.5 1 to 1065 1 to 8

Table 68 Unassociated/Unsolicited Tx Synchronous Responses

Responses RemarksOK Success

ERROR:INVALID INPUTFailureIf parameters are not valid.

1VV0301463 Rev. 1.0 Page 117 of 172 2018-01-24

Page 118: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

0

0

0

0

0

0

0

0

0

0

0

0

0

0

1

1

Table 69 Unassociated/Unsolicited Tx command Examples

Example 2 For sending Data frame where sequence number is 0 and fragment number is 0 in Sequence Control field:

The hex value for the Sequence Control field = 0x0000

The decimal value for the Sequence Control field = 0

Frame Control Example AT CommandType Type Description Subtype

Bits-B7B6B5B4

Subtype Description

0

Management

0000 Association request

AT+UNSOLICITEDTX=0,0,1,2,1,1,5,0,00:1d:c9:aa:bb:dd

0 0001 Association response

AT+UNSOLICITEDTX=16,0,1,2,1,1,5,0,00:1d:c9:aa:bb:dd

0 0010 Reassociation Request

AT+UNSOLICITEDTX=32,0,1,2,1,1,5,0,00:1d:c9:aa:bb:dd

0 0011 Reassociation response

AT+UNSOLICITEDTX=48,0,1,2,1,1,5,0,00:1d:c9:aa:bb:dd

0 0100 Probe request AT+UNSOLICITEDTX=64,0,1,2,1,1,5,0,00:1d:c9:aa:bb:dd

0 0101 Probe response AT+UNSOLICITEDTX=80,0,1,2,1,1,5,0,00:1d:c9:aa:bb:dd

0 1000 Beacon AT+UNSOLICITEDTX=128,0,1,2,1,1,4,0,ff:ff:ff:ff:ff:ff

0 1010 Disassociation AT+UNSOLICITEDTX=160,0,1,2,1,1,5,0,00:1d:c9:aa:bb:dd

0 1011 Authentication AT+UNSOLICITEDTX=176,0,1,2,1,1,5,0,00:1d:c9:aa:bb:dd

0 1100 Deauthentication AT+UNSOLICITEDTX=192,0,1,2,1,1,5,0,00:1d:c9:aa:bb:dd

1

Control

1010 Power Save PS-(Poll)

AT+UNSOLICITEDTX=164,1,1,2,1,0,10,0,00:1d:c9:aa:bb:dd

1 1011 Request To Send (RTS)

AT+UNSOLICITEDTX=184,1,1,2,1,0,10,0,00:1d:c9:aa:bb:dd

1 1100 Clear To Send (CTS)

AT+UNSOLICITEDTX=196,0,1,2,1,1,5,0,00:1d:c9:1b:82:df

1 1101 Acknowledgment (ACK)

AT+UNSOLICITEDTX=212,1,1,2,1,0,2,0,00:1d:c9:1b:82:df

1Data

0000 Data AT+UNSOLICITEDTX=8,1,1,2,1,0,10,0,00:1d:c9:aa:bb:dd

1 0100 Null Function (no data)

AT+UNSOLICITEDTX=72,1,1,2,1,0,10,0,00:1d:c9:aa:bb:dd

1VV0301463 Rev. 1.0 Page 118 of 172 2018-01-24

Page 119: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

AT+UNSOLICITEDTX=8,0,1,2,1,1,10,0,20:f8:5e:aa:25:05

Example 3 For sending Data frame where sequence number is 1 and fragment number is 0 in Sequence Control field:

The hex value for the Sequence Control field = 0x0010

The decimal value for the Sequence Control field = 16

AT+UNSOLICITEDTX=8,16,1,2,1,1,10,0,20:f8:5e:aa:25:05

Example 4 For sending Data frame where sequence number is 973 and fragment number is 0 in Sequence Control field:

The hex value for the Sequence Control field = 0x3cd0

The decimal value for the Sequence Control field = 15568

AT+UNSOLICITEDTX=8,15568,1,2,1,1,10,0,20:f8:5e:aa:25:05

Example 5 For sending Management (Beacon) frame,AT+UNSOLICITEDTX=128,1,1,2,1,0,10,0,ff:ff:ff:ff:ff:ff

Example 6 For sending Control (RTS) frame,AT+UNSOLICITEDTX=180,1,1,2,1,0,10,0,00:1d:c9:aa:bb:dd,00:1d:c9:aa:bb:ee

Example 7 For sending Control (CTS) frame,AT+UNSOLICITEDTX=196,1,1,2,1,0,10,0,00:1d:c9:aa:bb:dd,00:1d:c9:aa:bb:ee

5.2.2 Unassociated/Unsolicited Rx

This command is used to receive 802.11 management frames, control frames, or data frames on a specific channel without associating with an Access Point based on the configured parameters.

Command Syntax AT+UNSOLICITEDRX=<Frame type>,<Enable/Disable IE filter for reception frames>,<Reception IE ID>,<Channel>,<Reception wait time>

Parameter Description

Table 70, page 120 describes the Unassociated/Unsolicited Rx parameters.

1VV0301463 Rev. 1.0 Page 119 of 172 2018-01-24

Page 120: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

Table 70 Unassociated/Unsolicited Rx Parameters

Parameter Optional/Mandatory Value Description

Frame type Mandatory

Types of frames:• 1: Beacon frame• 2: Probe request frame• 4: Probe response frame• 8: Multi cast data frame• 16: Unicast data frame• 32: Unicast frame from

overlapping BSS• 64: Directed management frame

(Note: All directed management frames except probe request, beacon, and probe response)

• 256: Broadcast/multicast management frame

• 512: Overlapping BSS unicast management frame

• 1024: Broadcast/multicast management frame from overlapping BSS

• 2048: Miscellaneous management frames

• 4096: CTS frame• 8192: RTS frame• 16384: Non-directed control

frames• 1073741824: Enable duplicate

frame reception• 2147483648: Pass data to

application with MAC headers

It specifies the type of frames to be received.

Enable/Disable IE filter for reception frames

Mandatory1 or 0• 1: Enable IE based filtering• 0: Disable IE based filtering

It is used to enable or disable IE filter for reception frames based on the frame IDs configured in Reception IE ID parameter.

1VV0301463 Rev. 1.0 Page 120 of 172 2018-01-24

Page 121: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

Response

This command returns the standard command response.

Once the unsolicited frame is received by the GS node, it is sent to the serial interface in the following format.

<ESC>D<1 byte of RSSI in hex><2 bytes of length in hex><1 byte of frame type><3 bytes of reserved><4 bytes of time stamp in ticks><Data with MAC header/Data with Ethernet header>

• 1 byte of RSSI is a signed value in hexadecimal format.

• 2 bytes of length in hexadecimal format which specifies the length of data.

• 1 byte of frame type which is reserved for future. This parameter is in hexadecimal format which specifies the type of frame received. Types of frames to be supported are:

– 0x01: Beacon

– 0x02: Probe request

– 0x03: Probe response

– 0x04: Unicast data

– 0x05: Multicast data

Reception IE ID Mandatory Refer 802.11 specification.

It is used to filter a frame based on the configured Information Element (IE) within a frame.Note: • This parameter is valid only when

Enable/Disable IE filter for reception frames is enabled.

• Filtering is applicable for Beacons, Probe request and Probe response frames.

Channel Mandatory 1-14 It is the channel from which the data is received.

Reception wait time Mandatory

0 - 4294967295 Unit: milliseconds• 0: The receiver does not wait for

any frames.• 4294967295: The receiver is

switched on until AT+UNSOLICITEDRXSTOP command is issued.

It is the duration in milliseconds to keep the receiver switched on to receive other frames of interest.

Table 70 Unassociated/Unsolicited Rx Parameters (Continued)

Parameter Optional/Mandatory Value Description

1VV0301463 Rev. 1.0 Page 121 of 172 2018-01-24

Page 122: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

– 0x06: CTS

– 0x07: RTS

– 0x08: Associated request

– 0x09: Associated response

– 0x0F: Raw data with MAC header

• 3 bytes of reserved field which is left empty.

• 4 bytes of time stamp in ticks which specifies the reception time-stamp of the frame at MAC layer. Each tick is 25 nanoseconds as the reference clock is 40 MHz clock.

• Data of two types:

– Data with MAC header: Data which is received as it is at the MAC layer without changing its format.

– Data with Ethernet header: MAC header is removed from the received data and Ethernet header is added with fields: <6 bytes of Destination MAC>, <6 bytes of Source MAC>, <2 bytes of frame type>, <Real data>

Example 1 For receiving Management (Beacon) frame,AT+UNSOLICITEDRX=2147483649,0,,1,1000

Example 2 For receiving Data frame,AT+UNSOLICITEDRX=16,0,,1,10000

Example 3 For receiving Control (RTS/CTS) frame,AT+UNSOLICITEDRX=28672,0,,1,10000

5.2.2.1 Examples for Unassociated/Unsolicited Tx and Rx Commands

Example 1 AT+UNSOLICITEDTX=776,0,1,2,1,1,5,0,01:40:96:00:00:03,01:40:96:00:00:03,20:f8:5e:ed:5d:ce<ESC>D 1 2 3 4 5AT+UNSOLICITEDRX=8,0,,1,5000

Example 2 AT+UNSOLICITEDTX=264,15568,1,2,1,1,8,0,20:f8:5e:ed:5d:ce,20:f8:5e:ed:5d:ce,cc:b0:da:10:33:80AT+UNSOLICITEDRX=16,0,,1,10000

NOTE: Address 3 and address 4 of Unsolicited Tx has to be set appropriately working of both unsolicited Tx and Rx commands together.

1VV0301463 Rev. 1.0 Page 122 of 172 2018-01-24

Page 123: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

5.2.3 Unassociated/Unsolicited Rx StopThis command is used to stop the unsolicited data reception.

Command Syntax AT+UNSOLICITEDRXSTOP

1VV0301463 Rev. 1.0 Page 123 of 172 2018-01-24

Page 124: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

5.2.4 Unassociated/Unsolicited Data EncryptionThis command is used to enable or disable encryption in unassociated/unsolicited mode.

Command Syntax AT+UAMENC=<Enable/Disable>,<Encryption Type>,<Encryption Key>,<IE ID>

Parameter Description

Table 71, page 124 describes the Unassociated/unsolicited data encryption parameters.

Table 71 Unassociated/Unsolicited Data Encryption Parameters

Parameter Optional/Mandatory Value Description

Enable/Disable Mandatory• 0: Disable• 1: Enable

It specifies whether encryption is enabled or disabled in Unassociated mode.

Encryption Type Mandatory 1: RC4 encryption (default)It specifies the type of encryption used.Only supports RC4 encryption.

Encryption Key Mandatory User defined value which is an ASCII hexadecimal number

It specifies the encryption key formatted as an ASCII hexadecimal number.

IE ID Mandatory User defined value It specifies the ID to be encrypted.

1VV0301463 Rev. 1.0 Page 124 of 172 2018-01-24

Page 125: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

5.3 Station/AP Mode

5.3.1 Scan Time Settings

5.3.1.1 Set Scan TimeThis command is used to set the minimum and maximum scan time per channel. The maximum scan time should always be greater than or equal to the minimum scan time. This command also modifies the scan time configured with the ATS5 command.

Command Syntax AT+WST=<Minimum scan time><Reserved><CR>

Parameter Description

Table 72, page 125 describes the Set Scan Time parameters.

Synchronous Response

Table 73, page 125 describes the synchronous responses and remarks for the Set Scan Time command.

Example AT+WST=150,150

NOTE: This is the recommended method to set scan time per channel and obsoletes all other methods to configure scan time including ATS5 command. (see 4.3.7 Configure Profile, page 92).

Table 72 Set Scan Time Parameters

Parameter Optional/Mandatory Value (milliseconds) Description

Minimum scan time Mandatory5-1200, 150 (default)Unit-milliseconds

Minimum amount of time, radio receiver needs to be kept on per channel while scanning.

reserved Mandatory N/A

MCU issues the same value provided in the minimum scan time.Note: The value of the “Reserved Parameter”

is given as first parameter value to retainbackward compatibility.

Table 73 Set Scan Time Synchronous Responses

Events Verbose Mode Non Verbose Mode RemarksSuccess <CR><>LF>OK<CR><LF> <CR><LF>0<CR><LF> Parameters are valid

Failure <CR><LF>ERROR:<SP>INVALID<SP>INPUT<CR><LF> <CR><LF>2<CR><LF> Parameters invalid

1VV0301463 Rev. 1.0 Page 125 of 172 2018-01-24

Page 126: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

OK

1VV0301463 Rev. 1.0 Page 126 of 172 2018-01-24

Page 127: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

5.3.1.2 Get Scan TimeThis command is used to display minimum and maximum scan time in milliseconds.

Command Syntax AT+WST=?

Synchronous Response

Table 74, page 127 describes the synchronous responses and remarks for the Get Scan Time command.

Example AT+WST=?MinScanTime=150MaxScanTime=150

Table 74 Get Scan Time Synchronous Responses

Responses Remarks

MinScanTime=150MaxScanTime=150OK

SuccessDisplays “MinScanTime” and “MaxScanTime” which is configured using AT+WST command.By default it displays the default values that is 150ms (milliseconds) for min and max scan time.

1VV0301463 Rev. 1.0 Page 127 of 172 2018-01-24

Page 128: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

5.3.2 Authentication ModeThis command is used to configure the authentication mode.

Command Syntax AT+WAUTH=n

Parameter Description

Table 75, page 128 describes the WiFi Security Configuration Authentication Mode parameters.

Synchronous Response

Table 76, page 128 describes the synchronous responses and remarks for the WiFi Security Configuration Authentication Mode command.

Example AT+WAUTH=0OK

Table 75 WiFi Security Configuration Authentication Mode

Parameter Optional/Mandatory Value Mode Description

n Mandatory

0 (default) None This authentication mode command is specific to WEP encryption. If WPA/WPA2 operation is employed, the authentication mode may be left at the default value “None.”

1 WEP Open

2 WEP Shared

Table 76 WiFi Security Configuration Authentication Mode Synchronous Responses

Responses RemarksOK Success

ERROR:INVALID INPUTIf parameters are not valid.(n value is other than 0, 1, and 2)

1VV0301463 Rev. 1.0 Page 128 of 172 2018-01-24

Page 129: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

5.3.3 Security Configuration

5.3.3.1 Security SettingThis command is used to configure the GS node with different security configuration.

Command Syntax AT+WSEC=n

Parameter Description

Table 77, page 129 describes the Security Configuration parameters.

Table 77 Security Configuration Parameters

Parameter Optional/Mandatory Value Mode Description

n Mandatory

0 (default) Auto security (All)

The S2W Application supports either one of the Values. This strict security compliance is not applicable for WPS feature.

1 Open security2 WEP security

4 WPA-PSK security (TKIP only)

8 WPA2-PSK security (AES only)

16 WPA Enterprise32 WPA2 Enterprise64 WPA2-AES+TKIP security

Note: 1> In AP mode, only Open and WPA-AES as security mechanism is supported.2> Enterprise security is supported in Station mode and not supported in limited AP mode.3> Concurrent mode AP configuration settings varies from normal Limited AP mode configuration.4> WEP and WPA/WPA2 Personal is selected as default security for Wi-Fi Station mode (under 802.11 tab) in SDK Builder. To enable EAP security, select WPA/WPA2 Enterprise in WiFi Station mode (under 802.11 tab) in SDK Builder.5>GS module is unsuccessful to associate to an AP (WPA personal) when configured with AES for both Multicast and Unicast (as the Group Key Handshake timeout is (0x0010))Security: WEP-64 Open/Shared,WEP-128 Open/Shared,WPA-Personal (TKIP),WPA2-Personal (AES),WPA2-Personal (AES+TKIP),WPA Enterprise (TKIP),WPA2-Enterprise (AES),WPA2-Enterprise (AES+TKIP).6>Only TKIP is supported in WPA security

1VV0301463 Rev. 1.0 Page 129 of 172 2018-01-24

Page 130: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

Synchronous Response

Table 78, page 130 describes the synchronous responses and remarks for the Security Configuration command.

Example - GS node is configured with WEP shared security

AT+WAUTH=2OK

AT+WSEC=2OK

AT+WWEP1=0987654321OK

AT+WA=GainSpanDemo,,11IP SubNet Gateway192.168.1.99:255.255.255.0:192.168.1.1OK

5.3.3.2 WEP KeysThis command is used to configure WEP security. Upon receiving a valid command, the relevant WEP key is set to the value provided.

Command Syntax AT+WWEPn=<key>

Parameter Description

Table 79, page 131 describes the WEP Keys parameters.

Table 78 Security Configuration Synchronous Responses

Responses RemarksOK Success

ERROR:INVALID INPUTIf parameters are not valid.(n value is other than above mentioned value)

NOTE: To support WEP security in Limited AP mode, issue AT+WSEC=2 command along with AT+WWEP command.

1VV0301463 Rev. 1.0 Page 130 of 172 2018-01-24

Page 131: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

Synchronous Response

Table 80, page 131 describes the synchronous responses and remarks for the WEP Keys command.

Example - WEP Open AT+WRXACTIVE=1OKAT+WM=2OKAT+NSET=192.168.11.1,255.255.255.0,192.168.11.1OKAT+WAUTH=1OKAT+WSEC=2OKAT+WWEP1=1234567890OKAT+DHCPSRVR=1OKAT+WA=GainSpanAP,,6 IP SubNet Gateway192.168.11.1:255.255.255.0:192.168.11.1OKAT+NSTAT=?MAC=00:1d:c9:81:12:9aWSTATE=CONNECTED MODE=APBSSID=00:1d:c9:81:12:9a SSID="GainSpanAP" CHANNEL=6 SECURITY=WEP (OPEN)RSSI=-100

Table 79 WEP Keys Parameters

Parameter Optional/Mandatory Value Description

n, key Mandatory N/A

n is the key index, between 1 and 4, and keys are either 10 or 26 hexadecimal digits corresponding to a 40-bit key.Last issued key will be the active key used for encryption and decryption.

Table 80 WEP Keys Synchronous Responses

Responses RemarksOK Success

ERROR:INVALID INPUTIf parameters are not valid.(n value is other than 1,2,3, and 4 or key is invalid)

1VV0301463 Rev. 1.0 Page 131 of 172 2018-01-24

Page 132: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

IP addr=192.168.11.1 SubNet=255.255.255.0 Gateway=192.168.11.1DNS1=0.0.0.0 DNS2=0.0.0.0Rx Count=0 Tx Count=0

OK

Example - WEP Shared

AT+WRXACTIVE=1OKAT+WM=2OKAT+NSET=192.168.11.1,255.255.255.0,192.168.11.1OKAT+WAUTH=2OKAT+WSEC=2OKAT+WWEP1=1234567890OKAT+DHCPSRVR=1OKAT+WA=GainSpanAP,,6 IP SubNet Gateway192.168.11.1:255.255.255.0:192.168.11.1OKAT+NSTAT=?MAC=00:1d:c9:81:12:9aWSTATE=CONNECTED MODE=APBSSID=00:1d:c9:81:12:9a SSID="GainSpanAP" CHANNEL=6 SECURITY=WEP (SHARED)RSSI=-100IP addr=192.168.11.1 SubNet=255.255.255.0 Gateway=192.168.11.1DNS1=0.0.0.0 DNS2=0.0.0.0Rx Count=0 Tx Count=0

OK

5.3.3.3 WEP Key Type ConfigurationThis command is used to configure ASCII or HEX values as input values for WEP key.

Command Syntax AT+WWEPCONF=<enable/disable(1/0)>

Parameter Description

Table 81, page 133 describes the WEP Key Type Configuration parameters.

1VV0301463 Rev. 1.0 Page 132 of 172 2018-01-24

Page 133: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

Table 81 WEP Key Type Configuration Parameters

Parameter Optional/Mandatory Value Description

enable ASCII Mandatory 1

This parameter value enables ASCII mode where the WEP key entered through the AT+WWEPn=<key> command are characters whose ASCII value gets stored.

disable ASCII Mandatory 0 (default) This parameter value disables ASCII mode and the WEP key command only accepts HEX values.

1VV0301463 Rev. 1.0 Page 133 of 172 2018-01-24

Page 134: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

5.3.3.4 WPA-PSK and WPA2-PSK PassphraseThis command is used to set the WPA-PSK and WPA2-PSK passphrase. Upon receiving the command, the PSK passphrase is reset to the value provided.

Command Syntax AT+WWPA=<passphrase>

Parameter Description

Table 82, page 134 describes the WPA-PSK and WPA2-PSK Passphrase parameters.

Synchronous Response

Table 83, page 134 describes the synchronous responses and remarks for the WPA-PSK and WPA2-PSK Passphrase command.

Example AT+WWPA=test12345OK

AT+WA=GainSpanDemo,,11IP SubNet Gateway192.168.1.99:255.255.255.0:192.168.1.1OK

NOTE: It is recommended to use AT+WPAPSK command instead of the following command. See 5.3.3.5 WPA-PSK and WPA2-PSK Key Calculation, page 135.

Table 82 WPA-PSK and WPA2-PSK Passpharse Parameters

Parameter Optional/Mandatory Value Description

passphrase Mandatory 8-63

The passphrase is a string containing between 8 and 63 ASCII characters, used as a seed to create the WPA pre-shared key (PSK).If the comma (,) is a part of the passphrase, the passphrase parameter is to be framed in double quotation marks (“phassphrase”). See 2.7.3 SSID and Passphrase, page 44 for details.

Table 83 WPA-PSK and WPA2-PSK Phassphrase Synchronous Responses

Responses RemarksOK SuccessERROR:INVALID INPUT Invalid passphrase

1VV0301463 Rev. 1.0 Page 134 of 172 2018-01-24

Page 135: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

5.3.3.5 WPA-PSK and WPA2-PSK Key CalculationThis command is used to compute and store the value of the WPA/WPA2 PSK, derived from the SSID and Passphrase values. Computation of the PSK from the passphrase is complex and consumes substantial amounts of time and energy. To avoid recalculating this quantity every time the GS node associates, the GS node provides the capability to compute the PSK once and store the resulting value. The key value is stored in the SRAM copy of the current profile; the profile needs to be saved in flash memory for this value to persist during a transition to Standby.

Command Syntax AT+WPAPSK=<SSID>,<passphrase>

Parameter Description

Table 84, page 135 describes the WPA-PSK and WPA2-PSK Key Calculation parameters.

Synchronous Response

Table 85, page 135 describes the synchronous responses and remarks for the WPA-PSK and WPA2-PSK Calculation command.

Table 84 WPA-PSK and WPA2-PSK Key Calculation Parameters

Parameter Optional/Mandatory Value Description

SSID Mandatory 1-32 The SSID is a string of between 1 and 32 ASCII characters. See 2.7.3 SSID and Passphrase, page 44.

PASSPHRASE Mandatory 8-63

The passphrase is a string containing between 8 and 63 ASCII characters used as a seed to create the WPA pre-shared key (PSK). See 2.7.3 SSID and Passphrase, page 44.

Table 85 WPA-PSK and WPA2-PSK Calculation Synchronous Responses

Responses Remarks

Computing PSK from SSID and PassphraseOK

SuccessThe GS node immediately responds with this message along with standard OK response (0 in non-verbose). The current profile parameters PSK Valid, PSK-SSID, and WPA Passphrase are updated and can be queried with AT&V (see 4.3.7 Configure Profile, page 92). The next time the GS node associates to the given SSID, the PSK value is used without being recalculated.After the PSK has been computed, the command AT&W (to save the relevant profile) and AT&Y (to ensure that the profile containing the new PSK is the default profile) should be issued. The PSK will then be available when the GS node awakens from Standby mode. See 4.3.4 Select Default Profile, page 88 for profile management.

ERROR:INVALID INPUT If parameters are not valid.

1VV0301463 Rev. 1.0 Page 135 of 172 2018-01-24

Page 136: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

Example AT+WPAPSK=GainSpanDemo,test12345Computing PSK from SSID and PassPhrase...OK

AT+WA=GainSpanDemo,,11IP SubNet Gateway192.168.1.99:255.255.255.0:192.168.1.1OK

AT&W0OKAT+PSSTBY=1000

Out of StandBy-Timer

AT+WA=GainSpanDemo,,11IP SubNet Gateway192.168.1.99:255.255.255.0:192.168.1.1OK

5.3.3.6 WPA-PSK and WPA2-PSK KeyThis command is used to configure the WPA/WPA2 PSK key directly. It directly sets the pre-shared key as provided. The argument is a 32-byte key, formatted as an ASCII hexadecimal number; any other length or format is considered invalid.

Command Syntax AT+WPSK=<PSK>

Parameter Description

Table 86, page 136 describes the WPA-PSK and WPA2-PSK Key parameters.

NOTE: This command should be used along with the AT+WM command.

Table 86 WPA-PSK and WPA2-PSK Key Parameters

Parameter Optional/Mandatory Value Description

PSK Mandatory 32 byte keyPSK is a 32 byte key, formated as an ASCII hexadecimal number, and other length or format is considered invalid.

1VV0301463 Rev. 1.0 Page 136 of 172 2018-01-24

Page 137: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

Synchronous Response

Table 87, page 137 describes the synchronous responses and remarks for the WPA-PSK and WPA2-PSK Key command.

Example AT+WPSK=0001020304050607080900010203040506070809000102030405060708090001OK

AT&W0OK

AT+WA=GainSpanDemo,,11IP SubNet Gateway192.168.1.99:255.255.255.0:192.168.1.1OK

AT+PSSTBY=1000Out of StandBy-Timer

AT+WA=GainSpanDemo,,11IP SubNet Gateway192.168.1.99:255.255.255.0:192.168.1.1OK

Table 87 WPA-PSK and WPA2-PSK Key Synchronous Responses

Responses Remarks

OK

SuccessAfter the PSK has been entered, the commands AT&W (to save the relevant profile) and AT&Y (to ensure that the profile containing the new PSK is the default profile) should be issued. The PSK will then be available when the GS node awakens from Standby. See 4.3.4 Select Default Profile, page 88 for more information on profile management.

ERROR:INVALID INPUT Invalid PSK (if PSK is not 32 bytes)

1VV0301463 Rev. 1.0 Page 137 of 172 2018-01-24

Page 138: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

5.3.4 ScanningThis command is used to scan for networks with the specified parameters and displays the results. Scanning can be performed to find networks with specific SSID or in a particular operating channel, or a combination of these parameters. Scanning for a specific SSID employs active scanning, in which probe requests are transmitted with the SSID fields being filled appropriately.

Command Syntax AT+WS[=<SSID>[,<BSSID>][,<Channel>][,<Scan Time]]

Parameter Description

Table 88, page 138 describes the Scanning parameters.

Synchronous Response

Table 89, page 139 describes the synchronous responses and remarks for the Scanning command.

Table 88 Scanning Parameters

Parameter Optional/Mandatory Value Description

SSID Optional N/A

A string containing ASCII characters between 1 and 32 (see 2.7.3 SSID and Passphrase, page 44).When SSID is specified, the GS node only scans the configured SSID.

BSSID Optional N/A This command does not support scan based on the BSSID.

Channel Optional N/A

If channel is specified, then the node scans only that particular channel, else it scans all valid channels based on configured reg domain.Note: Maximum Scan per channel is 20.

Scan Time Optional5-1200 (milliseconds)150 (default)

(see 5.3.1.1 Set Scan Time, page 125)Configuring scan time using this parameter is obsolete.The recommended method to set scan time per channel is by using AT+WST command (see 5.3.1.1 Set Scan Time, page 125).

1VV0301463 Rev. 1.0 Page 138 of 172 2018-01-24

Page 139: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

Example Use Case 1 - for Infrastructure NetworkAT+WS=GainSpanDemo,,11BSSID SSID Channel Type RSSI Securityc8:d7:19:75:74:fb, GainSpanDemo ,11, INFRA, -39, NONENo.Of AP Found:1OK

2 -

AT+WS=GainSpanAdHocBSSID SSID Channel Type RSSI Security62:67:20:01:f1:07, GainSpanAdHoc ,11, ADHOC, -30, NONENo.Of AP Found:1OK

Table 89 Scanning Synchronous Responses

Responses Remarks<CR><LF><7 SP><BSSID><14 SP><SSID><21 SP><Channel><2 SP><TYPE><2 SP><RSSI><SP><Security><CR><LF><SP> <CR><LF><No.Of><SP><AP><SP><Found:><CR><LF><CR><LF>OK<CR><LF>OK

SuccessType is INFRA for infrastructure network andADHOC for ad-hoc networks.

1VV0301463 Rev. 1.0 Page 139 of 172 2018-01-24

Page 140: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

5.3.5 AssociationThis command is used to create or join an infrastructure network (limited access point mode).

Command Syntax AT+WA=<SSID>[,[<BSSID>][,<Channel>],[Rssi Flag],[WPS Registrar]]

Command Note • The WPS registrar is supported only with WPA/WPA2 security. It is not supported in open security.

• When WPA registrar is required, setting strict security using AT+WSEC (See 5.3.4 Scanning, page 138) command is mandatory before issuing the AT+WA command.

Usage The following is the behavior of the command in different modes:

1. In STA mode, i.e., AT+WM=0 (see 5.1.2 Operation Mode, page 105). The node will attempt to associate with the requested network. If the requested network is not available, an error message will display.

2. In AP mode, i.e., AT+WM=2 (see 5.1.2 Operation Mode, page 105), The node creates an infrastructure (Limited AP) network with the specified SSID. Issue AT+WSEC=n (refer 5.3.4 Scanning, page 138 for values) to create Limited AP with security as specified in Table 77Security Configuration Parameters, page 129.

Parameter Description

Table 90, page 141 describes the associate with a Network or create an Infrastructure (AP) Network parameter.

NOTE: Do not issue AT+WA command when GS node is in WiFi direct (P2P) mode. To issue AT+WA command, switch the GS node to either Station mode or Limited-AP mode using AT+WM command.

1VV0301463 Rev. 1.0 Page 140 of 172 2018-01-24

Page 141: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

Table 90 Associate with Network or Create an AP Network Parameters

Parameter Optional/Mandatory Value Description

SSID Mandatory 1-32 charactersThe SSID is a string containing between 1 and 32 ASCII characters. See 2.7.3 SSID and Passphrase, page 44 for SSID format details.

BSSID Optional

MAC is the 17 characters colon-delimited hexadecimal number (xx:xx:xx:xx:xx:xx)

BSSID of the Access point.In STA mode, upon this configuration the module will associate if both SSID and BSSID matches. Where as, if BSSID is not provided, module will try matching the SSID.In Limited AP mode, this shall be the same as the modules MAC address.I

Channel Optional

Depends on the value of AT+WREGDOMAIN (see 5.1.1 Regulatory Domain, page 103)

In STA mode, the module will search for required SSID in that particular channel only. However, if the channel is not specified it will scan all configured networks, starting from channel number 1 to maximum allowed channels, and associate them to the first network which matches the SSID or BSSID if provided.In Limited AP mode, the module will create an access point in that particular channel. However, if the channel is not provided the module will create an access point in the channel number 1.

Rssi Flag Optional0: Disable1: EnableDefault value - 1

This parameter specifies whether RSSI Flag is enabled or disabled based on the following configuration values:0: GS node associates with AP of the first found SSID or BSSID based on the configured SSIDs or BSSIDs using AT+WAUTO command.1: GS node associates with AP that has the best RSSI in the corresponding regulatory domain.Note: There is no option to disable this feature as well.This parameter in conjunction with Channel parameter decides the behavior of the GS node as provided in Table 91, page 142.

WPS Registrar Optional 1

Initialize WPS registrar.This will not trigger WPS procedure.Note: WPS registrar with hidden ssid is not supported

1VV0301463 Rev. 1.0 Page 141 of 172 2018-01-24

Page 142: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

Table 91 GS node’s behavior based on RSSI Flag and Channel

Table 92, page 142 describes the synchronous responses and remarks for associating with a network or creating an AP network.

Example AT+WA=GainSpanDemo,,11IP SubNet Gateway192.168.1.99:255.255.255.0:192.168.1.1OK

Channel RSSI Flag0 1

Provided

• Starts scan on the provided channel.

• Stops scan as soon as first match is found.

• Associates with the found AP.• If no scan entry is found, retries

till max scan time and reports error.

• Scans the given channel only• Finds the AP with highest RSSI in that

channel within the specified max scan time and associates with it.

• If no scan entry is found within max scan time, reports error.

Not provided

• Starts the scan from channel number 1, if no matching entry is found within the max scan time on that channel, then moves to next channel.

• Stops the scan after getting first matching AP and associates with it.

• If no scan entry is found on any channel, reports error.

• Scans all channels and finds the AP with highest RSSI and associates with it.

• If no scan entry is found on any channel, reports error.

Table 92 Associate with Network or Create an AP Network Synchronous Responses

Responses RemarksIP SubNet Gateway IPaddress: SubNetaddress: Gateway address SuccessERROR:INVALID INPUT If parameters are not valid.

ERROR

See 11.3.1 Log Level, page 495.Reissue the AT+LOGLVL command to get more details about the kind of error. Response changes based on LOGLVL.

ERROR:IP CONFIG FAIL If DHCP fails in infrastructure mode.

1VV0301463 Rev. 1.0 Page 142 of 172 2018-01-24

Page 143: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

5.3.6 DisassociationThis command is used to disassociate the current infrastructure network or stop the limited AP created by the node. It is also used to disconnect P2P mode.

Command Syntax AT+WD

Synchronous Response

Table 93, page 143 describes the synchronous responses and remarks for the Disassociation command.

Asynchronous Response

Table 94, page 143 describes the asynchronous responses and remarks for the Disassociation command.

Example AT+WDOK

5.3.7 Connection Maintenance

5.3.7.1 Keep Alive Timer

This command is used to keep-alive the timing intervals associated with the GS node. This keep-alive timer will fire for every n seconds once the GS node is associated. This timer will keep the GS node in associated state even when there is no activity between AP and GS node.

Command Syntax AT+PSPOLLINTRL=<n>

Parameter Description

Table 95, page 144 describes the Association Keep Alive Timer parameters.

Table 93 Disassociation Synchronous Responses

Responses RemarksOK Success

Table 94 Disassociation Asynchronous Responses

Responses Remarks314Dissassociation Event AP resets or connection to the AP is lost.

NOTE: This command is obsolete and it is retained for backward compatibility. It is recommended to use AT+WKEEPALIVE command.

1VV0301463 Rev. 1.0 Page 143 of 172 2018-01-24

Page 144: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

Synchronous Response

Table 96, page 144 describes the synchronous responses and remarks for the Association Keep Alive Timer command.

Example Use Case AT+WA=GainSpanDemo

IP SubNet Gateway192.168.17.14:255.255.255.0:192.168.17.1OK

AT+NDHCP=1IP SubNet Gateway192.168.17.14:255.255.255.0:192.168.17.1OK

AT+PSPOLLINTRL=60OK

5.3.7.2 WLAN Keep Alive IntervalThis command is used to set the keep-alive interval for n seconds. This keep-alive timer will fire for every n seconds once the node is associated. This timer will try to keep the GS node in associated state even if there is no activity between AP and GS node by sending a NULL frame.

Command Syntax AT+WKEEPALIVE=<Interval>[,<Type>]

Parameter Description

Table 97, page 145 describes the WLAN Keep Alive Interval parameters.

Table 95 Association Keep Alive Timer Parameters

Parameter Optional/Mandatory Value Description

n Mandatory 0 to 255 seconds 0 (default)

When set to 0, the Keep alive timer is disabled.

Table 96 Association Keep Alive Timer Synchronous Responses

Responses RemarksOK SuccessERROR:INVALID INPUT If parameters are not valid

1VV0301463 Rev. 1.0 Page 144 of 172 2018-01-24

Page 145: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

Synchronous Response

Table 98, page 145 describes the synchronous responses and remarks for the WLAN Keep Alive Interval command.

Table 97 WLAN Keep Alive Interval Parameters

Parameter Optional/Mandatory Value Description

Interval Mandatory

0 to 255 seconds This parameter specifies the time GS node keeps sending NULL frame to AP to maintain the association.The value 0 disables this feature.

45 seconds (default)

Type Optional Value range: 0,1

It specifies whether the timer for the above mentioned interval is maintained across standby or not.• 0 (Non-persistent): If this parameter is not

set or set to 0, the keep alive will work only in Always ON scenario by sending a NULL frame but not across standby as this is handled by WLAN.

• 1 (Persistent): If this parameter is set to 1, then the timer is maintained across standby. Once GS node wakes up after the specified an ARP frame is sent periodically in Always ON and standby both scenarios as this is handled by Application.

Table 98 WLAN Keep Alive Interval Synchronous Responses

Responses RemarksOK SuccessERROR:INVALID INPUT If parameters are not valid

1VV0301463 Rev. 1.0 Page 145 of 172 2018-01-24

Page 146: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

5.3.8 Advanced Commands

5.3.8.1 Get Client InformationThis command is used to get information about the clients associated to the module when it acts as a limited AP.

Command Syntax AT+APCLIENTINFO=?

Synchronous Response

Table 99, page 146 describes the synchronous responses and remarks for the Get Clients Information command.

Example 1 AT+APCLIENTINFO=?No.OfStationsConnected=1

No MacAddr IP1 60:67:20:3f:10:30 192.168.44.12OK

Example 2 - Client assigned with the IP statically

AT+APCLIENTINFO=?No.OfStationsConnected=1NO MacAddr IP1 60:67:20:3f:10:e0 ****OK

Table 99 Get Clients Information Synchronous Responses

Responses Remarks

No. Of Stations Connected=<NoOfClients><MacAddr> IP <no> OK

SuccessLimited AP mode:MAC address and the IP of each of the client associated to the Limited AP. The IP address will be the one assigned to the client using DHCP.

No.Of Stations Connected=0OK

No clients are connected.

ERROR If mode is not set (AT+WM) to limited AP before issuing this command.

NOTE: In case the GS node has not issued the IP to the client, (client did not request for IP/client assigned with the IP statically), “****” is displayed.

1VV0301463 Rev. 1.0 Page 146 of 172 2018-01-24

Page 147: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

5.4 WiFi Direct ModeThis section contains P2P specific commands.

5.4.1 Set DeviceThis command helps in configuring the P2P device attributes.

Command Syntax AT+P2PSETDEV=<Group owner intent value>,<Operating class>,<Listen channel>,<Operating channel>,<WPS config methods>, <country code><CR>

Parameter Description

Table 100, page 147 describes the Set Device parameters.

NOTE: Do not issue AT+WA command when GS node is in WiFi direct (P2P) mode. To issue AT+WA command, switch the GS node to Station mode or Limited-AP mode using AT+WM command.

Table 100 Set Device Parameters

Parameter Optional/Mandatory Value Description

Group owner intent value Mandatory

0 to 15Maximum value: 15

The group owner intent value is p2p device’s willingness of being the P2Pgroup owner, with a larger value indicating a higher desire.

Note: The intent value in AT+P2PSETDEV is same as AT+P2PGRPFORM.

Operating class Mandatory81: 1 to 13 channel82: 14 channel

Preferred operating band i.e, the frequency band at which the P2P device is in the listen state or the frequency band at which the p2p device is operating as group owner.Regulatory domain (FCC, ETSI, TELEC etc) is configured using AT+WREGDOMAIN command.

Listen channel Mandatory 1,6&11

1VV0301463 Rev. 1.0 Page 147 of 172 2018-01-24

Page 148: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

Synchronous Response

Table 101, page 148 describes the synchronous responses and remarks for the Set P2P Device.

Example 1 AT+P2PSETDEV=7,81,6,6,2388,USOKIntent Value=7Regulatory class:1-13Listen class: 6Operating channel: 6WPS config methods: Display, Push Button, KeypadCountry code: USA

Example 2 AT+P2PSETDEV=14,81,6,6,0280,JPOKIntent value =14Regulatory class:1-13Listen class: 6Operating channel: 6WPS config methods: Push Button

Operating channel Mandatory 1, 6 & 11

WPS config methods Mandatory 2 byte

WiFi simple configuration methods supported - DISPLAY- 3rd or 13th bit position with 0x2008 Hexa value.Push Button- 7th & 9th bit position with 0x0280 Hexa value.KEYPAD - 8th bit position with 0x0100 Hexa value.If all three fields are supported MCU configures this field as ‘0x2388’wher a combination for these are also allowed.

Country code Mandatory N/A

Indicates the country to operate in. A valid country code strings are US, JP, and EU. The country code string must be in upper case.Maximum Length is 2 characters. It is in upper case letters.

Table 100 Set Device Parameters

Parameter Optional/Mandatory Value Description

Table 101 Set Device Synchronous Responses

Events Verbose mode Non Verbose mode RemarksSuccess <CR><LF>OK<CR><LF> <CR><LF>0<CR><LF> All parameters are valid.Failure <CR><LF>ERROR:<SP>INPUT<CR><LF> <CR><LF>2<CR><LF> Parameters are valid.

1VV0301463 Rev. 1.0 Page 148 of 172 2018-01-24

Page 149: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

S

F

Country: Japan

5.4.2 Set WPS

This command helps in configuring the WPS related attributes of P2P device. WPS configuration method is configured through AT+P2PSETDEV command.

Command Syntax AT+P2PSETWPS=<device name>,<primary device type category ID>,<primary device type subcategory ID>,<uuid><CR>

Parameter Description

Table 102, page 149 describes the Set WPS parameters.

Synchronous Response

Table 103, page 149 describes the synchronous responses and remarks for the Set WPS command.

Example 1 AT+P2PSETWPS=Debvice ID,0006,0001,11223344556677881122334455667788OK

Table 102 Set WPS Parameters

Parameter Optional/Mandatory Value Description

Device name Mandatory32 bit character.default value (GAINSPAN-P2P)

Unique name to identify the device. P2P Device manufacturers should attempt to create unique Device Names and user interfaces that maximize the probability of selecting the correct device, but there will be cases where device selection is non-deterministic.

Primary device type category ID Mandatory 2-byte A device category value.

Primary device type subcategory ID Mandatory 2-byte A device subcategory value.

UUID Mandatory 16-byte Universally unique identifier.Note: GS2000 does not support configuring secondary device type subcategory ID.

Table 103 Set WPS Synchronous Responses

Events Verbose mode Non Verbose mode Remarksuccess <CR><LF>OK<CR><LF> <CR><LF>0<CR><LF> All parameters are valid.

ailure <CR><LF>ERROR:<SP>INVALID<SP>INPUT<CR><LF> <CR><LF>2<CR><LF> Parameters are valid.

1VV0301463 Rev. 1.0 Page 149 of 172 2018-01-24

Page 150: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

S

F

5.4.3 Start Find

This command is used to transition the device in to P2PFIND phase.

Command Syntax AT+P2PFIND=<Timeout>,<Channels to scan in search state><CR>

Parameter Description

Table 104, page 150 describes the Start Find parameters.

Synchronous Response

Table 105, page 150 describes the synchronous responses and remarks for the Set P2P Find command.

Asynchronous Response

Table 104 Start Find Parameters

Parameter Optional/Mandatory Value Description

Timeout Mandatory0 (default)(0 to 4294967296)Unit: seconds

If timeout is not specified, then it is considered as infinite, i.e., the system will be in find phase forever or until stopped explicitly using the AT+P2PSTOPFIND command.The value is a 32 bit variable.

Channels to scan in search state Mandatory 1(default) Social channels (1,6 & 11).

Note: Only social scan is currently supported. P2P Find is only supported in un-connected state (P2P device mode).

NOTE: Time spent per channel during scanning in the P2P search state is configured through “AT+WST” command.

Table 105 Start Find Synchronous Responses

Events Verbose mode Non Verbose mode Remarksuccess <CR><LF>OK<CR><LF> <CR><LF>0<CR><LF> All parameters are valid.

ailure <CR><LF>ERROR:<SP>INVALID<SP>INPUT<CR><LF> <CR><LF>2<CR><LF> Parameters are valid.

1VV0301463 Rev. 1.0 Page 150 of 172 2018-01-24

Page 151: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

Up

e

WP2reprP2sta

e

>

e

e

>

Table 106, page 151 describes the asynchronous responses and remarks for the Set P2P Find command.

Response

The format is similar to scan results, as given below.

p2p-dev-found<MAC address>,<device address>,<primary device category>,<primary device subcategory>,<secondary device category>,<secondary device subcategory>,<device name>,<channel>,<config methods>,<device capabilities>,<group capabilities>

Example p2p-dev-found 02:b5:64:63:30:63,02:b5:64:63:30:63, 0006,0050,f204,0001,,wireless pc,6,2388,33,49

Table 106 Start Find Asynchronous Responses

Events Verbose mode Non Verbose mode Remarks

Asynchronous Enhanced AsynchronousAsynchronous Enhanced

Asynchronous

on timeout <CR><LF>p2p-find-complete<CR><LF>

same as verbose & asynchronous mode.

same as verbose & asynchronous mode.

same as verbose & asynchronous mode.

After the completion of P2P find phase, the devicis moved back to P2P LISTEN state and remains there until the next command.

hen another P device

sponds to obe request in P search te.

<CR><LF>p2p-dev-found<SP><MAC address>,<p2p device address>,<primary device type subcategory>,<secondary device type catogory>,<secondary device type subcategory>,<device name>,<listen channel>,<wps configaration method>,<device capabilities>,<group capabilities><CR><LF>

same as verbose & asynchronous mode.

same as verbose & asynchronous mode.

same as verbose & asynchronous mode.

ASCII presentation of thcorresponding hexa decimal value are:

• <mac address>

• <p2p device address

• <primary device typcategory>

• <primary device typsubcategory>

• <secondary device type category>

• <secondary device type subcategory>

• <wps configuration method>

• <device capabilities

• <group capabilities>

1VV0301463 Rev. 1.0 Page 151 of 172 2018-01-24

Page 152: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

S

F

Oss

Command Note 1. Mac addr, devaddr, type, config methods, device cap and group cap values are displayed in Hex.

2. P2P find is NOT supported in GO mode.

5.4.4 Stop FindThis command is used to stop the P2P find operation that is currently in progress.

Response

This command returns the standard command response to the serial interface.

Command Syntax AT+P2PSTOPFIND<CR>

Synchronous Response

Table 107, page 152 describes the synchronous responses and remarks for the P2P Stop Find command.

Asynchronous Response

Table 108, page 152 describes the asynchronous responses and remarks for the P2P Stop Find command.

Table 107 Stop Find Synchronous Responses

Events Verbose mode Non Verbose mode Remarks

uccess <CR><LF>OK<CR><LF> <CR><LF>0<CR><LF> Format of the command iscorrect.

ailure <CR><LF>ERROR:<SP>INVALID<SP>INPUT<CR><LF> <CR><LF>2<CR><LF> Format of the command is

incorrect.

Table 108 Stop Find Asynchronous Responses

Events Verbose mode Non Verbose mode Remarks

Asynchronous Enhanced AsynchronousAsynchronous Enhanced

Asynchronous

nce uccessfully topped

<CR><LF>p2p-find-complete<CR><LF>

same as verbose & asynchronous mode.

same as verbose & asynchronous mode.

same as verbose & asynchronous mode.

Once P2P Find phase is terminated, the device is moved back to P2P LISTEN state and remains there until the next command.

1VV0301463 Rev. 1.0 Page 152 of 172 2018-01-24

Page 153: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

S

F

F

5.4.5 Provoke

This command triggers the WPS- registrar functionality for GO. Once this command is issued the registrar automatically turns off after 120seconds. If the command is issued multiple times, the timeout starts from the last issued command.

Command Syntax AT+P2PPROVOK=<WPS-KEYPAD PIN><CR>

Parameter Description

Table 109, page 153 describes the Provoke parameters.

Synchronous Response

Table 110, page 153 describes the synchronous responses and remarks for the Set P2P Configuration.

Example Start the registrar in PushButton or DISPLAY methodAT+P2PPROVOK

Start the registrar in KEYPAD methodAT+P2PPROVOK=89170960

Table 109 Provoke Parameters

Parameter Optional/Mandatory Value Description

WPS-keypad pin Mandatory N/AThe KEYPAD PIN, displayed in the peer p2p device after responding to the provision discovery request. The length is 8digits.

Table 110 Provoke Synchronous Responses

Events Verbose mode Non Verbose mode Remarksuccess <CR><LF>OK<CR><LF> <CR><LF>0<CR><LF> All parameters are valid.

ailure <CR><LF>ERROR<CR><LF> <CR><LF>1<CR><LF>Error in start/trying to provide PIN in DISPLAYmethod.

ailure <CR><LF>ERROR:<SP>INVALID<SP>INPUT<CR><LF> <CR><LF>1<CR><LF> parameters are invalid.

1VV0301463 Rev. 1.0 Page 153 of 172 2018-01-24

Page 154: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

5.4.6 Provision Discovery

This command is used to send provisioning discovery request to given peer with the given configuration method and wait for provisioning discovery response.

Command Syntax AT+P2PPD=<peer P2P device MAC address>,<WPS configration method><CR>

Usage Upon receiving this response, the host should issue connect or join command with displayed PIN.

Parameter Description

Table 111, page 154 describes the Provision Discovery parameters.

Response

1. If the configuration method is push button, then the peer will push the button upon receiving the provisioning discovery request. When the provisioning discover response comes back, the following response is sent to host: p2p-prov-disc-resppbc. Upon receiving this response, the host should issue connect or join command.

2. If the configuration method is “display” (option 1), then peer will display the PIN on receiving the provisioning discovery request that we would use in connect/join command. Once the provisioning discovery response comes back, the following response is sent to host: p2p-prov-disc-respenter pin. Upon receiving this response, the host should issue connect or join command with the PIN displayed on the peer.

3. If the configuration method is “keypad” (option 2), then peer will enter the PIN that we would display. Once the provisioning discovery response comes back from peer, the following response is sent to host: p2p-prov-disc-respdisplay pin <PIN>.

NOTE: Before issuing the provision discovery command, make sure P2PFind is stopped (AT+P2Pstopfind).

Table 111 Provision Discovery Parameters

Parameter Optional/Mandatory Value Description

Peer P2P device MAC address Mandatory N/A

The MAC address of the peer P2P device to send provisioning discovery request.MAC address is extracted from the list of devices discovered in P2Pfind phase(xx.xx.xx.xx.xx)

WPS configuration method Mandatory

0 Request peer P2P device to push button

1 Request peer P2P device to display PIN that would be used for connection/join

2Request peer P2P device to enter PIN that would be generated/displayed by the initiator of provision discovery request.

1VV0301463 Rev. 1.0 Page 154 of 172 2018-01-24

Page 155: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

UrepdrefrP

F

Synchronous Response

Table 112, page 155 describes the synchronous responses and remarks for the Provision discovery command.

Example -1 Provision Discovery using Push Button MethodAT+p2ppd=00:1d:c9:1b:94:08,0

Example -2 Provision Discovery using Display MethodAT+p2ppd=00:1d:c9:1b:94:08,1

Table 112 Provision Discovery Synchronous Responses

Events Verbose mode Non Verbose mode Remarks

pon ceiving

rovision iscovery sponse om peer 2P

Provision Discovery Response with Push Button Method<CR><LF>p2p-prov-disc-resp<SP>pbc<CR><LF>OK<CR><LF>

Provision Discovery Response with Display Method<CR><LF>p2p-prov-disc-resp<SP>display-pin<CR><LF>OK<CR><LF>

Provision Discovery Response with Keypad Method<CR><LF>p2p-prov-disc-resp<SP>enter-pin<CR><LF>OK<CR><LF>

<Provision Discovery Response with Push Button Method<CR><LF>p2p-prov-disc-resp<SP>pbc<CR><LF>0<CR><LF>

Provision Discovery Response with Display Method<CR><LF>p2p-prov-disc-resp<SP>display-pin<CR><LF>0<CR><LF>

Provision Discovery Response with Display Method<CR><LF>p2p-prov-disc-resp<SP>enter-pin<CR><LF>0<CR><LF>

Provision Discovery Response with Push Button Method

• Peer p2p device triggersthe push method and theMCU issues the join command (AT+P2PJOIN)

Provision Discovery Response with Display Method

• Peer p2p device displaysthe pin and the MCU issues the join commandwith the pin displayed onthe peer.

Provision Discovery Response with Keypad Method

• GS2000 provides a pin to MCU which is used inAT+P2PJOIN commandthat is entered in peer p2p device.

ailure <CR><LF>ERROR:<SP>INVALID<SP>INPUT<CR><LF> <CR><LF>2<CR><LF> Parameters are invalid.

NOTE: 1.) The timeout per provision discovery request is 1000ms (value not configurable) i.e, the wait time for receiving provision discovery response. 2.) Maximum number of retries is 10 (value not configurable).

1VV0301463 Rev. 1.0 Page 155 of 172 2018-01-24

Page 156: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

Example -3 Provision Discovery using Keypad MethodAT+p2ppd=00:1d:c9:1b:94:08,2

5.4.7 Group Form (Group Owner Negotiation)

This command is used to start P2P group formation with a discovered P2P peer.Before issuing this command P2Pfind has to be stopped.

Command Syntax AT+P2PGRPFORM=<peer (p2p device)MAC address>,<peer (p2p device)listen channel>,<WPS config method>,<WPS PIN>,<group owner intent value>,<Trigger GO Negotiation Request>,<p2p group type><CR>

Group formation includes group owner negotiation, provisioning and establishing data connection.

Parameter Description

Table 113, page 156 describes the Group Form (Group Owner Negotiation) parameters.

Table 113 Group Form (Group Owner Negotiation) Parameters

Parameter Optional/Mandatory Value Description

peer (p2p device) MAC address Mandatory N/A

MAC address of the peer P2P device to which the group information needs to be carried out. It is extracted from the information passed during P2PFIND

peer (p2p device) listen channel Mandatory N/A

it specifies the peer p2p device to which group information needs to be carried out and is extracted during P2PFIND phase.

WPS config method Mandatory

0 Use push button for provisioning (PBC)

1 Displays configuration information (i.e., display a PIN that peer has to enter.

2Key-in configuration information (i.e., enter the PIN using keypad, which was displayed by peer.

WPS PIN

Mandatory N/A The WPS pin, if the above selected option is DISPLAY or KEPAD method.

Note: 1.) WPS DISPLAY method is applicable only if MCU is interfaced with a device through which the display pin by the peer is an input to the MCU and pass on to GS2000.2.) WPS KEYPAD method is applicable only if the MCU is interfaced with an LCD display, through which WPS PIn is sent to the peer P2Pdevice. In the absence of the LCD display, MCU uses the predefined pin and sticks on the top of the device.PIN length should be 8digits and GS2000 doesn't support 4bytes PIN

1VV0301463 Rev. 1.0 Page 156 of 172 2018-01-24

Page 157: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

E

SUC

p SK

ver.

SUC

rts

Synchronous Response

Table 114, page 157 describes the synchronous responses and remarks for the Group Form (Group Owner Negotiation) command.

group owner intent value Mandatory 0 to 15

The Group Owner Intent value is P2P device’s willingness of being the P2P Group Owner, with a larger value indicating a higher desire.

Note: The intent value in AT+P2PSETDEV is same asAT+P2PGRPFORM

trigger GO negotiation request Mandatory

0- Trigger GO negotiation request.1- Wait for peer p2p device to trigger GO negotiation request.

0-Timeout per request id 1000ms, i.e, the time state expecting the GO negotiation response. Maximum retries is 30Timeout is 10 seconds.Note: To form P2P group between two GS nodes, trigger GO negotiation request must be different in these 2 nodes.

p2p group type Optional0- Temporary group1- persistent group0()

Set if the group should be a persistent group. if not specified, it is taken as zero (i.e., not a persistent P2P group).

Table 113 Group Form (Group Owner Negotiation) Parameters

Parameter Optional/Mandatory Value Description

NOTE: If any of the above parameters is not specified, then it will be considered not set. The default beacon interval is 100ms, DTIM count is 1 and listen interval is 600 beacon intervals.

Table 114 Group Form (Group Owner Negotiation) Synchronous Responses

vents Verbose mode Non Verbose mode Remarks

CESS

<CR><LF>p2p-go-negotiation-complete<SP>GO,SSID,operating channel,device MAC address,WPA2-personal passphrase or WPA2-personal PSK<CR><LF>Network Parameter Response Format<CR><LF>OK<CR><LF>

<CR><LF>p2p-go-negotiation-complete<SP>GO,SSID,operating channel,device MAC address,WPA2-personal passphrase or WPA2-personal PSK<CR><LF>Network Parameter Response Format<CR><LF>0<CR><LF>

The device becomes grouowner. WPA2-personal Pper shared key is 32bytesi.e,64 characters.After receiving the message theMCU starts the DHCP ser

CESS

<CR><LF>p2p-go-negotiation-complete<SP>client,SSID,operating channel,device MAC address,WPA2-personal passphrase or WPA2-personal PSK<CR><LF>Network Parameter Response Format<CR><LF>OK<CR><LF>

<CR><LF>p2p-go-negotiation-complete<SP>client,SSID,operating channel,device MAC address,WPA2-personal passphrase or WPA2-personal PSK<CR><LF>Network Parameter Response Format<CR><LF>0<CR><LF>

The device become groupmember.WPA2-personal PSK per shared key is 32bytes i.e,64 characters.After receivingthe message the MCU stathe DHCP client server

1VV0301463 Rev. 1.0 Page 157 of 172 2018-01-24

Page 158: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

FAIL

FAIL

Not<SP SP><S X.XXX

E

Example AT+P2PGRPFORM= 42:b0:fa:62:74:ac,1,4,,13,1,0

peer P2P device with MAC address “42:b0:fa:62:74:ac,1,4,,13,1,0”Channel 1Push Button MethodIntent value of 13Don’t trigger “GO negotiation request”In case group owner, start temporary group.

Responsep2p-go-neg-complete client,<ssid>,<channel>,<GO device address>,<passphrase>|<psk>

Example 1 - When a new group is created and the device becomes a client

p2p-group-started client,DIRECT-gs,6,02:1d:c9:01:02:03,GSDemo123

p2p-go-neg-complete GO,<ssid>,<channel>,<GO device address>,<passphrase>|<psk>

Example 2 - When a new group is created and the device becomes a GO

p2p-go-neg-complete GO,DIRECT-aR,11,02:1d:c9:90:6a:bb,E4JWHKo3p2p-go-neg-fail <reason>

Example -1 Group formation using PBC Method

AT+P2PGRPFORM=02:1d:c9:01:02:03,6,0,,1,1,0OK

Example -2 Group formation using Display Method

For group formation using Display Method, the following commands are entered on your device and peer device after discovering devices using p2pfind.

URE <CR><LF>ERROR<CR><LF> <CR><LF>1<CR><LF> Group formation Failed.

URE <CR><LF>ERROR:<SP>INVALID<SP>INPUT<CR><LF> <CR><LF>2<CR><LF> Parameters invalid.

e: Network parameter response format - ><SP><SP><SP>IP<SP><SP><SP><SP><SP><SP><SP><SP><SP><SP><SP><SP><SP><SP>Subnet<SP><SP><P><SP><SP><SP><SP><SP>Gateway<SP><SP><SP><SP><LF><SP>XXX.XXX.XXX.XXX.XXX.XXX.XXX.XX.XXX.XXX.XXX.<SP>

Table 114 Group Form (Group Owner Negotiation) Synchronous Responses (Continued)

vents Verbose mode Non Verbose mode Remarks

1VV0301463 Rev. 1.0 Page 158 of 172 2018-01-24

Page 159: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

At the peer where the PIN needs to be entered, the following command should be given.AT+P2PGRPFORM=02:1d:c9:01:02:04,6,1,42746188,1,1,0

The GO negotiation should happen between the two devices followed by provisioning and connection and the following response is given out.

p2p-group-started GO,DIRECT-gs,6,02:1d:c9:01:02:04,GSDemo123

p2p-group-started client,DIRECT-gs,6,02:1d:c9:01:02:03,GSDemo123

Example -3 Group formation using Keypad Method

AT+P2PGRPFORM=02:1d:c9:01:02:03,6,2,42746188,1,15,1,0

At the peer where the PIN needs to be displayed, the following command should be given:

AT+P2PGRPFORM=02:1d:c9:01:02:04,6,3,42746188,0,4,0,0

The GO negotiation should happen between the two devices followed by provisioning and connection and then he following response is given out.

p2p-group-started GO,DIRECT-gs,6,02:1d:c9:01:02:04,GSDemo123

p2p-group-started client,DIRECT-gs,6,02:1d:c9:01:02:03,GSDemo123

5.4.7.1 Provision Discovery Request Handling

Upon receiving provisioning discovery request, depending on WPS config method, one of the following responses is sent to host.

Response - PBC Method

p2p-prov-disc-req pbc<peer address>,<device address>,<primary device category>,<primary device subcategory>,<secondary device category>,<secondary device subcategory>,<device name>,<config methods>,<device capability>,<group capability>

The user action upon receiving this should be following.

AT+P2PPROVOK

1VV0301463 Rev. 1.0 Page 159 of 172 2018-01-24

Page 160: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

Response - Display Method

p2p-prov-disc-req display-pin <PIN> <peer address>,<device address>,>,<primary device category>,<primary device subcategory>,<secondary device category>,<secondary device subcategory>,<,<device name>,<config methods>,<device capability>,<group capability>

The user action should be to show the PIN on a display and issue following.

AT+P2PGRPFORM=…

or

AT+P2PPROVOK

Response - Keypad Method

p2p-prov-disc-req enter-pin <peer address>,<device address>,>,<primary device category>,<primary device subcategory>,<secondary device category>,<secondary device subcategory>,<device name>,<config methods>,<device capability>,<group capability>

The user action should be to enter PIN as follows:

AT+P2PGRPFORM=…

or

AT+P2PPROVOK=<PIN>

or

AT+P2PROVNOK

1VV0301463 Rev. 1.0 Page 160 of 172 2018-01-24

Page 161: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

GO

WP

WP

n

5.4.8 Client JoinThis command is used to join the P2P group owner. Provision discovery request and response (AT+P2PPD) needs to be exchanged with the group owner’s intent to join.

Command Syntax AT+P2PJOIN=<GO MAC address>,<wps config method>,<WPS-pin><CR>

Parameter Description

Table 115, page 161 describes the Client Join parameters.

Synchronous Response

Table 116, page 162 describes the synchronous responses and remarks for the Client Join command.

Table 115 Client Join Parameters

Parameter Optional/mandatory Value Description

MAC address Mandatory N/A The device MAC address of the group owner (xx.xx.xx.xx.xx.xx).

S Config method Mandatory N/A

The WPS method to use for WPS procedure• 0 - WPS-push button• 1 - WPS-display• 2 - WPS-keypad

The same configuration method is issued that is provided in the provision discovery request (AT+P2PPD)

S-Pin Mandatory N/A

The pin should be entered in the following cases:

1. If wps_method is keypad, then the entered piis passed (displayed by peer).

2. If wps_method is displayed, then the pin displayed is passed (keypad by peer).

The length allowed is 8 characters.

1VV0301463 Rev. 1.0 Page 161 of 172 2018-01-24

Page 162: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

CsG

Cf

F

Example WPS Push MethodAT+P2PJOIN=00:1d:c9:94:08,0

WPS Dislay MethodAT+P2PJOIN=00:1d:c9:94:08,1,82175108

WPS Keypad MethodAT+P2PJOIN=00:1d:c9:94:08,2,82175108

Table 116 Client Join Synchronous Responses

Events Verbose mode Non Verbose mode Remarks

onnected uccessfully to O

<CR><LF>p2p-join-success-client<SP><SSID>,<channel><<MAC address for GO>WPA2-personal PSK<CR><LF>OK<CR><LF>

<CR><LF>p2p-join-success-client<SP><SSID>,<channel><<MAC address for GO>WPA2-personal PSK<CR><LF>0<CR><LF>

WPA-personal PSK per shared keyis 32bytes long with 64 characters.

onnection ailed with GO

<CR><LF>p2p-join-fail<CR><LF>ERROR:<CR><LF>

<CR><LF>p2p-join-fail<CR><LF>1:<CR><LF>

ailure <CR><LF>ERROR<SP>INVALID<SP>INPUT<CR><LF> <CR><LF>2<CR><LF> Parameters are

invalid

1VV0301463 Rev. 1.0 Page 162 of 172 2018-01-24

Page 163: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

SU n.

SU

Fa

5.4.9 Invitation Procedures

This command is used to send an invitation request to the given peer address to join an active group.

Command Syntax AT+P2PINVITE=<peer p2p device MAC address><CR>

Usage The invitation is sent to request the peer to join the group for which this device is a GO or to request the peer to join the group for which the device address is specified.

Parameter Description

Table 117, page 163 describes the Invitation Procedures parameters.

Synchronous Response

Table 118, page 163 describes the synchronous responses and remarks for the Invitation Procedure command.

Asynchronous Response

Table 119, page 164 describes the asynchronous responses and remarks for the Invitation Procedure command.

NOTE: This does not support sending invitation to invoke a persistent group.

Table 117 Invitation Procedures Parameters

Parameter Description

Peer p2p device MAC address

The address of the peer P2P device to which an invitation has been sent. The address is saved by MCU.Timeout per invitation request is 10 seconds with a maximum retries of 10

Table 118 Invitation Procedures Synchronous Responses

Events Verbose mode Non Verbose mode RemarksCCESS <CR><LF>OK<CR><LF> <CR><LF>0<CR><LF> Successfully sent P2P invitatio

CCESS <CR><LF>ERROR<CR><LF> <CR><LF>1:<CR><LF> Failure in sending invitation request

ilure <CR><LF>ERROR<SP>INVALID<SP>INPUT<CR><LF> <CR><LF>2<CR><LF> Parameters are invalid

1VV0301463 Rev. 1.0 Page 163 of 172 2018-01-24

Page 164: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

FAI ies

SUC

he

Example AT+P2PINVITE=42:b0:fa:62:74:ac

5.4.10 Disconnect

This command is used to Disconnect P2P client or Group owner. Refer 5.3.6 Disassociation, page 143 for command syntax.

Usage If the device is in P2P mode, then this command does the following:

1. If the device is connected as a client to a group, then it disconnects.

2. If the device is operating as a GO, then it stops GO operation and switches to P2P device mode.

Table 119 Invitation Procedure Asynchronous Responses

Events Verbose mode Non Verbose mode Remarks

Asynchronous Enhanced AsynchronousAsynchronous Enhanced

Asynchronous

LURE <CR><LF>p2p-invitation-sent<SP>ERROR<CR><LF>

same as verbose & asynchronous mode.

same as verbose & asynchronous mode.

same as verbose & asynchronous mode.

Peer P2P device doesn't respond within 100ms/denthe invitation request

CESS. <CR><LF>p2p-invitation-sent<SP>OK<CR><LF>

same as verbose & asynchronous mode.

same as verbose & asynchronous mode.

same as verbose & asynchronous mode.

Peer P2P device accepts tinvitation request

1VV0301463 Rev. 1.0 Page 164 of 172 2018-01-24

Page 165: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

5.5 Concurrent Mode (STA Plus AP)Concurrent Mode provides the ability to run GS node both as STA as well as Limited-AP using Time Division method on a single radio.

In this mode, the GS node will function as Limited-AP for 80% of beacon time and as STA for remaining 20% of beacon time. It has the ability to switch between the two without loss of context. The application views it as two interfaces available at the same time.The potential to switch rapidly in the hardware allows this to be done efficiently using a single radio.

In concurrent mode, the application creates two interfaces one for STA and another for Limited-AP. Interface 0 must be initialized for STA interface and interface 1 must be for Limited-AP

1VV0301463 Rev. 1.0 Page 165 of 172 2018-01-24

Page 166: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

5.5.1 Enable/Disable Concurrent ModeThis command is used to enable/disable concurrent mode and to specify the percentage of time spent in each mode.

Command Syntax AT+NIFCMODE=<mode type>[,<%time in STA interface>,<Enable STA reliability mode>]

Parameter Description

Table 120, page 166 describes the Enable/Disable Concurrent Mode parameters.

Table 120 Enable/Disable Concurrent Mode Parameters

Parameter Optional/Mandatory Value Description

mode type Mandatory

0, 10: Disable1: EnableDefault value: 0

Enables or disables Concurrent mode.

% time in STA interfaceOptional

120% - Station20%, 30% are configurable values.Default value: 20%

When concurrent mode is enabled, GS node will operate as STA for 20% or 30% of Beacon time.

Enable STA reliability mode Optional

0, 10 - Disable1 - EnableDefault value: 0

Enables STA interface reliability mode.This parameter is enabled to improve the data transfer reliability in STA interface. This feature is useful in crowded environments and when STA is connected to an AP that delays sending data. Note:This parameter should be used in combination with following features to improve receive performance in Concurrent STA:• Disable UAPSD for STA interface.

(See AT+WA command in Association, page 140)

• Set Concurrent AP DTIM (DTIM period in LAP mode parameter) to 1 (See AT+WM command in Operation Mode, page 105)

1VV0301463 Rev. 1.0 Page 166 of 172 2018-01-24

Page 167: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

Synchronous Response

Table 121, page 167 describes the synchronous responses and remarks for Enable/Disable Concurrent Mode command.

5.5.2 Set the Interface NumberThis command is used to set the interface. All the commands which follow this command (till the next invocation of this command) are assumed to be for the set interface.

Command Syntax AT+NIF=<Interface Number 0/1 or ?>

Parameter Description

Table 122, page 168 describes the Set Interface Number parameters.

NOTE: 1.) In concurrent mode, Limited-AP mode supports 16 stations, open and WPA2-AES security. 2.) In general limited AP mode supports,16 stations & all claimed security as per release notes. 3.) It is recommended to keep the Beacon Interval of the AP Interface as 100ms. 4.) Issue AT+APCONF=0 for station interface in NCM concurrent mode, when the STA interface is brought up through NCM after the AP interface. 5.) It is recommended to use different port numbers for L4/TCP server sockets in concurrent mode.

Table 121 Enable/Disable Concurrent Mode Synchronous Responses

Responses RemarksOK SuccessERROR Failure

ERROR:INVALID INPUTIf parameters values are not valid.(Other than 0 and 1)

NOTE: Interface 0 should always be initialized first with STA

1VV0301463 Rev. 1.0 Page 167 of 172 2018-01-24

Page 168: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

Synchronous Response

Table 123, page 168 describes the synchronous responses and remarks for Set Interface Number command.

Example AT+NIF=<Interface number>\r\nOK\r\n

Table 122 Set Interface Number Parameters

Parameter Optional/Mandatory Value Description

Interface Number Mandatory 0 (default), 1 &?

If interface number is specified.0 - Client interface (default)1 - AP interface? - Queries which interface is in use.

Table 123 Set Interface Number Synchronous Responses

Responses RemarksOK SuccessERROR Failure

ERROR:INVALID INPUTIf parameters are not valid.(Other than 0 and 1)

0 or 1 Returns the active interface number.

1VV0301463 Rev. 1.0 Page 168 of 172 2018-01-24

Page 169: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

5.5.3 Indicating InterfaceASYNC messages in concurrent mode are followed by an interface number. This is only valid for messages which do not contain CID.

Command Note This message is only sent in case AT+NIFCMODE=1. When concurrent mode is started the escape sequence is:

<ESC><R>:<IF NO>:<len>:<data> Else <ESC><R>:<len>:<data>Disassociation Event <Interface Number>

Example AT+WA=CM_STA_SSIDIP SubNet Gateway192.168.0.100:255.255.225.0:192.168.0.1OkDissassociation Event 0

1VV0301463 Rev. 1.0 Page 169 of 172 2018-01-24

Page 170: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

5.5.4 Example Usage of Concurrent Mode

Example 1 The items below outline an example use case for concurrent mode. Interface 0 is the normal client and Interface 1 is the Limited AP.

• Enable Concurrent ModeAT+NIFCMODE=1

• Configuring Client InterfaceAT+NIF=0AT+WM=0AT+NDHCP=1AT+WA=...AT+mDNS=...

• Configuring the AP InterfaceAT+NIF=1AT+WM=2AT+NSET=.....AT+DHCPSRVR=1,...AT+WA=...

• Start the web server and advertise the services for the APAT+WEBSER=...AT+mDNS=....

• Switch to ClientAT+NIF=0

• Start a client connection to the server (connectivity through the infrastructure)AT+NCTCP=...

• Send data to the server<Esc Z><CID><Len><Data......>

• Received data from the server<Esc Z><CID><Len><Data......>

• Disconnect from APDisconection Indication <Interface Number>\r\n

• Smart Phone Connected to AP and sending data through <Esc N>1\r\n<Esc K)....

1VV0301463 Rev. 1.0 Page 170 of 172 2018-01-24

Page 171: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

Example 2 The following is an example for NCM in concurrent Mode.

SerialIP2WiFiAPP

AT+NIFCMODE=1,20

OK

AT+NIF=0OK

AT+WM=0OK

AT+WRXACTIVE=0OK

AT+WRXPS=1OK

AT+NDHCP=1OK

AT+WWPA=123456789OK

AT+WAUTO=0,GainSpan,,1OK

AT+NCMAUTO=0,1,0OK

IP SubNet Gateway192.168.71.93:255.255.225.0:192.168.71.1NWCONN-SUCCESSAT&w0OK

AT+NIF=1OK

AT+WM=2OK

AT=APCONF=1OK

AT+NAUTO=1,1,,8001OK

1VV0301463 Rev. 1.0 Page 171 of 172 2018-01-24

Page 172: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

AT+NSET=192.168.58.1,255.255.255.0,192.168.58.1OK

AT+WAUTO=2,NCM_AP,,1OK

AT+NCMAUTO=1,1,1OK

IP SubNet Gateway192.168.58.1:255.255.225.0:192.168.58.1NWCONN-SUCCESSAT&w0OK

1VV0301463 Rev. 1.0 Page 172 of 172 2018-01-24

Page 173: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

Chapter 6 Network

This chapter describes commands for configurations and operations related to Network layer.

• Network Interface Filter, page 173

• Get Network Interface Filter Configuration, page 176

• DHCP Client, page 176

• IP Address, page 178

• DHCP Server, page 180

• DHCP Server Configuration, page 182

• DNS Server, page 183

• DNS Address, page 184

• DNS Spoofing, page 185

All connection commands except for the transport of Raw Ethernet data (see 7.6.1.8 Close HTTP Client, page 285), use the embedded TCP/IP Network Stack functions to perform the required actions. Connection identifiers, denoted as <CID> are to be sent as single hexadecimal characters in ASCII format.

6.1 Network Interface FilterThis command supports the S2W GS node feature called network interface filter, which controls the traffic to the network stack so that unwanted TCP/UDP/ICMP packets can be dropped before giving to the network stack. This feature prevents the DOS attacks.

Command Syntax AT+L2CONFIG=<Protocol>,<Enable/Disable>

Command Note GainSpan node supports a feature called network interface filter which controls the traffic to the network stack so that unwanted TCP/UDP/ICMP packets can be dropped before giving to the network stack. This feature prevents the DOS attacks.

Parameter Description

Table 124, page 174 describes the Network Interface Filter parameters.

1VV0301463 Rev. 1.0 Page 173 of 186 2018-01-24

Page 174: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

Synchronous Response

Table 125, page 174 describes the synchronous responses and remarks for the Network Interface Filter command.

Example 1 - Enables the filter for ICMP reception

So that ICMP packets will not go to network stack.AT+L2CONFIG=1,1OK

Example 2 - Disables the above command

AT+L2CONFIG=1,0OK

Example 3 - Enables the filter for UDP and TCP reception

So that UDP/TCP packets with an invalid port will not go to the network stack.AT+L2CONFIG=2,2OK

Example 4 - Disables the command above

AT+L2CONFIG=2,0OK

Example 5 - Enables the filter for ICMP/UDP and TCP

AT+L2CONFIG=3,3OK

Example 6 - Disables the command

AT+L2CONFIG=3,0OK

Example Use Case GainSpan node is configured as a TCP server and enabled network interface filter with Server IP: 9003 and I2config for UDP/TCP enabled.

AT+WA=GainSpanDemo,,11IP SubNet Gateway

Table 124 Network Interface Filter Parameters

Parameter Optional/Mandatory Value Description

Protocol Mandatory1 For ICMP2 For UDP and TCPParameter is configured as a bit wise.

Enable/Disable Mandatory0 (default) For Disable1 For EnableParameter is configured as bit wise.

Table 125 Network Interface Filter Synchronous Responses

Responses RemarksOK Success

ERROR:INVALID INPUTFailureIf the parameters are not valid.

1VV0301463 Rev. 1.0 Page 174 of 186 2018-01-24

Page 175: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

192.168.23.101:255.255.255.0:192.168.23.1OK

AT+NSTCP=9003CONNECT0OK

AT+L2CONFIG=2,2OK

1VV0301463 Rev. 1.0 Page 175 of 186 2018-01-24

Page 176: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

6.2 Get Network Interface Filter ConfigurationThis command is used to get the configured current network interface filter.

Command Syntax AT+L2CONFIG=?

Synchronous Response

Table 126, page 176 describes the synchronous responses and remarks for the Get Network Interface Filter Configuration command.

Example AT+L2CONFIG=1,1OK

AT+L2CONFIG=?CONFIG MAP:01OK

6.3 DHCP ClientThis command is used to enable or disable DHCP client support for IPv4 network.

Command Syntax AT+NDHCP=n[,<hostname>,<radio mode>,<lease period>,<retry interval>]

Parameter Description

Table 127, page 176 describes the DHCP Client parameters.

Table 126 Get Network Interface Filter Configuration Synchronous Responses

Responses RemarksCONFIG MAP:<value>OK

value is the configured network interface filter.

Table 127 DHCP Client Parameters

Parameter Optional/Mandatory Value Description

n Mandatory0 (default) Disable1 Enable

hostname Optional

Value: String of 1 to 15 charactersDefault value: GS_<Last 6 digits of MAC ID>

hostname is a string with a maximum character length of 15. This will be displayed by Access Points as the hostname in the DHCP Clients table.

1VV0301463 Rev. 1.0 Page 176 of 186 2018-01-24

Page 177: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

Synchronous Response

Table 128, page 177 describes the synchronous responses and remarks for the DHCP Client command.

Asynchronous Response

Table 129, page 178 describes the asynchronous responses and remarks for the DHCP Client command.

radio mode Optional

1 Active mode2 (default) PS poll mode

3IEEE PS poll mode (It is the PS mode configured using AT+WIEEEPSPOLL command.)

lease period Optional

4294967296 seconds - infinite seconds(default)

It specifies the lease period to be requested in DHCP discover message.

retry interval Optional 2 secondsIt specifies the time interval between successive DHCP retries.Note: By default, DHCP retry interval is 1 sec initially and

the subsequent retries is 2 sec.

Table 127 DHCP Client Parameters

Parameter Optional/Mandatory Value Description

Table 128 DHCP Client Synchronous Responses

Responses Remarks

OKSuccessIf the GS node is not associated when the command is received, future associations will attempt to employ DHCP.

IP SubNet Gateway<IPaddress> <SubNet address> <Gateway address>

SuccessIf the interface is associated with a network, enabling DHCP will cause an attempt to obtain an IP address using DHCP from that network. Therefore issuing this command with n=1 will cause the GS node to attempt to refresh an existing DHCP address.

IP CONFIG FAIL

If the DHCP renewal failed then the GS node closes all the sockets opened and sends an error message ERROR: IP CONFIG FAIL to the serial interface. The host can re-issue the network configuration command to redo the DHCP procedure again.

1VV0301463 Rev. 1.0 Page 177 of 186 2018-01-24

Page 178: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

Example 1 - If the node is not associated when the command is received

AT+NDHCP=1OK

Example 2 - If the node is associated when the command is received

AT+WA=GainSpanDemoIP SubNet Gateway192.168.1.99:255.255.255.0:192.168.1.1OK

AT+NDHCP=1IP SubNet Gateway192.168.44.145:255.255.255.0:192.168.44.1OK

6.4 IP AddressThis command is used to set network parameters statically. Upon deployment of this command, any previously specified network parameters are overridden, and the node is configured to use the newly specified network parameters for the current association, if associated, and for any future association. The use of DHCP is disabled if the network parameters are configured statically. The DNS address can be set using AT+DNSSET (see 6.8 DNS Address, page 184).

Command Syntax AT+NSET=<Device IPv4 Address>,<IPv4 Subnet Mask>,<Gateway IPv4 Address><CR>

Parameter Description

Table 130, page 179 describes the Static Configuration of Network Parameters.

Table 129 DHCP Client Asynchronous Responses

Responses Remarks815ERROR: IP CONFIG FAILWhere:Subtype - 8Length - 15 (ASCII equivalent decimal is 21 characters, i.e., length of the actual message).Actual message - ERROR: IP CONFIG FAILThe type of message. Length is 1 byte. For asynchronous message, it is 0x41 (ASCII value A).

IP configuration has failed. This message comes asynchronously when there is a DHCP renew fails.For asynchronous message format.

Note: <ESC> and Type is not displayed because its Tera Term issue.

1VV0301463 Rev. 1.0 Page 178 of 186 2018-01-24

Page 179: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

SucceSucce

Failur

Synchronous Response

Table 131, page 179 describes the synchronous responses and remarks for the Static Configuration of Network Parameters command.

Example Use Case 1 - If the node is not associated when the command is received

AT+NSET=192.168.44.12,255.255.255.0,192.168.44.12OKAT+WA=GainSpanIP SubNet Gateway192.168.44.12:255.255.255.0:192.168.44.12OK

Example Use Case 2 - If the node is associated when the command is received

AT+WA=GainSpanDemoIP SubNet Gateway192.168.1.99:255.255.255.0:192.168.1.1OKAT+NSET=192.168.44.12,255.255.255.0,192.168.44.12IP SubNet Gateway192.168.44.12:255.255.255.0:192.168.44.12

Table 130 Static Configuration of Network Parameters

Parameter Optional/Mandatory Value Description

device IPv4 Address Mandatory 192.168.1.99 (default value)

IP address of the source in the form xxx.xxx.xxx.xxx

IPv4 Subnet Mask Mandatory 255.255.255.0 (default value) Net mask is in the form of xxx.xxx.xxx.xxx

Gateway IPv4 Address Mandatory 192.168.1.1 (default value)

Gateway of the address (node: Src Adr and Gateway should be same in the case of Limited AP or P2P mode)

Note: IPv4 address is represented in dot decimal notation each of the four decimal numbers range from 0 to 255.

Table 131 Static Configuration of Network Parameters Synchronous Responses

Events Verbose Mode Non Verbose Mode Remarksss in unassociated state <CR><LF>OK<CR><LF> <CR><LF>0<CR><LF> VALID Parameterss in associated state <CR><LF>OK<CR><LF> <CR><LF>0<CR><LF> Command not to be used

e <CR><LF>ERROR<SP><INVALID><SP>INPUT<CR><LF> <CR><LF>2<CR><LF> INVALID Parameter

NOTE: 1.) This command is recommended to be issued before creating the limited AP or before associating STA to the network. 2.) AT+NDHCP = 0 command is issued before configuring the network parameters for both limited AP and STA.

1VV0301463 Rev. 1.0 Page 179 of 186 2018-01-24

Page 180: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

6.5 DHCP ServerThis command is used to start/stop the DHCP server. Prior to starting the server, the GS node should be configured with a valid static IP address (using commands described in 6.8 DNS Address, page 184, both Device IPv4 address and Gateway IPv4 address should be same) and created or configure to create a limited AP network.

This DHCP server can support maximum 32 client connections with server IP as the statically configured IP address and client IP address starts from the next IP address of the configured static IP address.

Command Syntax AT+DHCPSRVR=<Start/Stop DHCPv4 Server>[,<Enable/Disable DNS IP Advertising>,<Enable/Disable Gateway IP Advertising><CR>]

Parameter Description

Table 132, page 180 describes the DHCP Server parameters.

Table 132 DHCP Server Parameters

Parameter Optional/Mandatory Value Description

Start/Stop DHCPv4 Server Mandatory

0 Stops the DHCPv4 server1 Starts the DHCPv4 ServerNote: 1.) Returns ERROR (failure), if the server is already started and start is issued.2.) Returns ERROR (failure), if server is already stopped and stop is issued.

Enable/Disable DNS IP advertising Optional

0 (default) Enable, advertises DNS IP address information in DHCP message (offer & ACK) to the client.

1 Disable, does not advertise the DNS IP address.

Note: Device IP address itself is taken as DNS IP address. The value is not configured with any AT command.

Enable/Disable Gateway IP advertising Optional

0 (default)Enable, advertises the gateway IP address information in DHCP message (offer & ACK) to client.

1 Disable, does not advertise the gateway IP address.

Note: Gateway IP address is taken from AT+NSET.

1VV0301463 Rev. 1.0 Page 180 of 186 2018-01-24

Page 181: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

EventSuccessFailure age 180

Failure

Synchronous Response

Table 133, page 181 describes the synchronous responses and remarks for the DHCP Server command.

Example 1 Starting the DHCP sever with defualt settingsAT+WM=2OkAT+NSET=192.168.8.1,255.255.255.0,192.168.8.1OkAT+DHCPSRVRCFG=192.168.8.2.64OKAT+DHCPSRVR=1OK

AT+WA=DHCPSRVR-test, ,6Ok

Example 2 Starting DHCP server with DNS and gateway advertising disabledAT+WM=2OkAT+NSET=192.168.8.1,255.255.255.0,192.168.8.1OkAT+DHCPSRVRCFG=192.168.8.2.64OKAT+DHCPSRVR=1,1,1OK

AT+WA=DHCPSRVR-test, ,6Ok

NOTE: 1.)DHCPv4 server supports maximum 64 DHCPv4 clients. 2.)24 hours (86400seconds) is the default lease time provided by DHCPv4 server which is configured only through SDK builder and not through AT command. 3.)DHCP server is capable of providing DHCP-OFFER in both unicast and broadcast (based on the client request).

Table 133 DHCP Server Synchronous Responses

s Verbose Mode Non Verbose Mode Remarks<CR><LF>OK<CR><LF> <CR><LF>0<CR><LF> Parameters are valid<CR><LF>ERROR<CR><LF><CR><LF>1<CR><LF> Refer Start/Stop DHCPv4 Server note Table 132, p<CR><LF>ERROR<SP>INVALID<SP>INPUT<CR><LF> <CR><LF>2<CR><LF> Parameters are valid.

1VV0301463 Rev. 1.0 Page 181 of 186 2018-01-24

Page 182: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

Su

Fa

6.6 DHCP Server Configuration

This command is used to configure the DHCP server. It should be issued prior to the DHCP server start command.

Command Syntax AT+DHCPSRVRCFG=<DHCP-Client’s Starting IP address>,<Max DHCP-Client’s supported><CR>

Parameter Description

Table 134, page 182 describes the DHCP Server Configuration parameters.

Synchronous Response

Table 135, page 182 describes the synchronous responses and remarks for the DHCP Server Configuration command.

Example Configuring the starting address and restrict DHCP pool to 10 clients.

AT+DHCPSRVRCFG=192.168.8.2,10

OK

Table 134 DHCP Server Configuration Parameters

Parameter Optional/Mandatory Value Description

DHCP-Client’s starting IP address Mandatory N/A

The first IP address assigned by the DHCP server when the client requests an IP. Format should be: xxx.xxx.xxx.xxx

max DHCP-client’s supported Mandatory

1 to 64(64-default value)

The number of clients supported by the DHCP server.

NOTE: 1.) If this command is not issued, the DHCP-client starting IP address is the subsequent device IP address configured through AT+NSET. 2.) LAP only supports 16 STA when secured through WPA/2-PSK security.

Table 135 DHCP Server Configuration Synchronous Responses

Events Verbose Mode Non Verbose Mode Remarksccess <CR><LF>OK<CR><LF> <CR><LF>0<CR><LF> Parameters are valid.

ilure <CR><LF>ERROR:<SP>INVALID<SP>INPUT<CR><LF> <CR><LF>2<CR><LF> Parameters are invalid

1VV0301463 Rev. 1.0 Page 182 of 186 2018-01-24

Page 183: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

6.7 DNS ServerThis command is used start/stop the DNS server. Prior to start the server, the DHCP server should be started and created or configure to create a limited AP network. This DNS server use the same DHCP server IP address as it IP address (see 8.1.2.1 mDNS Module Initialization, page 343).

Command Syntax AT+DNS=<Start/stop>,<url>

Parameter Description

Table 136, page 183 describes the DNS Server parameters.

Synchronous Response

Table 137, page 183 describes the synchronous responses and remarks for the DNS Server command.

Example Use Case - Configure the node as a limited AP, start the DNS server

Serial2WiFiAPPAT+NSET=192.168.7.1,255.255.255.0,192.168.7.1OK

AT+DHCPSRVR=1OK

AT+WM=2OK

AT+WA=GainSpanDemo,,11IP SubNet Gateway

Table 136 DNS Server Parameters

Parameter Optional/Mandatory Value Description

Start/Stop Mandatory0 Stops the server1 Starts the Server

url Optional N/AIt specifies the DNS name associated to the DNS IP address. It is a string with no special characters.

Table 137 DNS Server Synchronous Responses

Responses Remarks

OK

SuccessThe node is statically configured with IP address, and configured to create a limited AP. The client IP address starts from the next IP address of the configured IP address.

ERROR:INVALID INPUTIf the parameters are not valid.(other than 0/1 or url is not)

1VV0301463 Rev. 1.0 Page 183 of 186 2018-01-24

Page 184: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

192.168.7.1:255.255.255.0:192.168.7.1OK

AT+DNS=1,www.gainspandemo.comOK

AT+WEBPROV=admin,adminOK

6.8 DNS AddressThis command is used to set the IP address of the DNS server to be used by the node. The second DNS2 IP is optional but should not be the same as DNS1 IP address.

Command Syntax AT+DNSSET=<DNS1 IP>,[<DNS2 IP>]

Command Note This command must be issued before associating to a network. This static configuration of DNS set will take effect only in the case of static IP address on the GS node.

Parameter Description

Table 138, page 184 describes the Static Configuration of DNS (Client) parameters.

Synchronous Response

Table 139, page 184 describes the synchronous responses and remarks for the Static Configuration of DNS (Client) command.

Table 138 Static Configuration of DNS (Client) Parameters

Parameter Optional/Mandatory Value DescriptionDNS1 IP Mandatory N/A DNS1 IP is the IP address of the DNS server.

DNS2 IP Optional N/A DNS2 IP should not be the same as DNS1 IP address.

Table 139 Static Configuration of DNS (Client) Synchronous Responses

Responses Remarks

OKSuccessTo take effect, this command should be given before associating to the network.

ERRORFailureIf the parameters are not valid.

1VV0301463 Rev. 1.0 Page 184 of 186 2018-01-24

Page 185: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

6.9 DNS SpoofingThis translates the readable domain name into a numerical IP address used to connect the communication between the browser and the node.This also helps user to access provisioning webpage, web server URL. When the DNS server is enabled, the requested page with incorrect domain name will direct to the correct webpage.

Example AT+DNS=1OK

1VV0301463 Rev. 1.0 Page 185 of 186 2018-01-24

Page 186: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

1VV0301463 Rev. 1.0 Page 186 of 186 2018-01-24

Page 187: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

Chapter 7 Data Transfer

This chapter describes commands for configurations and operations related to Transport and Application layers.

• Data Transfer Configuration, page 187

• Security Configuration, page 196

• Network Connection Management (NCM), page 209

• Auto Mode, page 222

• UDP/TCP, page 235

• HTTP, page 269

• MQTT Client, page 289

• WebSocket Client, page 298

• CoAP Client, page 307

• GSLink, page 316

• Multicast, page 335

7.1 Data Transfer Configuration

7.1.1 Data Transfer in Bulk ModeThis command is used to enable or disable the bulk mode data transfer.

Command Syntax AT+BDATA=n

Parameter Description

Table 140, page 187 describes the Enable/Disable Bulk Mode Data Transfer parameters.

Table 140 Enable/Disable Bulk Mode Data Transfer Parameters

Parameter Optional/Mandatory Value Description

n MandatoryValue range: 0, 1Default value: 0

It specifies whether data transfer in bulk mode is enabled or not.• 0: Disable data transfer in bulk mode• 1: Enable data transfer in bulk mode

1VV0301463 Rev. 1.0 Page 187 of 340 2018-01-24

Page 188: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

7.1.2 Data DropThis command is used to enable or disable dropping input data at Serial-to-WiFi level when socket failure or disconnect happens.

Command Syntax AT+DROPDATAEN=n

Parameter Description

Table 141, page 188 describes the Data drop parameters.

When Data drop command is enabled, the behavior of <ESC> S and <ESC> Z are as follows:

When <ESC> S <CID> is executed,

• <ESC> S validates the specified CID.

• If the CID is invalid, then S2W remains in data processing mode until <ESC> E is received.

• If CID gets closed in between, then “ERROR” is displayed on the terminal and data is dropped.

• MCU needs to send <ESC> E sequence to execute AT command.

When <ESC> Z <CID> is executed for bulk data mode,

• <ESC> Z validates the specified CID>

• If the CID is invalid, then S2W remains in data mode, receives complete sequence, and displays “ERROR” on the terminal.

When Data drop command is disabled, the behavior of <ESC> S and <ESC> Z are as follows:

When <ESC> S <CID> is executed,

• <ESC> S validates the specified CID.

• If the CID is invalid, then S2W enters into command processing mode.

• If CID gets closed in between, then “ERROR” is displayed on the terminal after each data transmission failure.

• MCU needs to send <ESC> E sequence to execute AT command.

When <ESC> Z <CID> is executed for bulk data mode,

Table 141 Data Drop Parameters

Parameter Optional/Mandatory Value Description

n MandatoryValue range: 0, 1Default value: 0

It specifies whether dropping input data at Serial-to-WiFi level when there is a socket failure or disconnection is enabled or not.• 0: Disable• 1: Enable

1VV0301463 Rev. 1.0 Page 188 of 340 2018-01-24

Page 189: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

• <ESC> Z validates the specified CID>

• If the CID is invalid, then S2W exists from the data processing mode.

7.1.3 Connection StatusThis command is used to return the current CID configuration for all existing CIDs.

Command Syntax AT+CID=?

Usage This command returns the current CID configuration for all existing CIDs:

1. CID number (in decimal format)

2. CID type

3. Mode

4. Local port

5. Remote port

6. Remote IP address

Synchronous Response

Table 142, page 189 describes the synchronous responses and remarks for the Output Connections command.

Example

AT+CID=?

CID TYPE MODE LOCAL PORT REMOTE PORT REMOTE IP0 UDP SERVER 1009 0 0.0.0.01 UDP CLIENT 46445 9001 192.168.23.1005 TCP CLIENT 62771 9007 192.168.23.1006 TCP SERVER 4000 0 0.0.0.03 TCP-SSL CLIENT 44499 443 192.168.2.73OK

Table 142 Output Connections Synchronous Responses

Responses Remarks<CID> <TYPE> <MODE> <LOCALPORT> <REMOTE PORT> <REMOTE IP>OK

If valid CIDs are present

No valid CIDs If no valid CIDs are present.

1VV0301463 Rev. 1.0 Page 189 of 340 2018-01-24

Page 190: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

7.1.4 Closing a ConnectionThis command is used to close the connection associated with the specified CID, if it is currently open. On completion of this command the CID is free for use in future connections.

Command Syntax AT+NCLOSE=<CID>

Parameter Description

Table 143, page 190 describes the Closing a Connection parameters.

Synchronous Response

Table 144, page 190 describes the synchronous responses and remarks for Closing a Connection command.

Example Use Case GainSpan (GS) node is configured with the TCP client connection and closed the connection using “nclose.”

AT+NDHCP=1OK

AT+WA=GainSpanDemo,,11IP SubNet Gateway192.168.23.101:255.255.255.0,192.168.23.1OK

AT+NCUDP=192.168.23.100,8005CONNECT 8OK

AT+NCLOSE=8OK

Table 143 Closing a Connection Parameters

Parameter Optional/Mandatory Value DescriptionCID Mandatory 16 (maximum) CID is the allocated connection identifier.

Table 144 Closing a Connection Synchronous Responses

Responses Remarks

OK Connection with the given CID is closed, and this CID can be used for future connection.

INVALID CID If any invalid CID is provided.

1VV0301463 Rev. 1.0 Page 190 of 340 2018-01-24

Page 191: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

C

T

7.1.5 Closing All ConnectionsThis command is used to close all open connections.

Command Syntax AT+NCLOSEALL

Synchronous Response

Table 145, page 191 describes the synchronous responses and remarks for Closing All Connections command.

Example AT+NCLOSEALLOK

7.1.6 Socket Options ConfigurationThis command is used to configure a socket which is identified by a CID.

Command Syntax AT+NXSETSOCKOPT=<CID>,<Type>,<Parameter>,<Value>,<Length>,<IP_DSCP(25)>

Parameter Description

Table 146, page 191 describes the Socket Options Configuration parameters.

NOTE: In concurrent mode, AT+NCLOSEALL command closes all the CIDs on the current operating interface (selected via NIF=0 or NIF=1). To close CIDs of the other concurrent mode interface, it is required to switch to specific interface and use this AT command.

Table 145 Closing All Connections Synchronous Responses

Responses RemarksOK All open connections are closed.

Table 146 Socket Options Configuration Parameters

Parameter Optional/Mandatory Value Type/Name Description

ID Mandatory16 (maximum) connection identifiers are allowed.

N/ACID is the socket identifier received after opening a connection.

ype Mandatory

1 SOL_SOCKET It specifies the category type for Socket.

2 IPPROTO_IP It specifies the category type for IP

3 IP_PROTOTCP It specifies the category type for TCP.

1VV0301463 Rev. 1.0 Page 191 of 340 2018-01-24

Page 192: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

P

N•••

arameter Mandatory

29 TCP_MAXRT It specifies the maximumretransmission timeout inseconds.

9 TCP_KEEPALIVE

It allows to enable or disable sending keep alivepackets after the predefined time of 30 seconds.

2A TCP_MAX_REXMITIt specifies the maximumnumber of retransmissioncount.

2B TCP_REX_TIMER_RATE

It is used to set the retransmission timer rate.

8 SO_RCVBUFIt sets the receive buffer size for TCP packets. Themaximum limit is 64KB.

2Emax queue depth:20(default)

TCP_MAX_TX_Q_DEPTH

It specifies the TCP transmission queue depthin terms of number of packets.

Note: 1.) It gives max no of packets queued until ACK is received.2.)For bidirectional data transfer 6-7 packets is set to avoid all the packets queued on the transmission path and due to the non availability of packets thereception packets are dropped.3.)For single socket only transmission is done.

2F TCP_REX_TIMER_RATE_IN_NW_TICKS

It specifies the transmission rate in termsof network ticks.

25 IP_DSCP

It specifies the type of field under the IP header DSCP (Differentiated Service Code Point)

ote: The following NXSETSOCKOPTs are not supported in network stack.SO_SENDBUFSO_RESUSEPORTEnabling or disabling Nagle algorithm. It is disabled by default in the network stack.

Table 146 Socket Options Configuration Parameters (Continued)

Parameter Optional/Mandatory Value Type/Name Description

1VV0301463 Rev. 1.0 Page 192 of 340 2018-01-24

Page 193: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

V

.

L

I

Synchronous Response

Table 147, page 194 describes the synchronous responses and remarks for Socket Options Configuration command.

alue Mandatory

• Default value for retransmission timeout - 75 seconds

• Default value for retransmission count - 12

• Default value for retransmission timer rate - 1 second

• Default value for Keepalive - 0 (disable)

Note: When Keepalive is enabled, the default value for Keepalive timeout is 30 seconds.• Default value for buffer

size is 8k bytes

N/A

• For retransmission timeout, the value is time to be set in terms of seconds.

• For retransmission count,the value is a number. Once the number of retransmissions for a packet reaches this value,the socket is automatically closed by the network stack.

• For retransmission timer rate, the value is time to be set in terms of seconds

• For Keepalive, the value to be set is 0 or 1. 1 is to enable Keepalive and 0 isto disable Keepalive.

• For buffer, the value is thesize of buffer to be set in bytes.

ength Mandatory N/A N/A

It specifies the length of the value in bytes.4 - Integer2 - Short1 - Char

P_DSCP(25) Mandatory 224, 160, 96 and 64 N/A

It specifies the priority ofthe data configured for theConnection Identifier. It svalues are:224-AC_VO WMM-Voice priority160-AC_VI WMM-Video priority96-AC_BE WMM-Best effort priority64-AC_BK WMM-Background priority

Table 146 Socket Options Configuration Parameters (Continued)

Parameter Optional/Mandatory Value Type/Name Description

1VV0301463 Rev. 1.0 Page 193 of 340 2018-01-24

Page 194: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

Example Use Case 1 Enable TCP_KEEPALIVE

GS node and TCP server running on a Host are both connected to an Access Point. Open a TCP client on GS node and check whether the TCP connection between the client and server is idle. If connection is idle, then TCP client (GS node) sends TCP_KEEPALIVE packets every 30 seconds which is the default Keepalive timeout.

To enable TCP_KEEPALIVE, use the following command:

AT+NXSETSOCKOPT=1,1,9,0,4

Where:

CID - 1

Type - 1 (SOL_SOCKET)

Parameter - 9 (TCP_KEEPALIVE)

Value - 1 (TCP_KEEPALIVE is enabled)

Length - 4 bytes (Integer)

Example Use Case 2 Set the maximum TCP retransmission time (TCP_MAXRT) to 100 seconds.

The maximum retransmission time is set to 25 seconds by default in S2W application with a retransmission interval of 2 seconds.

To configure the retransmission time to 100 seconds, use the following command:

AT+NXSETSOCKOPT=1,3,29,100,4

Where:

CID - 1

Type - 3 (IP_PROTOTCP)

Parameter - 29 (TCP_MAXRT)

Value - 100 (TCP_MAXRT is set to 100 seconds)

Length - 4 bytes (Integer)

Table 147 Socket Options Configuration Synchronous Responses

Responses RemarksOK SuccessERROR: SOCKET FAILURE 0 If parameters are not valid.

NOTE: TCP_KEEPALIVE timeout can only be enabled or disabled, with a timeout of 30 seconds.

1VV0301463 Rev. 1.0 Page 194 of 340 2018-01-24

Page 195: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

Example Use Case 3 Set the maximum TCP retransmission count (TCP_MAX_REXMIT) to 40.

The maximum retransmission count is set to 12 by default in S2W application with a retransmission interval of 2 seconds.

To configure the retransmission count to 40, use the following command:

AT+NXSETSOCKOPT=1,3,2A,40,4

Where:

CID - 1

Type - 3 (IP_PROTOTCP)

Parameter - 2A (TCP_MAX_REXMIT)

Value - 40 (TCP_MAX_REXMIT is set to 40)

Length - 4 bytes (Integer)

Example Use Case 4 Set the retransmission timer rate (TCP_REX_TIMER_RATE) to 1 second.

To configure the retransmission timer rate to 1 second, use the following command:

AT+NXSETSOCKOPT=1,3,2B,1,4

Where:

CID - 1

Type - 3 (IP_PROTOTCP)

Parameter - 2B (TCP_REX_TIMER_RATE)

Value - 1 (TCP_REX_TIMER_RATE is set to 1 second)

Length - 4 bytes (Integer)

Example Use Case 5 Set the receive buffer size (SO_RCVBUF) to 4k.

To configure the buffer size to 4k, use the following command:

AT+NXSETSOCKOPT=0,1,8,4096,4

Where:

CID - 0

Type - 1 (SOL_SOCKET)

Parameter - 8 (SO_RCVBUF)

Value - 4096 (SO_RCVBUF is set to 4k)

Length - 4 bytes (Integer)

Example Use Case 6 Setting the priority of the data as voice for the connection identifier.

AT+NXSETSOCKOPT=0,2,25,224,4

1VV0301463 Rev. 1.0 Page 195 of 340 2018-01-24

Page 196: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

Setting the priority of the data as video for the connection identifier.

AT+NXSETSOCKOPT=0,2,25,160,4

Where:

CID - 0

Type - 2 (IPPROTO_IP)

Parameter - 25 (IP_DSCP)

Length - 4 bytes (Integer)

7.2 Security Configuration

7.2.1 Certificate AdditionThis command is used to add the certificate for SSL/HTTPS and EAP connections that allows only one copy of the certificate either in Flash/RAM. Its is used for any SSL based connection except EAP.

Command Syntax AT+TCERTADD=<Name>,<Format>,<Size>,<Location><CR>

After receiving OK, execute the following Escape sequence and perform the remaining steps in Tera Term as mentioned below:

<ESC>W<certificate of the above size>

From the Tera Term VT, perform the following:

1. Select File > Send file

2. Select the check box Binary under Option

3. Open the folder which contains the certificates

4. Wait for the response as OK. Returns OK when the size is equal to the size mentioned in the command and does not Returns OK if the uploading certificate file size is less then the size mentioned in the command. when the size of the file is greater than the size mentioned in the command- returns OK and the additional bytes will be echoed back to the host.

NOTE: 1).It is mandatory not to insert any space before the “CertificateName” as the command would fail. 2).The command is used for loading SSL certificate and is not used for loading EAP.

1VV0301463 Rev. 1.0 Page 196 of 340 2018-01-24

Page 197: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

Parameter Description

Table 148, page 197 describes the Certificate Addition parameters.

Synchronous Response

Table 149, page 198 describes the synchronous responses and remarks for the Certificate Addition command.

Table 148 Certificate Addition Parameters

Parameter Optional/Mandatory Value Description

Name Mandatory

Name of a certificate should be prefixed with SSL_.Example: .der should be renamed to SSL_.der.Note: Certificates are also uploaded or deleted over the air through the interface provided in sslcert.html. The naming convention mentioned above shall apply there as well.

This parameter specifies the name of the certificate to be added.The reserved EAP certificates are:

• TLS_CA - Certificate of the CA from where the radius server got certified from.

• TLS_CLIENT - Client certificate also know as public key of the GS device.

• TLS_KEY - Private key for the GS device.

Note: ‘Do not name a certificate as SSL_CA’, ‘SSL_SERVER’ or ‘SSL_KEY’ as they are reserved for HTTPS server certificates (root certificate is used to validate the clients, server certificate and server key respectively).

Format Mandatory0,10: DER format (Binary)1: HEX format (Binary)

Format of the certificate to be added.

Size Mandatory N/A Size of the certificate to be added.

Location MandatoryLocation to store the certificates0 Flash1 RAM

Note: There is a carriage return after the <Location> parameter.

1VV0301463 Rev. 1.0 Page 197 of 340 2018-01-24

Page 198: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

Example Name:CAFormat:0(Binary)Size:868 bytesLocation:0(Flash)AT+SETTIME=30/07/2015,15:00:00OK

AT+NDHCP=1OK

AT+WA=GainSpanDemoIP SubNet Gateway192.168.44.148:255.255.255.0:192.168.44.1OKAT+TCERTADD=ca,0,868,0OK

<ESC>W

From the Tera Term VT, perform the following:

1. Select File > Send file

2. Select the check box Binary under Option

3. Open the folder which contains the certificate ca which is of 868 bytes.

OK

Example when the verbose mode is disabled adding certificate using AT+TCERADDATV00AT+TCERTADD=SSL_CA,0,654,10

OK

Table 149 Certificate Addition Synchronous Responses

Responses RemarksOK SuccessERROR:INVALID INPUT Invalid parameters

NOTE: when verbose mode is disabled and adding certificate using AT+ TCERTADD command, the second response after loading the certificate (ESC+W) will be OK.

1VV0301463 Rev. 1.0 Page 198 of 340 2018-01-24

Page 199: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

7.2.2 Certificate DeletionThis command is used to delete the SSL/HTTPS/EAP-TLS certificate that is stored in Flash/RAM.

Command Syntax AT+TCERTDEL=<certificate name>

Parameter Description

Table 150, page 199 describes the Certificate Deletion parameters.

Synchronous Response

Table 151, page 199 describes the synchronous responses and remarks for the Certificate Deletion command.

Example 1 AT+TCERTDEL=TLS_CAOK

Table 150 Certificate Deletion Parameters

Parameter Optional/Mandatory Value Description

certificate name Mandatory N/A

Name of the certificate to delete from Flash/RAM. In case of EAP-TLS certificate names are:

• TLS_CA - Certificate of the CA from where the radius server got certified from.

• TLS_CLIENT - Client certificate also know as public key of the GS device.

• TLS_KEY - Private key for the GS device.

Table 151 Certificate Deletion Synchronous Responses

Responses RemarksOK SuccessERROR:INVALID INPUT Invalid parameterERROR Could not delete as the file does not exist.

1VV0301463 Rev. 1.0 Page 199 of 340 2018-01-24

Page 200: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

7.2.3 Certificate ValidationThis command is used to enable or disable Server’s certificate validation on DUT.

Command Syntax AT+SRVVALIDATIONEN=n

Parameter Description

Table 152, page 200 describes the certificate validation parameters.

Synchronous Response

Table 153, page 200 describes the synchronous responses and remarks for the certificate validation command.

NOTE: 1).This command is used for SSL only. The command configuration is not retained across standby. 2).This command can be used to enable or disable EAP certificate validation for both SSL and EAP.

Table 152 Certificate Validation Parameters

Parameter Optional/Mandatory Value Description

n Mandatory0 - Disable It disables Server’s certificate validation on

DUT.

1 - Enable (Default) It enables Server’s certificate validation on DUT.

Table 153 Certificate Validation Synchronous Responses

Responses RemarksOK SuccessERROR:INVALID INPUT Invalid parameters

1VV0301463 Rev. 1.0 Page 200 of 340 2018-01-24

Page 201: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

7.2.4 Get Certificate InformationThis command is used to get the validation information of a certificate.

Command Syntax AT+CERTINFOGET=<certficate name>

Parameter Description

Table 154, page 201 describes the get certificate information parameters.

Synchronous Response

Table 155, page 201 describes the synchronous responses and remarks for the certificate validation command.

7.2.5 EAP-ConfigurationThis command is used to load EAP certificates (only for Enterprise Security).

Command Syntax AT+WEAPCONF=<Outer Authentication>,<Inner Authentication>,<user name>,<password>[,<Common name and organizational unit>,<Enable/Disable Anonymous ID>, <Enable/Disable PRF 1.2>,<Use CA Certificate>]

The command syntax changes based on the outer or inner authentication parameter.

If the outer authentication parameter is 255, then the incoming server certificate is enabling common name and organizational unit:

AT+WEAPCONF=255, <common name>, <organisational unit>

Table 154 Get Certificate Information Parameters

Parameter Optional/Mandatory Value Description

certificate name Mandatory

Name of the certificate as configured using AT+TCERTADD

Provides validation information of the certificate.

Table 155 Get Certificate Information Synchronous Responses

Responses RemarksOK SuccessERROR:INVALID INPUT Invalid parameters

NOTE: If the validity period of the command AT+CERTINFOGET exceed beyond 2055 there will be Display Error in certificate information.

1VV0301463 Rev. 1.0 Page 201 of 340 2018-01-24

Page 202: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

If the outer authentication parameter is 254, then the incoming server certificate is anonymous ID in EAP response identity is:

AT+WEAPCONF=254,<Enable/Disable anonymous ID>

If the inner authentication parameter is 253, then the incoming server certificate is Pseudo-random Function (PRF) in EAP response identity is:

AT+WEAPCONF=253, <Enable/Disable PRF 1.2>

Parameter Description

Table 156, page 202 describes the EAP Configuration parameters.

Table 156 EAP Configuration Parameters

Parameter Optional/Mandatory Value Description

Outer Authentication Mandatory

The valid outer authentication values are:43 EAP-FAST13 EAP-TLS21 EAP-TTLS25 EAP-PEAP

255Enables common name and organizational unit verification in incoming server certificate.

254 Enables anonymous ID in EAP response identity

Note: The combination for Outer and Inner authentication parameters is provided in Table 157, page 203.

Inner Authentication Mandatory

The valid inner authentication values are:26 EAP-MSCHAP6 EAP-GTC253 EAP-PAPNote: The combination for Outer and Inner authentication parameters is provided in Table 157, page 203.

user name

MandatoryNote: This parameter is not applicable for EAP-TLS.

N/A The user name is an ASCII string with a maximum length of 32 ASCII characters.

password

MandatoryNote: This parameter is not applicable for EAP-TLS.

N/A The password is an ASCII string with a maximum length of 32 ASCII characters.

1VV0301463 Rev. 1.0 Page 202 of 340 2018-01-24

Page 203: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

The following table lists the combination of Outer and Inner authentication parameters.

Synchronous Response

Table 158, page 204 describes the synchronous responses and remarks for the EAP-Configuration command.

Common name andOrganizational Unit

Optional values of incoming certificate

This parameter provides the common name and organizational unit passed as a string before EAP association. This is later verified with the incoming server certificate.

Enable/Disable Anonymous ID Optional

0- Disable (default)1- Enable

This parameter specifies whether Anonymous ID is part of EAP response identity or not.• 0- Disable anonymous ID in EAP response

identity• 1- Enable anonymous ID in EAP response

identity

Enable/Disable PRF 1.2. Optional

0- Disable (default)1- Enable

This parameter specifies whether PRF 1.2 is part of EAP response identity or not.• 0- Disable PRF 1.2 in EAP response identity• 1- Enable PRF 1.2 in EAP response identity

Use CA Certificate Optional0- Disable (default)1- Enable

This parameter specifies whether the CA certificate loaded in GS node is used to validate the incoming Server certificate.• 0 - Do not use CA certificate• 1 - Use CA certificate

Table 156 EAP Configuration Parameters

Parameter Optional/Mandatory Value Description

Table 157 Combination of Outer and Inner Authentication

Outer Authentication Inner Authentication Combination of Outer and Inner

AuthenticationEAP-FAST EAP-MSCHAP EAP-FAST-MSCHAPEAP-FAST EAP-GTC EAP-FAST-GTCEAP-TLS EAP-MSCHAP EAP-TLS-MSCHAPEAP-TTLS EAP-MSCHAP EAP-TTLS-MSCHAPEAP-PEAP V0 EAP-MSCHAP EAP-PEAP V0-MSCHAPEAP-PEAP V1 EAP-GTC EAP-PEAP V1-GTCEAP-TTLS EAP-PAP EAP-TTLS-PAP

1VV0301463 Rev. 1.0 Page 203 of 340 2018-01-24

Page 204: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

Example 1- PEAP without certificates

AT+WEAPCONF = 25,26,gsn,GainSpanDemo123OK

AT+SETTIME=15/10/2013,17:31:00OK

AT+WA=GainSpanDemo,,11IP SubNet Gateway192.168.1.99:255.255.255.0:192.168.1.1OK

AT+NDHCP=1IP SubNet Gateway192.168.23.103:255.255.255.0:192.168.23.1OK

Example 2 - PEAP with certificates set to the optional parameter 1

AT+WEAPCONF=25,26,gsn,GSDemo123,1”(PEAPv0 with Cerificate)AT+WEAPCONF=25,6,gsn,GSDemo123,1”(PEAPv1 with Certificate)

Example 3 - EAP response with incoming server certificate and anonymous ID

AT+WEAPCONF=255,192.168.2.106,QAAT+WEAPCONF=254,1AT+SETTIME=06/11/2015,11:52:00AT+WEAPCONF=13,26,gsn,GSDemo123AT+NDHCP=1AT+WA=<SSID>

Example 4 - EAP response for PRF1.2 function

To Enable PRF 1.2AT+WEAPCONF=253,1

To Disable PRF 1.2AT+WEAPCONF=253,0

Table 158 EAP-Configuration Synchronous Responses

Responses RemarksOK SuccessERROR:INVALID INPUT Invalid parameters

1VV0301463 Rev. 1.0 Page 204 of 340 2018-01-24

Page 205: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

7.2.6 EAP Certificate UploadThis command is used to enable the GS node to receive the EAP certificates used for various authentication like EAP -TLS, EAP-PEAP, etc.

Command Syntax AT+WEAP=<Type>,<Format>,<Size>,<Location><CR><ESC>W <data of size above>

Parameter Description

Table 159, page 205 describes the EAP Certificate Upload parameters.

Synchronous Response

Table 160, page 205 describes the synchronous responses and remarks for the EAP command.

Table 159 EAP Certificate Upload Parameters

Parameter Optional/Mandatory Value Description

Type Mandatory

Type of the certificate

0 Certification of CA where the radius server is certified from.

1 Client certification also known as public keys of GS device.

2 Private key og the GS device.

Format MandatoryFormat of the certificate0 DER format (Binary)1 DER format (Binary)

Size MandatorySize of the certificate to be transferred. Size of the certificate in bytes is in the decimal format.

Location Mandatory

Location to store the certificates

0 Flash, stored in file system in GS2000 module.

1RAMNote: RAM will be lost when the power is cycled.

Note: There is a carriage return after <location>.

Table 160 EAP Synchronous Responses

Responses RemarksOK SuccessERROR:INVALID INPUT Invalid parameters

1VV0301463 Rev. 1.0 Page 205 of 340 2018-01-24

Page 206: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

Example - Adding a der formatted CA certificate in flash.

Type:0(Client CA)Format:0(Binary)NumberofBytes:3026

AT+WEAP=0,0,3026,0OK<ESC>W<Certificate of 3026bytes>OK

From the Tera Term VT, perform the following:

1. Select File > Send file

2. Select the check box Binary under Option

3. Open the folder which contains the ClientCA certificate

4. Select ClientCA (this has 3026 bytes of data)

7.2.7 EAP Time ValidationThis command is used to enable or disable time validation for EAP certificates.

Command Syntax AT+WEAPTIMECHK=n

Parameter Description

Table 161, page 206 describes the EAP time validation parameters.

Synchronous Response

Table 162, page 207 describes the synchronous responses and remarks for the EAP time validation command.

NOTE: 1).To disable CA validation, do not load CA cert. 2). The command configuration is retained across standby when used with NCM. 3).Before disabling time validation the server validation has to be enabled (if server validation is disabled then time check disable will not work). The right command sequence to be followed is as follows: AT+SRVVALIDATIONEN=1 AT+WEAPTIMECHK= 1

Table 161 EAP Time Validation Parameters

Parameter Optional/Mandatory Value Description

n Mandatory0 Disable1 Enable (Default)

1VV0301463 Rev. 1.0 Page 206 of 340 2018-01-24

Page 207: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

Table 162 EAP Time Validation Synchronous Responses

Responses RemarksOK SuccessERROR:INVALID INPUT Invalid parameters

1VV0301463 Rev. 1.0 Page 207 of 340 2018-01-24

Page 208: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

As there is no direct method to Get and Delete EAP certificates, the recommended way to get and delete EAP certificate is:

Example 1 For getting EAP Certificate:CA:AT+CERTINFOGET=TLS_CA

Client certificate:AT+CERTINFOGET=TLS_CLIENT

Client key:AT+CERTINFOGET=TLS_KEY

Example 2 For deleting EAP certificate:CA:AT+TCERTDEL= TLS_CA

Client certificate:AT+TCERTDEL= TLS_CLIENT

Client Key:AT+TCERTDEL= TLS_KEY

1VV0301463 Rev. 1.0 Page 208 of 340 2018-01-24

Page 209: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

7.3 Network Connection Management (NCM)The GS node supports network connection manager which manages WLAN (L2), IP/Network (L3), and Transport layer (L4) level connections. The parameters for L2, L3 and L4 layers can be configured using commands specified in 7.4.4 Wireless Parameters, page 230 and 7.4.5 Network Parameters, page 232. The security parameters can be configured using the commands specified in 5.3.3 Security Configuration, page 129.

7.3.1 NCM Start/StopThis command is used to start/stop the network connection manager.

Command Syntax AT+NCMAUTO=<Mode>,<Start/Stop>[,Level],[<Nvds store flag>]

Usage If the NCM Start/Stop is stored in persistent storage, then the GS node will take the appropriate action for successive boots.

This command starts the NCM by connecting to the AP (if the mode configured as station) or create a limited AP (if the mode configured as limited AP) with the pre-configured parameters. Once it connects to any of the L2, L3, and L4, disconnection triggers the NCM and it starts do the L2, L3, and L4 re-connection.

Once the connection is established the GS node returns the following message to the serial interface.

For L2+L3:IP address“NWCONN-SUCCESS”For L2+L3+L4:IP address “NWCONN-SUCCESS”“CONNECT <cid>”

For limited AP, the first two parameters are only valid and it outputs the same message for L2+L3 to the serial interface.

NOTE: When a node is configured or started using NCM, use AT+NCMAUTO=0,0,0 to stop the NCM or dis associate from the current network.

NOTE: If the DHCP renewal success with a new IP address then the GS node closes the sockets that are open (L4) and sends a message “IP CONFIG-NEW IP” with the new IP information to the serial interface and it retains the L4 connection if the NCM is started with L4 support.

1VV0301463 Rev. 1.0 Page 209 of 340 2018-01-24

Page 210: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

Parameter Description

Table 163, page 210 describes the NCM Start/Stop parameters.

Synchronous Response

Table 164, page 210 describes the synchronous responses and remarks for NCM Start/Stop command.

Example 1 To stop NCM, when AT+NCMAUTO=0,0,0 is issued, S2W responds OK for Synchronous. Proceed with executing AT+NCMAUTO=? to get the NCM status. NCM is stopped only if the NCM state is “NCM NOT STARTED”.

AT+APCONF=1

OK

AT+WM=2

OK

AT+NSET=192.168.51.1,255.255.255.0,192.168.51.1

Table 163 NCM Start/Stop Parameters

Parameter Optional/Mandatory Value Description

Mode Mandatory0 For station mode1 For limited AP mode

Start/Stop Mandatory0 For stop the NCM1 For start the NCM

Level Mandatory0 For L2+L3 connection1 For L2+L3+L4 connection

NVDS Store Flag Mandatory

0 (default)

For storing the NCM Start/Stop information in the persistent storage when the store persistent information command (AT&W0) is issued by the host.

1

For disabling the storage of this information. The default value is 0. This parameter is valid for NCM in station mode only.

Table 164 NCM Start/Stop Synchronous Responses

Responses RemarksOK SuccessERROR:INVALID INPUT If parameters are not valid.

1VV0301463 Rev. 1.0 Page 210 of 340 2018-01-24

Page 211: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

OK

AT+WAUTO=2,GS_LAP,,11

OK

AT+NCMAUTO=1,1,0

OK

IP SubNet Gateway

192.168.51.1:255.255.255.0:192.168.51.1

NWCONN-SUCCESS

AT+NCMAUTO=0,0,0

OK

AT+NCMAUTO=?

NCM NOT STARTED //*This NCM state ensures that NCM is stopped.*//

OK

AT+NCMAUTO=0,0,0

ERROR //*ERROR indicates that NCM is not initialized.*//

NOTE: When NCM stop command is issued, make sure that the NCM state is NCM NOT STARTED and proceed with further operations.

1VV0301463 Rev. 1.0 Page 211 of 340 2018-01-24

Page 212: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

7.3.2 Configure NCMThis command is used to configure the NCM parameters for its state machine. This is the ID corresponding to the NCM configuration parameters. The L4 configuration parameters (L4 retry count and period) can be configured using ATS6/7 command.

Command Syntax AT+NCMAUTOCONF=<Conf Id>,<Value>

Parameter Description

Table 165, page 212 describes the NCM Configuration parameters.

Table 165 NCM Configuration Parameters

Parameter Optional/Mandatory Conf Id Value Description

Conf Id, Value

Mandatory 0 1 to 65535 (default is 1000 milliseconds) CPU Wait Period (1 to 6)

Not Supported 1 1 to 65535 (default 1000 milliseconds) Power Save Periods (not supported)

Mandatory 2 1 to 65535 (default 1000 milliseconds) Know Channel Scan Period

Not Supported 3 1 to 65535 (default 1000 milliseconds)

Specific Channels Scan Period (not supported)

Mandatory

4 1 to 65535 (default 1000 milliseconds) All Channel Scan period

5 1 to 65535 (default 1000 milliseconds)

Layer 3 Connect PeriodThis specifies the Serial to WiFi level delay between each connection request.When a connection does not go through for a connection request, the network stack retries as per the configuration.

6

Can be configured using the command ATS 6/7 in 4.3.7 Configure Profile, page 92

NCM Layer 4 Retry PeriodThis specifies the Serial to WiFi level delay between each connection request.When a connection does not go through for a connection request, the network stack retries as per the configuration.

7

NCM Layer 4 Retry CountThis specifies the Serial to WiFi level retry count.When a connection does not go through for a connection request, the network stack retries as per the configuration.

1VV0301463 Rev. 1.0 Page 212 of 340 2018-01-24

Page 213: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

Conf Id, Value Mandatory 8 1 to 65535 (default 10) Known channel scan retry count

Conf Id, Value Not Supported 9 1 to 65535 (default 10)

Specific channels scan retry count (not supported)

Conf Id, Value Mandatory 10 1 to 65535 (default 10) All Channel scan retry count

Conf Id, Value Mandatory 11 1 to 65535 (default 100)

Layer 3 Connect retry count This specifies the Serial to WiFi level retry count.When a connection does not go through for a connection request, the network stack retries as per the configuration.

Conf Id, Value Optional 120, 1 (default 0)0 - enable1 - disable

It specifies whether to broadcast SSID in beacon frames or not.

Conf Id, Value Optional 13 1 to 65535 (default 3)It specifies the dtim period in AP mode.

Conf Id, Value Optional 14 1 to 65535 (default 3600)

It specifies the time-out interval when there is no activity from the connected nodes.

Conf Id, Value Mandatory 25

Radio mode 1,2,31 - Active mode2 - PS poll mode (default)3 - IEEE PS poll mode

It specifies the radio mode during DHCP process.

Table 165 NCM Configuration Parameters (Continued)

Parameter Optional/Mandatory Conf Id Value Description

1VV0301463 Rev. 1.0 Page 213 of 340 2018-01-24

Page 214: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

Conf Id, Value Mandatory 26 0xffffffff (default)It specifies the lease period to be requested in DHCP discover message in seconds.

Conf Id, Value Mandatory 27 2 seconds default It specifies the time interval between successive DHCP retries.

Conf Id, Value Mandatory 28

0, 10 - Disable power optimized scan (default)1 - Enable power optimized scan

It specifies whether power optimized scan is enabled or not based on the following configuration values:• 1: When this parameter is set to 1,

power optimized scan is enabled and GS node associates with AP of the first found SSID or BSSID. SSIDs or BSSIDs are configured using AT+WAUTO command.

• 0: When this parameter is set to 0, power optimized scan is disabled and GS node associates with AP that has best RSSI in the corresponding regulatory domain.

Table 165 NCM Configuration Parameters (Continued)

Parameter Optional/Mandatory Conf Id Value Description

NOTE: The L4 configuration parameters (L4 retry count and period) can be configured using ATS6/7 command. Refer to 4.3.7 Configure Profile, page 92.

1VV0301463 Rev. 1.0 Page 214 of 340 2018-01-24

Page 215: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

Synchronous Response

Table 166, page 215 describes the synchronous responses and remarks for NCM Configuration command.

Example AT+NCMAUTOCONF=26,0xFFFFFFFFERROR: INVALID INPUT

AT+NCMAUTOCONF=26,10OK

7.3.3 NCM Status GetThis command is used to get the status or the profile information of network connection manager.

Command Syntax AT+NCMAUTO=?/??

Parameter Description

Table 167, page 215 describes the NCM Status Get parameters.

Table 168, page 215 lists the NCM State and their values.

Table 166 NCM Configuration Synchronous Responses

Responses RemarksOK SuccessERROR:INVALID INPUT If parameters are not valid.

Table 167 NCM Status Get Parameters

Parameter Optional/Mandatory Value Description

? Mandatory N/A This parameter is used to get the status of network connection manager

?? Optional N/AThis parameter is used to get the profile information of network connection manager

Table 168 NCM State Description

NCM State DescriptionFollowing NCM state occurs when NCM is not initialized in the module.NCM NOT STARTED NCM is not initializedFollowing NCM states occur when NCM is initialized in the module.NCM STARTED:0 NCM is not initializedNCM STARTED:1 NCM is initialized and ready

1VV0301463 Rev. 1.0 Page 215 of 340 2018-01-24

Page 216: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

Example AT+NCMAUTO=0,0,0,0OKAT+NCMAUTO=? //NCM NOT STARTED

AT+NCMAUTO=?NCM STARTED:6 //NCM is scanning some specific channel

AT+NCMAUTO=?NCM STARTED:9 // L2 and L3 both are success

NCM STARTED:2NCM has initiated L2 disconnect with WLAN and waits for indication to disconnect from WLAN. NCM initiates disconnect when Sync Loss is detected

NCM STARTED:3

NCM has disconnected L2. This occurs:• At start• When NCM triggers disassociation and WLAN confirms it• When WLAN indicates disassociation

NCM STARTED:4 Scanning known AP with previously scanned MAC frame

NCM STARTED:5 Scanning known channelNCM STARTED:6 Scanning specific channelsNCM STARTED:7 Scanning All channelsNCM STARTED:8 L2 connected and L3 is not connected yetNCM STARTED:9 Both L2 and L3 are connectedNCM STARTED:10 NCM is waiting or in idle state

Table 168 NCM State Description

NCM State Description

1VV0301463 Rev. 1.0 Page 216 of 340 2018-01-24

Page 217: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

7.3.4 Enable NCM AP Configuration This command is used to enable the NCM AP configuration. The NCM AP parameters can be configured using the auto connect commands specified in section 7.4 Auto Mode, page 222. However, these commands are used for both station and limited AP mode. To distinguish the parameters for limited AP mode, the GS node provides a command.

Command Syntax AT+APCONF=<n>

Parameter Description

Table 169, page 217 describes the NCM AP Configuration Enable parameters.

Once it is enabled, the parameters configured using commands in 7.4.1 Auto Mode (Common), page 222 and 9.3.2 Standby, page 442, go to Limited-AP.

Table 170, page 217 describes the GS node value settings.

Table 169 NCM AP Configuration Enable Parameters

Parameter Optional/Mandatory Value Description

n MandatoryValue range: 0, 1Default value: 0

It specifies whether NCM AP configuration is enabled or not.0: For Station mode1: For Limited-AP mode

Table 170 GS node Value Settings for NCM AP Configuration Enable

Parameter DescriptionSSID GainSpanProvChannel 1Security 0 (open)WEP Key 1234567890WEP Key Index 1WEP Key Length 5WPA Phassphrase GSDemo123Beacon Interval 100DHCP Server Enable TRUE (1)DNS Server Enable TRUE (1)IP Address 192.168.240.1Subnet Mask 255.255.255.0Gateway 192.168.240.1DHCP Start IP Address 192.168.240.2

1VV0301463 Rev. 1.0 Page 217 of 340 2018-01-24

Page 218: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

Synchronous Response

Table 171, page 218 describes the synchronous responses and remarks for NCM AP Configuration Enable command.

Example AT+APCONF=1

7.3.4.1 Examples for NCM Commands

This section provides examples for NCM in Limited-AP and STA modes.

Example for Limited-AP Mode

AT+APCONF=1OK

AT+WM=2OK

AT+WAUTO=2,GainSpan,,1OK

AT+NSET=192.168.51.1,255.255.255.0:192.168.51.1OK

AT+NCMAUTO=1,1,0OK

IP SubNet Gateway192.168.51.1:255.255.225.0:192.168.51.1NWCONN-SUCCESS

AT&w0OK

AT+RESET=1

DNS Name config.gainspanUser Name adminPwd admin

Table 170 GS node Value Settings for NCM AP Configuration Enable (Continued)

Parameter Description

Table 171 NCM AP Configuration Enable Synchronous Responses

Responses RemarksOK Success

ERROR:INVALID INPUTIf parameters are not valid.(Other than 0 and 1)

1VV0301463 Rev. 1.0 Page 218 of 340 2018-01-24

Page 219: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

APP Reset-APP SW Reset

IP SubNet Gateway192.168.51.1:255.255.255.0:192.168.51.1NWCONN-SUCCESS

Example for STA Mode

AT+WAUTO=0,GainSpanOK

AT+NAUTO=0,1,192.168.67.54,9000OK

AT+NCMAUTO=0,1,1OK

IP SubNet Gateway192.168.67.53:255.255.225.0:192.168.67.1NWCONN-SUCCESS

CONNECT 0AT&W0OK

1VV0301463 Rev. 1.0 Page 219 of 340 2018-01-24

Page 220: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

7.3.5 RoamingThe GS node supports roaming which is used under the following conditions:

– APs have the Same SSID and same Security

– WPA/WPA2 Enterprise security is not supported

– APs can be on different channels

– The S2W Application in Radio PS-Poll or Active Receive Mode

– Only RSSI is used. PER and other statistics are not used.

This feature will be bundled with Network Connection Manager (NCM) and roaming parameters are configured with the following AT command.

AT+NCMAUTOCONF=<Param ID>,<Param Value>

Parameter Description

Table 172, page 220 describes the Roaming parameters.

Table 172 Roaming Parameters

Parameter Optional/Mandatory Value DescriptionParam ID

Mandatory16

Roaming Feature Enabled/DisabledParam Value

0- Disabled (default)1- Enable

Param IDMandatory

17Lower RSSI Threshold

Param Value 70db (default)Param ID

Mandatory18

Higher RSSI ThresholdParam Value50db (default)

Param IDMandatory

19Time between Background ScansParam Value

1000ms (default)

Param IDMandatory

20 Number of Times Low Threshold is crossed before roaming trigger is enabled - N1

Param Value3 (default)

Param IDMandatory

21Maintain L3 - there is a common DHCP Server.Param Value Maintain L3 enabled

(default)

1VV0301463 Rev. 1.0 Page 220 of 340 2018-01-24

Page 221: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

Param ID

Optional

22

Maintain L4 - L4 connection are not closed.Param Value

Maintain L4(0-disable and 1-enable)(default 0)

Param IDOptional

23Maximum number of scans to find the AP to connect.Param Value ScanRetryCnt = 5

(default)Param ID

Optional24 Delay after maximum number of

scans. Configure the time in milliseconds.Param Value ScanPauseTime =

5000msec (default)

Table 172 Roaming Parameters (Continued)

Parameter Optional/Mandatory Value Description

1VV0301463 Rev. 1.0 Page 221 of 340 2018-01-24

Page 222: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

7.4 Auto Mode

7.4.1 Auto Mode (Common)All the commands in this section are applicable for New Auto Mode as well.

7.4.1.1 Enable Auto Connection

This command is used to store configuration settings in non-volatile memory and modify according to the parameter value in the command; the resulting change (if any) takes effect on the next reboot, or the next issuance of an ATA command.

Command Syntax ATCn

Parameter Description

Table 173, page 222 describes the Enable Auto Connection parameters.

Synchronous Response

Table 174, page 222 describes the synchronous responses and remarks for Enable Auto Connection command.

Table 173 Enable Auto Connection Parameters

Parameter Optional/Mandatory Value Description

n Mandatory0, 10: Disable1: Enable

n is 0 to disable auto connection or 1 to enable auto connection.

Table 174 Enable Auto Connection Synchronous Responses

Responses RemarksOK SuccessERROR:INVALID INPUT If parameters are not valid.

1VV0301463 Rev. 1.0 Page 222 of 340 2018-01-24

Page 223: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

7.4.1.2 Initiate Auto Connect

This command is used to start auto connection including association.

Upon reception of this command, the interface initiates the auto connection procedure as described in7.4.1.1 Enable Auto Connection, page 222, using the parameters specified by the AT+WAUTO and AT+NAUTO commands (see 7.4.4 Wireless Parameters, page 230 and 7.4.5 Network Parameters, page 232).

Command Syntax ATA

Usage

New Auto Mode: The GS node initiates auto connection but does not respond with any success or failure information. To check whether the auto connection is initiated, check GPIO9 is high or low and will be high only if the valid data pipe for L4 is created.

Legacy Auto Mode: The GS node responds with the IP address, Subnet Mask, and Gateway IP address, followed by CONNECT<space>CID and OK or 0 (per verbose status) if the connection is successful.

After the connection is established, the GS node enters the data transfer mode described in 7.4 Auto Mode, page 222.

If the GS node is already associated with a wireless network, the alternative command ATA2 below may be used.This command is not applicable for new auto connection

Command Note The GPIO8 should be kept low for the auto connection, since a low to high transition of this GPIO exits the auto connection data mode. After exiting from auto connect data mode using +++ or GPIO8 high, it is recommended to use ATO go back to auto connect data mode. Profile information can be obtained using AT+NCMAUTO=??. See 7.3.3 NCM Status Get, page 215.

Example

AT+WAUTO=0,GainSpanDemoOK

AT+NDHCP=1OK

NOTE: 1.)In new auto mode the GPIO9 will be high only when the valid data pipe exists and the enhanced asynchronous is enabled (AT+ASYNCMSGFMT=1) 2.)Enhanced Asynchronous messages are not supported. 3.)In WAC, auto connect and enhanced asynchronous messages is not support.

NOTE: Connection or disconnection commands such as AT+WA and AT+WD are not used as Auto connection uses NCM in the background.

1VV0301463 Rev. 1.0 Page 223 of 340 2018-01-24

Page 224: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

AT&W0OK

ATC1OK

ATAIP SubNet Gateway192.168.17.2:255.255.255.0:192.168.17.1OK

CONNECT 0 1 192.168.17.3 49756

7.4.1.3 Initiate Auto Connect – TCP/UDP Level

This command is used to initiate auto connection when the GS node is already associated with an Access Point.

Command Syntax ATA2

Usage This command requires a pre-existing wireless association. On reception of this command, the interface establishes a network connection to a TCP or UDP server with the parameters specified by the AT+NAUTO command (see Network Parameters). This command assumes a pre-existing association and should not be issued unless such exists. If a valid command input was received, but the connection cannot be established due to a socket bound failure, the message ERROR:SOCKET FAILURE or 3 (per verbose settings) is returned.

ResponseIf the connection is successful it returns CONNECT<space>CID followed by standard command response.

7.4.1.4 Exit from Auto Connect Data Mode

In auto connect mode the GS node opens a serial data pipe to pass the serial data from/to the host MCU to/from the remote machine. In this mode, all serial inputs are treated as data. To enable the command mode without breaks, the connection the GS node provides uses the following mechanisms:

NOTE: The L3 notification after the ATA command will be removed in the upcoming release.

NOTE: ATA2 is applicable for old auto connection.

1VV0301463 Rev. 1.0 Page 224 of 340 2018-01-24

Page 225: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

1. +++ and wait for 1 second. After this, the GS node exits from the data mode and supports to accept AT commands to change the configuration. +++ and wait for auto connection exit timeout (ATSA). This can be disabled by setting ATSA as 0 so that +++ will be considered as data (See 4.3.7 Configure Profile, page 92).

2. Make the GPIO8 high. After this, the GS node exits from the data mode and supports to accept AT commands to change the configuration.

7.4.1.5 Return to Auto Connect Mode

The command is used to return to auto connect mode.

Command Syntax ATO

Usage If the interface receives this command after it has exited the auto connect mode with +++ or GPIO8 high, it shall return to auto connect mode. If the connection no longer exists, the interface attempts to reestablish the previous connection, and returns to data mode if the reconnection is successful. If the GS node was not previously connected when this command is received, it returns an error.

ResponseThis command returns standard command response or ERROR, if the operation fails.

7.4.2 Legacy Auto Mode

7.4.2.1 Enable/Disable New Auto Mode

This command is used to enable or disable new auto mode.

Command Syntax AT+AUTOCON=n<CR>

NOTE: To stop auto connection, use AT+NCMAUTO=0,0,0 command.

NOTE: The difference between the auto mode and enable new auto mode is: 1.) In auto mode when a connection is established there is no indication where as in new auto mode connection is established with an indication. 2.) When L2 disconnects the GPIO10 goes LOW with a failure massage in auto connection. 3.) In the auto connect mode NCM re establishes after disconnection with out any message to the host and in enable auto mode the connection is notified.

1VV0301463 Rev. 1.0 Page 225 of 340 2018-01-24

Page 226: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

Parameter Description

Table 177, page 230 describes the Enable new auto mode parameters.

Synchronous Response

Table 178, page 231 describes the synchronous responses and remarks for Enable/Disable new auto mode Parameters command.

NOTE: New auto mode is enabled by default from SDK Builder. User can select old or new auto mode from the SDK Builder.

Table 175 Enable new auto mode Parameters

Parameter Optional/Mandatory Value Description

n MandatoryValue range: 0, 1Default value: 1

It specifies whether new auto mode is enabled or disabled.

Table 176 Enable new auto mode Parameters Synchronous Responses

Responses Remarks\r\nOK\r\n Success

\r\nERROR:INVALID INPUT\r\nParameter invalid.If the value n is other than 0 or 1.

1VV0301463 Rev. 1.0 Page 226 of 340 2018-01-24

Page 227: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

7.4.3 Examples for Auto Connect ModeThis section provides examples for legacy and new auto modes in Limited-AP and STA modes.

Example for Limited-AP Mode

AT+WM=2OK

AT+APCONF=1OK

AT+NSET=192.168.21.1,255.255.255.0,192.168.21.1OK

AT+DHCPSRVR=1OK

AT+WAUTO=2,GainSpanAP,,6OK

AT+NAUTO=1,1,,4001OK

ATC1OK

AT&W0OK

ATA/AT+REST/Power cycle the nodeOK

Example for STA AT+NDHCP=1OK

AT+WAUTO=0,GainSpanDemoOK

AT+NAUTO=0,1,192.168.25.2,9999OK

ATC1OK

NOTE: When using New auto mode in Limited-AP, AT+WM=2 and AT+APCONF=1 are mandatory commands as the new auto mode uses NCM.

1VV0301463 Rev. 1.0 Page 227 of 340 2018-01-24

Page 228: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

AT&W0OK

ATA/AT+REST/Power cycle the nodeOK

This section provides examples for old auto mode connection and new auto mode connection in Limited AP and station modes.

Example for legacy auto mode in Limited-AP

AT+AUTOCON=0OKAT+WM=2OK

AT+NSET=192.168.81.1,255.255.255.0,192.168.81.1OK

AT+DHCPSRVR=1OK

AT+WAUTO=2,GAINSPAN_APOK

AT+NAUTO=1,1,,9000OK

ATC1OK

AT&W0OK

ATA

Example for legacy auto mode in STA

AT+AUTOCON=0

AT+WAUTO=0,GainSpanDemoOK

AT+NDHCP=1OK

AT+NAUTO=0,1,192.168.25.2,9001OK

ATC1OK

1VV0301463 Rev. 1.0 Page 228 of 340 2018-01-24

Page 229: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

AT&W0OK

ATAOK

Example for new auto mode in Limited-AP

AT+AUTOCON=1OKAT+APCONF=1OKAT+WM=2OK

AT+NSET=192.168.81.1,255.255.255.0,192.168.81.1OK

AT+DHCPSRVR=1OK

AT+WAUTO=2,GS2KLAPOK

AT+NAUTO=1,1,,9000OK

ATC1OK

AT&W0OK

Example for new auto mode in STA

AT+AUTOCON=1

AT+WAUTO=0,GainSpanDemoOK

AT+NDHCP=1OK

AT+NAUTO=0,1,192.168.25.2,9001OK

ATC1OK

AT&W0OK

1VV0301463 Rev. 1.0 Page 229 of 340 2018-01-24

Page 230: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

ATAOK

7.4.4 Wireless ParametersThis command is used to set the auto connection wireless parameters for the current profile. All other parameters required to configure the wireless connection are taken from the current Profile.

Command Syntax AT+WAUTO=<mode>,<SSID>,[<BSSID>],[channel]

Parameter Description

Table 177, page 230 describes the Wireless parameters.

Synchronous Response

Table 178, page 231 describes the synchronous responses and remarks for Wireless Parameters command.

Table 177 Wireless Parameters

Parameter Optional/Mandatory Value Type Description

mode Mandatory Value range: 0, 2STALimited-AP mode

It specifies if GS node can be configured as an STA mode or Limited-AP mode.• 0: STA• 1: Limited-AP

SSID (Service Set Identifier) Mandatory

Any valid SSID (see 2.7.3 SSID and Passphrase, page 44) for SSID format)

N/A

It specifies the SSID of the AP or Limited-AP to connect to.SSID is the unique name given to the network. GS node (STA) connects to the desired network or creates a network (Limited-AP) using SSID.

BSSID (Basic Service Set Identifier)

OptionalAny valid BSSID (17 character of the form xx:xx:xx:xx:xx:xx)

N/A It specifies the BSSID of the AP to connect to.

channel Optional 1-14 N/A

It specifies the channel number which is the communication channel or radio channel used to communicate with the peer.

1VV0301463 Rev. 1.0 Page 230 of 340 2018-01-24

Page 231: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

Table 178 Wireless Parameters Synchronous Responses

Responses RemarksOK SuccessERROR:INVALID INPUT If parameters are not valid.

1VV0301463 Rev. 1.0 Page 231 of 340 2018-01-24

Page 232: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

7.4.5 Network ParametersThis command is used to set the network parameters for auto connection operation for the current profile.

Command Syntax AT+NAUTO=<Type>,<Protocol>,<Destination IP/Host name>,<Destination Port>,[Source Port]

Parameter Description

Table 179, page 232 describes the Network parameters.

Table 179 Network Parameters

Parameter Optional/Mandatory Value Description

Type Mandatory Value range: 0, 1

It specifies whether the type is client or server.• 0: Client• 1: ServerNote: It is recommended to use UDP/TCP server type while using auto connection in Limited-AP mode.

Protocol Mandatory Value range: 0, 1

It specifies the protocol used is UDP or TCP.• 0: UDP• 1: TCPNote: It is recommended to use TCP.

Destination IP/Host name Mandatory

Any valid IP address as per the IP address classes in xxx.xxx.xxx.xxx format.Host name is any valid domain name with max length of 32 ASCII character.

It specifies the IP address or the host name (domain name) of the remote system (optional if the GS node is acting as a server). The GS node accepts either the destination IP or host name. The maximum length of the host name can be 32 ASCII characters.

Destination Port Mandatory

Value range: 1 to 65535 (port number 0 is reserved and can’t be used)Format: 16-bit unsigned integer

It specifies the port number to be connected to on the remote system.

1VV0301463 Rev. 1.0 Page 232 of 340 2018-01-24

Page 233: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

Synchronous Response

Table 180, page 233 describes the synchronous responses and remarks for Network Parameters command.

Asynchronous Response

Table 181, page 233 describes the asynchronous responses and remarks for Network Parameters command.

Source Port Optional

Value range: 1 to 65535 (port number 0 is reserved and can’t be used)Format: 16-bit unsigned integer

It specifies the source port to bind. It is valid only in case of UDP client. This parameter is an optional one for UDP client and not valid for any other protocol.

Table 179 Network Parameters (Continued)

Parameter Optional/Mandatory Value Description

Table 180 Network Parameters Synchronous Responses

Responses RemarksOK SuccessERROR:INVALID INPUT If parameters are not valid.

Table 181 Network Parameters Asynchronous Responses

Responses Remarks

N/A

In case of AT+WAUTO Asynchronous messages are expected only in layer 4 level.When GS node is TCP/UDP server, then CONNECT and DISCONNECT are asynchronous responses.When GS node is TCP/UDP client, then only DISCONNECT will be the asynchronous message.

N/A

TCP/IP connection successful. <CID> = the new CID in hexadecimal format.TCP/IP connection with the given CID is closed.This response is sent to the host when a connection is closed by the remote device.

1VV0301463 Rev. 1.0 Page 233 of 340 2018-01-24

Page 234: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

Example

AT+ASYNCMSGFMT=1OK

AT+WAUTO=0,GainSpanDemoOK

AT+NDHCP=1OK

AT+NAUTO=1,1,,3000OK

AT&W0OK

ATC1OK

ATAIP SubNet Gateway192.168.17.2:255.255.255.0:192.168.17.1OK

NOTE: 1> For New auto mode, use AT+NCMAUTO=0,0,0 to stop or send deauth. 2> For Legacy auto mode, there is no command to stop or send deauth. Issue +++ or GPIO8 high to come out of the data processing mode, configure the settings, and issue ATA to trigger fresh auto connection.

1VV0301463 Rev. 1.0 Page 234 of 340 2018-01-24

Page 235: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

7.5 UDP/TCP

7.5.1 Basic

7.5.1.1 Create TCP Clients

This command is used to create a TCP client connection for a remote server with IPv4 address.

Command Syntax AT+NCTCP=<Dest-Address>,<Port>

Parameter Description

Table 182, page 235 describes the TCP Clients for IPv4 parameters.

Synchronous Response

Table 183, page 236 describes the synchronous responses and remarks for Create TCP Clients (IPv4) command.

NOTE: 1.) If the receiving TCP is unable to consume data and the host keeps transmitting TCP data, then there is a possibility that the receiver may reach zero window. As the host keeps transmitting TCP data, the data is accumulated in GS network stack. In such cases, processing the next TCP data send (from host) would be blocked causing the serial interface to be blocked. This condition will be cleared when the receiver updates its window or the TCP timeout happens for the data that is stored in GS network stack. 2.) In Concurrent mode, TCP servers with same port number can be created on both interfaces (0 and 1)

Table 182 TCP Clients for IPv4 Parameters

Parameter Optional/Mandatory Value Description

Dest-Address Mandatory N/A Dest-Address is the destination (server) IP address.

Port Mandatory N/A Port is the destination (server) port.

1VV0301463 Rev. 1.0 Page 235 of 340 2018-01-24

Page 236: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

Asynchronous Response

Table 184, page 236 describes the asynchronous responses and remarks for Create TCP Clients (IPv4) command.

Example Use Case GainSpan (GS) node is configured as a TCP client with:

TCP Server IP: 192.168.23.100TCP Server port: 3009

AT+WA=GainSpanDemoIP SubNet Gateway192.168.1.99:255.255.255.0:192.168.1.1OK

AT+NDHCP=1IP SubNet Gateway192.168.17.3:255.255.255.0:192.168.17.1OK

AT+NCTCP=192.168.23.100,3009CONNECT 0OK

Example Use Case When AT+NCTCP is executed before L2/L3:

Serial2WiFiAPPAT+NCTCP=192.168.12.1,1234

Table 183 TCP Clients for IPv4 Synchronous Responses

Responses RemarksCONNECT <CID>OK

Success connection with CID number.

ERROR Upon connection failure or invalid parameter.

ERROR:NO CIDGS node supports only 16 clients, it will not create the next connection (i.e., 17th connection) when all 16 connections (CIDs) are being active.

Table 184 TCP Clients for IPv4 Asynchronous Responses

Responses Remarks

DISCONNECT <CID>TCP connection with the given CID is closed. This response is sent to the host when a connection is closed by the remote server.

ERROR: SOCKET FAILURE <CID> Upon connection failure.

1VV0301463 Rev. 1.0 Page 236 of 340 2018-01-24

Page 237: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

DISASSOCIATEDOK

AT+WSTATUSNOT ASSOCIATEDOK

AT+NSTAT=?MAC=00:1d:c9:1b:93:b0WSTATE=NOT CONNECTED MODE=NONEBSSID=00:00:00:00:00:00 SSID=””CHANNEL=NONE SECURITY=NONERSSI=0IP addr=0.0.0 SubNet=0.0.0.0 Gateway=0.0.0.0DNS1=0.0.0.0 DNS2=0.0.0.0Rx Count=0 Tx Count=0OK

AT+CID=?No Valid CidsOK

1VV0301463 Rev. 1.0 Page 237 of 340 2018-01-24

Page 238: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

7.5.1.2 Create UDP Client

This command is used to create a UDP client connection for a remote sever with IPv4 address. Upon deployment of this command, the interface opens a UDP socket capable of sending data to the specified destination address and port.

Command Syntax AT+NCUDP=<Dest-Address>,<Port>[<,Src-Port>]

Parameter Description

Table 185, page 238 describes the UDP Clients IPv4 parameters.

Synchronous Response

Table 186, page 238 describes the synchronous responses and remarks for the UDP Clients IPv4 command.

Example Use Case GainSpan (GS) node is configured as a UDP client with:

Server IP: 192.168.23.100Server port: 9003

NOTE: GS node receives UDP packets of size less than or equal to 1500 bytes.

Table 185 UDP Clients IPv4 Parameters

Parameter Optional/Mandatory Value Description

Dest-Address Mandatory N/A Dest-Address is the destination (server) IP address.

Dest-Port Mandatory N/APort is the destination (server) port.Note: The port range 0xBAC0(47808) to 0xBACF (47823)

may not be used for destination port.

Src-Port Optional N/APort is the source (client) port. If a source port is provided, the socket will bind to the specified port.

Table 186 UDP Clients IPv4 Synchronous Responses

Responses RemarksCONNECT <CID>OK

Successful connection

ERROR: SOCKET FAILURE <CID> When the active Src-Port and the active Dest-Port number is being used for establishing a new connections with the TCP Server.

ERROR: NO CID GS node support only 16 CIDs, it will not create the next connection (i.e., 17th connection) when all 16 CIDs are being active.

1VV0301463 Rev. 1.0 Page 238 of 340 2018-01-24

Page 239: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

AT+WA=GainSpanDemoIP SubNet Gateway192.168.1.99:255.255.255.0:192.168.1.1OK

AT+NDHCP=1IP SubNet Gateway192.168.23.101:255.255.255.0:192.168.23.1OK

AT+NCUDP=192.168.23.100,9003CONNECT 0OK

7.5.1.3 Start TCP Server

This command is used to start the TCP server connection with IPv4 address.

Command Syntax AT+NSTCP=<Port>, [<Max client connection>, <TCP window size>

Parameter Description

Table 187, page 240 describes the Start TCP Server command parameters.

NOTE: If the receiving TCP is unable to consume data and the host keeps transmitting TCP data, then there is a possibility that the receiver may reach zero window. As the host keeps transmitting TCP data, the data is accumulated in GS network stack. In such cases, processing the next TCP data send (from host) would be blocked causing the serial interface to be blocked. This condition will be cleared when the receiver updates its window or the TCP timeout happens for the data that is stored in GS network stack.

1VV0301463 Rev. 1.0 Page 239 of 340 2018-01-24

Page 240: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

Po

M

TC

Synchronous Response

Table 188, page 240 describes the synchronous responses and remarks for the TCP Server command.

Asynchronous Response

Table 189, page 241 describes the asynchronous responses and remarks for the TCP Sever command.

Table 187 TCP Server Parameters

Parameter Optional/Mandatory Value Description

rt Mandatory N/A The interface opens a socket on the specified port and listens for connections.

ax client connection OptionalValue range: 0-9, a-fFormat: IntegerDefault value: 15

It specifies the maximum client connectionwith the server.The total number of network sockets is 16including server socket.

P window size Optional

Value range: 1024 to 8192Format: IntegerDefault value: 8192

It specifies the size of the TCP window server.

Table 188 TCP Server Synchronous Responses

Responses RemarksCONNECT <CID>OKExample: CONNECT 0

SuccessTCP connection successful. <CID> = the new CID in hexadecimal format.

DISCONNECT <CID>Example: DISCONNECT 1

Client disconnects the connection from GS node (TCP server).

ERROR:NO CID

GS node supports 16 CIDs, when 16 connections are established and tries to connect for 17th connection, then an error message will be displayed for insufficient memory.

ERROR:SOCKET FAILURE <CID>Example: ERROR: SOCKET FAILURE 0

When the same port is used for creating TCP sever, then GS node displays an error message for the duplicate port.

1VV0301463 Rev. 1.0 Page 240 of 340 2018-01-24

Page 241: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

Example Use Case GainSpan (GS) node is configured as a TCP server with

Port: 8005AT+NDHCP=1OK

AT+WA=GainSpanDemo,,11IP SubNet Gateway192.168.23.101:255.255.255.0:192.168.23.1OK

AT+NSTCP=8005CONNECT 0

Example Use Case When AT+NSTCP is executed before L2/L3:

Serial2WiFiAPPAT+NCTCP=192.168.12.1,1234DISASSOCIATEDOK

AT+NSTCP=3456DISASSOCIATED

AT+NSTCP=8888DISASSOCIATED

AT+WSTATUSNOT ASSOCIATEDOK

Table 189 TCP Server Asynchronous Responses

Responses RemarksCONNECT <SERVER_ID> <CLIENT_ID> <CLIENT IP> <CLIENT_PORT>Example: CONNECT 0 1 192.168.17.2 50569Where,0 - server_cid1 - client_cid192.168.23.100 - client_ip50569 - client_port

SuccessSuccessful connection establishment of TCP client (Hercules) to GS node (TCP server).

DISCONNECT <CID>Example: DISCONNECT 3

TCP connection with the given CID is closed. This response is sent to the host when a connection is closed by the remote device (TCP client).

1VV0301463 Rev. 1.0 Page 241 of 340 2018-01-24

Page 242: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

AT+NSTAT=?MAC=00:1d:c9:1b:93:b0WSTATE=NOT CONNECTED MODE=NONEBSSID=00:00:00:00:00:00 SSID=””CHANNEL=NONE SECURITY=NONERSSI=0IP addr=0.0.0 SubNet=0.0.0.0 Gateway=0.0.0.0DNS1=0.0.0.0 DNS2=0.0.0.0Rx Count=0 Tx Count=0OK

AT+NSTCP=1234DISASSOCIATED

AT+CID=?No Valid CidsOK

1VV0301463 Rev. 1.0 Page 242 of 340 2018-01-24

Page 243: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

7.5.1.4 Start UDP Server

This command is used to start a UDP server connection with IPv4 address.

Command Syntax AT+NSUDP=<Port>

Parameter Description

Table 190, page 243 describes the UDP Server parameters.

Synchronous Response

Table 191, page 243 describes the synchronous responses and remarks for the UDP Server command.

NOTE: GS node receives UDP packets of size less than or equal to 1500 bytes.

Table 190 UDP Server Parameters

Parameter Optional/Mandatory Value Description

Port Mandatory N/AServer port (The port range 0xBAC0 (47808) to 0xBACF (47823) may not be used).

Table 191 UDP Server Synchronous Responses

Responses RemarksCONNECT <CID>OKExample: CONNECT 0

SuccessUDP connection successful. CID is the new socket identifier allocated to the socket on GS node.

ERROR:SOCKET FAILURE <CID>Example: ERROR: SOCKET FAILURE 0

When the same port is used for creating UDP server, then GS node displays an error message for the duplicate port.

ERROR:NO CIDGS node supports 16 CIDs, when 16 connections are established and tries to connect for 17th connection, then an error message will be displayed.

1VV0301463 Rev. 1.0 Page 243 of 340 2018-01-24

Page 244: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

Example Use Case GainSpan (GS) node is configured as a UDP server with port 1009.

AT+NDHCP=1OK

AT+WA=GainSpanDemo,,11IP SubNet Gateway192.168.23.101:255.255.255.0:192.168.23.1OK

AT+NSUDP=1009CONNECT 0OK

7.5.1.5 Store TCP Client Configuration

This command is used to store the connection parameters of a TCP client connected to a remote server with IPv4 address.

Command Syntax AT+NCTCPSTORE=<CID>

Parameter Description

Table 192, page 244 describes the Store TCP client configuration command parameters.

Synchronous Response

Table 193, page 245 describes the synchronous responses and remarks for the Store HTTP client configuration command.

NOTE: This command should be issued after establishing TCP connection and before going to standby. In case of TCP over SSL, this command internally takes care of the SSL session related connection parameters to store the necessary security settings.

Table 192 Store TCP Client Configuration Parameters

Parameter Optional/Mandatory Value Description

CID MandatoryValue range: 0 to FFormat: Hexadecimal

It specifies the socket identifier allocated to a socket on GS node.

1VV0301463 Rev. 1.0 Page 244 of 340 2018-01-24

Page 245: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

7.5.1.6 Restore TCP Client Configuration

This command is used to restore the connection parameters previously stored through AT+NCTCPSTORE command.

Command Syntax AT+NCTCPRESTORE=<CID>

Parameter Description

Table 194, page 245 describes the Restore TCP client configuration command parameters.

Synchronous Response

Table 195, page 245 describes the synchronous responses and remarks for the Restore HTTP client configuration command.

Table 193 Store TCP Client Configuration Synchronous Responses

Responses RemarksOK SuccessERROR:INVALID INPUT If parameters are not valid.

NOTE: This command should be issued after coming out of standby and all the L3 and below layer connections are properly restored. In case of TCP over SSL, this command will also internally take care of the SSL session related connection parameters to restore the necessary security settings.

Table 194 Restore TCP Client Configuration Parameters

Parameter Optional/Mandatory Value Description

CID MandatoryValue range: 0 to FFormat: Hexadecimal

It specifies the socket identifier allocated to a socket on GS node.

Table 195 Restore TCP Client Configuration Synchronous Responses

Responses RemarksOK SuccessERROR:INVALID INPUT If parameters are not valid.

1VV0301463 Rev. 1.0 Page 245 of 340 2018-01-24

Page 246: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

7.5.2 Secured (DTLS/SSL)

7.5.2.1 Open DTLS Client

The Datagram Transport Layer Security (DTLS) provides communications privacy services for client operations.

This command is used to open a DTLS client connection.

Command Syntax AT+DTLSOPEN=<CID>,<Certificate Name>,<Client Certificate Name>,<Client Key Name>

Command Note This command must be issued after associating to a network and opening a socket.

DTLS connection should be closed before issuing AT+WD command.

Parameter Description

Table 196, page 246 describes the DTLS Open parameters.

Synchronous Response

Table 197, page 246 describes the synchronous responses and remarks for the DTLS Open command.

Table 196 DTLS Open Parameters

Parameter Optional/Mandatory Value Description

CID Mandatory

Value range: 0 to FFormat: Hexadecimal

It specifies the socket identifier allocated to a socket on GS node.

Certificate Name Mandatory N/A Name given to a certificateClient Certificate Name Mandatory N/A Name given to a client certificateClient Key Name Mandatory N/A Key name of a client.

Table 197 DTLS Open Synchronous Responses

Responses RemarksOK SuccessERROR:INVALID INPUT If parameters are not valid.

1VV0301463 Rev. 1.0 Page 246 of 340 2018-01-24

Page 247: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

7.5.2.2 Close DTLS Client

This command is used to close a DTLS client connection opened using AT+DTLSOPEN command.

Command Syntax AT+DTLSCLOSE=<CID>

Parameter Description

Table 198, page 247 describes the DTLS Close parameters.

Synchronous Response

Table 199, page 247 describes the synchronous responses and remarks for the DTLS Close command.

Table 198 DTLS Close Parameters

Parameter Optional/Mandatory Value Description

CID MandatoryValue range: 0 to FFormat: Hexadecimal

It specifies the socket identifier allocated to a socket on GS node.

Table 199 DTLS Close Synchronous Responses

Responses RemarksOK SuccessERROR:INVALID INPUT If parameters are not valid.

1VV0301463 Rev. 1.0 Page 247 of 340 2018-01-24

Page 248: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

7.5.2.3 Store DTLS Client Configuration

This command is used to store the connection parameters of a DTLS client connected to a remote server with IPv4 address.

Command Syntax AT+DTLSSTORE=<CID>

Parameter Description

Table 200, page 248 describes the Store DTLS client configuration command parameters.

Synchronous Response

Table 201, page 248 describes the synchronous responses and remarks for Store DTLS client configuration command.

NOTE: This command should be issued after establishing DTLS connection and before going to standby.

Table 200 Store DTLS Client Configuration Parameters

Parameter Optional/Mandatory Value Description

CID MandatoryValue range: 0 to FFormat: Hexadecimal

It specifies the socket identifier allocated to a socket on GS node.

Table 201 Store DTLS Client Configuration Synchronous Responses

Responses RemarksOK SuccessERROR:INVALID INPUT If parameters are not valid.

1VV0301463 Rev. 1.0 Page 248 of 340 2018-01-24

Page 249: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

7.5.2.4 Restore DTLS Client Configuration

This command is used to restore the connection parameters previously stored through AT+DTLSSTORE command.

Command Syntax AT+DTLSRESTORE=<CID>

Parameter Description

Table 202, page 249 describes the Restore DTLS client configuration command parameters.

Synchronous Response

Table 203, page 249 describes the synchronous responses and remarks for the Restore DTLS client configuration command.

NOTE: This command should be issued after coming out of standby and all the L3 and below layer connections are properly restored. In case of TCP over SSL, this command will also internally take care of the SSL session related connection parameters to restore the necessary security settings.

Table 202 Restore DTLS Client Configuration Parameters

Parameter Optional/Mandatory Value Description

CID MandatoryValue range: 0 to FFormat: Hexadecimal

It specifies the socket identifier allocated to a socket on GS node.

Table 203 Restore DTLS Client Configuration Synchronous Responses

Responses RemarksOK SuccessERROR:INVALID INPUT If parameters are not valid.

1VV0301463 Rev. 1.0 Page 249 of 340 2018-01-24

Page 250: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

7.5.2.5 Configure SSLThis command is used to configure the SSL parameters.

It supports to configure:

• Domain name check and configure the size of SSL buffer in bytes which is used to store the alternate names (domain names) provided in the incoming server certificate.

• Close an existing SSL connection and configure the timeout value to close the SSL connection.

Command Syntax AT+SSLCONF=<Configuration ID>,<Configuration value>

Parameter Description

Table 204, page 252 describes the SSL configuration parameters.

1VV0301463 Rev. 1.0 Page 250 of 340 2018-01-24

Page 251: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

1VV0301463 Rev. 1.0 Page 251 of 340 2018-01-24

Page 252: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

Table 204 Configuring SSL Parameters

Parameter Optional/Mandatory Value Description

Configuration ID Mandatory

Value Range: 1 to 9Format: Decimal.

1: Domain name check, when this parameter is set to 1, GS module performs the domain name check.2:SSL close timeout check, when this parameter is set to 2, GS module supports to close an existing SSL connection after a timeout.3: Enables signature algorithm extension.4: Enables max fragment length extension.5: Disable SSL re- negotiation extension.6: Sets TLS version.7: Enables ECC ciphers.8: Enables SNI extension.9: Selectively display of ECC ciphers.

1VV0301463 Rev. 1.0 Page 252 of 340 2018-01-24

Page 253: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

Synchronous Response

Table 205, page 254 describes the synchronous responses and remarks for Closing SSL Connection command.

Configuration value MandatoryValue Range: N/AFormat: N/A

When Configuration ID is 1: Buffer size in bytes(50-2000) is specified to store the alternate names (domain names) provided in the incoming server certificate. Note: Maximum buffer size can be more than 2000 bytes

since this depends on the memory availability in GSNode. Timeout value is 1 to 60 seconds

When Configuration ID is 2: This is the Timeout value in seconds required to close an existing SSL connectionWhen Configuration ID is 3,the configuration value is:0 - to disables signature algorithm extension1 - to enables signature algorithm extensionWhen Configuration ID is 4,the configuration value is:0 - to disables max fragment length extension1 - to enables max fragment length extensionWhen Configuration ID is 5,the configuration value is:0 - to enable SSL De-negotiation extension1 - to disable SSL De- negotiation extensionWhen Configuration ID is 6, the configuration value is:0 - set version to TLS is 1.01 - set version to TLS is 1.12 - set version to TLS is 1.2The default version is 1.2When Configuration ID is 7, the configuration value is:0 - to disables ECC ciphers1 - to enables ECC ciphersWhen Configuration ID is 8, the configuration value is the “server name” string added to SSL extension.When Configuration ID is 9, the configuration value is the cipher bit map (32bit)

Table 204 Configuring SSL Parameters (Continued)

Parameter Optional/Mandatory Value Description

1VV0301463 Rev. 1.0 Page 253 of 340 2018-01-24

Page 254: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

Example 1 Enabling domain name check in SSL client and to allocate 100 Bytes for storing domain names.

AT+SSLCONF=1,100

Example 2 Configuring SSL client terminate connection, if the SSL server is not responding for more than 20 seconds.

AT+SSLCONF=2,20

Example 3 Configure SSL Client to send Signature Algorithm Extensions in Client Hello Frame.AT+SSLCONF=3,1

Example 4 Configure SSL Client to send maximum supported fragment Length extension in Client Hello Frame.

AT+SSLCONF=4,1

Example 6 Configure SSL client to for disabling SSL re-negotiation.AT+SSLCONF=5,1

Example 7 Configure SSL client use only TLS1.0 VersionAT+SSLCONF=6,0

Example 8 Configure SSL client use only TLS1.1 Version or lessAT+SSLCONF=6,1

Example 9 Configure SSL client use only TLS1.2 Version or lessAT+SSLCONF=6,2

Example 10 Configure SSL client to support elliptic-curve Diffie–Hellman and Elliptic Curve Digital Signature Algorithm.

AT+SSLCONF=7,1

Example 11 Configure SSL Client to set Server Name Indication (SNI) as “client5.google.com”.AT+SSLCONF=8,client5.google.com

Example 12 The following are the bit position to enable individual cipher:

Cipher Name Bit PositionTLS_RSA_WITH_3DES_EDE_CBC_SHA 0TLS_RSA_WITH_RC4_128_SHA 1TLS_RSA_WITH_RC4_128_MD5 2TLS_RSA_WITH_AES_128_CBC_SHA 3TLS_RSA_WITH_AES_256_CBC_SHA 4TLS_RSA_WITH_AES_128_CBC_SHA256 5TLS_RSA_WITH_AES_256_CBC_SHA256 6

Table 205 Configuring SSL Synchronous Responses

Responses RemarksOK SuccessERROR: INVALID INPUT If parameters are not valid.

1VV0301463 Rev. 1.0 Page 254 of 340 2018-01-24

Page 255: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256 7TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 8TLS_ECDHE_ECDSA_WITH_AES_128_CCM_8 9TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 10

Issue the following AT commands for enabling the above cipher suite excluding bit position(0,1,2).

AT+SSLCONF=7,1AT+SSLCONF=9,7f8

7.5.2.6 Open SSL

This command is used to open an SSL connection over the TCP connection identified by a CID. For SSL connection, GS node uses the certificate stored in memory that is identified by a certificate name. Prior to issuing this command, a valid TCP connection identified by CID needs to exist.

Client certificate name and client key name are required for SSL client authentication.

Command Syntax AT+SSLOPEN=<CID>,[<certificate name>, <client certificate name>,<client key name>]

Parameter Description

Table 206, page 256 describes the SSL Connection Open parameters.

NOTE: a> ECC ciphers is included only if the AT command to enable ECC is issued(AT+SSLCONF=7,1). b> If AT command AT+SSLCONF=7,1 is issued without a specified bitmap, then all the supporting ECC ciphers with bit position (7-10)gets added by default. c> If AT command AT+SSLCONF=7,1 is not issued, then SSL will not include any of the ECC ciphers irrespective of whether the bitmap contains any ECC cipher or not.

NOTE: a> Certificates and Key must be in DER format. b> If the size of Server key is more than 2k, then GS node as SSL Client will not connect to the SSL Server.

1VV0301463 Rev. 1.0 Page 255 of 340 2018-01-24

Page 256: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

Synchronous Response

Table 207, page 256 describes the synchronous responses and remarks for SSL Connection Open command.

Example AT+NDHCP=1OKAT+WA=GainSpanDemo,,11IP SubNet Gateway192.168.23.101:255.255.255.0:192.168.23.1OKAT+SETTIME=11/30/2013,11:03:00OKAT+NCTCP=192.168.2.73,443CONNECT 0OKAT+SSLOPEN=0OK

7.5.2.7 Close SSL

This command is used to close the existing SSL connection over the TCP connection identified by CID.

Command Syntax AT+SSLCLOSE=<CID>

Parameter Description

Table 208, page 257 describes the Closing SSL Connection parameters.

Table 206 SSL Connection Open Parameters

Parameter Optional/Mandatory Value Description

CID Mandatory

Value range: 0 to FFormat: Hexadecimal

It specifies the socket identifier allocated to a socket on GS node.

certificate name Optional N/A Name of the SSL certificate.client certificate name Optional N/A Name of the SSL client certificate.client key name Optional N/A Name of the SSL client key.

Table 207 SSL Connection Open Synchronous Responses

Responses RemarksOK Success

1VV0301463 Rev. 1.0 Page 256 of 340 2018-01-24

Page 257: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

Synchronous Response

Table 209, page 257 describes the synchronous responses and remarks for Closing SSL Connection command.

Example AT+NDHCP=1OK

AT+WA=GainSpanDemo,,11IP SubNet Gateway192.168.23.101:255.255.255.0:192.168.23.1OK

AT+SETTIME=11/30/2013,11:03:00OK

AT+NCTCP=192.168.2.73,443CONNECT 0OK

AT+SSLOPEN=0OK

AT+SSLCLOSE=0OK

Table 208 Closing SSL Connection Parameters

Parameter Optional/Mandatory Value Description

CID Mandatory

Value range: 0 to FFormat: Hexadecimal

It specifies the socket identifier allocated to a socket on GS node.

Table 209 Closing SSL Connection Synchronous Responses

Responses RemarksOK Success

ERROR: INVALID CID Displays error message for invalid connection identifier.

NOTE: SSL renegotiation is not supported after SSL restore.

1VV0301463 Rev. 1.0 Page 257 of 340 2018-01-24

Page 258: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

7.5.3 Data Handling

7.5.3.1 Normal Data Handling

This section provides details about the Data Handling Escape Sequences used in GS node.

The following sections are covered:

• UART Interface, page 258

• SPI Interface, page 262

7.5.3.1.1 UART Interface

Table 210, page 258 describes the Data Handling using ESC key sequences on the UART interface.

NOTE: Use flow control when data sent is greater than 2048 bytes.

Table 210 Data Handling Using ESC Sequences on UART Interface Flow Control Data Mode (Data Type) Connection

TypeDescription and Escape <ESC> Command

Sequence

SW or HW Normal (ASCII Text)TCP clientTCP server

This escape sequence selects the specified Connection ID as the current connection. This switches the connection to be used without exiting from the Data mode of operation. Use this sequence to send data from a TCP server, TCP client or UDP client (must be done before data can be received by that client).

Module send and receive sequence:

<ESC>S<CID><data><ESC>EExample: to send user data (e.g., Hello) on CID 1, the format will be:

<ESC>S1Hello<Esc>E

1VV0301463 Rev. 1.0 Page 258 of 340 2018-01-24

Page 259: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

SW or HW Normal (ASCII Text) UDP client

If UDP client is configured with unicast destination server IP address.

Module send and receive sequence:

<ESC>S<CID><data><ESC>E

If UDP client is configured with broadcast destination server IP address (i.e., 255.255.255.255), then:Module expects to receive the following data sequence from Host:

<ESC>S<CID><data><ESC>E

Module sends the following data sequence to Host:

<ESC>u<CID><IPAddress><space><port><hortizontal tab><data><ESC>E

SW or HW Normal (ASCII Text) UDP server

This escape sequence is used when sending and receiving UDP data on a UDP server connection. When this command is used, the remote address and remote port is transmitted.

Module expects to receive the following data sequence from Host:

<ESC>u<CID><IPAddress>:<port>:<data><ESC>E

Module sends the following data sequence to Host:

<ESC>u<CID><IPAddress><space><port><horizontaltab><data><ESC>E

Example: when Module sends data (e.g., Hello) on CID 0, the format will be:

<ESC>u0192.168.0.101<space>1001<horizontaltab>Hello<ESC>E

Table 210 Data Handling Using ESC Sequences on UART Interface (Continued)Flow Control Data Mode (Data Type) Connection

TypeDescription and Escape <ESC> Command

Sequence

1VV0301463 Rev. 1.0 Page 259 of 340 2018-01-24

Page 260: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

SW or HW Normal (Binary) N/ABinary data transfer with software or hardware flow control are not supported with ESC sequence.

SW or HW Bulk (ASCII Text)TCP clientTCP server

To improve data transfer speed, you can use this bulk data transfer. This sequence is used to send and receive data on TCP client, TCP server, or UDP client connection.

Module send and receive sequence:

<ESC>Z<CID><data length><data>

Example: to send a 5 byte user data (e.g., Hello) on CID 1, the format will be:

<ESC>Z10005Hello

SW Bulk (ASCII Text or Binary) UDP client

If UDP client is configured with a unicast destination server IP address, then

Module send and receive sequence:

<ESC>Z<CID><data length><data>

If UDP client is configured with a broadcast destination server IP address (i.e., 255.255.255.255), then:

Module expects to receive the following data sequence from Host:

<ESC>Z<CID><data length><data>

Module sends the following data sequence to Host:

<ESC>y<CID><IPAddress><space><port><horizontaltab><data length><data>

Table 210 Data Handling Using ESC Sequences on UART Interface (Continued)Flow Control Data Mode (Data Type) Connection

TypeDescription and Escape <ESC> Command

Sequence

1VV0301463 Rev. 1.0 Page 260 of 340 2018-01-24

Page 261: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

SW or HW Bulk (ASCII Text or Binary) UDP server

This escape sequence is used when sending and receiving UDP bulk data on a UDP server connection. When this command is used, the remote address and remote port is transmitted.

Module expects to receive the following data sequence from Host:

<ESC>Y<CID><IPAddress:<port>:<data length><data>

Module sends the following data sequence to Host:

<ESC>y<CID><IPAddress><space><port><horizontal tab><data length><data>

Example: when receiving a 5 byte user data (e.g., Hello) on CID 1, the format will be:

<ESC>y0192.168.0.101<space>1001<horizontal tab>0005Hello

HW Bulk (ASCII or Binary)TCP clientTCP serverUDP client

To improve data transfer speed, one can use this bulk data transfer. This sequence is used to send and receive data on TCP client, TCP server, or UDP client connection.

Module send and receive sequence:

<ESC>Z<CID><data length)<data>

Example: to send a 5 byte user data (e.g., Hello) on CID 1, the format will be:

<ESC>Z10005Hello

SW Bulk (Binary) N/A Binary data transfer with software flow control not supported.

Table 210 Data Handling Using ESC Sequences on UART Interface (Continued)Flow Control Data Mode (Data Type) Connection

TypeDescription and Escape <ESC> Command

Sequence

1VV0301463 Rev. 1.0 Page 261 of 340 2018-01-24

Page 262: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

7.5.3.1.2 SPI Interface

Table 211, page 262 describes Data Handling using the ESC Sequences on the SPI Interface.

SW Normal (Binary) UDP

This escape sequence is used when sending and receiving UDP data on a UDP server connection. The remote address and remote port is transmitted in binary encoding with the MSB transmitted first.

<ESC>u CID<remote address><remote port>

The following example shows the header to transmit a UDP packet using binary addressing taking up 9 bytes (d denoting decimal value):

<ESC>u4<192d><168d><1d><1d><0d><52d><data><ESC>E

Table 210 Data Handling Using ESC Sequences on UART Interface (Continued)Flow Control Data Mode (Data Type) Connection

TypeDescription and Escape <ESC> Command

Sequence

Table 211 Data Handling Using ESC Sequences on the SPI Interface Data Mode (Data Type) Connection Type Description and Escape <ESC> Command

Sequence

Normal (ASCII Text)TCP clientTCP server

1. Data transfer is transparent due to byte stuffing at SPI driver level.

2. Byte stuffing must be incorporated in Host controller as per the Adapter guide.

Module send and receive sequence:

<ESC>S<CID><data><ESC>E

or Auto mode.

1VV0301463 Rev. 1.0 Page 262 of 340 2018-01-24

Page 263: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

Normal (ASCII Text) UDP client

If UDP client is configured with an unicast destination server Ip address, then:Module send and receive sequence:

<ESC>S<CID><data><ESC>E

If UDP client is configured with a broadcast destination server IP (i.e., 255.255.255.255), then:Module expects to receive the following data sequence from MCU:

<ESC>S<CID><data>ESC>E

Module sends the following data sequence to MCU:

<ESC>u<CID><IP Address><space><port><horizontal tab><ESC>E

Normal (ASCII Text) UDP server

This escape sequence is used when sending and receiving UDP data on a UDP server connection. When this command is used, the remote address and remote port is transmitted.Module expects to receive the following data sequence from Host:

<ESC>u<CID><IPAddress>:<port>:<data><ESC>E

Module sends the following data sequence to Host:

<ESC>u<CID><IPAddress><space><port><horizontal tab><data><ESC>E

Example: when receiving user data (e.g., Hello) on CID o, the format will be:

<ESC>u0192.168.0.101<space>1001<hortizontal tab>Hello<Esc>E

Normal (Binary) N/A Binary data transfer with software flow control is not supported with ESC sequence.

Normal (ASCII Text or Binary) N/A Hardware flow control is not supported.

Table 211 Data Handling Using ESC Sequences on the SPI Interface (Continued)Data Mode (Data Type) Connection Type Description and Escape <ESC> Command

Sequence

1VV0301463 Rev. 1.0 Page 263 of 340 2018-01-24

Page 264: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

Bulk (ASCII Text or Binary)

TCP clientTCP server

1. Data transfer is transparent due to byte stuffing at SPI driver level.

2. Byte stuffing must be incorporated in Host controller as per the Adapter guide.

Module send and receive sequence:

<ESC>Z<CID><data length><data>

Example: to send a 5 byte user data (e.g., Hello) on CID 1, the format will be:

<ESC>Z10005Hello

Bulk (ASCII Text or Binary) UDP client

If UDP client is configured with a unicast destination server IP address, then:Module sends and receives the following data sequence:

<ESC>Z<CID><data length><data>

If UDP client is configured with a broadcast destination server IP address (i.e., 255.255.255.255), then:Module expects to receive the following data sequence from Host:

<ESC>Z<CID><data length><data>

Module sends the following data seqeuence to Host:

<ESC>y<CID><IP Address><space><port><horizontal tab><data length><data>

Table 211 Data Handling Using ESC Sequences on the SPI Interface (Continued)Data Mode (Data Type) Connection Type Description and Escape <ESC> Command

Sequence

1VV0301463 Rev. 1.0 Page 264 of 340 2018-01-24

Page 265: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

Esccol)

<ESC<ESC<ESC<ESC<ESC<ESC<ESCNote: Re

Table 212, page 265, describes the responses and remarks the SPI Byte Protocol & SPI Block Protocol for Non Bulk and Bulk Mode.

Bulk (ASCII Text or Binary) UDP server

This escape sequence is used when sending and receiving UDP bulk data on a UDP server connection. When this command is used, the remote address and remote port is transmitted.Module receives from Host the following data sequence:

<ESC>y<CID><IP Address>:<port>:<data length><data>

Module sends the following data sequence to Host:

<ESC>y<CID><IP Address><space><port><horizontal tab><data length><data>

Example: when receiving a 5 byte user data (e.g., Hello) on CID 1, the format will be:

<ESC>y0192.168.0.101<space>1001<horizontal tab>0005Hello

Table 211 Data Handling Using ESC Sequences on the SPI Interface (Continued)Data Mode (Data Type) Connection Type Description and Escape <ESC> Command

Sequence

Table 212 Response for SPI Byte Protocol & SPI Block Protocol

ape Sequence Events ResponseUART SDIO SPI (Byte Protocol) SPI (Block Proto

Non Bulk Mode (Data transfer supports ASCII data handling)>S<CID> Valid CID <ESC>O <ESC>O No response>S<CID> Invalid CID <ESC>F <ESC>F <ESC>F>U<CID> Valid CID <ESC>O <ESC>O No response>U<CID> Invalid CID <ESC>F <ESC>F <ESC>F>E End of Data <ESC>O <ESC>O <ESC>O>S<CID><Data><ESC>E - Use this sequence to send data from a TCP Server, TCP Client and UDP Client.>U<CID><IP Address>:<Port><Data><ESC>E - Use this sequence to send data from UDP Server.fer the responses returned by the S2W for valid CID, invalid CID and end of data events.

Bulk Mode (Data transfer supports both ASCII and binary handling)

1VV0301463 Rev. 1.0 Page 265 of 340 2018-01-24

Page 266: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

<ESC<ESC<ESC<ESC<ESC lient and U<ESC UDP ServerNote: Re

Esc

7.5.3.2 Bulk Data Handling

In Bulk Data Mode, data transfers are managed using escape sequences (ESC Z, ESC Y and ESC y). Each escape sequence (see Table 213, page 267) starts with the Escape <ESC> key (ASCII character 27 (0x1B)). Encoding is used for both transmitted and received data. Enable bulk data by using command “AT+BDATA=” (1 is enable and 0 is disable).

The format of a bulk data frame for TCP client, TCP server, or UDP client is:

<ESC>Z<CID><Data Length xxxx 4 ascii char><data>

The contents of < > are a byte or byte stream.

– CID is connection identifier (UDP, TCP, etc.; as derived when TCP socket is created by issuing the command: AT+NCTCP, for example.)

– Data Length is 4 ASCII character represents decimal value i.e. 1400 byte (0x31 0x34 0x30 0x30).

– The Data Length range should be 1 to 1400 bytes when sending to GainSpan module from Host and it will be 1 to 1500 bytes when Host is receiving from GainSpan module

User Data size must match the specified Data Length. Ignore all command or Escape <ESC> sequence in between data pay load. User should send the specified length of data to the GS node irrespective of any asynchronous events happened on the GS node so that the GS node can start receiving next commands.

For example, if CID value is 3, then:

To send a 5 byte user data (e.g. DE) for a TCP client connection, the format will be:

>Z<CID> Valid CID <ESC>O <ESC>O No response>Z<CID> Invalid CID <ESC>F <ESC>F <ESC>F>Y<CID> Valid CID <ESC>O <ESC>O No response>Y<CID> Invalid CID <ESC>F <ESC>F <ESC>F>Z<CID><Data Length XXXX(4 ASCII character)><Data> - Use this sequence to send data from a TCP Server, TCP CDP Client.>Y<CID><IP Address>:<Port><Data length XXXX(4 ASCII character)><Data> - Use this sequence to send data from.fer the responses returned by the S2W for valid CID and invalid CID.

Table 212 Response for SPI Byte Protocol & SPI Block Protocol (Continued)

ape Sequence Events Response

NOTE: This is the recommended data handling method.

1VV0301463 Rev. 1.0 Page 266 of 340 2018-01-24

Page 267: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

<ESC>Z30005DE

To send a 512 byte user data for a TCP client connection, the format will be:

<ESC>Z30512<512 bytes of user data>

To send data on UDP server, the bulk data frame format is:

<ESC>Y<CID><Ip address>:<port>:<Data Length xxxx 4 decimal digits><data>

When receiving data on UDP server, the format of a bulk data frame is:

<ESC>y<CID><IP address><space><port><horizontal tab><Data Length xxxx 4 decimal digits><data>

Table 213 Escape Sequences

Operation Escape Sequence DescriptionBulk Data transfer on TCP Server/Client and UDP Client connection

<ESC>Z<CID>Data Len 4 digit ascii<Data>

To improve data transfer speed, one can use this bulk data transfer. This escape sequence is used to send and receive data on a TCP Client/Server and UDP client connection.

Example: <ESC>Z40005Hello - where 4 is the CID, 0005 is the 5 byte data length and Hello is the data to be sent.Bulk Data Send on UDP server connection

<ESC>Y<CID> remote address: remote port:Data Len 4 digit ascii<Data>

This escape sequence is used when sending UDP data on a UDP server connection. When this command is used, the remote address and remote port is transmitted in ASCII text encoding and terminated with a “:” character.

Example: <ESC>Y4192.168.1.52:000Hellop where 4 is the CID, 0005 is the 5 byte data length and Hello is the data to be sent.Bulk Data Receive on UDP Server Connection

<ESC>y<CID> remoteaddress<space>remote port<horizontal tab>Data length in 4 digit ascii<Data>

This escape sequence is used when receiving UDP data on a UDP server connection. When this sequence is used, the remote address and remote port is transmitted in ASCII text encoding and separated by a space ( ) character.

Example: <ESC>y4192.168.1.1<space>53<horizontal tab>0005Hello where 4 is the CID, 0005 is the 5 byte data length and Hello is the data received.

1VV0301463 Rev. 1.0 Page 267 of 340 2018-01-24

Page 268: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

NOTE: a> The contents of < > are either a byte or byte stream, except for <ESC>; literals outside brackets are ASCII characters. b> GS node sends success or failure responses as mentioned in Table 6 Data Handling Responses at Completion, page 40 when MCU transmits bulk data.

1VV0301463 Rev. 1.0 Page 268 of 340 2018-01-24

Page 269: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

7.6 HTTP

7.6.1 HTTP(S) Client

7.6.1.1 Configure HTTP Client

This command is used to configure the HTTP parameters.

Command Syntax AT+HTTPCONF=<Param name>,<Param Value>

Parameter Description

Table 214, page 269 describes the HTTP client configuration parameters.

Table 214 HTTP Client Configuration Parameters

Parameter Optional/Mandatory Description

Param name Mandatory

Param name is the HTTP header.Custom header starts from 255 onwards and any standard header should start before this.The HTTP header is one of the following.HTTP_HEADER_AUTHORIZATION (2)HTTP_HEADER_CONNECTION (3)HTTP_HEADER_CONTENT_ENCODING (4)HTTP_HEADER_CONTENT_LENGTH (5)HTTP_HEADER_CONTENT_RANGE (6)HTTP_HEADER_CONTENT_TYPE (7)HTTP_HEADER_DATE (8)HTTP_HEADER_EXPIRES (9)HTTP_HEADER_FROM (10)HTTP_HEADER_HOST (11)HTTP_HEADER_IF_MODIFIED_SINCE (12)HTTP_HEADER_LAST_MODIFIED (13)HTTP_HEADER_LOCATION (14)HTTP_HEADER_PRAGMA (15)HTTP_HEADER_RANGE (16)HTTP_HEADRER_REFERER (17)

1VV0301463 Rev. 1.0 Page 269 of 340 2018-01-24

Page 270: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

Synchronous Response

Table 215, page 270 describes the synchronous responses and remarks for HTTP Client Configuration command.

Example 1 The GainSpan (GS) node (HTTP client) is configured with HTTP header parameters and the HTTP connection is opened with the HTTP server.

where some of the HTTP headers are configured . The HTTP headers configured are: HTTP_HEADER_CONNECTION (3)HTTP_HEADER_EXPIRES (11)HTTP_HEADER_USER_AGENT (20)Customer Header (258)

AT+WA=GainSpanDemo,,11IP SubNet Gateway

Param name Mandatory

HTTP_HEADER_SERVER (18)HTTP_HEADER_TRANSFER_ENCODING (19)HTTP_HEADER_USER_AGENT (20)HTTP_HEADER_WWW_AUTHENTICATE (21)HTTP_REQUEST_URL (23)HTTP_CFG_PARAM_CLOSE_TIMEOUT(27)HTTP_CFG_PARAM_HEADER_COOKIE(247)HTTP_CFG_PARAM_HEADER_COOKIE2(248)HTTP_CFG_PARAM_HEADER_SET_COOKIE(249)Note: 1.)Customer header starts from 255. Note: 2) The maximum total HTTP headers that GS node can process is limited

to 1024Bytes.

Param Value Mandatory It is the string that depends on the above parameter.When param is 11 (HTTP_HEADER_HOST), then the value string will be 192.168.2.73 (Host address)When param is 27 (HTTPC_CFG_PARAM_CLOSE_TIMEOUT), then the value specifies a timeout value to close an existing HTTP connection. Value range: 1-60 secondsMinimum value: 10 milliseconds

Table 214 HTTP Client Configuration Parameters (Continued)

Parameter Optional/Mandatory Description

Table 215 HTTP Client Configuration Synchronous Responses

Responses Remarks

OKSuccessSuccessful HTTP connection

ERROR: INVALID INPUTFailureIf parameters are not valid.

1VV0301463 Rev. 1.0 Page 270 of 340 2018-01-24

Page 271: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

192.168.23.101:255.255.255.0:192.168.23.1OK

AT+HTTPCONF=3,KEEP-ALIVEOK

AT+HTTPCONF=11,192.168.2.73OK

AT+HTTPCONF=23,192.168.2.73:443OK

AT+HTTPCONF=2,Basic dGVzzdDp0ZXN0MTIz=test:test123OK

AT+HTTPCONF=255,SSID:GainSpanDemoOK

AT+HTTPCONF=256,Temperature:28OK

AT+HTTPCONF=257,Light:35OK

AT+HTTPCONF=258,Voltage:3.3OK

AT+HTTPOPEN=192.168.2.73,800OK

Example 2 To configure HTTP close timeout, execute the following command:

AT+HTTPCONF=27,100

Where,27: S2W_HTTPC_CFG_PARAM_CLOSE_TIMEOUT(27)100: Timeout value for HTTP close

On successful execution, OK is displayed.

Example 3 To configure HTTP close timeout, execute the following command:

AT+HTTPCONF=27,0ERROR:INVALID INPUT

An error is displayed as zero is an invalid input value for timeout. The minimum timeout value supported is 10 milliseconds.

Example 4 To configure HTTP range header, execute the following command:

1VV0301463 Rev. 1.0 Page 271 of 340 2018-01-24

Page 272: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

AT+HTTPCONF=16,Bytes=0-100OK

This command displays files up to the specified bytes.

7.6.1.2 Clear HTTP Client Configuration

This command is used to remove an HTTP client configuration.

Command Syntax AT+HTTPCONFDEL=<Param>

Parameter Description

Table 216, page 272 describes the HTTP Client Configuration Removal parameters.

Table 216 HTTP Client Configuration Removal Parameters

Parameter Optional/Mandatory Description

Param Mandatory GS node removes the HTTP configuration specified by the param. param is the HTTP header and is one of the following.

HTTP_HEADER_AUTHORIZATION (2)HTTP_HEADER_CONNECTION (3)HTTP_HEADER_CONTENT_ENCODING (4)HTTP_HEADER_CONTENT_LENGTH (5)HTTP_HEADER_CONTENT_RANGE (6)HTTP_HEADER_CONTENT_TYPE (7)HTTP_HEADER_DATE (8)HTTP_HEADER_EXPIRES (9)HTTP_HEADER_FROM (10)HTTP_HEADER_HOST (11)HTTP_HEADER_IF_MODIFIED_SINCE (12)HTTP_HEADER_LAST_MODIFIED (13)HTTP_HEADER_LOCATION (14)HTTP_HEADER_PRAGMA (15)HTTP_HEADER_RANGE (16)HTTP_HEADER_REFERER (17)HTTP_HEADER_SERVER (18)HTTP_HEADER_TRANSFER_ENCODING (19)HTTP_HEADER_USER_AGENT (20)HTTP_HEADER_WWW_AUTHENTICATE (21)HTTP_REQUEST_URL (23)HTTP_CFG_PARAM_CLOSE_TIMEOUT(27)HTTP_CFG_PARAM_HEADER_COOKIE(247)HTTP_CFG_PARAM_HEADER_COOKIE2(248)HTTP_CFG_PARAM_HEADER_SET_COOKIE(249)

1VV0301463 Rev. 1.0 Page 272 of 340 2018-01-24

Page 273: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

Synchronous Response

Table 217, page 273 describes the synchronous responses and remarks for HTTP Client Configuration Removal command.

7.6.1.3 Open HTTP Client Connection

This command is used to open an HTTP client connection on the GS node to the server specified by the host name or IP address.

Command Syntax AT+HTTPOPEN=<hostname/IP address>[,<Port Number>,<SSLFlag>,<CertificateName>,<Proxy>,<Connection Timeout>,<ClientCertificateName>,<ClientKeyName>]

Parameter Description

Table 218, page 273 describes the HTTP Client Connection Open parameters.

Table 217 HTTP Client Configuration Removal Synchronous Responses

Responses RemarksOK Success

ERROR Trying to delete a header parameter which is not configured.

ERROR: INVALID INPUT Invalid parameter

NOTE: It is mandatory not to insert any space before the “CertificateName” as the command would fail.

Table 218 HTTP Client Connection Open Parameters

Parameter Optional/Mandatory Value Description

Hostname/IP address Mandatory N/A

The host is either the Fully Qualified Domain name (FQDN) of the server or the IP address of the server to which the HTTP client will open the connection (e.g., www.gainspan.com or 74.208.130.221)

PortNumber Optional N/A

Port number of the server to which the HTTP client will open the connection. The client can specify the port when the server is running on a non-standard port. Default is the standard port - 80 for HTTP and 443 for HTTPs.

SSLFlag Optional0 (default) SSL Disabled1 SSL Enabled

1VV0301463 Rev. 1.0 Page 273 of 340 2018-01-24

Page 274: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

Synchronous Response

Table 219, page 274 describes the synchronous responses and remarks for HTTP Client Connection Open command.

Example http client connection (validating server against date of validity of server certificate) with serverhaving IP address 192.168.2.73

AT+HTTPOPEN=192.168.2.731OK

CertificateName Optional N/A

The name of the CA Certificate to be used for Server Certificate Authentication in case SSL is enabled. The CA Certificate must be provisioned before this.It uses the certificate configuration on the GS node identified by the certificate name.

Proxy Optional N/AThis flag is used only during HTTPS connection through proxy 1 - The HTTPS connection is through proxy server.

ConnectionTimeout Optional 25seconds (default)

This parameter provides the maximum time limit for setting up of the connection with the server.

ClientCertificateName Optional N/AThe client certificate name is required for SSL client authentication and must be provisioned before using this parameter.

ClienKeyName Optional N/AThe client key name is required for SSL client authentication and must be provisioned before using this parameter.

Note: Certificates and Key must be in DER format (To add certificate to the GS node use the AT+TCERTADD command (see 7.2.1 Certificate Addition, page 196).

Table 218 HTTP Client Connection Open Parameters (Continued)

Parameter Optional/Mandatory Value Description

Table 219 HTTP Client Connection Open Synchronous Responses

Responses Remarks<CID> OK Success

ERROR

FailureIf parameters are not valid or if the command is issued before associating to the network.

1VV0301463 Rev. 1.0 Page 274 of 340 2018-01-24

Page 275: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

7.6.1.3.1 Open HTTP Connection Using Non-authenticated Proxy Server

Example The following example provides the AT command sequence to open HTTP connection using Non-Authenticated Proxy server.

• Enable the DHCP client on the GS node.AT+NDHCP=1OK

• Associate with a networkAT+WA=GainSpan,,6IP SubNet Gateway192.168.23.45:255.255.255.0:192.168.23.1OK

• Configure the IP address of Proxy server.AT+HTTPCONF=11,192.168.2.117

• Configure basic authentication of the final HTTP server.AT+HTTPCONF=2,Basic dGVzdDp0ZXN0MTIz

• Configure IP address of the Proxy server with the port number.AT+HTTPOPEN=192.168.2.117,80//**AT+HTTPOPEN=<HOST>,<PORT NUMBER>**//0OK

• Send the final HTTP GET request from GS node to the final HTTP server along with the corresponding URI in the server.AT+HTTPSEND=0,1,100,http://192.168.2.223/test1kb.html//**AT+HTTPSEND=<CID>,<TYPE>,<TIME OUT>,<PAGE>Value of Type is 1 to 7,1: HTTP GET3: HTTP POST **//6&7 is applicable only when GS node is acting as a webserver.

1VV0301463 Rev. 1.0 Page 275 of 340 2018-01-24

Page 276: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

7.6.1.3.2 Open HTTPS Connection Using Non-authenticated Proxy Server

Example The following example provides the AT command sequence to open HTTPS connection using Non-authenticated proxy server by validating the CA certificate.

• Load CA certificate in the GS node.AT+TCERTADD=ca,0,736,0//**AT+TCERTADD=<NAME>,<FORMAT>,<SIZE>,<LOCATION> NAME: Name of the certificateFORMAT: 0, Binary (der format)SIZE: Size of the certificateLOCATION: Flash **//OK

• Enable DHCP client on the GS node.AT+NDHCP=1OK

• Associate with a network.AT+WA=GainSpan,,6IP SubNet Gateway192.168.23.45:255.255.255.0:192.168.23.1OK

• Configure current system time of the GS node.AT+SETTIME=16/12/2014,15:06:00OK

• Display the current system time of the GS node.AT+GETTIME=?16/12/2014,15:6:5,1418742365360OK

• Configure the Proxy server with the IP address and port number of the final HTTPS server.AT+HTTPCONF=23,192.168.2.223:443OK

• Configure IP address of the Proxy Server.AT+HTTPCONF=11,192.168.2.117OK

• Configure basic authentication of the final HTTPS server.AT+HTTPCONF=2,Basic dGVzdDp0ZXN0MTIz OK

• To open the HTTPS connection with final HTTPS server using Non-authenticated proxy server, configure the IP address of Proxy server with the port number.AT+HTTPOPEN=192.168.2.117,80,1,,1 //**AT+HTTPOPEN=<HOST>,<PORT NUMBER>,<SSL FLAG>,,<PROXY>**//0OK

1VV0301463 Rev. 1.0 Page 276 of 340 2018-01-24

Page 277: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

• Send the final HTTPS GET request from GS node to the final HTTPS server along with the corresponding URI in the serverAT+HTTPSEND=0,1,100,https://192.168.2.223/test1kb.html//**AT+HTTPSEND=<CID>,<TYPE>,<TIME OUT>,<PAGE>Value of TYPE is 1 or 3,1: HTTPS GET3: HTTPS POST**//

7.6.1.3.3 Open HTTPS Connection Using Domain Name Verification

GS module verifies the domain name given in the command against the domain name in the incoming server certificate when opening an HTTPS connection.

Example 1 The following example provides the AT command sequence to open HTTPS connection by verifying domain name when log level is set as 1.

• Enable DHCP client on the GS node.AT+NDHCP=1OK

• Associate with a network.AT+WA=GainSpan,,6IP SubNet Gateway192.168.23.45:255.255.255.0:192.168.23.1OK

• Configure current system time of the GS node.AT+SETTIME=26/02/2015,15:06:00OK

• Enable the Domain name check and specify the buffer size which is used to store alternative names provided in the incoming server certificate. The following command stores 100 bytes of alternate names (domain names) in the buffer.AT+SSLCONF=1,100//**AT+SSLCONF=<Domain name check>,<Buffer size>**//OK

• Configure log level to 1 to view warning message when domain name verification fails.AT+LOGLVL=1//When AT=LOGLVL is configured as:0: No warning is provided1: Warning provided with name mismatch2: Warning provided along with the alternate names (domain names) provided in the incoming server certificate**//OK

• Open the HTTPS connection with the host name. If there is a mismatch of host name GS module sends a warning message as shown below. AT+HTTPOPEN=mtsindia.yahoo.com,,1 //**AT+HTTPOPEN=<Host>,,<SSLFlag>**//

1VV0301463 Rev. 1.0 Page 277 of 340 2018-01-24

Page 278: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

IP:46.228.47.1151 warning: certificate mismatchOK

Example 2 The following example provides the AT command sequence to open HTTPS connection by verifying domain name when log level is set as 2.

• Enable DHCP client on the GS node.AT+NDHCP=1OK

• Associate with a network.AT+WA=GainSpan,,6IP SubNet Gateway192.168.23.45:255.255.255.0:192.168.23.1OK

• Configure current system time of the GS node.AT+SETTIME=26/02/2015,15:06:00OK

• Enable the Domain name check and specify the buffer size which is used to store alternative names provided in the incoming server certificate. The following command stores 100 bytes of alternate names (domain names) in the buffer.AT+SSLCONF=1,100//**AT+SSLCONF=<Domain name check>,<Buffer size>**//OK

• Configure log level to 2 to view warning message as well as the buffer content when domain name verification fails.AT+LOGLVL=2//When AT=LOGLVL is configured as:0: No warning is provided1: Warning provided with name mismatch2: Warning provided along with the alternate names (domain names) provided in the incoming server certificate**//OK

• Open the HTTPS connection with the host name. If there is a mismatch of host name GS module sends a warning message along with the buffer content since the log level is set to 2 as shown below.AT+HTTPOPEN=mtsindia.yahoo.com,,1 IP:46.228.47.1151 warning: certificate mismatch: www.yahoo.com www.yahoo.com yahoo.com hsrd.yahoo.com us.yahoo.com

1VV0301463 Rev. 1.0 Page 278 of 340 2018-01-24

Page 279: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

fr.yahoo.com uk.yahoo.comOK

7.6.1.4 Configure Receive Response Headers/Status Line

This command configures the reception HTTP response headers and response status line coming from HTTP server.

Command Syntax AT+HTTPRECVCONF=<CID>,<send status line>,<send http response headers>

Parameter Description

Table 220, page 279 describes the Configuration to Receive Response Headers/Request Line parameters.

Table 220 Configuration to Receive Response Headers/Request Line Parameters

Parameter Optional/Mandatory Value Description

CID MandatoryValue range: 0 to FFormat: Hexadecimal

It specifies the socket identifier allocated to a socket on GS node.

send status line Mandatory

0, 10: Do not receive response status line1: Receive response status lineDefault value:1

When MCU wants to receive response status line, set this parameter to 1

send http response headers Mandatory

Hexadecimal value of the response header’s bit position. Table 221, page 280 lists various response headers.

It specifies the bitmap for registering individual HTTP headers. MCU can register for various headers by setting the specific bit position in this parameter as specified in Table 221, page 280.Example: Configure the parameter to support GSN_HTTP_HEADER_CONNECTION (1) and GSN_HTTP_HEADER_CONTENT_ENCODING (2)• Calculate the binary value of the

response header’s bit position which is 110

• Convert the binary value to hexadecimal value which is 6

The command will be as follows:AT+HTTPRECVCONF=0,1,6

1VV0301463 Rev. 1.0 Page 279 of 340 2018-01-24

Page 280: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

Note: 1. GSN_HTTP_HEADER_CUSTOM can be used to register for response headers apart from mentioned values. In case multiple custom headers coming in HTTP request, all the custom headers will be passed to the MCU.

Synchronous Response

Table 222, page 281 describes the synchronous responses and remarks for Configuration to Receive Headers/Status Line command.

Table 221 Send HTTP Response Headers

Header Name/ValueGSN_HTTP_HEADER_ALLOW(1)GSN_HTTP_HEADER_AUTHORIZATION (2) GSN_HTTP_HEADER_CONNECTION (3) GSN_HTTP_HEADER_CONTENT_ENCODING (4)GSN_HTTP_HEADER_CONTENT_LENGTH (5)GSN_HTTP_HEADER_CONTENT_RANGE (6) GSN_HTTP_HEADER_CONTENT_TYPE (7) GSN_HTTP_HEADER_COOKIE(8)GSN_HTTP_HEADER_COOKIE2(9)GSN_HTTP_HEADER_DATE (10) GSN_HTTP_HEADER_EXPIRES (11) GSN_HTTP_HEADER_FROM (12) GSN_HTTP_HEADER_HOST (13) GSN_HTTP_HEADER_IF_MODIFIED_SINCE (14) GSN_HTTP_HEADER_LAST_MODIFIED (15)GSN_HTTP_HEADER_LOCATION (16) GSN_HTTP_HEADER_PRAGMA (17) GSN_HTTP_HEADER_RANGE (18) GSN_HTTP_HEADER_REFERER (19) GSN_HTTP_HEADER_SERVER (20) GSN_HTTP_HEADER_SET_COOKIE(21)GSN_HTTP_HEADER_TRANSFER_ENCODING (22) GSN_HTTP_HEADER_USER_AGENT (23) GSN_HTTP_HEADER_WWW_AUTNENTICATE(24)GSN_HTTP_HEADER_CUSTOM(32)

1VV0301463 Rev. 1.0 Page 280 of 340 2018-01-24

Page 281: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

7.6.1.5 Exchange/Send Data with HTTP Client

This command is used to Get/Post HTTP data on the HTTP client. The content can be transferred using the escape sequence mentioned previously.

Command Syntax AT+HTTPSEND=<CID>,<Type>,<Timeout>,<Page>,<Size of data>,[<Send response status line>,<Send response headers count>]

MCU sends data using the following Escape <ESC> sequence:ESC<H><CID><Data of above size>

Parameter Description

Table 223, page 281 describes the HTTP Client Get/Post parameters.

Table 222 Configuration to Receive Response Headers/Status Line Synchronous Responses

Responses RemarksOK Success

ERROR:INVALID INPUT If parameters are not valid and if GSLink is not enabled in the binary.

Table 223 HTTP Client Get/Post Parameters

Parameter Optional/Mandatory Value Description

CID MandatoryValue range: 0 to FFormat: Hexadecimal

It specifies the socket identifier allocated to a socket on GS node.

Type MandatoryValue range: 1 to 7Format: Decimal

GSN_HTTP_METHOD_GET (1)GSN_HTTP_METHOD_HEAD (2)GSN_HTTP_METHOD_POST (3)GSN_HTTP_METHOD_PUT (4)GSN_HTTP_METHOD_DELETE (5)GSN_HTTP_METHOD_GETRESP (6)GSN_HTTP_METHOD_POSTRESP (7)

Timeout MandatoryFormat: DecimalUnit: Seconds

Timeout value is in seconds

Page Mandatory Format: String The page/script being accessed (e.g., /index.html)

1VV0301463 Rev. 1.0 Page 281 of 340 2018-01-24

Page 282: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

If HTTP connection is opened by enabling SSL encryption, this command encrypts data based on the encrypt key in SSL connection structure (before data is sent through Network layer) for a specific CID. The encrypted data is then sent through the Network layer.

Receive is implicit in AT+HTTPSEND based on HTTPS Server's response to the sent data. Received data is asynchronous and should be handled accordingly.

The response from server is sent to the host in one or more chunks with maximum size of 2048 bytes. Each chunk is of the format:

<ESC>H<1Byte-CID><4 bytes–Length of the data><data>

The data part of first chunk of the response will have the status line at the beginning. The status line contains the status code and the status phrase. This will be in the format:

<status code><space><status phrase>\r\n

After the last chunk, OK/ERROR is sent to the host.

Synchronous Response

Table 224, page 282 describes the synchronous responses and remarks for HTTP Client Get/Post command.

Size of data MandatoryFormat: StringMaximum value: 1460 bytes

Actual content size. Optional in case of GET.Note: It is recommended to use when sending data from

MCU as part for GSN_HTTP_METHOD_GETRESPor GSN_HTTP_METHOD_POSTRESP

Send response status line Optional

Value range: 0, 1Format: Decimal

When MCU wants to send custom response status line, set this parameter to 1.• 0: Do not send custom response status line• 1: Send custom response status line

Send response headers count Optional

Value range: 0 or Number of different custom headers which are required to be sent

When MCU wants to send custom response headers, set this parameter to number of different custom headers which are required to be sent.Set this argument to 0, if no custom headers are to be sent.

Table 223 HTTP Client Get/Post Parameters (Continued)

Parameter Optional/Mandatory Value Description

Table 224 HTTP Client Get/Post Synchronous Responses

Responses RemarksOK SuccessERROR:INVALID INPUT If parameters are not valid.

1VV0301463 Rev. 1.0 Page 282 of 340 2018-01-24

Page 283: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

7.6.1.6 Store HTTP Client Configuration

This command is used to store the connection parameters of an HTTP client connected to a remote server with IPv4 address.

Command Syntax AT+HTTPSTORE=<CID>

Parameter Description

Table 225, page 283 describes the Store HTTP client configuration command parameters.

Synchronous Response

Table 226, page 283 describes the synchronous responses and remarks for the Store HTTP client configuration command.

NOTE: This command should be issued after establishing HTTP connection and before going to standby. In case of HTTPs, this command internally takes care of the SSL session related connection parameters to store the necessary security settings.

Table 225 Store HTTP Client Configuration Parameters

Parameter Optional/Mandatory Value Description

CID MandatoryValue range: 0 to FFormat: Hexadecimal

It specifies the socket identifier allocated to a socket on GS node.

Table 226 Store HTTP Client Configuration Synchronous Responses

Responses RemarksOK SuccessERROR:INVALID INPUT If parameters are not valid.

1VV0301463 Rev. 1.0 Page 283 of 340 2018-01-24

Page 284: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

7.6.1.7 Restore HTTP Client Configuration

This command is used to restore the connection parameters previously stored through AT+HTTPSTORE command.

Command Syntax AT+HTTPRESTORE=<CID>

Parameter Description

Table 227, page 284 describes the Restore HTTP client configuration command parameters.

Synchronous Response

Table 228, page 284 describes the synchronous responses and remarks for the Store HTTP client configuration command.

NOTE: This command should be issued after coming out of standby and all the L3 and below layer connections are properly restored. In case of HTTPS, this command internally takes care of the SSL session related connection parameters to restore the necessary security settings.

Table 227 Restore HTTP Client Configuration Parameters

Parameter Optional/Mandatory Value Description

CID MandatoryValue range: 0 to FFormat: Hexadecimal

It specifies the socket identifier allocated to a socket on GS node.

Table 228 Restore HTTP Client Configuration Synchronous Responses

Responses RemarksOK SuccessERROR:INVALID INPUT If parameters are not valid.

1VV0301463 Rev. 1.0 Page 284 of 340 2018-01-24

Page 285: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

7.6.1.8 Close HTTP Client

This command is used to close the HTTP client connection identified by the CID.

Command Syntax AT+HTTPCLOSE=<CID>

Parameter Description

Table 229, page 285 describes the Close HTTP client command parameters.

Synchronous Response

Table 230, page 285 describes the synchronous responses and remarks for the Store HTTP client configuration command.

Table 229 Close HTTP Client Parameters

Parameter Optional/Mandatory Value Description

CID MandatoryValue range: 0 to FFormat: Hexadecimal

It specifies the socket identifier allocated to a socket on GS node.

Table 230 Close HTTP Client Synchronous Responses

Responses RemarksOK SuccessERROR:INVALID INPUT If parameters are not valid.

1VV0301463 Rev. 1.0 Page 285 of 340 2018-01-24

Page 286: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

7.6.2 HTTP(S) Server

7.6.2.1 HTTP Server Redirection

This command is used to add the redirection URL on the GS node.

Command Syntax AT+NURIREDIR=<URL>

Parameter Description

Table 231, page 286 describes the HTTPD Redirection parameters.

Example - In limited AP mode

AT+WM=2OK

AT+NSET=192.168.12.1,255.255.255.0,192.168.12.1OKAT+WA=GAINSPANDEMO,,6OkAT+DHSCPSRVR=1OKAT+DNS=1

AT+WEBPROV=,,OKAT+NURIREDIR=/tls.htmlOK

Table 231 HTTPD Redirection Parameters

Parameter Optional/Mandatory Value Description

URL Mandatory Max URL length is 64 bytes

URL is the address of the redirection page.

1VV0301463 Rev. 1.0 Page 286 of 340 2018-01-24

Page 287: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

7.6.2.2 Start/Stop Web Server

This command is used to start/stop the web server.

Command Syntax AT+WEBSERVER=n,<user name>,<password>,[1=SSL enable/0=SSL disable],[idle timeout],[Response timeout]

Parameter Description

Table 232, page 287 describes the Start/Stop Webserver parameters.

Table 232 Start/Stop Webserver Parameters

Parameter Optional/Mandatory Value Description

n MandatoryValue range: 0,1Default value: 0

It specifies whether webserver is started or stopped.• 0: Stop• 1: Start

user name Mandatory

Any valid string with maximum length of 16 characters.Default value: admin

It specifies the username of the webserver. If default username from the SDK Builder needs to be used, then issue DEFAULT. If username is not provided in the SDK Builder, then use “admin”.If this parameter is left blank, then authentication is disabled.

password Mandatory

Any valid string with maximum length of 16 characters.Default value: admin

It specifies the password for the webserver. If default password from the factory default area needs to be used, then issue DEFAULT. If password is not provided in the factory default area, use “admin”.

SSL Enable/Disable Optional Value range: 0,1

It specifies whether SSL is enabled or not.• 0: Disable• 1: Enable

Idle timeout (seconds) Optional 120 seconds (default)

It specifies the time-frame GS node waits for HTTP data. If no data is transferred within the idle time, then HTTP connection is removed by the client or GS node itself.

Response Timeout (milliseconds) Optional

Maximum value - 100000 milliseconds (100 seconds)

Response timeout restricts MCU (host) to respond within a specified time.Note: Response timeout should be less than 120 seconds

1VV0301463 Rev. 1.0 Page 287 of 340 2018-01-24

Page 288: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

Synchronous Response

Table 233, page 288 describes the synchronous responses and remarks for Start/Stop Webserver command.

Example To configure GS node with idle timeout as 5 seconds and response timeout as 2 seconds, execute the following command:

AT+WEBSERVER=1,admin,admin,0,5,2000OK

7.6.2.3 Web Server Status

This command is used to output the current status (started or stopped) of the web server and displays the registered URIs.

Command Syntax AT+WEBSERVER=?

Synchronous Response

Table 234, page 288 describes the synchronous responses and remarks for the Web server status command.

Table 233 Start/Stop Webserver Synchronous Responses

Responses RemarksOK SuccessERROR:INVALID INPUT If parameters are not valid.

NOTE: The max timeout that can be configured for HTTP Server is 90seconds since the main task sys qual is set to 90seconds.

Table 234 Webs erver Status Synchronous Responses

Responses Remarks<CR><LF>Webserver<SP>Started<SP>URI:/gainspan/profile/mcu<CR><LF>OK<CR><LF>

Success When Web server is started.

<CR><LF>Webserver<SP>Stopped<CR><LF>OK<CR><LF>

Success When Web server is stopped.

<CR><LF>ERROR:<SP>INVALID INPUT<CR><LF>

FailureIf parameter is not valid.

<CR><LF>ERROR<CR><LF> FailureWhen double question mark (??) is issued.

1VV0301463 Rev. 1.0 Page 288 of 340 2018-01-24

Page 289: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

P

HostNa

QDN) the

PortNue pecify d port.

ClientI Client cters.

7.7 MQTT Client

7.7.1 MQTT Client ConnectThis Command is used to connect to an MQTT Server. It creates a MQTT network connection and send MQTT CONNECT Packet.

Command Syntax AT+MQTTCONNECT=<HostName/IPAddress>,<PortNumber>,<ClientID>[,<UserName>,<Password>,<SSLFlag>,<CertificateName>,<ClientCertificateName>,<ClientKeyName>,ConnectionTimeout>]

Parameter Description

Table 235, page 289 describes the MQTT Client Connect configuration parameters.

NOTE: GS node supports 8 connections when established.

NOTE: 1).With multiple feature selection along with MQTT over SSL will lead to memory issues it could be while opening the connections or while data transfer and reception.As the heap available is not enough for the two MQTT connections with client certificates configured, with less heap the behavior is non-predictive.Issue does not occur in the following cases: a). if there is only one connection b). If two connections are present but no client cert and key are configured. 2). Supports a maximum of 4 connections.

Table 235 MQTT Client Connect Configuration Parameters

arameter Optional/Mandatory Value Description

me/IP Address Mandatory N/A

It is the host either Fully Qualified Domain name (Fof the server or the IP address of the server to whichMQTT client opens the connection.For example: api.devicewise.com or 54.175.125.23

mber MandatoryDefault Std Port:1833: MQTT Client,8883: MQTT over SSL

This gives the Port number of the server to which thMQTT client opens the connection. The client can sthe port when the server is running on a non-standar

D Mandatory N/AIt is the Client connecting to the Server with a uniqueIdentifier.It is the user defined string of ASCII charaExample: GS2K_001122.

1VV0301463 Rev. 1.0 Page 289 of 340 2018-01-24

Page 290: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

UserNa t.

Passwo by the

SSLFla ver.

Certific

rver

ClientCName

be

ClientK be

Connec

P

Synchronous Response

Table 236, page 290 describes the synchronous responses and remarks for MQTT Client Connect Configuration command.

Example 1 AT+MQTTCONNECT=api.devicewise.com,1883,gs2k_178db1,GainSpanDemo_App,DemoForGainSpanApp,0,,,,30

me OptionalValue range: N/AFormat: StringDefault value: N/A

It specifies the UTF-8 encoded string along with thepassword used by the server to authenticate the clien

rd OptionalValue range: N/AFormat: IntegerDefault value: N/A

It specifies the binary data used along with usernameserver to authenticate the cloud.It is mandatory for TELIT device cloud.

g Optional0- Disable,1-EnableDefault - 0

This is used to enable the SSL connection to the ser

ateName Optional N/A

It is the name of the CA Certificate to be used for SeCertificate Authentication in case SSL is Enabled. The CA Certificate must be provisioned before Authentication.It uses the certificate configuration on the GS node identified by the certificate name.

ertificate Optional N/A It is required for SSL client authentication and mustprovisioned before using this parameter.

ey Name Optional N/A It is required for SSL client authentication and mustprovisioned before using this parameter.

tionTimeout Optional Default - 30Seconds It provides the maximum time limit for setting the connection with the server.

Table 235 MQTT Client Connect Configuration Parameters (Continued)

arameter Optional/Mandatory Value Description

Table 236 MQTT Client Connect Configuration Synchronous Responses

Responses Remarks<IP>:<xxx.xxx.xxx.xxx><CID>OK

Success

<IP>:< xxx.xxx.xxx.xxx>ERROR

FailureIf Invalid Server IP/Host/client ID/Token

ERROR: INVALID INPUTFailureIf parameters are not valid.

1VV0301463 Rev. 1.0 Page 290 of 340 2018-01-24

Page 291: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

CID sing

Topi ata

Leng

QoS

Reta

re

ge ed

Where,

HostName - api.devicewise.com

PortNumber – 1883

ClientID - gs2k_178db1

ApplicationName - GainSpanDemo_App

Token – DemoForGainSpanApp

SSLFlag – 0

ConnectionTimeout – 30 seconds

7.7.2 MQTT Client PublishThis Command is used to send an Application Messages from client to the server.

Command Syntax AT+MQTTPUBLISH=<CID>,<TopicName>,<Length>,<Qos>[,<Retain Flag>]

MCU sends MQTT data using the following Escape <ESC> sequence:<ESC>N<CID><DataofaboveLength>

Parameter Description

Table 237, page 291 describes the MQTT Client Publish configuration parameters.

Table 237 MQTT Client Publish Configuration Parameters

Parameter Optional/Mandatory Value Description

Mandatory 0 to 9, a-fIt specifies the socket or the client identifier (CID) allocated to a socket on GS node. Its value is obtained uthe AT+MQTTCONNECT command.

cName Mandatory String It identifies the information channel to which payload dis published.

th Mandatory N/A It is the actual content size.

Mandatory

0,1,2Currently supported in 0 and 1 only

It specifies the level of assurance for delivery of the application message.

inFlag Optional0,1Default - 0

If it is set to 1, the Server MUST store the ApplicationMessage and its QoS, so that it can be delivered to futusubscribers whose subscriptions match its topic name.If it is set to 0, the Server MUST NOT store the messaand MUST NOT remove or replace any existing retainmessage.

1VV0301463 Rev. 1.0 Page 291 of 340 2018-01-24

Page 292: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

Synchronous Response

Table 238, page 292 describes the synchronous responses and remarks for MQTT Client Publish Configuration command.

Example 1 AT+MQTTPUBLISH=0,thing/GainSpanDemo_App/property/light,3,1,0

Where,

CID – 0

Topic Name – thing/GainSpanDemo_App/property/light

Length - 3

QoS – 1

RetainFlag – 0

<ESC>N0123

Where,

Start of Escape command - <ESC>N,

Connection Identifier – 0

Data - 123

7.7.3 MQTT Client SubscribeThis command is used to send subscribe Packet from the Client to the Server to create one or more Subscriptions. It contains a list of Topic Filters indicating the topics to which the Client wants to subscribe. It must contain at least one Topic Filter or Qos Pair.

Command Syntax AT+ MQTTSUBSCRIBE = <CID>,< TopicName>,<QoS>[,<Timeout>]

Parameter Description

Table 239, page 293 describes the MQTT Client Subscribe configuration parameters.

Table 238 MQTT Client Publish Configuration Synchronous Responses

Responses RemarksOK Success

ERROR: INVALID CIDFailureInvalid Socket/Client Identifier.

ERROR: INVALID INPUTFailureIf parameters are not valid.

1VV0301463 Rev. 1.0 Page 292 of 340 2018-01-24

Page 293: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

CID sing

Topi ata

QoS an

Time r

Synchronous Response

Table 240, page 293 describes the synchronous responses and remarks for MQTT Client Publish Configuration command.

Example 1 AT+MQTTSUBSCRIBE= 0,notify/mailbox_activity,1,0

Where,

CID - 0;

TopicName - notify/mailbox_activity;

QoS - 1;

Timeout – 0.

7.7.4 MQTT Client DisconnectThis command is used to close the MQTT client connection identified by the CID.

Command Syntax AT+MQTTDISCONNECT=<CID>

Table 239 MQTT Client Subscribe Configuration Parameters

Parameter Optional/Mandatory Value Description

Mandatory 0 to 9, a-fIt specifies the socket or the client identifier (CID) allocated to a socket on GS node. Its value is obtained uthe AT+MQTTCONNECT command.

cName Mandatory String It identifies the information channel to which payload dis published.

Mandatory

0,1,2Currently supported in 0 and 1 only

It gives the maximum QoS level at which the Server csend Application Messages to the Client.

out Optional Default - 60Seconds

It provides the Subscription Acknowledge time limit fosetting up the acknowledgment from the server.

Table 240 MQTT Client Publish Configuration Synchronous Responses

Responses RemarksOK Success

ERROR: INVALID CIDFailureInvalid Socket/Client Identifier.

ERROR: INVALID INPUTFailureIf parameters are not valid.

1VV0301463 Rev. 1.0 Page 293 of 340 2018-01-24

Page 294: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

CID sing

CID

Parameter Description

Table 241, page 294 describes the MQTT Client Disconnect configuration parameters.

Synchronous Response

Table 242, page 294 describes the synchronous responses and remarks for MQTT Client Disconnect Configuration command.

Example 1 AT+MQTTDISCONNECT=0

Where,

Connection Identifier(CID) - 0

7.7.5 Store MQTT ClientThis command is used to store the connection parameter of an MQTT client connected to a remote server.

Command Syntax AT+MQTTSTORE=<CID>

Parameter Description

Table 243, page 294 describes the Store MQTT Client configuration parameters.

Table 241 MQTT Client Disconnect Configuration Parameters

Parameter Optional/Mandatory Value Description

Mandatory 0 to 9a-fIt specifies the socket or the client identifier (CID) allocated to a socket on GS node. Its value is obtained uthe AT+MQTTCONNECT command.

Table 242 MQTT Client Disconnect Configuration Synchronous Responses

Responses RemarksOK Success

ERROR: INVALID CIDFailureInvalid Socket/Client Identifier.

ERROR: INVALID INPUTFailureIf parameters are not valid.

Table 243 Store MQTT Client Configuration Parameters

Parameter Optional/Mandatory Value Description

Mandatory 0-9, a-f It specifies the socket or the client identifier (CID) allocated to a socket on GS node.

1VV0301463 Rev. 1.0 Page 294 of 340 2018-01-24

Page 295: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

CID

Synchronous Response

Table 244, page 295 describes the synchronous responses and remarks for Store MQTT Client Configuration command.

Example 1 AT+MQTTSTORE=0

7.7.6 Restore MQTT ClientThis command is used to restore the connection parameters which was previously stored using AT+MQTTSTORE command

Command Syntax AT+MQTTRESTORE=<CID>

Parameter Description

Table 245, page 295 describes the Restore MQTT Client configuration parameters.

Synchronous Response

Table 246, page 295 describes the synchronous responses and remarks for Restore MQTT Client Configuration command.

Table 244 Store MQTT Client Configuration Synchronous Responses

Responses RemarksOK Success

ERROR: INVALID CIDFailureInvalid Socket/Client Identifier.

ERROR: INVALID INPUTFailureIf parameters are not valid.

Table 245 Restore MQTT Client Configuration Parameters

Parameter Optional/Mandatory Value Description

Mandatory0-9, a-fFormat: Hexadecimal

It specifies the socket or the client identifier (CID) allocated to a socket on GS node.

Table 246 Restore MQTT Client Configuration Synchronous Responses

Responses RemarksOK Success

ERROR: INVALID CIDFailureInvalid Socket/Client Identifier.

ERROR: INVALID INPUTFailureIf parameters are not valid.

1VV0301463 Rev. 1.0 Page 295 of 340 2018-01-24

Page 296: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

CID

Time

Example 1 AT+MQTTRESTORE=0

7.7.7 MQTT PingThis command is used to send the device a ping through the remote MQTT server specified by the connection identifier

Command Syntax AT+MQTTPING=<CID>,<Timeout>

Parameter Description

Table 247, page 296 describes the MQTT Ping configuration parameters.

Example 1 AT+MQTTPING=0,30

OK

7.7.8 Receive MQTT DataGS node sends MQTT data using the following Escape <ESC> sequence

Asynchronous Data <ESC><N><CID><StartOfFrame><CurrentLength><Total Length Of Frame><TopicName><Space><Data Of Length Equal to CurrentLength>

Asynchronous Data Parameter Description

Table 248, page 296 describes the Receive MQTT data (ESC N) parameters.

Table 247 MQTT Ping Configuration Parameters

Parameter Optional/Mandatory Value Description

Mandatory 0-9, a-f It specifies the socket or the client identifier (CID) allocated to a socket on GS node.

out Mandatory Default: 30Seconds.

It specifies the time taken to receive the MQTT ping response from MQTT server

Table 248 Receive MQTT Data (ESC N) Parameters

Parameter Optional/Mandatory Value Description

ESC N N/A N/A This is sent repeatedly for each fragment of the data frame.

CID N/AValue range: 0 to FFormat: HexaDecimal

It specifies the socket identifier allocated to a socket on GS node.

StartOf Frame N/AValue range: 0,1Format: Byte

It specifies the value for the parameter which is 1 for the very first frame and the rest of the data frame should have StartOfFrame as 0.

1VV0301463 Rev. 1.0 Page 296 of 340 2018-01-24

Page 297: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

The value of the StartOfFrame will be 1 at the start of the frame, the subsequent data will be sent to the host in the format:

<ESC><N><CID><StartOfFrame><CurrentLength><Data Of Length Equal to CurrentLength>

In this case the value of the <StartOfFrame> will be 0.

CurrentLength N/AValue range: 4BytesFormat: Decimal

It specifies the length of the current data.

Total Length Of FrameN/AValue range: 4BytesFormat: Decimal

It specifies the total length of the data.

TopicName N/A Format: String It identifies the information channel to which data is subscribed.

Table 248 Receive MQTT Data (ESC N) Parameters (Continued)

Parameter Optional/Mandatory Value Description

1VV0301463 Rev. 1.0 Page 297 of 340 2018-01-24

Page 298: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

P

Parame

n er per

l with oxy ified

shing proxy

Parame lue is

th.

7.8 WebSocket Client

7.8.1 WebSocket Client ConfigurationThis command is used to configure the header that is to be sent during the connection handshake.

Command Syntax AT+WEBSOCKCONF=<ParameterType>,<ParameterValue>

Parameter Description

Table 249, page 298 describes the WebSocket Client configuration parameters.

Synchronous Response

Table 250, page 299 describes the synchronous responses and remarks for WebSocket Client Configuration command.

Table 249 WebSocket Client Configuration Parameters

arameter Optional/Mandatory Value Description

terType Mandatory

Value: 1,2,31: Connection Header2: Proxy Header3: Proxy Request Path

It specifies that, 1 is the header used during Web Socket connection establishment (Upgrade request). Multiple connectioheaders can be specified using this value with 1 headcommand.2 is the header used during establishing the SSL tunneproxy server. The header is configured only if the prserver is present.Multiple proxy headers can be specusing this value with 1 header per command.3 is the request path to be used at the time of establithe SSL tunnel with proxy server and is only used ifserver is present

terValue Mandatory Format-String

It is the string that depends on the Parameter type. If the parameter type is 1 or 2, then the parameter vain the format <header name>: <header value>.If the parameter is 3, then it is a string of request pa

NOTE: 1.)The web socket specific header “Upgrade”, Connection”, Sec-WebSocket-Key’ and “Sec-WebSocket-Version” are set internally. 2.) The only mandatory connection header to be configured is “Host:<Hostname/IP Address of the server>”.

1VV0301463 Rev. 1.0 Page 298 of 340 2018-01-24

Page 299: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

P

CID in GS

Example 1 AT+WEBSOCKCONF=1,HOST:echo.websocket.org

7.8.2 Store WebSocket Client ConfigurationThis command is used to store the connection parameters of WebSocket client connected to a remote server.

Command Syntax AT+WEBSOCKSTORE=<CID>

Parameter Description

Table 251, page 299 describes the Store WebSocket Client configuration parameters.

Synchronous Response

Table 252, page 299 describes the synchronous responses and remarks for Store WebSocket Client Configuration command.

Table 250 WebSocket Client Configuration Synchronous Responses

Responses RemarksOK Success

ERROR: INVALID INPUTFailureIf parameters are not valid.

Table 251 Store WebSocket Client Configuration Parameters

arameter Optional/Mandatory Value Description

Mandatory Value: 0 to F It specifies the socket identifier allocated to a socketNode.

Table 252 Store WebSocket Client Configuration Synchronous Responses

Responses RemarksOK Success

ERROR: INVALID INPUTFailureIf parameters are not valid.

1VV0301463 Rev. 1.0 Page 299 of 340 2018-01-24

Page 300: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

P

CID in GS

P

Value using

7.8.3 Restore WebSocket Client ConfigurationThis command is used to restore the connection parameters previously stored through the command AT+WEBSOCKSTORE

Command Syntax AT+WEBSOCKRESTORE=<CID>

Parameter Description

Table 253, page 300 describes the Restore WebSocket Client configuration parameters.

Synchronous Response

Table 253, page 300 describes the synchronous responses and remarks for Restore WebSocket Client Configuration command.

7.8.4 Clear WebSocket Client ConfigurationThis command is used to remove the WebSocket client configuration.

Command Syntax AT+WEBSOCKCONFDEL=<Value>

Parameter Description

Table 255, page 300 describes the Clear WebSocket Client configuration parameters.

Table 253 Restore WebSocket Client Configuration Parameters

arameter Optional/Mandatory Value Description

Mandatory Value: 0 to F It specifies the socket identifier allocated to a socketNode.

Table 254 Restore WebSocket Client Configuration Synchronous Responses

Responses RemarksOK Success

ERROR: INVALID INPUTFailureIf parameters are not valid.

Table 255 Clear WebSocket Client Configuration Parameters

arameter Optional/Mandatory Value Description

Mandatory N/A It removes the websocket configuration configured AT+WEBSOCKCONF.

1VV0301463 Rev. 1.0 Page 300 of 340 2018-01-24

Page 301: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

P

HostNa ch the

PortNu an

Reques

SSLFla ver.

Synchronous Response

Table 256, page 301 describes the synchronous responses and remarks for Clear WebSocket Client Configuration command.

Example 1 AT+WEBSOCKCONFDEL=HOST:echo.websocket.org

OK

7.8.5 Open WebSocket Client ConnectionThis command is used to open the WebSocket client connection to the server specified by the Host Name or IP Address.

Command Syntax AT+WEBSOCKOPEN=<HostName/IP Address>,<PortNumber>,<RequestPath>,[<SSLFlag>, <CertificateName>,<Proxy>,<ConnectionTimeout>,<ClientCertificateName>,<ClientKeyName>]

Parameter Description

Table 257, page 301 describes the Open WebSocket Client Connection configuration parameters.

Table 256 Clear WebSocket Client Configuration Synchronous Responses

Responses RemarksOK SuccessERROR Failure

ERROR: INVALID INPUTFailureIf parameters are not valid.

Table 257 Open WebSocket Client Connection Configuration Parameters

arameter Optional/Mandatory Value Description

me/IP Address Mandatory N/A It is the Host name or IP Address of the server to whiWebSocket Client opens the connection.

mber Mandatory

Default Std Port -TCP/IP Port80: WebSocket Server,TCP/IP Port443: WebSocket over SSL

It gives the Port number of the server to which the WebSocket client opens the connection. The client cspecify the port when the server is running on a non-standard port.

tPath Mandatory N/A Request URI is used in WebSocket upgrade request

g Optional0- Disable,1-EnableDefault - 0

Thia is used to enable the SSL connection to the ser

1VV0301463 Rev. 1.0 Page 301 of 340 2018-01-24

Page 302: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

Certific

rver

ProxyL

ClientCName

be

ClientK be

Connec

P

Synchronous Response

Table 258, page 302 describes the synchronous responses and remarks for Open WebSocket Client Connection Configuration command.

Example 1 AT+WEBSOCKOPEN=174.129.224.73,,/

Where,

Server IP:172.129.224.73

RequestPath: / (empty request)

ateName Optional N/A

It is the name of the CA Certificate to be used for SeCertificate Authentication in case SSL is Enabled. The CA Certificate must be provisioned before Authentication.It uses the certificate configuration on the GS node identified by the certificate name.

Optional N/AThis flag is used only during WebSocket through SSconnection through proxy 1 - The WSS connection through proxy server.

ertificate Optional N/A It is required for SSL client authentication and mustprovisioned before using this parameter.

ey Name Optional N/A It is required for SSL client authentication and mustprovisioned before using this parameter.

tionTimeout Optional Default - 25Seconds It provides the maximum time limit for setting the connection with the server.

Table 257 Open WebSocket Client Connection Configuration Parameters (Continued)

arameter Optional/Mandatory Value Description

Table 258 Open WebSocket Client Connection Configuration Synchronous Responses

Responses Remarks<IP>:<xxx.xxx.xxx.xxx><CID>OK

Success

ERROR

ERROR: INVALID INPUTFailureIf parameters are not valid.

1VV0301463 Rev. 1.0 Page 302 of 340 2018-01-24

Page 303: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

P

CID

socket

N

TimeouLength

IsBinarext or et to

7.8.6 Send Data with WebSocket ClientThis command is used to send the data to server connected. The content is transferred using escape sequence.

Command Syntax AT+WEBSOCKSEND= <CID>,<Timeout>,<Length>,[<IsBinary>]

MCU sends WebSocket data using the following Escape <ESC> sequence:<ESC>i<CID><Data of above Length>

Parameter Description

Table 259, page 303 describes the Send Data with WebSocket Client configuration parameters.

Synchronous Response

Table 260, page 304 describes the synchronous responses and remarks for Send Data with WebSocket Client Configuration command.

NOTE: 1).WebSocket over SSL supports only 4 CID. 2).With multiple feature selection along with WebSocket over SSL will lead to memory issues it could be while opening the connections or while data transfer and reception.As the heap available is not enough for the two websocket connections with client certificates configured, with less heap the behavior is non-predictive.Issue does not occur in the following cases: a). if there is only one connection b). If two connections are present but no client cert and key are configured. 3). Supports a maximum of 4 connections.

Table 259 Send Data with WebSocket Client Configuration Parameters

arameter Optional/Mandatory Value Description

Mandatory 0-9, a-f

It specifies the socket identifier (CID) allocated to a on GS node.Its value is obtained using the AT+WEBSOCKOPEcommand.

t Mandatory N/A It is the waiting time before the Response (seconds)Mandatory N/A It is the length of the payload sent with the Request.

y Mandatory0-Data is Text1-Data is Binary

It specifies the data sent over WebSocket can be in TBinary format, by default the data type (opcode) is s“Text”

1VV0301463 Rev. 1.0 Page 303 of 340 2018-01-24

Page 304: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

Example 1 AT+WEBSOCKSEND=0,100,100,1

<ESC>I0GainSpan01

Where,

<ESC>i – Start of escape sequence

0 - Connection Identifier

GainSpan - Data

1- IsBinary

7.8.7 Receive WebSocket DataGS node sends WebSocket data using the following Escape <ESC> sequence

Asynchronous Data <ESC><I><CID><EndofMessage><opcode><data Length><Data Of Length Equal to CurrentLength>

Asynchronous Data Parameter Description

Table 261, page 304 describes the Receive WebSocket data (ESC I) parameters.

Table 260 Send Data with WebSocket Client Configuration Synchronous Responses

Responses RemarksOK SuccessERROR

ERROR: INVALID INPUTFailureIf parameters are not valid.

Table 261 Receive WebSocket Data (ESC I) Parameters

Parameter Optional/Mandatory Value Description

ESC I N/A N/A This is sent repeatedly for each fragment of the data frame.

CID N/AValue range: 0 to FFormat: HexaDecimal

It specifies the socket identifier allocated to a socket on GS node.

1VV0301463 Rev. 1.0 Page 304 of 340 2018-01-24

Page 305: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

P

CID

socket

N

7.8.8 Close WebSocket ClientThis command is used to close the WebSocket client connection identified by the Connection Identifier.

Command Syntax AT+WEBSOCKCLOSE=<CID>

Parameter Description

Table 262, page 305 describes the Close WebSocket Client configuration parameters.

Synchronous Response

Table 263, page 305 describes the synchronous responses and remarks for Close WebSocket Client Configuration command.

EndofMessege N/AValue range: 0,1Format: Byte

It specifies the value for the parameter which is set to 1 for the last chunk of WebSocket data received. And the rest of the data frame is set to 0.

opcode N/A

Value range: 1,21: Text Data2: Binary DataFormat: Byte

It specifies the data type in the WebSocket message.

Data Length N/AValue range: 4BytesFormat: Decimal

It specifies the length of the data.

Table 261 Receive WebSocket Data (ESC I) Parameters (Continued)

Parameter Optional/Mandatory Value Description

Table 262 Close WebSocket Client Configuration Parameters

arameter Optional/Mandatory Value Description

Mandatory 0-9, a-f

It specifies the socket identifier (CID) allocated to a on GS node.Its value is obtained using the AT+WEBSOCKOPEcommand.

Table 263 Close WebSocket Client Configuration Synchronous Responses

Responses RemarksOK Success

ERROR: INVALID INPUTFailureIf parameters are not valid.

1VV0301463 Rev. 1.0 Page 305 of 340 2018-01-24

Page 306: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

P

CID

socket

N

Time O er.

Payload

Example 1 AT+WEBSOCKCLOSE=0

Where, 0 – Connection Identifier

7.8.9 WebSocket PingThis command is used to send a ping from the device to the WebSocket server.

Command Syntax AT+WEBSOCKPING=<CID>,<Time Out>,<Payload>

Parameter Description

Table 264, page 306 describes the WebSocket Ping configuration parameters.

Synchronous Response

Table 265, page 306 describes the synchronous responses and remarks for WebSocket Ping Configuration command.

Example AT+WEBSOCKPING=0,10,Gainspan

Table 264 WebSocket Ping Configuration Parameters

arameter Optional/Mandatory Value Description

Mandatory 0-9, a-f

It specifies the socket identifier (CID) allocated to a on GS node.Its value is obtained using the AT+WEBSOCKOPEcommand.

ut MandatoryValue Range: 1 to 4,294,967,295Format: Integer

It specifies the time taken in seconds to receive the WebSocket ping response from the WebSocket serv

MandatoryValue Range:1 to 64 bytesFormat: String

It specifies the number of bytes sent from GS node

Table 265 WebSocket Ping Configuration Synchronous Responses

Responses RemarksOK Success

ERROR: INVALID INPUTFailureIf parameters are not valid.

1VV0301463 Rev. 1.0 Page 306 of 340 2018-01-24

Page 307: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

P

CID

socket

N

Payload

7.8.10 WebSocket PongThis command is used to respond to the ping message coming from the WebSocket server with the payload.

Command Syntax AT+WEBSOCKPONG=<CID>,<Payload>

Parameter Description

Table 266, page 307 describes the WebSocket Pong configuration parameters.

Synchronous Response

Table 267, page 307 describes the synchronous responses and remarks for WebSocket Pong Configuration command.

Example AT+WEBSOCKPONG=0,Gainspan

7.9 CoAP Client

7.9.1 CoAP Client Option Configuration

This command is used to configure the CoAP parameters.

Command Syntax AT+CoAPOPTCONF=<Parm>,<Value>

Table 266 WebSocket Pong Configuration Parameters

arameter Optional/Mandatory Value Description

Mandatory 0-9, a-f

It specifies the socket identifier (CID) allocated to a on GS node.Its value is obtained using the AT+WEBSOCKOPEcommand.

MandatoryValue Range:1 to 64 bytesFormat: String

It specifies the number of bytes sent from GS node

Table 267 WebSocket Pong Configuration Synchronous Responses

Responses RemarksOK Success

ERROR: INVALID INPUTFailureIf parameters are not valid.

1VV0301463 Rev. 1.0 Page 307 of 340 2018-01-24

Page 308: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

Parameter Description

Table 268, page 308 describes the CoAP Client Option Configuration parameters.

Note: 1. When using CoAP with XML the only valid value is 41.Note: 2. If the Token Option is not set, no Token Option is sent.Note: 3. To specify more than one Accept Option, the values must be given with a “.” separator with

the priority from left to right.

Synchronous Response

Table 269, page 309 describes the synchronous responses and remarks for CoAP Client Option Configuration command.

Table 268 CoAP Client Option Configuration Parameters

Parameter ValuesGSN_COAP_OPTION_IF_MATCH (1)

N/A

GSN_COAP_OPTION_URI_HOST (3)GSN_COAP_OPTION_ETAG (4)GSN_COAP_OPTION_IF_NONE_MATCH (5)GSN_COAP_OPTION_URI_PORT (7)GSN_COAP_OPTION_URI_PATH (11)

GSN_COAP_OPTION_CONTENT_FORMAT (12)

• text/plain;charset=utf-8 (0)• application/line-format (40)• application/xml (41)1

• application/octet-stream (42)• application/exi (47)• application/json (50)

GSN_COAP_OPTION_MAX_AGE (14)N/A

GSN_COAP_OPTION_URI_QUERY (15)

GSN_COAP_OPTION_ACCEPT (16)3

• text/pain;charset=utf-8 (0)• application/line-format (40)• application/xml (41)1

• application/octet-stream (42)• application/exi (47)• application/json (50)

GSN_COAP_OPTION_TOKEN (19)2 • Auto Generate (0)• Any Value (1 to 8 bytes)

GSN_COAP_OPTION_PROXY_URI (35) N/A

NOTE: The value is a string that depends on the parameters in the above table.

1VV0301463 Rev. 1.0 Page 308 of 340 2018-01-24

Page 309: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

7.9.2 CoAP Client Option Configuration RemovalThis command is used to remove the CoAP configuration specified by “param”.

Command Syntax AT+CoAPOPTCONFDEL=<Param>

Parameter Description

Table 270, page 309 describes the CoAP Client Option Configuration Removal parameters.

Table 269 CoAP Client Option Configuration Synchronous Responses

Responses RemarksOK SuccessERROR Failure

Table 270 CoAP Client Option Configuration Removal Parameters

ParameterGSN_COAP_OPTION_IF_MATCH (1)GSN_COAP_OPTION_URI_HOST (3)GSN_COAP_OPTION_ETAG (4)GSN_COAP_OPTION_IF_NONE_MATCH (5)GSN_COAP_OPTION_URI_PORT (7)GSN_COAP_OPTION_URI_PATH (11)GSN_COAP_OPTION_CONTENT_FORMAT (12)GSN_COAP_OPTION_MAX_AGE (14)GSN_COAP_OPTION_URI_QUERY (15)GSN_COAP_OPTION_ACCEPT (16)GSN_COAP_OPTION_TOKEN (19)GSN_COAP_OPTION_PROXY_URI (35)

1VV0301463 Rev. 1.0 Page 309 of 340 2018-01-24

Page 310: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

Synchronous Response

Table 271, page 310 describes the synchronous responses and remarks for CoAP Client Option Configuration Removal command.

7.9.3 CoAP Client Connection OpenThis command is used to open a CoAP client on the GS node and connect to the server specified by the "IP/Host Name" and "Port Number". If the DTLS flag is set to 1, then other parameters such as "CA Certificate Name", "Client Certificate Name", and "Client Key Name" need to be provided.

Command Syntax AT+CoAPOPEN=<IP/Host Name>,<Port Number>,[<DTLS Flag>,<CA certificate name>,<Client certificate name>,<Client key name>]

Parameter Description

Table 272, page 311 describes the CoAP Client Connection Open parameters.

Table 271 CoAP Client Option Configuration Removal Synchronous Responses

Responses RemarksOK SuccessERROR Failure

1VV0301463 Rev. 1.0 Page 310 of 340 2018-01-24

Page 311: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

Note: 1. Certificates and Key must be in DER (encoded certificate file) format.

Table 272 CoAP Client Connection Open Parameters

Parameter Optional/Mandatory Value Description

IP/Host name Mandatory NA

Host is either the Fully Qualified Domain Name of the Server or the IP address of the server to which the CoAP client will open the connection (e.g., www.gainspan.com, or 74.208.130.221)

Port Number Mandatory 5683 (Default Port Number)

The Port Number of the server to which the CoAP client will open the connection. The client can specify the port when the server is running on a non-standard port.

DTLS Flag OptionalValue range: 0, 1Default value: 0

When the DTLS Flag is set to 0, then all the optional parameter need to be provided.When DTLS flag is set to 1, it supports to open a CoAP client on the GS node and connect to the server specified by the host name or IP address.• 0 - Disable DTS flag and CoAP

content is created and CID is returned

• 1 - Enable DTS flag. It is a CoAP over DTLS or secured CoAP.

CA certificate name1 Optional N/AIt specifies the CA certificate name which is required for DTLS server authentication.

Client certificate name1 Optional N/A

It specifies the client certificate name which is required for DTLS client authentication. The certificate and key must be provisioned before using this parameter.

client key name1 Optional N/A

The client key name is required for DTLS client authentication. The certificate and key must be provisioned before using this parameter.

1VV0301463 Rev. 1.0 Page 311 of 340 2018-01-24

Page 312: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

Synchronous Response

Table 273, page 312 describes the synchronous responses and remarks for CoAP Client Connection Open command. It returns the normal response code and the CID of the CoAP client connection on success.

Example 1 AT+COAPOPEN=coap.exocite.com,5683,00OK

Note: 0 is CID.

Example 2 Example with DTLS support:

AT+SETTIME = 13/8/2015,11:10:20AT+COAPOPEN = 192.168.111.123.8888,1OK

Table 273 CoAP Client Connection Open Synchronous Responses

Responses Remarks<CID>OK

Success

ERROR Failure

1VV0301463 Rev. 1.0 Page 312 of 340 2018-01-24

Page 313: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

7.9.4 CoAP Client Connection SendThis command is used to GET or POST data to or from the CoAP Server. Upon deployment of this command, the GS node sends the request (GET/POST) and waits for response for specified amount of time configured in the "response timeout" parameter.

Command Syntax AT+CoAPSENDRECEIVE=<CID>,<coap-uri>,<connection method>,<connection type>,<response timeout>,[<payloadsize>,<payload type>]

Command Note In case of CoAP connection is opened with DTLS encryption enabled, this command encrypts the data based with encrypt key in DTLS connection structure for the specific CID. This encryption happens before Network Layer and the Encrypted data will be sent through the network layer.

Parameter Description

Table 274, page 313 describes the CoAP Client Connection Send parameters.

Table 274 CoAP Client Connection Send Parameters

Parameter Optional/Mandatory Value Description

CID Mandatory

Value range: 0 to FFormat: Hexadecimal

It specifies the socket identifier (CID) allocated to a socket on GS node.Its value is obtained using the AT+COAPOPEN command.

coap-uri Mandatory NA

CoAP URI is the only URI without host and port. Example: /timeResource not "coap://capserver.com:5683/timeResource"The DTLS flag has to be enabled and the current time of the GS Node need to be configured for COAP over DTLS.

connection method Mandatory GET/POST CoAP connection method.connection type Mandatory CON/NON CoAP connection type.

response timeout Mandatory

Value range: 0 - 60 Unit: SecondsDefault value: 0

The time to wait before a response is received (in seconds). This is required to be set only if connection type is of type Non-conformable.Note: The value of response Timeout should be less than or equal to 60 seconds.

1VV0301463 Rev. 1.0 Page 313 of 340 2018-01-24

Page 314: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

Receive is implicit in AT+CoAPSENDRECEIVE based on the CoAP Server’s response to the sent data. Received data is synchronized and is printed on the console.

Synchronous Response

Table 275, page 314 describes the synchronous responses and remarks for CoAP Client Connection Send command. It returns the normal response code and the CID of the CoAP client connection on success.

Example AT+COAPSENDRECEIVE = 0,/storage/test,GET,NON,10ok

payload size Optional N/A Length of the payload sent with the request. Optional in case of GET.

payload type Optional

Format: StringValue range:• text/plain;charset=u

tf-8• application/line-for

mat• application/xml• application/octet-str

eam• application/exi• application/json

Content-type of the payload. Optional in case of GET.

In case of POST, on successful execution of the command, OK response will be sent to Host. Host sends the data to be POSTED in the following format.<ESC>P<CID><Content of size mentioned in "PayLoad Size" argument>

Table 274 CoAP Client Connection Send Parameters (Continued)

Parameter Optional/Mandatory Value Description

Table 275 CoAP Client Connection Send Synchronous Responses

Responses RemarksOK SuccessERROR Failure

1VV0301463 Rev. 1.0 Page 314 of 340 2018-01-24

Page 315: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

7.9.5 CoAP Client Connection CloseThis command is used to close a CoAP client connection identified by the CID and returns the standard command response.

Command Syntax AT+CoAPCLOSE=<CID>

Parameter Description

Table 276, page 315 describes the CoAP Client Connection Close parameters.

Synchronous Response

Table 277, page 315 describes the synchronous responses and remarks for CoAP Client Connection Close command.

Table 276 CoAP Client Connection Close Parameters

Parameter Optional/Mandatory Value Description

CID Mandatory

Value range: 0 to FFormat: Hexadecimal

It specifies the socket identifier allocated to a socket on GS node.

Table 277 CoAP Client Connection Close Synchronous Responses

Responses Remarks

OK Connection with the given CID is closed, and this CID can be used for future connection.

INVALID CID If any invalid CID is provided.

1VV0301463 Rev. 1.0 Page 315 of 340 2018-01-24

Page 316: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

7.10 GSLinkGSLink is mainly used to offload MCU from parsing XML, JSON and raw data in HTTP transactions. GS node can be a HTTP server or client. While using , GS node acts as an interface between MCU and the other node that runs HTTP server or client.

GS node supports to send and receive HTTP data in XML, raw HTTP, and JSON formats. Data can be sent and received,

• as part of an HTTP message (raw HTTP method) which contains complete data

• as XML data where each element can be sent and received individually

• and as JSON data where each element can be sent and received independently

When acting as an HTTP Server, GS node only performs HTTP_GET_RESPONSE or HTTP_POST_RESPONSE. When acting as an HTTP Client, it performs HTTP_GET, HTTP_HEAD, HTTP_POST, HTTP_PUT, or HTTP_DELETE. As GS node is aware of the type of communication used by HTTP server, it chooses and initiates appropriate format (raw HTTP/XML/JSON) of communication.

7.10.1 GSLink with HTTP When using HTTP with GSLink, the host must do the following:

• Configure the HTTP client or server parameters

• If HTTP client, open HTTP connection.

• If HTTP server, wait for HTTP client connection.

• Use the respective CID as part of HTTP, XML, or JSON send

NOTE: 1).GS web-server supports only one client using. 2).No other HTTP Request is supported while POST is in progress. 3).Data size must be greater then zero for GET response in raw mode.

1VV0301463 Rev. 1.0 Page 316 of 340 2018-01-24

Page 317: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

7.10.2 Receive RequestWhen web client sends a request (GET/POST) to web server (GS node), the GS node passes the request to MCU using the following Escape <ESC> sequence.

Asynchronous Data <ESC>K<CID><Len><Type><URI>

Asynchronous Data Parameter Description

Table 278, page 317 describes the HTTP Request (GET/POST) parameters.

Example <ESC>K000221/gainspan/profile/mcu

Table 278 HTTP Request (GET/POST) Parameters

Parameter Optional/Mandatory Value Description

ESCK Mandatory N/A This escape sequence is sent once the URL is fetched by the remote HTTP client.

CID Mandatory

Value range: 0 to FFormat: Hexadecimal

It specifies the socket identifier allocated to a socket on GS node.

Len Mandatory Format: Decimal

It specifies the length of the string including <type>, <URI> which is of 4 ASCII characters represented in decimal value.

Type Mandatory

Value range: 1 or 3Format: Decimal

It specifies the type used.• 1: GET REQUEST• 3: POST REQUEST

URI Mandatory Format: String It specifies the URL fetched by the Remote HTTP client.

NOTE: 1.) Multiple parsers (XML and JSON) cannot be enabled together. AT command returns an error when multiple parsers are enabled. 2.) When the request is sent to the host, a response to the request is mandatory from the host irrespective of the connection status. Once the response from the host is sent, the server takes care of connection closure.

1VV0301463 Rev. 1.0 Page 317 of 340 2018-01-24

Page 318: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

7.10.3 Enable XML ParserThis command is used to enable or disable XML parser on HTTP data sent and received by the GS node.

Command Syntax AT+XMLPARSE=n

Parameter Description

Table 279, page 318 describes the Enable XML Parser parameters.

Synchronous Response

Table 280, page 318 describes the synchronous responses and remarks for Enabling or disabling XML Parser on HTTP Data command.

7.10.4 Send XML DataThis section provides commands used to send XML elements one by one using <ESC>G sequence when GS node acts as HTTP server.

Command Syntax AT+XMLSEND=<CID>,<Type>,<Timeout>,<Page URI>,<Root tag name>[,<N>],<Send response status line>, <Send response headers count>

MCU sends XML data using the following ESC sequence:

<ESC>G<CID>[Opcode]<Len><Tag name>:<Value>

Refer Table 283, page 321 for parametric description of <ESC>G sequence

ESC G is to sent N times, one for each tag.

Table 279 Enable or Disable XML Parser Parameters

Parameter Optional/Mandatory Value Description

n Mandatory Value range: 0,1

It specifies whether XML parser is enabled or disabled.• 0: Disable• 1: Enable

Table 280 Enable or Disable XML Parser Synchronous Responses

Responses RemarksOK Success

ERROR:INVALID INPUTIf parameters are not valid.(n value is other than 0 or 1)

1VV0301463 Rev. 1.0 Page 318 of 340 2018-01-24

Page 319: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

“Len” is the length of the string including <tag name>:<value> The value of the tag length is 256

Usage Usage of Opcode:

• 9900 - 9990: Future Use

• 9992: MIME type

• 9999: Future Use

• 9998: Start of Element with sub-elements

• 9997: End of Element with sub-elements

• 9996: Attribute

• 0000: End of Data

Parameter Description

Table 281, page 319 describes the Send XML Data parameters.

NOTE: MCU should send complete data as mentioned in AT+XMLSEND or AT+HTTPSEND commands.

Table 281 Send XML Data Parameters

Parameter Optional/Mandatory Value Description

CID MandatoryValue range: 0 to FFormat: Hexadecimal

It specifies the socket identifier allocated to a socket on GS node.

Type MandatoryValue range: 6 or 7Format: Decimal

It specifies the type used which is either GETRESP or POSTRESP• 6 (GETRESP)• 7 (POSTRESP)

Timeout Mandatory

Format: DecimalExample:AT+XMLSEND=0,7,100,//environment/sensor,info,1,1,5

Timeout is the HTTP timeout for the get/post.

Page URI Mandatory

Format: StringDefault Value: /gainspan/profile/mcu(default)Example: AT+XMLSEND=0,7,100,//environment/sensor,info,1,1,5

It specifies the URI to be used for communication.

1VV0301463 Rev. 1.0 Page 319 of 340 2018-01-24

Page 320: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

Synchronous Response

Table 282, page 320 describes the synchronous responses and remarks for sending XML Parser on HTTP Data command.

Example AT+XMLSEND=0,7,100,//environment/sensor,element1,1,1,5

MCU sends XML data using the following ESC sequence:

<ESC><G>00009STATUS:OK

Where,

– <ESC>G: Escape format to send XML data.

Root tag name Mandatory

Format: StringExample: AT+XMLSEND=0.7,100,//environment/sensor,info,1,1,5

It specifies the Root tag of XML data.

N Optional

Format: DecimalExample: AT+XMLSEND=0,7,100,//environment/sensor,info,1,1,5

N is the number of elements in the XML string.

Send response status line Optional

Value range: 0,1Example: AT+XMLSEND=0,7,100,//environment/sensor,info,1,1,5

When MCU wants to send custom response status line, set this parameter to 1.• 0: Do not send custom response status line• 1: Send custom response status line

Send response headers count Optional

Value range: 0 or Number of different custom headers which are required to be sentExample: AT+XMLSEND=0,7,100,//environment/sensor,info,1,1,5

When MCU wants to send custom response headers, set this parameter to number of different custom headers which are required to be sent.Set this argument to 0, if no custom headers are to be sent.

Table 281 Send XML Data Parameters (Continued)

Parameter Optional/Mandatory Value Description

Table 282 Send XML Data Synchronous Responses

Responses RemarksOK SuccessERROR:INVALID INPUT If parameters are not valid.

1VV0301463 Rev. 1.0 Page 320 of 340 2018-01-24

Page 321: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

– 0: CID

– 0009: Length

– STATUS:OK: XML data in <tag>:<value> format.

7.10.5 Receive XML DataGS node sends XML data using the following Escape <ESC> sequence

Asynchronous Data <ESC>G<CID>[Opcode]<Len><Tag name>:<Value>

Asynchronous Data Parameter Description

Table 283, page 321 describes the Receive XML data (ESC G) parameters.

Table 283 Receive XML Data (ESC G) Parameters

Parameter Optional/Mandatory Value Description

ESC G N/A N/A This is sent repeatedly for each tag for the XML data.

CID N/A

Value range: 0 to FFormat: Decimal

It specifies the socket identifier allocated to a socket on GS node.

Opcode N/A

Value range: 9998, 9997, 9996, 0000Format: Decimal

It specifies the type of data sent to MCU.• 9998: Start of Element with sub elements• 9997: End of Element with sub elements• 9996: Attribute• 0000: End of Data

Len N/A

Value range: 0000-9999Format: Decimal

Len is the length of the XMLdata sent by GS node to MCU including <tag name>:<value> in 4 bytes ASCII decimal value.

Tag name N/A Format: N/A It specifies name of the xml tag being sent as part of HTTP data.

Value N/A Format: N/A It specifies the value corresponding to the Tag name.

1VV0301463 Rev. 1.0 Page 321 of 340 2018-01-24

Page 322: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

7.10.6 Send Raw HTTP Data

This command is used to send raw HTTP data using <ESC>H sequence when GS node acts as HTTP server.

Command Syntax AT+HTTPSEND=<CID>,<Type>,<Timeout>,<Page>,<Size of data>,[<Send response status line>,<Send response headers count>]

MCU sends raw HTTP data using the following Escape <ESC> sequence:

<ESC>H<CID><Data of above size>

Parameter Description

Table 284, page 322 describes the Send Raw HTTP Data parameters.

NOTE: Information provided in this section is a subset of information in section Exchange/Send Data with HTTP Client, page 281, and it is only relevant for GSLink.

Table 284 Send Raw HTTP Data Parameters

Parameter Optional/Mandatory Value Description

CID MandatoryValue range: 0 to FFormat: Hexadecimal

It specifies the socket identifier allocated to a socket on GS node.

Type MandatoryValue range: 6 or 7Format: Decimal

GSN_HTTP_METHOD_GETRESP (6)GSN_HTTP_METHOD_POSTRESP (7)

Timeout MandatoryFormat: DecimalUnit: Seconds

Timeout value is in seconds

Page Mandatory Format: String The page/script being accessed (e.g., /index.html)

1VV0301463 Rev. 1.0 Page 322 of 340 2018-01-24

Page 323: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

Size of data Optional Format: StringActual size of the contentNote: It is recommended to use when sending data from

MCU as part for GSN_HTTP_METHOD_GET-RESP or GSN_HTTP_METHOD_POSTRESP

Send response status line Optional

Value range: 0,1Format: Decimal

When MCU wants to send custom response status line, set this parameter to 1.• 0: Do not send custom response status line• 1: Send custom response status line

Send response headers count Optional

Value range: 0 or Number of different custom headers which are required to be sent

When MCU wants to send custom response headers, set this parameter to number of different custom headers which are required to be sent.Set this argument to 0, if no custom headers are to be sent.

Table 284 Send Raw HTTP Data Parameters (Continued)

Parameter Optional/Mandatory Value Description

1VV0301463 Rev. 1.0 Page 323 of 340 2018-01-24

Page 324: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

Synchronous Response

Table 285, page 324 describes the synchronous responses and remarks for sending Raw HTTP Data command.

7.10.7 Receive Raw HTTP DataMCU receives raw HTTP data using the following Escape <ESC> sequence:

Asynchronous Data <ESC>H<CID><Length of data><data>

Asynchronous Data Parameter Description

Table 286, page 324 describes the Receive Raw HTTP Data (ESC H) parameters.

Table 285 Send Raw HTTP Data Synchronous Responses

Responses RemarksOK SuccessERROR:INVALID INPUT If parameters are not valid.

Table 286 Receive Raw HTTP Data (ESC H) Parameters

Parameter Optional/Mandatory Value Description

ESCH N/A Format: String This is sent repeatedly for each tag for the raw HTTP data.

CID N/A

Value range: 0 to F (1 byte)Format: Hexadecimal

It specifies the socket identifier allocated to a socket on GS node.

Length of data N/A Format: ASCII decimal

‘Length of data’ is the length of the raw HTTP data sent by GS node to MCU, in 4 bytes ASCII decimal value.

data N/A Format: String Actual content

1VV0301463 Rev. 1.0 Page 324 of 340 2018-01-24

Page 325: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

7.10.8 Enable JSON DataThis command is used to enable or disable JSON parser on HTTP data sent and received by GS node.

Command Syntax AT+JSONPARSE=n

Parameter Description

Table 287, page 325 describes the Enable or disable JSON Parser on HTTP Data parameters.

Synchronous Response

Table 288, page 325 describes the synchronous responses and remarks for enabling or disabling JSON Parser on HTTP Data command.

NOTE: Once the JSON parser is enabled, use AT+URIRECV command to change the content type to JSON. See URI Registration (Modification), page 329

Table 287 Enable or Disable JSON Parser on HTTP Data Parameters

Parameter Optional/Mandatory Value Description

n MandatoryValue range: 0, 1Format: Decimal

If n is 0, JSON parser is disabled. If n is 1, JSON parser is enabled.• 0: Disable• 1: Enable

Table 288 Enable or Disable JSON Parser on HTTP Data Synchronous Responses

Responses RemarksOK Success

ERROR:INVALID INPUTIf parameters are not valid.(n value is other than 0 or 1)

1VV0301463 Rev. 1.0 Page 325 of 340 2018-01-24

Page 326: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

7.10.9 Send JSON DataThis section provides commands used to send JSON elements one by one using <ESC>G sequence when GS node acts as HTTP server.

Command Syntax AT+JSONSEND=<CID>,<Type>,<Timeout>,<URI>,<Root object>

MCU sends JSON data using the following Escape <ESC> sequence:

<ESC>G<CID>[Opcode]<Length><Tag name>:<Value>

Refer Table 283, page 321 for parametric description of <ESC>G sequence

JSON supports following opcodes:

• 9987: Start of JSON array

• 9988: Start of JSON array element

• 9989: Reserved

• 9990: Reserved

• 9991: HTTP request line

• 9992: HTTP header

• 9993: CGI parameters

• 9994: HTTP response Line

• 9995: Reserved

• 9996: XML attribute / JSON literal attribute

• For JSON parser this will be used to represent non string values, which includes number, Boolean, null.

• 9997: end of inner most parent element

To indicate end of XML complex element/JSON object/array/array element

• 9998: start of element w/sub-elements

To indicate start of XML complex element /JSON object

• 0000: End of XML/JSON data

1VV0301463 Rev. 1.0 Page 326 of 340 2018-01-24

Page 327: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

Parameter Description

Table 289, page 327 describes the Send JSON Data parameters.

Synchronous Response

Table 290, page 327 describes the synchronous responses and remarks for Send JSON Data command.

Example AT+JSONSEND=0,6,50,/gainspan/profile/mcu,data

OK

<ESC><G>00009STATUS:OK /* refer Table 283, page 321*//

Table 289 Send JSON Data Parameters

Parameter Optional/Mandatory Value Description

CID MandatoryValue range: 0 to FFormat: Hexadecimal

It specifies the socket identifier allocated to a socket on GS node.

Type MandatoryValue range: 6, 7Format: Decimal

GSN_HTTP_METHOD_GETRESP (6)GSN_HTTP_METHOD_POSTRESP (7)

Timeout Mandatory Format: Decimal Timeout value is in seconds

URI MandatoryFormat: StringDefault value:/gainspan/profile/mcu

It specifies the URI to be used for communication.

Root object Mandatory Format: String It specifies the root object of JSON.

Table 290 Send JSON Data Synchronous Responses

Responses RemarksOK SuccessERROR:INVALID INPUT If parameters are not valid.

1VV0301463 Rev. 1.0 Page 327 of 340 2018-01-24

Page 328: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

7.10.10 Receive JSON DataMCU receives JSON data using the following Escape <ESC> sequence

Asynchronous Data <ESC>G<CID>[Opcode]<Len><Object name>:<Value>

Asynchronous Data Parameter Description

Table 283, page 321 describes the Receive JSON data (ESC G) parameters.

Table 291 Receive JSON Data (ESC G) Parameters

Parameter Optional/Mandatory Value Description

ESC G N/A N/A This is sent repeatedly for each object of the JSON data.

CID N/A

Value range: 0 to FFormat: Decimal

It specifies the socket identifier allocated to a socket on GS node.

Opcode N/A

Value range: 9998, 9997, 9996, 0000Format: Decimal

It specifies the type of data sent to MCU.

• 9987: Start of JSON array

• 9988: Start of JSON array element

• 9991: HTTP request line

• 9992: HTTP header

• 9993: CGI parameters

• 9994: HTTP response Line

• 9995: Reserved

• 9996: XML attribute / JSON literal attribute

• For JSON parser this will be used to represent non string values, which includes number, Boolean, null.

• 9997: end of inner most parent element

To indicate end of XML complex element/JSON object/array/array element

• 9998: start of element w/sub-elements

To indicate start of XML complex element /JSON object

• 0000: End of XML/JSON data•

1VV0301463 Rev. 1.0 Page 328 of 340 2018-01-24

Page 329: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

7.10.11 URI Registration (Modification)This command is used to register a new URI or modify the default URI. MCU registers to receive CGI arguments, request line, and HTTPD headers through this command.

Command Syntax AT+URIRECV=<URI>[,Content Type,<Send CGI arguments>,<Send request line>,<Send HTTPD Headers>]]

MCU receives CGI arguments, Request line, or HTTPD headers through different ESC sequences along with various Reserved length values.

Parameter Description

Table 292, page 329 describes the URI Modification parameters.

Len N/A

Value range: 0000-9999Format: Decimal

Len is the length of the JSON data sent by GS node to MCU including <Object name>:<value> in 4 bytes ASCII decimal value.

Object name N/A Format: N/A It specifies name of the JSON tag being sent as part of HTTP data.

Value N/A Format: N/A It specifies the value corresponding to the object name.

Table 291 Receive JSON Data (ESC G) Parameters (Continued)

Parameter Optional/Mandatory Value Description

Table 292 URI Modification Parameters

Parameter Optional/Mandatory

Value Description

URI (Uniform Resource Identifier) Mandatory

• /gainspan/profile/mcu (default)

• /gainspan/system (reserved)

URI is a string used to identify a web resource.Note: Maximum length of URI is 64 characters including the null terminating character (‘\0’).

Content Type OptionalValue range: 0 to 4Format: Decimal

Content type for the URI.• 0: application/xml (default)• 1: application/json• 2: application/html• 3: Img/gif• 4: application/octet-stream

1VV0301463 Rev. 1.0 Page 329 of 340 2018-01-24

Page 330: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

Send CGI arguments OptionalValue range: 0, 1Format: DecimalDefault value: 0

• 0: Do not forward CGI arguments to MCU.

• 1: Forward all CGI arguments to MCU.

Send request line OptionalValue range: 0, 1Format: DecimalDefault value: 0

• 0: Do not forward request line to MCU.• 1: Forward request line to MCU.

Send HTTPD Headers OptionalValue range: 1 to FFFFFFFFFormat: Hexadecimal

This parameter specifies the Bitmap value of a specific HTTP header. MCU can enable various headers by setting respective bit positions in this parameter as specified in the Table 293, page 330.Example: If this parameter is set as FFFFFFFF, then all the headers listed in Table 293, page 330 are enabled.

Table 292 URI Modification Parameters (Continued)

Parameter Optional/Mandatory

Value Description

Table 293 Send HTTPD Headers

Header Name/ValueGSN_HTTP_HEADER_ALLOW(1)GSN_HTTP_HEADER_AUTHORIZATION (2) GSN_HTTP_HEADER_CONNECTION (3) GSN_HTTP_HEADER_CONTENT_ENCODING (4)GSN_HTTP_HEADER_CONTENT_LENGTH (5)GSN_HTTP_HEADER_CONTENT_RANGE (6) GSN_HTTP_HEADER_CONTENT_TYPE (7) GSN_HTTP_HEADER_COOKIE(8)GSN_HTTP_HEADER_COOKIE2(9)GSN_HTTP_HEADER_DATE (10) GSN_HTTP_HEADER_EXPIRES (11) GSN_HTTP_HEADER_FROM (12) GSN_HTTP_HEADER_HOST (13) GSN_HTTP_HEADER_IF_MODIFIED_SINCE (14) GSN_HTTP_HEADER_LAST_MODIFIED (15)GSN_HTTP_HEADER_LOCATION (16) GSN_HTTP_HEADER_PRAGMA (17) GSN_HTTP_HEADER_RANGE (18) GSN_HTTP_HEADER_REFERER (19)

1VV0301463 Rev. 1.0 Page 330 of 340 2018-01-24

Page 331: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

Note: 1. GSN_HTTP_HEADER_CUSTOM can be used to register for request header apart from mentioned values. In case multiple custom headers coming in HTTP request, all the custom headers will be passed to the MCU.

Synchronous Response

Table 294, page 331 describes the synchronous responses and remarks for URI Modification command.

Example AT+HTTPRECVCONF=0,1,ffffffff

7.10.12 Receive CGI ArgumentsMCU registers to receive CGI arguments using AT+URIRECV and receives CGI arguments using the following ESC sequence.

Asynchronous Data <Esc>G<CID><Reserved length value><Argument length><Argument><’=’><Argument value><CR><LF>

End of CGI arguments list is indicated by:<Esc>G<CID><Reserved length value><0><CR><F>

Asynchronous Data Parameter Description

Table 295, page 332 describes the Receive CGI arguments (ESC G) parameters.

GSN_HTTP_HEADER_SERVER (20) GSN_HTTP_HEADER_SET_COOKIE (21)GSN_HTTP_HEADER_TRANSFER_ENCODING (22) GSN_HTTP_HEADER_USER_AGENT (23) GSN_HTTP_HEADER_WWW_AUTHENTICATE (24)GSN_HTTP_HEADER_CUSTOM(32)

Table 293 Send HTTPD Headers (Continued)

Header Name/Value

Table 294 URI Modification Synchronous Responses

Responses RemarksOK SuccessERROR:INVALID INPUT If parameters are not valid.

1VV0301463 Rev. 1.0 Page 331 of 340 2018-01-24

Page 332: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

Table 295 Receive CGI Arguments (ESC G) Parameters

Parameter Optional/Mandatory DescriptionESC G Mandatory This is sent repeatedly for each CGI argument.

CID Mandatory It specifies the socket identifier allocated to a socket on GS node.

Reserved length value Mandatory Reserved for future use. Value 9993 is used to specify that CGI argument is sent to MCU.

Argument length Mandatory The total number of characters in the Argument.

Argument Mandatory The CGI argument sent to MCU. CGI argument is sent one by one through the same escape sequence.

Argument value Mandatory The character string including the <‘=’> delimiter.

1VV0301463 Rev. 1.0 Page 332 of 340 2018-01-24

Page 333: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

7.10.13 Receive Request LineMCU registers to receive Request line using AT+URIRECV and receives Request line using the following ESC sequence:

Asynchronous Data <Esc>G<CID><Reserved length value)><Length><Method><’:’><Request URI><CR><LF>

Asynchronous Data Parameter Description

Table 296, page 333 describes the Receive request line (ESC G) parameters.

Table 296 Receive Request Line (ESC G) Parameters

Parameter Optional/Mandatory DescriptionESC G Mandatory This is sent repeatedly for each CGI argument.

CID Mandatory It specifies the socket identifier allocated to a socket on GS node.

Reserved length value Mandatory Reserved for future use. Value 9993 is used to specify that Request line is sent to MCU.

Length Mandatory Number of bytes in Request URI including Method.

Method Mandatory

Specifies one of the following methods:• GSN_HTTP_METHOD_GET (1)• GSN_HTTP_METHOD_HEAD (2)• GSN_HTTP_METHOD_POST (3)• GSN_HTTP_METHOD_PUT (5)• GSN_HTTP_METHOD_DELETE (6)

Request URI Mandatory Request uri string with size equal to <Length - 1> bytes.

1VV0301463 Rev. 1.0 Page 333 of 340 2018-01-24

Page 334: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

7.10.14 Receive HTTP HeadersMCU registers to receive HTTP headers using AT+URIRECV and receives HTTP headers using the following ESC sequence:

Asynchronous Data <Esc>G<CID><Reserved length value><Header length><Header type><’:’><Header value><CR><LF>

End of HTTP Headers list is indicated by:<Esc>G<CID><Reserved length value><0><CR><F>

Asynchronous Data Parameter Description

Table 297, page 334 describes the Receive HTTP Headers (ESC G) parameters.

Table 297 Receive HTTP Headers (ESC G) Parameters

Parameter Optional/Mandatory DescriptionESC G Mandatory This is sent repeatedly for each CGI argument.

CID Mandatory It specifies the socket identifier allocated to a socket on GS node.

Reserved length value Mandatory Reserved for future use. Value 9992 is used to specify that HTTP header is sent to MCU.

Header length MandatoryTotal number of characters in Header type and Header value character strings including the <‘=’> delimiter.

Header type Mandatory Type of the header.Header value Mandatory Value of the header.

1VV0301463 Rev. 1.0 Page 334 of 340 2018-01-24

Page 335: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

7.11 Multicast

7.11.1 IP Multicast JoinThis command is used to join the specified multicast group (specified by the Group IP address).

Command Syntax AT+NIPMULTICASTJOIN=<Group IP>

Synchronous Response

Table 298, page 335 describes the synchronous responses and remarks for the IP Multicast Join command.

Example 1 AT+NIPMULTICASTJOIN=224.0.0.251

Example 2 AT+NDHCP=1OKAT+WWPA=0384124610OKAT+WA=SwN-AP-NG1 IP SubNet Gateway192.168.1.8:255.255.255.0:192.168.1.1OKAT+NIPMULTICASTJOIN=224.0.0.251OK

Table 298 IP Multicast Join Synchronous Responses

Responses Remarks

OKSuccessPrior to issuing this command, the GS node needs to be associated with a network.

ERROR FailureERROR: INVALID INPUT If parameter is not valid.DISASSOCIATED If GS node is not associated with any network.

1VV0301463 Rev. 1.0 Page 335 of 340 2018-01-24

Page 336: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

7.11.2 IP Multicast LeaveThis command is used to leave the specified multicast group (specified by the IP address).

Command Syntax AT+NIPMULTICASTLEAVE=<Group IP>

Synchronous Response

Table 299, page 336 describes the synchronous responses and remarks for the IP Multicast Leave command.

Example AT+NIPMULTICASTLEAVE=224.0.0.251OK

EXAMPLE:

GSNODE 1:

AT+NDHCP=1OKAT+WA=GSDemo IP SubNet Gateway192.168.1.8:255.255.255.0:192.168.1.1OKAT+NIPMULTICASTJOIN=224.0.0.251OK

AT+NIPMULTICASTLEAVE=224.0.0.251OK

Table 299 IP Multicast Leave Synchronous Responses

Responses RemarksOK Success

ERRORFailureIf the given "Group IP" is wrong.

1VV0301463 Rev. 1.0 Page 336 of 340 2018-01-24

Page 337: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

7.11.3 Enable Multicast ReceptionThis command is used to enable or disable Multicast and Broadcast reception. Multicast and Broadcast are tied together.

Command Syntax AT+MCSTSET=n

Parameter Description

Table 300, page 337 describes the Enable/Disable Multicast Reception parameters.

Synchronous Response

Table 301, page 337 describes the synchronous responses and remarks for the Enable/Disable Multicast Reception command.

Table 300 Enable/Disable Multicast Reception Parameters

Parameter Optional/Mandatory Value Description

n Mandatory

0

Disable802.11 MAC layer multicast + broadcast reception is disabled.Reception of all higher layer (IP and above) multicast and broadcast packets are disabled by AT+MCSTSET=0 option. When disabled, the ability for the node to receive higher layer broadcast traffic such as ARP responses that are needed to establish IP layer communication is also disabled.

1 (default)

Enable802.11 MAC layer multicast + broadcast reception is enabled.Reception of all higher layer (IP and above) multicast and broadcast packets is enabled by “AT+MCSTSET=1” option. The MCU will receive/transmit the multicast and broadcast packets by opening the UDP sockets using the command “AT+NCUDP” (see 7.5.1.2 Create UDP Client, page 238).

NOTE: 1.) Multicast reception disable is supported only in station mode.

Table 301 Enable/Disable Multicast Reception Synchronous Responses

Responses RemarksOK Success

ERROR:INVALID INPUTIf parameters are not valid(If n value is other than 0 or 1)

1VV0301463 Rev. 1.0 Page 337 of 340 2018-01-24

Page 338: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

Example Use Case

Table 302, page 338 lists the use cases for the Enable/Disable Multicast Reception.

Table 302 Enable/Disable Multicast Reception

No. Power Save Parameter Listen Beacon Parameter

Listen Multicast Parameter

Radio State

1 AT+WRXACTIVE=1 Don’t Care Don’t Care Radio is always ON.

2 AT+WRXACTIVE=1 AT+WRXPS=0 Don’t Care Setting Not Valid - Radio will be always ON.

3 AT+WRXACTIVE=0 AT+WRXPS=0 Don’t Care

Setting Not Valid - Radio will be in PS mode turning ON and OFF every listen interval or DTIM depending on “listen multicast” setting.

4 AT+WRXACTIVE=0 AT+WRXPS=1 DisableRadio is turned ON based on listen interval. See below for listen interval setting.

5 AT+WRXACTIVE=0 AT+WRXPS=1 EnableRadio is turned ON based on DTIM interval and listen interval setting.

1VV0301463 Rev. 1.0 Page 338 of 340 2018-01-24

Page 339: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

Example Use Case 1 - Configuring GainSpan node as a UDP Client and Transmitting/Receiving Multicast Packets

Where - Destination address (Multicast): 224.0.0.0

Destination port: 3610AT+WA=GainSpanDemo,,11IP SubNet Gateway192.168.1.99:255.255.255.0:192.168.1.1OK

AT+NDHCP=1IP SubNet Gateway192.168.23.101:255.255.255.0:192.168.23.1OK

AT+MCSTSET=1OK

AT+NCUDP=224.0.0.0,3610CONNECT 0OK

Example Use Case 2 - Configuring GainSpan node as a UDP Client and Transmitting/Receiving Unicast Packets

Where - Destination address: 192.168.23.100 (Unicast)

Destination port: 9000AT+WA=GainSpanDemo,,11IP SubNet Gateway102.168.23.101:255.255.255.0:192.168.23.1OK

AT+MCSTSET=1OK

AT+NCUDP=192.168.23.100,9000CONNECT 0OK

1VV0301463 Rev. 1.0 Page 339 of 340 2018-01-24

Page 340: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

1VV0301463 Rev. 1.0 Page 340 of 340 2018-01-24

Page 341: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

Chapter 8 Advanced Service

This chapter describes commands for configurations and operations related to advanced services of Network and GainSpan supported Application features.

• Network, page 341

• Application Features, page 366

8.1 Network

8.1.1 PingThis command is used to send the device a ping to the remote machine specified by the IPV4 address.

Command Syntax AT+PING=<IP address/host name>,[[<Counts>],[<timeout>],[<fixed pattern Len>],[<TOS>],[<TTL>],[<customised PAYLOAD>]]<CR>

Parameter Description

Table 303, page 341 describes the Ping parameters.

Table 303 Ping Parameters

Parameter Optional/Mandatory Value DescriptionIP Address/ host name Mandatory N/A The IP address of the server to which the

command is directed.

Counts Optional 0 (default)This indicates the number of ping requests to send. In this case, ping will continue until termied.

Timeout Optional 3000 (default)This is the timeout in milliseconds for each ping response to come after it sends out a ping request. The valid range is 1000-99000.

1VV0301463 Rev. 1.0 Page 341 of 430 2018-01-24

Page 342: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

Example 1 Pinging to the server with its IP addressAT+NDHCP=1OKAT+WA=GainSpanDemoIP SubNet Gateway192.168.1.99:255.255.255.0:192.168.1.1OKAT+DNSLOOKUP=www.gainspan.comIP:23:23.181.241OKAT+PING=23.23.181.241Pinging for 23.23.181.241 with 56bytes of dataOK2Pinging to the server with its host nameAT+NDHCP=1OKAT+WA=GainSpanDemoIP SubNet Gateway192.168.10.3:255.255.255.0:192.168.10.1OKAT+DNSLOOKUP=www.gainspan.comIP:23.23.181.241

Fixed Pattern Len Optional 56 (default)

Length is configured to send packet size >56 by enabling “Variable Packet size” from the builder. If Len is not provided, default 56 bytes of G is sent.If Len is provided, then up to 56 bytes of G is sent. The ping packet is 0 to 1024. The packet length and pattern is fixed for the GS node.

TOS Optional 0 (default) This is the type of service. The valid range is 0-99.

Note: Packet length is fixed in GS node.If both Length and Payload are configured in the AT+PING command then Payload will have highest precedence.

TTL Optional 30 (default) This is the time to live. The valid range is 0-255.

Customized Payload Optional 0 to 16

This is the customized data to be sent in each ping packet. The payload length should be in the range 0-16. The payload may contain valid alphanumeric characters (0-9, 1-e). It is used to send ping packets of non fixed pattern.

Note: To terminate a ping sequence, issue the <ESC>C

Table 303 Ping Parameters

Parameter Optional/Mandatory Value Description

1VV0301463 Rev. 1.0 Page 342 of 430 2018-01-24

Page 343: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

OKAT+PING=www.gainspan.comPinging for 23.23.181.241 with 56 bytes of data

OK

8.1.2 Service Discovery Using mDNS

8.1.2.1 mDNS Module Initialization

This command is used to start the mDNS procedure of the node with IPv4 network.

Command Syntax AT+MDNSSTART

Synchronous Response

Table 304, page 343 describes the synchronous responses and remarks for the mDNS Module Initialization command.

Example AT+MDNSSTARTOK

Table 304 mDNS Module Initialization Synchronous Responses

Responses Remarks

OKSuccessPrior to issuing of this command the node should be associated to the network.

ERRORFailureIf the node is not associated before issuing this command.

1VV0301463 Rev. 1.0 Page 343 of 430 2018-01-24

Page 344: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

8.1.2.2 mDNS Status

This command is used to output the current status (started or stopped) of the mDNS.

Command Syntax AT+MDNSSTART=?

Synchronous Response

Table 305, page 344 describes the synchronous responses and remarks for the mDNS status command.

8.1.2.3 mDNS Host Name Registration

This command is used to register or give a unique name to each of the nodes for mDNS.

Command Syntax AT+MDNSHNREG=[<Host name>],<Domain name>

Parameter Description

Table 306, page 344 describes the mDNS Host Name Registration parameters.

Synchronous Response

Table 307, page 345 describes the synchronous responses and remarks for the mDNS Host Name Registration command.

Table 305 mDNS Status Synchronous Responses

Responses RemarksMDNS StartedOKMDNS StoppedOK

Success

ERROR: INVALID INPUT If parameter is not valid.

Table 306 mDNS Host Name Registration Parameters

Parameter Optional/Mandatory Value Description

Host name Optional N/A

Host name is optional. If host name is not given, factory default name concateed with last 3 bytes of the MAC address shall be taken.Maximum host name length supported is 32 bytes.

Example: If the factory default name is GAINSPAN and the MAC address of the node is 00-1d-c9-d0-70-cc, then the host will be GAINSPAN_d070cc.Domain name Mandatory N/A The domain name is always “local.”

1VV0301463 Rev. 1.0 Page 344 of 430 2018-01-24

Page 345: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

Example AT+MDNSHNREG=Provisioning,localOK

8.1.2.4 mDNS Host Name De-registration

This command is used to de-register the domain name which is registered using AT+MDNSHNREG.

Command Syntax AT+MDNSHNDEREG=<Host name>,<Domain name>

Parameter Description

Table 308, page 345 describes the mDNS Host Name De-Registration parameters.

Synchronous Response

Table 309, page 346 describes the synchronous responses and remarks for the mDNS Host Name De-Registration command.

Table 307 mDNS Name Registration Synchronous Responses

Responses Remarks

OKRegistration Success!! for RR: <Host name>

SuccessPrior to issue this command, the node should be associated to the network.

ERRORFailureIf the node is not started in mDNS module, before issuing this command.

Table 308 mDNS Host Name De-Registration Parameters

Parameter Optional/Mandatory Value Description

Host name Mandatory N/A Host name is the host name which is registered using AT+MDNSHNREG.

Domain name Mandatory N/A Domain name is the domain name which is registered using AT+MDNSHNREG.

1VV0301463 Rev. 1.0 Page 345 of 430 2018-01-24

Page 346: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

Example AT+MDNSHNDEREG=Prov,localOK

8.1.2.5 mDNS Services Registration

This command is used to register the services to the mDNS.

Command Syntax AT+MDNSSRVREG=<ServiceInstanceName>,[<ServiceSubType>],<ServiceType>,<Protocol>,<Domain>,<port>,<Default Key>[,<key 1=val 1>,<key 2=val,..<key n=val>]

Parameter Description

Table 310, page 346 describes the mDNS Services Registration parameters.

Table 309 mDNS Host Name De-Registration Synchronous Responses

Responses Remarks

OKSuccessPrior to issuing this command the node should be registered with the host name.

ERROR:INVALID INPUTFailureBefore issuing this command, if the node is not registered with a host name.

Table 310 mDNS Services Registration Parameters

Parameter Optional/Mandatory

Value Description

ServiceInstanceName Mandatory N/A This parameter specifies the name of the service. It can take up to 256 characters.

ServiceSubType Optional N/A This parameter specifies the name of the service subtype if any.

ServiceType Mandatory N/A This parameter specifies the type of service, such as HTTP, FTP, and so on.

Protocol Mandatory N/A This parameter specifies the protocol used (TCP, UDP).

Domain Mandatory N/A This parameter specifies the name of the domain and it should be “local”.

Port Mandatory N/A This parameter specifies the port number used for communication (80 for HTTP).

1VV0301463 Rev. 1.0 Page 346 of 430 2018-01-24

Page 347: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

Synchronous Response

Table 311, page 347 describes the synchronous responses and remarks for the mDNS Services Registration command.

DefaultKey Mandatory

0, 1, 2Maximum length: 128 bytes

This parameter specifies the default service registered by GS node. Use one of the following values:• 0: No services are registered by GS node by

default. User can add services by adding “key=value” pair in GS node’s Service registry which is detected in mDNS response of User’s application.

Note: If the user needs to develop their own Application, then set the Defaultkey =0 and provide applicable “key = value” pairs (one or more) in GS node’s service registry.

DefaultKey (Contd.) Mandatory

0, 1, 2Maximum length: 128 bytes

• 1: GS node is registered with Provisioning service by default and sends this service’s name (gsprov.html) to mobile application during mDNS discovery. Here the “key=value” pair registered in GS node’s service registry is Provisioning=gsprov.html.

• 2: GS node is registered with Over The Air Firmware Upgrade service by default and sends this service’s name (otafu.html) to mobile application during mDNS discovery. Here the “key=value” pair registered in GS node’s service registry is OTAFU=otafu‘html

<key1=value1>,<key2=value2>, ...<keyn=valuen> Optional NA

These parameters specify respective “key=value” pairs to be added in GS node’s service registry. These parameters are used only when DefaultKey parameter is set to 0.

Table 310 mDNS Services Registration Parameters (Continued)

Parameter Optional/Mandatory

Value Description

Table 311 mDNS Services Registration Synchronous Responses

Responses RemarksOK Success

ERROR:INVALID INPUT

FailureCommand AT+MDNSSRVREG is issued. Before issuing AT+MDNSSTART (i.e, the node is not started with an MDNS module)

1VV0301463 Rev. 1.0 Page 347 of 430 2018-01-24

Page 348: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

Asynchronous Response

Table 312, page 348 describes the Asynchronous responses and remarks for the mDNS Services Registration command.

Example Use Case GainSpan node is configured with mDNS module with user specific “key=value” pairs.

Here - Default key is set to 0 (Number 0 indicates no service is registered with GS node by default)

AT+MDNSSRVREG=prov,,_http,_tcp,local,80,0,SSID=GainSpanDemo,Channel=6//*Here, Key1=value1 parameter is SSID=GainSpanDemo and Key2=value2 parameter is Channel=6*//OK

Example Use Case Asynchronous response in GSAT+MDNSSRVREG=GAINSPAN,,_http,_tcp,local,80,1,path=/gsprov.htmlOKRegistration Failed!! for RR:GAINSPAN

Table 312 mDNS Services Registration Asynchronous Responses

Responses RemarksOKRegistration Success!! for RR:<ServiceInstanceName>

SuccessPrior to issuing this command, the node should be started with a mDNS module.

OKRegistration Failed!! for RR:<ServiceInstanceName>

FailurePrior to issuing this command, the node should be started with a mDNS module.

1VV0301463 Rev. 1.0 Page 348 of 430 2018-01-24

Page 349: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

8.1.2.6 mDNS Services De-registration

This command is used to de-register the services which are registered through AT+MDNSSRVDERREG.

Command Syntax AT+MDNSSRVDEREG=<ServiceInstanceName>,[<ServiceSubType>],<ServiceType>,<Protocol>,<Domain>

Parameter Description

Table 313, page 349 describes the mDNS Services De-Registration parameters.

Synchronous Response

Table 314, page 349 describes the synchronous responses and remarks for the mDNS Services De-Registration command.

Table 313 mDNS Services De-Registration Parameters

Parameter Optional/Mandatory Value Description

ServiceInstanceName Mandatory N/A ServiceInstanceName is the name of the service. It can take up to 256 characters.

ServiceSubType Optional N/A ServiceSubType is the name of the service subtype if any.

ServiceType Mandatory N/A ServiceType is the type of service, for example HTTP, FTP, etc.

Protocol Mandatory N/A Protocol is the protocol used (TCP, UDP).Domain Mandatory N/A Name of the domain. It should be “local”

Table 314 mDNS Services De-Registration Synchronous Responses

Responses Remarks

OK

SuccessPrior to issuing this command, the node should be registered with the mDNS service through AT+MDNSSRVREG.

ERROR:INVALID INPUTFailureInvalid parameters.

1VV0301463 Rev. 1.0 Page 349 of 430 2018-01-24

Page 350: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

Example AT+MDNSSRVDEREG=Prov,,_http,_tcp,localOK

8.1.2.7 mDNS Services Announce

This command is used to announce the mDNS services.

Command Syntax AT+MDNSANNOUNCE

Synchronous Response

Table 315, page 350 describes the synchronous responses and remarks for the mDNS Services Announce command.

Example AT+MDNSACCOUNCEOK

8.1.2.8 mDNS Service Discover

This command is used to discover the mDNS services.

Command Syntax AT+MDNSSD=[<Servicesubtype>],<Servicetype>,<Protocol>,<Domain>

Parameter Description

Table 316, page 350 describes the mDNS Service Discover parameters.

Table 315 mDNS Services Announce Synchronous Responses

Responses Remarks

OKSuccessPrior to issuing this command, the node should start the mDNS module.

ERRORFailureBefore issuing this command, the node is not started with an mDNS module.

Table 316 mDNS Service Discover Parameters

Parameter Optional/Mandatory Value Description

ServiceSubType Optional N/A ServiceSubType is the name of the service subtype if any.

ServiceType Optional N/A ServiceType is the type of service, for example HTTP, FTP, etc.

Protocol Mandatory N/A Protocol is the protocol used (TCP, UDP).Domain Mandatory N/A Name of the domain. It should be “local”

1VV0301463 Rev. 1.0 Page 350 of 430 2018-01-24

Page 351: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

Synchronous Response

Table 317, page 351 describes the synchronous responses and remarks for the mDNS Service Discover command.

Asynchronous Response

Table 318, page 351 describes the asynchronous responses and remarks for the mDNS Service Discover command.

Example 1 FAILURE:AT+MDNSSD=,_http,_tcp,localOKService Discovery FailedSUCCESS:AT+MDNSSD=,_http,_tcp,localOK

Table 317 mDNS Service Discover Synchronous Responses

Responses RemarksOKA Service Discovered: <No of service discovered>

Service Instance name= ProvService app protocol= _httpService protocol= _tcpService domain= localService IP address= <IP Address Port> = <Port>

Service Text Info= path=/<xxxx.html>

SuccessNote: Prior to issuing this command, the node should start the mDNS module and should register the services.

ERROR:INVALID INPUTFailureBefore issuing this command, the node has not started with the mDNS module.

Table 318 mDNS Service Discover Asynchronous Responses

Responses RemarksOK Success

OKService Discovery Failed

FailurePrior to issuing this command, the node should start the mDNS module and should register the services.

1VV0301463 Rev. 1.0 Page 351 of 430 2018-01-24

Page 352: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

The service discovered in the above example is 2, there parameter indication is as below:Service instance name - 2Service application protocol =_httpService protocol =_tcpService domain =localservice IP address =192.168.136.133 Port =80

Example 2 AT+WM=0OKAT+WWPA=B9740249070OKAT+NDHCP=1OKAT+WA=GainSpan_Home IP SubNet Gateway 192.168.1.103:255.255.255.0:192.168.1.1OKAT+MDNSSTARTOKAT+MDNSSD=,_http,_tcp,localOK

A Service Discovered: 2

Service Instance name = ProvService app protocol = _httpService protocol = _tcpService domain = localService IP address = 192.168.1.101 Port = 80

Service Text Info = path=/concurrent.html

1VV0301463 Rev. 1.0 Page 352 of 430 2018-01-24

Page 353: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

8.1.2.9 mDNS Module De-Initialization

This command is used to stop the mDNS module.

Command Syntax AT+MDNSSTOP

Synchronous Response

Table 319, page 353 describes the synchronous responses and remarks for the mDNS Module De-Initialization command.

Example AT+MDNSSTOPOK

8.1.2.10 Example for mDNS Commands

The following use case covers all the mDNS commands:AT+WA=GainSpanDemo,,11IP SubNet Gateway192.168.1.99:255.255.255.0:192.168.1.1OK

AT+NDHCP=1IP SubNet Gateway192.168.23.101:255.255.255.0:192.168.23.1OK

AT+WEBPROV=admin,adminOK

AT+MDNSSTARTOK

AT+MDNSHNREG=Prov,localOK

Registration Success!for RR:Prov

Table 319 mDNS Module De-Initialization Synchronous Responses

Responses Remarks

OKSuccessPrior to issuing this command, the node should start the mDNS module.

ERRORFailureExecuting the command second time or more then once.

1VV0301463 Rev. 1.0 Page 353 of 430 2018-01-24

Page 354: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

AT+MDNSSRVREG=Provisioning,,_http,_tcp,local,80,0,path=/gsprov.htmlOK

Registration Success!!for RR: ProvisioningAT+MDNSANNOUNCEOKAT+MDNSHNDEREG=Prov,localOK

AT+MDNSSRVDEREG=Provision,,_http,_tcp,localOK

AT+MDNSSTOPOK

1VV0301463 Rev. 1.0 Page 354 of 430 2018-01-24

Page 355: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

8.1.3 DNS Lookup (Client)This command is used to receive an IP address from a host name. Upon deployment of this command, the node queries the DNS server to obtain the IP address corresponding to the host name provided in URL, and returns the address if found or ERROR if the URL does not exist.

Command Syntax AT+DNSLOOKUP=<URL>,[<Retry count>,<Retry timeout>]

Command Note If the server does not respond or is not reachable, then the application retries for the specified number of times provided by the optional parameters <Retry count> and <Retry timeout> in the command. The retry count is addition to the first attempt.

Example AT+DNSLOOKUP=www.gainspan.com,2,5

Parameter Description

Table 320, page 355 describes the DNS Lookup (Client) parameters.

Table 320 DNS Lookup (Client) Parameters

Parameter Optional/Mandatory Value DescriptionURL Mandatory N/A URL is the host name to be identified.

Retry count Optional

1-10 range It is the number of times node retries to query the URL.This excludes the initial attempt of query.This is applicable for primary and secondary DNS.If value is not given or 0 is provided, then the default value is used.

3 (default)

Retry timeout Optional1-20 seconds It is the time interval between two retries.

The node waits for the specified time after sending a query request.

5 seconds (default)

Note: The value of Retry count * Retry timeout should be less than 90 seconds.

1VV0301463 Rev. 1.0 Page 355 of 430 2018-01-24

Page 356: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

Synchronous Response

Table 321, page 356 describes the synchronous responses and remarks for the DNS Lookup (Client) command.

The node returns 0 for OK, and 1 for ERROR if a valid command was issued, but DNS lookup failed (if verbose mode is disabled).

Example AT+NDHCP=1OK

AT+WA=GainSpanDemo,,1ERROR

AT+WA=GainSpanDemo,,11IP SubNet Gateway192.168.44.110:255.255.255.0:192.168.44.1OK

AT+DNCLOOKUP=www.gainspan.comIP:23.23.181.241OK

Table 321 DNS Lookup (Client) Synchronous Responses

Responses Remarks

IP:<ip address>OK

SuccessPrior to issuing this command the node should be associated to the network.

ERROR

FailureIf the node is not associated before issuing this command (Valid command is executed but DNS lookup fails).

ERROR:INVALID INPUTFailureIf valid command is not executed.

1VV0301463 Rev. 1.0 Page 356 of 430 2018-01-24

Page 357: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

8.1.4 ARP

8.1.4.1 ARP Cache Enable

This command is used to enable the cache for ARP entries (maximum 8) in its non-volatile memory and available across standby wakeup cycle. The node starts caching ARP entries and upon the store network command update to its nonvolatile memory (see 6.8 DNS Address, page 184). ARP aging is not supported. When WiFi layer connection is lost, the ARP entries will also be invalidated.

Command Syntax AT+NARPCHACHEEN=<Enable>

Parameter Description

Table 322, page 357 describes the ARP Cache Enable parameters.

Synchronous Response

Table 323, page 357 describes the synchronous responses and remarks for the ARP Cache Enable command.

Example AT+WA=GainSpanDemo,,1IP SubNet Gateway192.168.1.99:255.255.255.0:192.168.1.1OK

AT+NDHCP=1IP SubNet Gateway192.168.44.145:255.255.255.0:192.168.44.1OKAT+NARPCHACHEEN=1OK

Table 322 ARP Cache Enable Parameters

Parameter Optional/Mandatory Value Description

Enable Mandatory

1 - Enable (Default value)

Start caching

0 - Disable Stop caching

Table 323 ARP Cache Enable Synchronous Responses

Responses Remarks

OKSuccessPrior to issuing this command the node should be associated to the network.

ERROR:INVALID INPUTFailureIf the parameters are not valid.(value other than 0 or 1)

1VV0301463 Rev. 1.0 Page 357 of 430 2018-01-24

Page 358: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

8.1.4.2 ARP Cache Delete

This command is used to delete the ARP entries from the GS node’s network stack.

Command Syntax AT+NARPCHACHEDEL

Synchronous Response

Table 324, page 358 describes the synchronous responses and remarks for the ARP Delete command.

Example AT+NARPCHACHEDELOK

8.1.4.3 ARP Entry Listing

This command is used to list all ARP entries present in the nodes network stack.

Command Syntax AT+NARP=?

Synchronous Response

Table 325, page 358 describes the synchronous responses and remarks for the ARP Entry Listing command.

Example AT+NARP=?c8:d7:19:75:74:f9:192.168.44.160:67:20:3f:10:e0:192.168.44.144OK

Table 324 ARP Delete Synchronous Responses

Responses RemarksOK Success

Table 325 ARP Entry Listing Synchronous Responses

Responses Remarks

Macaddress:IP address OK

SuccessDisplays the ARP entries present in the nodes network stack. The MAC address is in the format xx:xx:xx:xx:xx:xx and the IP address is in the format xx:xx:xx:xx:xx:xx.

OK If no ARP entries present.

ERROR:INVALID INPUTFailureIf parameters are invalid (value other than ?).

1VV0301463 Rev. 1.0 Page 358 of 430 2018-01-24

Page 359: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

8.1.4.4 ARP Entry Set

This command is used to set a static entry in the ARP table.

Command Syntax AT+NARPSET=<Ip address>,<Mac address>

Command Note This command must be issued after associating to a network.

Parameter Description

Table 326, page 359 describes the ARP Entry Set parameters.

Synchronous Response

Table 327, page 359 describes the synchronous responses and remarks for the ARP Entry Set command.

Table 326 ARP Entry Set Parameters

Parameter Optional/Mandatory DescriptionIp address Mandatory xxxx.xxxx.xxxx.xxxx format.Mac address Mandatory xx:xx:xx:xx:xx:xx format.

Table 327 ARP Entry Set Synchronous Responses

Responses RemarksOK SuccessERROR Failure

1VV0301463 Rev. 1.0 Page 359 of 430 2018-01-24

Page 360: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

8.1.4.5 ARP Entry Delete

This command is used to delete an entry in the ARP table.

Command Syntax AT+NARPDELETE=<Ip address>,<Mac address>

Command Note This command must be issued after associating to a network.

Parameter Description

Table 328, page 360 describes the ARP Entry Delete parameters.

Synchronous Response

Table 329, page 360 describes the synchronous responses and remarks for the ARP Entry Delete command.

Table 328 ARP Entry Delete Parameters

Parameter Optional/Mandatory DescriptionIp address Mandatory xxxx.xxxx.xxxx.xxxx format.Mac address Mandatory xx:xx:xx:xx:xx:xx format.

Table 329 ARP Entry Delete Synchronous Responses

Responses RemarksOK Success

ERRORFailureIf the ARP is entry is not found in the table.

1VV0301463 Rev. 1.0 Page 360 of 430 2018-01-24

Page 361: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

8.1.4.6 ARP Learning

This command is used to enable or disable updating ARP entries to network stack.

When ARP learning is enabled, the ARP table is updated based on the application filter and the ARP request packets received. Currently, the default application filter drops all the ARP request packets which are not destined to the GS2000 node. Therefore, learning is only from the incoming ARP request packets for the node.

When ARP learning is disabled, the ARP table is updated only when the ARP request is sent from the GS2000 and the ARP response is received for the same. The ARP table is not updated in any other case.

Command Syntax AT+NARPAUTO=n

Command Note This command must be issued after associating to a network. Table 330, page 361 describes the parameter in ARP Learning command.

Parameter Description

Table 330, page 361 describes the ARP Learning parameters.

Synchronous Response

Table 331, page 361 describes the synchronous responses and remarks for the ARP Learning command.

NOTE: There is no AT command to change or update this behavior in the S2W default filter. There are only AT commands to change the UDP/TCP receive behaviors in the S2W default filter.

Table 330 ARP Learning Parameters

Parameter Optional/Mandatory Value Description

n Mandatory0: Enable1: DisableDefault value: 1

When ARP Learning is enabled, ARP cache is updated with the entry based on ARP response information.When ARP learning is disabled, the ARP table is updated only when the ARP request is sent from the GS2000 and the ARP response is received for the same.

Table 331 ARP Learning Synchronous Responses

Responses RemarksOK SuccessERROR Failure - When the parameter is other than 0 or 1.

1VV0301463 Rev. 1.0 Page 361 of 430 2018-01-24

Page 362: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

8.1.4.7 Gratuitous ARP

This command is used to send gratuitous ARP.

Command Syntax AT+GRATARP

Synchronous Response

Table 332, page 362 describes the synchronous responses and remarks for the ARP Learning command.

8.1.4.8 ARP Resolve

This command is used to map the IP address of the destiion node.

Command Syntax AT+ARPRESOLVE=<IP>

Parameter Description

Table 333, page 362 describes the ARP Resolve parameters.

Synchronous Response

Table 334, page 362 describes the synchronous responses and remarks for the ARP Resolve command.

Example - Use Case Configure the node in station mode, store the network parameters before going to standby.and restore the parameter after exiting from standby.Now resolve ARP and check the ARP entries.

Table 332 Gratuitous ARP Synchronous Responses

Responses RemarksOK Success

ERROR:INVALID INPUTIf the command is provided with any input values.Example: AT+GRATARP=0.

Table 333 ARP Resolve Parameters

Parameter Optional/Mandatory DescriptionIP address Mandatory xxx.xxx.xxx.xxx format.

Table 334 ARP Resolve Synchronous Responses

Responses RemarksOK SuccessERROR:INVALID INPUT For invalid input

1VV0301463 Rev. 1.0 Page 362 of 430 2018-01-24

Page 363: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

AT+WM=0OKAT+NDHCP=1OKAT+WA=GainSpanDemo IP SubNet Gateway192.168.125.117:255.255.255.0:192.168.125.1OKAT+PING=192.168.125.101Pinging for 192.168.125.101 with 56 bytes of data

OK

Reply from 192.168.125.101: bytes=56 time=1018 ms TTL 64Reply from 192.168.125.101: bytes=56 time=791 ms TTL 64Reply from 192.168.125.101: bytes=56 time=376 ms TTL 64Ping Statistics for 192.168.125.101: Packets: Sent = 7, Received = 6, Lost = 14 percentApproximate round trip times in milliseconds Minimum = 76ms, Maximum = 1018ms, Average = 450ms

AT+NARP=?60:67:20:3f:10:e0 : 192.168.125.101OKAT+STORENWCONNOKAT+PSSTBY=10000

Out of StandBy-Timer

AT+RESTORENWCONNOKAT+NARP=?OKAT+ARPRESOLVE=192.168.125.101OKAT+NARP=?60:67:20:3f:10:e0 : 192.168.125.101OK

1VV0301463 Rev. 1.0 Page 363 of 430 2018-01-24

Page 364: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

8.1.5 NAT FunctionalityThis provides NAT functionality over Limited AP interface only.

8.1.5.1 Enable NAT

This command is used to enable or disable NAT features.

Command Syntax AT+NATENABLE=<Enable/Disable>,<WAN Interface IP Address>,[<max Number of table entries>],[<NAT Entry Idle Timeout>]

Command Note The NAT feature running on GS2011 and GS2200M module is both Wi-Fi and cellular module specific with a well defined serial interface used in any cellular module.

For AT commands to be used by the host MCU refer “GS2K S2W Use Case Reference Guide”.

For transfer of packet format (send/receive) over serial interface refer “Adapter Command reference Guide”.

In a test setup like HE910, the host MCU does a dial up, fetches the WAN Interface IP address and the DNS server address. After the completion of Dial-Up procedure, the host MCU provides the WAN interface IP address to GS2011/GS2200M, through “AT+NATENABLE” command. This address is used for NATing. The primary and secondary DNS addresses should be provided to GS2011/GS2200M module using “AT+DNSSET” command. These DNS addresses is further provided to the clients connecting to GS2000/GS2200M AP through DHCP.

In active mode, the external server initiates the connection to the client via data pipe after it receiving the PORT command from the client. NAT does not support a new connection from the external peer. Certain implementations track the FTP traffic and allows such connections which is a known issue with NAT and firewall.

Parameter Description

Table 335, page 365 describes the Enable NAT parameters.

NOTE: Only the Host MCU does the Dial-Up not the S2W firmware.

1VV0301463 Rev. 1.0 Page 364 of 430 2018-01-24

Page 365: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

En

W

.

men

s

N

t

Synchronous Response

Table 335, page 365 describes the synchronous responses and remarks for Enable NAT command.

8.1.5.2 IP Packet Handling

Transfer of IP packets is done using escape sequence that starts with the ASCII character 27 (0x1B) which is equivalent to the ESC key. Each IP packet is sent over serial interface in both the direction (transmitting/receiving) having 8 bytes of escape sequence header preceding to it.

The data format is as follows:<ESC>R:<Data Length XXXX(4 ASCII character)>:<IP Packet>

where,

the maximum value of the Data Length in the above escape sequence header is 1460.

Example Following example show <ESC> sequence header for sending 10 Bytes of Data.<ESC>R:0010:defghij

Table 335 Enable NAT Parameter

Parameter Optional/Mandatory Value Description

able/Disable Mandatory1-Enable,0-Disable

It enables or disables NAT features

AN Interface IP Address Mandatory N/A

It specifies the mapping of NAT IP addressIt is the IP address of WAN interface on which IP packets are sent or received.WAN IP address is obtained by 3G/4G module.

ax Number of NAT table tries Optional Default - 512 It specifies the maximum number of entrie

in the NAT table.

AT Entry Idle Timeout Optional Default - 240secIt specifies the timeout in which there is noactivity on the NAT Entry and marks as noin use.

Table 336 Enable NAT Synchronous Responses

Responses RemarksOK SuccessERROR:INVALID INPUT For invalid input

1VV0301463 Rev. 1.0 Page 365 of 430 2018-01-24

Page 366: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

8.2 Application Features

8.2.1 Firmware Update

8.2.1.1 Over the Air Firmware Upgrade Using Module Flash

This set of commands is for over the air frame upgrade using pull method. This module uses the HTTP client to download the binaries form an HTTP server. AT+HTTPCONF command is used to configure any header(s) that need to be present in the HTTP GET request.

8.2.1.1.1 FWUP Configuration

This command is used to upgrade firmware via the wireless interface.

Command Syntax AT+SOTAFWUPCONF=<param>,<value>

Parameter Description

Table 337, page 366 gives the valid <param> and the description of the respective <value>.<value> is in string format.

a.) Firmware upgrade performed at less than 2.7V is not expected to work as the flash memory in GS node is designed to start working from 2.7V (minimum). b.) After successful firmware upgrade from 5.1.6 to 5.2.0, to go back to the factory image (that is 5.1.6), wait for the live calibration to complete before issuing any commands. Because issuing at+ver=?? command after factory restore results in system hang and the MCU has to wait for the live calibration to complete after downgrade to 5.1.6. binary. c.)Performing a factory restore to 5.1.5 from any version greater than 5.1.5 or downgrading to 5.1.5 gives the boot reason as HW Crypto Boot. MCU needs to handle this boot reason accordingly.

Table 337 FWUP Configuration Parameter Values

Parameters Value0 Server IP address1 Server Port2 Proxy present (0 - Not Present / 1 - Present)3 Proxy server IP (required only if Param 2 is equal to 1)4 Proxy server Port (required only if Param 2 is equal to 1)5 SSL enabled (0 - Not Enabled / 1- Enabled)

6 CA certification name (if it is already been added using the AT+TCERTADD command)

7 GS2000 binary request URL

1VV0301463 Rev. 1.0 Page 366 of 430 2018-01-24

Page 367: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

Synchronous Response

Table 338, page 367 describes the synchronous responses and remarks for the FWUP Configuration command.

9 Server host name10 GS2000 sigure binary request URL

11

Values: 0 or 10: Disables domain name check on incoming certificate from server.1: Enables domain name check on incoming certificate from server.Note: • AT+SSLCONF (See 7.5.2.5 Configure SSL, page 250) command

should be configured before enabling domain name check using this parameter.

• AT+LOGLVL (See 11.3.1 Log Level, page 495) command should be configured to select the debug level so that the response of a command will include more information (error reason) in case of an error.

• When domain name check is enabled and there is an error on domain name mismatch, a warning is displayed as per the configured log level (AT+LOGLVL) and the firmware upgrade termies.

• When domain name check is disabled and there is an error on domain name mismatch, a warning is not displayed as per the configured log level (AT+LOGLVL) and the firmware upgrade continues.

12 Client certificate name13 Client key certificate

NOTE: In case of HTTP/S through Proxy, the request URL should be absolute path and not the relative path.

Table 337 FWUP Configuration Parameter Values

Parameters Value

Table 338 FWUP Configuration Synchronous Responses

Responses RemarksOK SuccessERROR:INVALID INPUT For invalid input

1VV0301463 Rev. 1.0 Page 367 of 430 2018-01-24

Page 368: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

8.2.1.1.2 FWUP Start

This command is used to start upgrading the Firmware.

Command Syntax AT+SOTAFWUPSTART

Usage This command uses the header configured using AT+HTTPCONF command and other required parameters configured using the AT+SOTAFWUPCONF command, starts the http connection, downloads the new images, and starts updating the firmware.

Synchronous Response

Table 338, page 367 describes the synchronous responses and remarks for the FWUP Start command.

8.2.1.1.3 FWUP Rollback

This command is used to rollback to the previous firmware version.

Command Syntax AT+SOTAFWUPROLLBACK

Command Response On successful execution, this command resets the system and prints the Serial to WiFi banner. On failure, it returns error.

Synchronous Response

Table 340, page 368 describes the synchronous responses and remarks for FWUP rollback command.

Table 339 FWUP Start Synchronous Responses

Responses Remarks

APP Reset External Flash FW-UPSUCCESS

Success

ERROR For invalid input

NOTE: If a firmware is rolled back to 5.1.5 or to its previous versions, upon successful execution “HW Crypto Boot” is displayed instead of “Serial2WiFi App”.

Table 340 FWUP Rollback Synchronous Responses

Responses RemarksSerial2WiFi AppNote: HW Crypto Boot when rolled back to 5.1.5 or its previous versions.

Success

ERROR If the rollback to the previous firmware version fails.

1VV0301463 Rev. 1.0 Page 368 of 430 2018-01-24

Page 369: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

8.2.1.1.4 Firmware Information

This command is used to get the version numbers of available firmwares in flash.

Command Syntax AT+FWINFOGET

Command Response This command returns the standard command response to the serial host. It provides version numbers of three firmwares:

• Current firmware

• Previous firmware (Backup)

• Factory firmware (Backup-1)

Synchronous Response

Table 341, page 369 describes the synchronous responses and remarks for Firmware information command.

Table 341 Firmware Information Synchronous Responses

Responses Remarks

CURRENTAPP VERSION=5.2.0.1GEPS VERSION=5.2.0.1WLAN VERSION=5.2.0.1BACKUPAPP VERSION=5.2.0.1GEPS VERSION=5.2.0.1WLAN VERSION=5.2.0.1BACKUP-1APP VERSION=5.2.0.1GEPS VERSION=5.2.0.1WLAN VERSION=5.2.0.1OK

Success.If any of the firmwares are not available in the flash, then the value for APP VERSION, GEPS VERSION, and WLAN VERSION will be 0.Example: The following example shows the response when previous firmware and factory firmware are not available in flash.CURRENTAPP VERSION=5.2.0.1GEPS VERSION=5.2.0.1WLAN VERSION=5.2.0.1BACKUPAPP VERSION=0GEPS VERSION=0WLAN VERSION=0BACKUP-1APP VERSION=0GEPS VERSION=0WLAN VERSION=0OK

ERROR If version information is not available in control block.

1VV0301463 Rev. 1.0 Page 369 of 430 2018-01-24

Page 370: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

8.2.1.2 Over the Host Firmware Upgrade (OTHFU)

Pre-requisites Perform the following steps before OTHFU:

1. Close down all sockets including web server.

2. Disconnect from network (AT+WD), stop NCM auto-mode/legacy auto-mode/enhanced auto-mode.

3. Save in profile (AT&Wn and AT&Yn).

4. It is highly recommended to reset the GS node.

5. OTHFU works with following serial interfaces and MCU need not modify any Serial interface configurations.

• UART – With hardware flow control

• UART – With software flow control

• SPI – Byte stuffing

• SPI – Command & Response

• SDIO

Procedure Sequence of execution to transfer Digital sigure or Firmware from Host MCU to GS node is as follows:

1. Host MCU splits the images into multiple chunks, where each chunk is of 1024 bytes. The exception being,

• Digital sigure which is of 512 Bytes.

• Last chunk of the firmware image (since firmware is not 1024 byte aligned)

2. If the encoding format is Hex or Base64, then each chunk is sent to the encoder. (If MCU is sending data in raw binary format, skip this step.)

• Output of 1024 bytes hex encoding is 2048 bytes.

• Output of 1024 bytes Base64 encoding is 1404 bytes.

3. Raw binary data (1024 bytes) or encoded data (2048 bytes if hex encoded or 1404 bytes if Base64 encoded) is passed to GS node in the following format:

<ESC>M<Chunk size in bytes><:><Image of mentioned chunk size>

• Binary data: <ESC>M<1024><:><raw data chunk>

NOTE: Chunk size in bytes need to be represented in 4 bytes format. For example, If the chunk size is 1024, then it is represented as follows: <ESC>M<1><0><2><4>.<:><Image of mentioned chunk size> If the chunk size is 256 bytes (less than 1000), then it is represented as follows: <ESC>M<0><2><5><6>.<:><Image of mentioned chunk size>

1VV0301463 Rev. 1.0 Page 370 of 430 2018-01-24

Page 371: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

• Hex encoded data: <ESC>M<2048><:><hex encoded chunk>

• Base64 encoded data: <ESC>M<1404><:><Base64 encoded chunk>

4. After successfully receiving one complete chunk, GS node indicates Host MCU with “<ESC>O”

• Until Host MCU receives SUCCESS/FAILURE indication, it does not send the next chunk.

• The maximum timeout period the Host MCU waits for the SUCCESS indication is 60 seconds.

5. After sending the last chunk, GS node validates the firmware with the provided digital sigure and returns SUCCESS or FAILURE to Host MCU.

6. If SUCCESS, GS node updates the module flash and resets itself.

7. Upon next boot, GS node boots with “APP Reset OTH FW-UP-SUCCESS” message.

8. IF FAILURE, then Host MCU performs the following steps:

• Issues ‘AT+RESET’ command, reboot the Host MCU and restart the operation.

• If reset command fails or if there is no response, Host MCU needs to be reset by pulling the external reset pin and the operation is restarted after reboot.

Post-requisites 1. Provisioned information and certificates are retained as File system is saved across firmware upgrade.

2. If NCM Auto mode/Legacy Auto Mode/Enhanced Auto Mode is stopped, restart before proceeding with the procedure.

NOTE: Bit Corruption may occur if USB to serial converter is connected to PC through a HUB.

1VV0301463 Rev. 1.0 Page 371 of 430 2018-01-24

Page 372: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

I

E

S

8.2.1.2.1 Start OTHFU

This command is used for over the host firmware upgrade.

Command Syntax AT+SOTHFWUPSTART=<Image Type>,<Encoding format>,<Size>.

Command Response This command returns the standard command response to the serial host.

Parameter Description

Table 342, page 372 describes the OTHFU Start parameters.

NOTE: 1.) When this command is executed, only GS2K Single image is upgraded. 2.) OTHFU does not support Superblock update. 3.) Superblock is selected during first time Factory Flash and must not be changed for any future updates.

Table 342 OTHFU Start Parameters

Parameter Optional/Mandatory Value Description

mage Type Mandatory0- Digital sigure (DS).1- Firmware (image)

This parameter specifies if the type of image is Digital sigure or Firmware.If Host MCU wants GS node to validate the firmware against Digital sigure, then it sendsthe Digital sigure to the GS node before sending the Firmware. Once the GS node validates the Firmware, it deletes the Digital sigure. GS node does not support Digital sigure greater than 512 bytes.

ncoding Format Mandatory0- Binary Format1- Hex Format2- Base64 encoded Firmware

This parameter specifies the format of the Firmware. Binary format (0) is the recommended formatfor all serial interfaces except UART with software flow control.

ize Mandatory N/A This parameter specifies the size of digital sigure or firmware in bytes.

1VV0301463 Rev. 1.0 Page 372 of 430 2018-01-24

Page 373: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

<CR<CR><ES d

<CRd ed

<EShunk e>’

<ES<ES e>’

<ES>sig<ESlash<<ES>sig

E ks

Succe lly

s

Failu

e

l.

Synchronous Response

Table 343, page 373 describes the synchronous responses and remarks for the OTHFU Start.

Asynchronous Response

Table 344, page 373 describes the asynchronous responses and remarks for the OTHFU Start command.

Table 343 OTHFU Start Synchronous Responses

Verbose mode Non Verbose mode Remarks><LF>OK<CR><LF> <CR><LF>0<CR><LF> Success><LF>ERROR:<SP>INPUT<CR><LF <CR><LF>2<CR><LF> Failure.

C>O <ESC>O One complete chunk successfully receive

><LF>OK<CR><LF> <CR><LF>0<CR><LF>Successfully received all chunks, validatethe digital sigure (if requested) and updatthe on-module flash.

C>F<CR><LF>Error<SP>parsing<SP>c<SP>len\r\n <ESC>F<CR><LF>36<CR><LF>

If parsing of ‘<ESC>M<chunk size in bytes><:><image of mentioned chunk sizfailed.

C>F<CR><LF>Error<SP>parsing<SP>C><M><CR><LF> <ESC>F<CR><LF>37<CR><LF>

If parsing of ‘<ESC>M<chunk size in bytes><:><image of mentioned chunk sizfailed.

C>F<CR><LF>Error<SP>updating<SPure<CR><LF> <ESC>F<CR><LF>38<CR><LF> Digital sigure exceeded 512 bytes

C>F<CR><LF>Error<SP>writing<SP>fCR><LF> <ESC>F<CR><LF>39<CR><LF> On-module flash write failed

C>F<CR><LF>Error<SP>verifying<SPure<CR><LF> <ESC>F<CR><LF>40<CR><LF> Digital sigure verification failed.

Table 344 OTHFU Start Asynchronous Responses

vents Verbose mode Non Verbose mode Remar

Asynchronous Enhanced Asynchronous Asynchronous Enhanced Asynchronous

ess<CR><LF>APP<SP>RESET<SP>OTH<SP>FW-UP-SUCCESS<CR><LF>

<ESC><A><F><E><1B>APP<SP>Reset<SP>OTH<SP> FW-UP-Success

<CR><LF>35<CR><LF>

<ESC><A><F><E><02><1D>

FirmwarsuccessfuUpgrade

re<ESC>F<CR><LF>Error<SP>parsing<SP>chunk<SP>len\r\n

<CR><LF>2<CR><LF><ESC>F<CR><LF>Error<SP>parsing<SP>chunk<SP>len\r\n

<CR><LF>2<CR><LF>

FirmwarUpgradewas not successfu

1VV0301463 Rev. 1.0 Page 373 of 430 2018-01-24

Page 374: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

8.2.2 HomeKit

8.2.2.1 Initialize HomeKit

This command is used to initialize HomeKit service.

Command Syntax AT+HKSETUP=[<Accessory category>,<Discovery ID>,<Configuration number>,<Model name>,<Setup code>,<Event notification flag>, <Enable iCloud>]

Parameter Description

Table 345, page 375 describes the Initialize HomeKit command parameters.

NOTE: 1). For iCloud, it is recommended not to send more then 100 notifications in an interval of 24 hours. 2). For local network, it is recommended to send notification based on the set threshold of the accessories. 3). The system behavior is unpredictable, if the notification is sent in short regular intervals. 4). “Idle Timeout” is set to “0” using AT+WEBSERVER command, as the webserver is not expected to Close the connection when there is no communication between GS module and the MCU.

NOTE: GS module support a maximum configuring device ID parameter of 32 characters only.

1VV0301463 Rev. 1.0 Page 374 of 430 2018-01-24

Page 375: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

Table 345 Initialize HomeKit Parameters

Parameter Optional/Mandatory Value Description

Accessory category MandatoryValue range: 1 to 16Format: IntegerDefault value: N/A

It specifies the category of an accessory. Select one of the following values to select a category:• 1: Other• 2: Bridge• 3: Fan• 4: Garage• 5: Light bulb• 6: Door lock• 7: Outlet• 8: Switch• 9: Thermostat• 10: Sensor• 11: Security system• 12: Door• 13: Window• 14: Window covering• 15: Programmable switch• 16: Range extender• 17+: Reserved

Discovery ID MandatoryValue range: N/AFormat: StringDefault value: N/A

It specifies a globally unique ID of an accessory which is a random number generated at every factory reset and is persistent across reboot. This must be formatted as XX:XX:XX:XX:XX:XX, where,“XX” is a hexadecimal string representing a byte. It is also used as an accessory’s pairing identifier. Example: Primary MAC address is a globally unique ID in the following format:

00:1D:C9:XX:XX:XX,

where XX is a hexadecimal string representing a byte

1VV0301463 Rev. 1.0 Page 375 of 430 2018-01-24

Page 376: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

When there is a communication from the controller, the GS node sends asynchronous event to the Host in the below format of events:

<Esc>A<AsyncEventId>,[<data>]

Asynchronous Data Parameter DescriptionTable 346, page 377 describes the Asynchronous Event Notification parameters.

Configuration number Mandatory

Value range: 1 to 4294967295Format: IntegerDefault value: N/A

It specifies the current configuration number of an accessory. It is updated only when an accessory, service, or characteristic is added or removed on the accessory server.When the value of Configuration number exceeds 4294967295, it wraps to 1.The Configuration number should persist across reboots, power cycles, and so on.

Model name MandatoryValue range: N/AFormat: StringDefault value: N/A

It specifies the model name of an accessory.

Setup code Mandatory

Value range: N/AFormat: String Default value: 101-48-505

It specifies the password to pair a controller.Format: XXX-XX-XXXwhere X is a number.

Event notification flag MandatoryValue range: 0 to FFFFFormat: IntegerDefault value: N/A

It specifies the events those have to be notified to the host. Table 347, page 377 lists the available events along with their bit position. Use the bit position to get the hexadecimal value of the event.

Enable iCloud OptionalValue range: 0, 1Format: IntegerDefault value: Disable

It specifies whether iCloud is enabled or disabled.

Table 345 Initialize HomeKit Parameters (Continued)

Parameter Optional/Mandatory Value Description

1VV0301463 Rev. 1.0 Page 376 of 430 2018-01-24

Page 377: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

The following table lists the Asynchronous Event Notification IDs.

Table 346 Asynchronous Event Notification Parameters

Parameter Optional/Mandatory Value DescriptionAsyncEventId Mandatory N/A It identifies the event.

data Optional N/AIt is the data sent along with the event.

It is optional and valid only for read, write and notification set request from Controller.

Table 347 Events Notification Flag Values

Event Notification Flag Value (Bit)Paining Initiated 0Pairing failed 1Pairing done 2Pairing session closed 3Verification initiated 4Verification failed 5Verification done 6Verification session closed 7Receive failed and session closed 8Pairing removed 9Pairing added 10Identify response request 11Accessory discovery request 12Char read request 13Char write request 14Char event notification request 15iCloud activation init 16iCloud activation done 17iCloud activation failed 18iCloud pairing init 19iCloud pairing done 20iCloud pairing failed 21iCloud connected 22iCloud disconnected 23iCloud verification init 24

1VV0301463 Rev. 1.0 Page 377 of 430 2018-01-24

Page 378: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

Synchronous Response

Table 348, page 378 describes the synchronous responses and remarks for Initialize HomeKit command.

iCloud verification done 25iCloud verification failed 26iCloud verification session closed 27iCloud accessory discovery 28iCloud char read 29iCloud char write 30iCloud char event req 31iCloud pair add 32iCloud pair remove 33Note: The asynchronous event notification to the host is indicated by value - 0,1

where, 1 indicates the enabling of the notification of the characteristics and0 indicates the disabling of the notification of characteristics.

Table 347 Events Notification Flag Values

Event Notification Flag Value (Bit)

Table 348 Initialize HomeKit Responses

Responses RemarksOK SuccessERROR:INVALID INPUT If parameters are not valid.

1VV0301463 Rev. 1.0 Page 378 of 430 2018-01-24

Page 379: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

8.2.2.2 Add Accessory

This command is used to add an accessory. An accessory is any product intended to interface with an iDevice through GS node. It is comprised of services where each service contains one or more characteristics.

Example Consider a ceiling fan with a light.

Here, ceiling fan is the accessory with two services:

– A fan service to interact with the ceiling fan

– A light service to interact with the light

The fan service contains following characteristics:

– Power state: This characteristic is a boolean value that represents the power state of the fan. A true value indicates that the fan is powered ON and a false value indicates that the fan is powered OFF.

– Fan rotation speed: This characteristic is an integer value that represents the percentage of rotation speed the fan is currently using.

– Fan rotation direction: This characteristic is an enumerated value that represents the rotation direction of the fan. 0 indicates the fan is rotating clockwise and 1 indicates the fan is rotating counter-clockwise.

The light service contains the following characteristic:

– Power state: This characteristic is a boolean value that represents the power state of the fan. A true value indicates that the fan is powered ON and a false value indicates that the fan is powered OFF.

Command Syntax AT+HKAAC=[<Accessory ID>,<Number of services>]

Parameter Description

Table 349, page 379 describes the add accessory command parameters.

Table 349 Add Accessory Parameters

Parameter Optional/Mandatory Value Description

Accessory ID MandatoryValue range: 1 to 10Format: IntegerDefault value:

It specifies the identifier of the newly added accessory.

Number of services MandatoryValue range: 1 to 100Format: IntegerDefault value: N/A

It indicates the number of services supported by the added accessory.

1VV0301463 Rev. 1.0 Page 379 of 430 2018-01-24

Page 380: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

Synchronous Response

Table 350, page 380 describes the synchronous responses and remarks for Add accessory command.

Table 350 Add Accessory Responses

Responses RemarksOK SuccessERROR:INVALID INPUT If parameters are not valid.

1VV0301463 Rev. 1.0 Page 380 of 430 2018-01-24

Page 381: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

8.2.2.3 Add Service

This command is used to add a service to an accessory.

Command Syntax AT+HKASC=[<Accessory ID>,<Service ID>,<Service Type>,<Number of characteristics>, <Primary>, <Hidden>]

Parameter Description

Table 351, page 381 describes the add service command parameters.

Synchronous Response

Table 352, page 381 describes the synchronous responses and remarks for Add service command.

Table 351 Add Service Parameters

Parameter Optional/Mandatory Value Description

Accessory ID MandatoryValue range: 1 to 10Format: IntegerDefault value: N/A

It specifies the identifier of the accessory.

Service ID MandatoryValue range: 1 to 255Format: IntegerDefault value: N/A

It specifies the identifier of the service to be added.

Service Type MandatoryValue range: N/AFormat: StringDefault value: N/A

It specifies the type of service supported by the accessory. It is derived from the UUID of the Accessory to which the service is being added as defined in Apple’s HomeKit specification.

Number of Characteristics MandatoryValue range: 1 to 100Format: IntegerDefault value: N/A

It specifies the number of characteristics supported by the newly added service.

Primary MandatoryValue range: N/AFormat: IntegerDefault value: N/A

It specifies the service to be the primary service of the accessory.

Hidden MandatoryValue range: N/AFormat: IntegerDefault value: N/A

It specifies the service is the hidden service of the accessory.

Table 352 Add Service Responses

Responses RemarksOK SuccessERROR:INVALID INPUT If parameters are not valid.

1VV0301463 Rev. 1.0 Page 381 of 430 2018-01-24

Page 382: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

8.2.2.4 Add Characteristics

This command is used to add characteristics to the service of an accessory.

Command Syntax AT+HKACC=[<Acessory ID>,<Service ID>,<Characteristic ID>,<Characteristic Type>,<Flag>,<Format>,<Value>], [<Minimum Value>, <Maximum Value>, <Step Value><Unit>]

Parameter Description

Table 353, page 382 describes the add characteristics command parameters.

Table 353 Add Characteristics Parameters

Parameter Optional/Mandatory Value Description

Accessory ID MandatoryValue range: 1 to 10Format: IntegerDefault value: N/A

It specifies the identifier of the accessory.

Service ID MandatoryValue range: 1 to 255Format: IntegerDefault value: N/A

It specifies the identifier of the service to which a new characteristic will be added.

Characteristic ID MandatoryValue range: N/AFormat: IntegerDefault value: N/A

It specifies the identifier of the characteristic to be added. Note: Characteristic IDs and Service IDs of an Accessory need to be unique IDs. For example, If Service ID is set to 1, then Characteristic ID need to be any other value other than 1. In this case, Characteristic ID could be set to 2 or any number other than 2. If a new service for the same accessory needs to be added, then it needs to be any value other than 1 (1st Service ID) and 2 (Characteristic ID of 1st Service ID).

Characteristic Type MandatoryValue range: N/AFormat: StringDefault value: N/A

It specifies the type of characteristic supported by the service. It is derived from the UUID of the Accessory to which the characteristic is being added as defined in Apple’s HomeKit specification.

1VV0301463 Rev. 1.0 Page 382 of 430 2018-01-24

Page 383: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

Flag MandatoryValue range: 1, 2, 4Format: IntegerDefault value: N/A

It specifies if the characteristic supports one or more of the of following:• 1: Readable• 2: Writable• 4: Event notifiableIf more than one values are used for the flag, then the value of readable, writable, and event notifiable will be ORed based on whether the characteristic can be read, write, or event notifiable.Example: If the flag has to configured for readable and event notifiable, then the values of Readable (1) and Event notifiable (4) are ORed and the result which is 5 (1+4) is configured as flag.

Format MandatoryValue range: 0 to 6Format: IntegerDefault value: N/A

It specifies the format of the characteristic. Use one of the following formats:• 0: Signed integer• 1: Unsigned integer• 2: Float• 3: Boolean• 4: String• 5: TLV8• 6: Unsigned 8 bit integer

Value MandatoryValue range: N/AFormat: N/ADefault value: N/A

It specifies the value of the characteristic depending on the Characteristic Type parameter.

Minimum Value Optional N/AIt specifies the minimum value for a characteristic which is in the format of “int” or “float” type.

Table 353 Add Characteristics Parameters (Continued)

Parameter Optional/Mandatory Value Description

1VV0301463 Rev. 1.0 Page 383 of 430 2018-01-24

Page 384: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

Synchronous Response

Table 354, page 384 describes the synchronous responses and remarks for Add characteristics command.

8.2.2.5 Send Data as Response

This command is used to send data as a response to either a request or a notification. It is issued when host receives a read, write or event set request through asynchronous event, or response to any change in characteristics when notification is enabled.

Command Syntax AT+HKDATA=[<Format>,<Aid>,<Chracteristics ID>,<Status>,<Value>]

Parameter Description

Table 355, page 385 describes Respond to a request or notification parameters.

Maximum Value Optional N/AIt specifies the maximum value for a characteristic which is in the format of “int” or “float” type.

Step Value Optional N/AIt specifies the minimum step value for the characteristic which is in the format of “int” or “float” type.

Unit Optional N/A

It specifies the unit of the value such as:0: Celsius1: Percentage2: Arc-degrees3: Lux4: Seconds

Table 353 Add Characteristics Parameters (Continued)

Parameter Optional/Mandatory Value Description

Table 354 Add Characteristics Responses

Responses RemarksOK SuccessERROR:INVALID INPUT If parameters are not valid

1VV0301463 Rev. 1.0 Page 384 of 430 2018-01-24

Page 385: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

Synchronous Response

Table 356, page 385 describes the synchronous responses and remarks for Respond to a request or notification.

8.2.2.6 Erase HomeKit Configuration

This command is used to erase HomeKit configuration that has the paired controller information.Once the command is issued, the relative information to paring is deleted and the GS node is reset.

Command Syntax AT+HKEC

Synchronous Response

Table 357, page 386 describes the synchronous responses and remarks for Erase HomeKit Configuration command.

Table 355 Send Data Parameters

Parameter Optional/Mandatory Value Description

Format MandatoryValue range: 1 to 3Format: IntegerDefault value: N/A

It specifies the action to be performed by host. Use one of the following:• 1: Read• 2: Write or notify response• 3: Notification

Accessory ID MandatoryValue range: 1 to 10Format: IntegerDefault value: N/A

It specifies the identifier of the accessory.

Characteristics ID MandatoryValue range: N/AFormat: IntegerDefault value: N/A

It specifies the identifier of the characteristic.

Status MandatoryValue range: N/AFormat: N/ADefault value: N/A

It specifies the status of the operation.

Value OptionalValue range: N/AFormat: N/ADefault value: N/A

It specifies the value of the current characteristic which is posted to the iDevice as per the request.It is used only in response to read request.

Table 356 Send Data Responses

Responses RemarksOK SuccessERROR:INVALID INPUT If parameters are not valid.

1VV0301463 Rev. 1.0 Page 385 of 430 2018-01-24

Page 386: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

Example AT+HKECOK

8.2.2.7 HomeKit as Link Service

This command is used to link few services to one service.

Command Syntax AT+HKLSC = <Accessory ID>, <Service ID>, <Number of services>, <IID1>, <II2>,...

Parameter Description

Table 358, page 386, describes the HomeKit as Linked Service parameters.

Synchronous Response

Table 359, page 386 describes the synchronous responses and remarks for HomeKit as Link Service command.

Table 357 Erase HomeKit Configuration Responses

Responses RemarksOK Success

Table 358 HomeKit as Link Service Parameters

Parameter Optional/Mandatory Value Description

Accessory ID MandatoryValue range: N/AFormat: StringDefault value: N/A

It specifies the ID of the accessory.

Service ID MandatoryValue range: N/AFormat: StringDefault value: N/A

It specifies the identifier of the services.

Number of Services MandatoryValue range: 1 to 10Format: IntegerDefault value: N/A

It specifies the number of characteristics supported by the newly added service.

IID OptionalValue range: 1 to 10Format: IntegerDefault value: N/A

It is the source IID of the service to which services with IIDs - ii1, ii2,... will be linked

Table 359 HomeKit Link Service Responses

Responses RemarksOK Success

1VV0301463 Rev. 1.0 Page 386 of 430 2018-01-24

Page 387: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

8.2.3 ProvisioningGainSpan provisioning solution allows a device to be provisioned in limited AP and station mode.

It is completely secure where,

– Credentials are not seen over air

– Credentials including certificate key is encrypted and stored in flash.

Various provisioning methods supported are:

– Web Provisioning

– WiFi Protected setup (WPS)

– Group Provisioning

– Verified Provisioning

– Wireless Accessory Configuration (WAC) Provisioning

NOTE: It is recommended to use WPA2 personal security at WiFi layer.

1VV0301463 Rev. 1.0 Page 387 of 430 2018-01-24

Page 388: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

8.2.3.1 Web Provisioning

8.2.3.1.1 Web Provisioning Start

This command is used to support provisioning through web pages.

Command Syntax AT+WEBPROV=<user name>,<password>[,SSL Enabled,Param StoreOption,idletimeout,ncmautoconnect,format version, dual interface]

Parameter Description

Table 360, page 388 describes the Web Provisioning Server Start parameters.

Table 360 Web Provisioning Server Start Parameters

Parameter Optional/Mandatory Value Description

user name Mandatory 1-16 characters

Any valid username in the range 1-16 characters for the web provisioning. The characters in a valid username can be any of the following:• Alphabets, numbers, alpha numeric, or special characters• Combiion of alphabets, numbers, alpha numeric, and

special characters• Blank space

password Mandatory 1-16 characters

Any valid password in the range 1-16 characters for the web provisioning.The characters in a valid password can be any of the following:• Alphabets, numbers, alpha numeric, or special characters• Combiion of alphabets, numbers, alpha numeric, and

special characters• Blank space

SSL Enabled OptionalValue range: 0,1Default value: 0

It is required to load the root CA certificate server certificate and server key prior to starting the SSL enabled web server.• 0: Start the web provisioning server without SSL• 1: Start the web provisioning server with SSL

The command to upload the server certificate is:

AT+TCERTADD=SSL_SERVER,0,<Server certificate length>,0

1VV0301463 Rev. 1.0 Page 388 of 430 2018-01-24

Page 389: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

SSL Enabled (Contd)

The command to load the key certificate is:

AT+TCERTADD=SERVER_KEY,0,<keylength>,0<ESC>W<data of size key length>

The command to load root certificate is:

AT+TCERTADD=SSL_CA,<format>,<size>,<location>Note: “SSL_ “is prefixed while uploading the SSL server certificate through the web provisioning page or the browser. (<IP Address>/sslcert.html).

ParamStoreOption OptionalValue range: 0 - 2Default value: 0

This option selects the provisioned parameters’ store location.• 0 - For sending the provisioned information to the serial

interface (HOST). If secured provisioning is enabled in the binary, then provisioning information sent to the Host does not display the Limited AP’s passphrase. If secured provisioning is not enabled in the binary, then provisioning information sent to the Host displays the Limited AP’s passphrase.

Note: When a binary is built through SDK Builder, Secured provisioning is enabled by default under Miscellaneous tab. To disable Secured provisioning in binary, uncheck it under Miscellaneous tab before building the binary.If secured provisioning feature is enabled in the binary and provisioning is done from Limited-AP mode to Station mode with security, then the POST request from provisioning application to DUT will have Limited AP's passphrase field as blank and the provisioning information sent to the host does not display Limited-AP's passphrase. The field 'AP-PSK_PASS_PHRASE=' is blank. If secured provisioning feature is disabled in the binary, then the POST request and provisioning information sent to the host displays Limited-AP's passphrase in the field 'AP-PSK_PASS_PHRASE=<passphrase>'

• 1 - For storing the provisioned information in the GS node profile.

• 2 - For performing both options above.

Table 360 Web Provisioning Server Start Parameters (Continued)

Parameter Optional/Mandatory Value Description

1VV0301463 Rev. 1.0 Page 389 of 430 2018-01-24

Page 390: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

ParamStoreOption (Contd)

The provisioned information sent to the serial host:SSID=<ssid>CHNL=channel>CONN_TYPE=0 /*Not used*/MODE=0 /*Not used*/SECURITY=<security> (1-open, 2-wep, 3-wpa/wpa2 personal, 4-wpa/wpa2 enterprise)WEP_ID=<wepID>WEP_KEY=<wepkey>PSK_PASS_PHRASE=<pskPassPhrase>DHCP_ENBL=<0/1>STATIC_IP=<static IP address>SUBNT_MASK=<subnet Mask>GATEWAY_IP=<gateway>AUTO_DNS_ENBL=<0 /1>PRIMERY_DNS_IP=<primary DNS server IP>SECNDRY_DNS_IP<secondary DNS IP>AP-SSID=<ssid>AP-CHNL=<Channel>AP-BEACON-INTRL=<interval> (100-1600)AP-SECURITY=<security> (1-open, 2-wep, 3-wpa/wpa2 personal, 4-wpa/wpa2 enterprise)AP-PSK_PASS_PHRASE=<passphrase>AP-WEP-ID=<id> (1-4)AP-WEP-KEY=<wep key>AP- STATIC_IP=<static IP address>AP -SUBNT_MASK=<subnet Mask>AP- GATEWAY_IP=<gateway>AP-DHCPSRVR-ENABLE=<0/1>AP-DHCPSRVR-STARTIP=<IP>DHCPSRVR-NO-CONN=64AP-DNSSRVR-ENABLE=1AP-DNS-DOMAIN-NAME=<dns name>NEW_USER_NAME=<new User Name>NEW_PASS=<new Password>

Table 360 Web Provisioning Server Start Parameters (Continued)

Parameter Optional/Mandatory Value Description

1VV0301463 Rev. 1.0 Page 390 of 430 2018-01-24

Page 391: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

Synchronous Response

Table 361, page 391 describes the synchronous responses and remarks for Web Provisioning Start command.

ParamStoreOption (Contd)

The following fields are printed when format version is set to 1:WEP_AUTH_MODE=<Mode Value (1,2)> Where 1- open, 2- shared)

AP-WEP_AUTH_MODE=<Mode Value (0)> Where 0 - open

idletimeout Optional 120 seconds

HTTPS server starts a timer when a client connects to it. It closes the connection with client when there is no communication within the specified idletimeout time frame.

ncmautoconnect Optional0, 10 (default)

0 - Do not start the NCM1 - Start the NCM after storing the parameters

format version Optional 0,1

0: Prints the GS1011 compatible information1: Prints the following extra information which is not compatible with GS1011 • WEP_AUTH_MODE=<Mode Value (1,2)> Where 1-

open, 2- shared)• AP-WEP_AUTH_MODE=<Mode Value (0)> Where 0 -

open

dual interface Optional0, 10: Disable1: Enable

Enables or disables concurrent mode provisioning.

Table 360 Web Provisioning Server Start Parameters (Continued)

Parameter Optional/Mandatory Value Description

Table 361 Web Provisioning Start Synchronous Responses

Responses RemarksOK SuccessERROR: INVALID INPUT If parameters are not valid.

1VV0301463 Rev. 1.0 Page 391 of 430 2018-01-24

Page 392: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

Example 1 AT+NSET=192.168.17.111,255.255.255.0,192.168.17.1OK

AT+WM=2OK

AT+WA=GainSpanDemo,,11IP SubNet Gateway192.168.17.111:255.255.255.0:192.168.17.1OK

AT+DHCPSRVR=1OK

AT+WEBPROV=admin,admin,,1,,1OK

Prior to issuing this command the GS node should be in limited AP network with a valid IP address. Upon reception of this command the GS node starts a web server.

Once the GS node returns the success response (“OK”), the user can open provisioning webpage on the PC or browser and also access provisioning applications on android and IOS devices with the IP address of the GS node and the HTTP client application (e.g. Internet Explorer).

If the GS node is configured as limited AP, the DHCP and DNS server should be started prior to issuing this command. Once the GS node returns the success response (“OK”), the user can open a web page on the PC or smart phone that is connected to the limited AP.

User can configure both L2 and L3 level information on the provisioning application (browser, android and IOS devices). Submit button stores all the configured information in the GS node and logout/boot button presents all provisioned information to the serial host and resets the GS node.

1VV0301463 Rev. 1.0 Page 392 of 430 2018-01-24

Page 393: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

Example 2 AT+NDHCP=1OK

AT+WA=AE_GAINSPANIP SubNet Gateway192.168.75.1:255.255.255.0:192.168.75.1OK

AT+WEBPROV=ADMIN,ADMINOKAPP Reset External Flash FW-UP-SUCCESS

To start the web server this command is also used, in OTAFU push method.This method can be executed in either client mode or AP mode. In the client mode the GS is associated with the AP, after which the web server is started using the web provisioning start command. Now connect the client (where the web application/ mobile application is running, which can be used to upgrade the firmware) to the same access point and initiate the firmware upgrade from the application. Open the browser or the web page with the url <IP Address>/otafu.html to update the firmware. Once the firmware is successfully updated, the node will reset the message “APP Reset External Flash FW-UP-SUCCESS” to the MCU.

GS mobile application can also be used to upgrade the firmware, first connect the mobile device (andriod/iOS) to the same network to which GS node (station) is connected. Using GS mobile application allow the user to browse to the firmware images on the local device. Now select the images and initiate the update.

Example 3 To demonstrate web provisioning along with reset message, execute the following sequence of commands:

AT+NSET=192.168.2.1,255.255.255.0,192.168.2.1OK

AT+WM=2OK

AT+WA=WIFIAPTEST

IP SubNet Gateway192.168.2.1:255.255.255.0:192.168.2.1OK

AT+DHCPSRVR=1OK

Start web server for provisioning.AT+WEBPROV=admin,admin,,2,,1

Provision the node (http:// 192.168.2.1/gsprov.html) to connect with standard access point in CLIENT mode.

1VV0301463 Rev. 1.0 Page 393 of 430 2018-01-24

Page 394: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

SSID=GSDemoKitCHNL=6CONN_TYPE=0MODE=0SECURITY=1DHCP_ENBL=1AP-SSID=CUMULUSAP-CHNL=6AP-BEACON-INTRL=100AP-SECURITY=3AP-PSK_PASS_PHRASE=12345678AP-STATIC_IP=192.168.8.1AP-SUBNT_MASK=255.255.255.0AP-GATEWAY_IP=192.168.8.1AP-DHCPSRVR-ENABLE=1AP-AP-DHCPSRVR-STARTIP=192.168.8.2AP-DHCPSRVR-NO-CONN=8AP-DNSSRVR-ENABLE=1AP-DNS-DOMAIN-NAME=paymentexpress.com

APP Reset-APP SW Reset

IP SubNet Gateway192.168.66.101:255.255.255.0:192.168.66.1NWCONN-SUCCESS

Connected to provisioned network without any user intervention.

8.2.3.1.2 Web Provisioning Stop

This command is used to stop Web provisioning. This command is typically done at the manufacturing line in the factory. This command can be done only once. There is no command to delete the Logo.

Command Syntax AT+WEBPROVSTOP

Synchronous Response

Table 362, page 394 describes the synchronous responses and remarks for Web Provisioning Stop command.

Table 362 Web Provisioning Stop Synchronous Responses

Responses RemarksOK Success

ERRORIf command is issued without starting web provisioning using AT+WEBPROV command.

1VV0301463 Rev. 1.0 Page 394 of 430 2018-01-24

Page 395: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

8.2.3.1.3 Web Provisioning Status

This command is used to output the current status (started or stopped) of the web provisioning and display the URIs registered.

Command Syntax AT+WEBPROV=?

URIs registered by default are as follows:

• URI:/gainspan/system/config

• URI:/gainspan/system/prov

• URI:/gainspan/system/time

• URI:/gainspan/system/certs

• URI:/gainspan/system/api

• URI:/gainspan/system/firmware

• URI:/gainspan/system/wpacertupload

• URI:/gainspan/system/sslcertupload

• URI:/gainspan/system/capabilities

Synchronous Response

Table 363, page 395 describes the synchronous responses and remarks for the Web Provisioning status command.

Table 363 Web Provisioning Status Synchronous Responses

Responses RemarksWebprov StartedURI:/gainspan/system/configURI:/gainspan/system/provURI:/gainspan/system/timeURI:/gainspan/system/certsURI:/gainspan/system/apiURI:/gainspan/system/firmwareURI:/gainspan/system/wpacertuploadURI:/gainspan/system/sslcertuploadURI:/gainspan/system/capabilitiesOKWebprov StoppedOK

Success

ERROR: INVALID INPUT If parameter is not valid.

1VV0301463 Rev. 1.0 Page 395 of 430 2018-01-24

Page 396: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

8.2.3.2 Group Provisioning

Group provisioning mode supports to provision a group of devices together. In this mode, the GS node acts as Limited AP with the following default settings:

• SSID with a prefix and MAC ID

– Prefix: GS_PROV

– MAC ID: Last 6 digits of MAC ID

Example: If MAC ID is 00:1d:c9:23:1d: 3c, then the SSID will be GS_PROV_231d3c.

• Open security in channel 1

• HTTPS server

• mDNS

8.2.3.2.1 Prerequisites

For GS node to work in Group Provisioning mode, it is mandatory to enable the following options in SDK builder:

• NCM AUTOSTART

• mDNS

• HTTPS Server

• DHCP Server

8.2.3.2.2 Procedure to Support Group Provisioning

Using SDK Builder To enable Group Provisioning mode using SDK Builder,

1. Access SDK Builder, and select Group Provisioning under Provisioning tab.

2. Click on the ‘+’ symbol to view the configuration parameters for Group Provisioning.

3. Configure the following parameters as per requirement.

NOTE: If Group Provisioning mode is enabled, then NCM AUTOSTART, mDNS, HTTPS Server, DHCP Server are enabled by default. Otherwise, this has to be enabled manually.

1VV0301463 Rev. 1.0 Page 396 of 430 2018-01-24

Page 397: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

Table 364 Group Provisioning Parameters

Using AT Commands from Host MCU

To enable Group Provisioning using AT commands from Host MCU,

1. Load SSL certificates using the following commands:AT+TCERTADD=SSL_SERVER,0,670,0AT+TCERTADD=SSL_CA,0,760,0AT+TCERTADD=SSL_KEY,0,609,0

For more information about AT+TCERTADD command, refer 7.2.7 EAP Time Validation, page 206.

2. Stop the NCM AUTO mode by executing the following command:AT+NCMAUTO=1,0,0,0AT+WD

3. Configure the GS node to support Group provisioning mode by executing the following command:AT+WM=6

4. Start the NCM AUTO by executing the following command:AT+NCMAUTO=1,1,0,0

5. Start the Group provisioning mode using the Android application.

Parameter Optional/Mandatory Value Description

Regulatory Domain Optional• FCC• ETSI• TELEC

It specifies the regulatory domain used based on User preference.

Mode Optional bgn Mixed Mode bgn Mixed is being used in Group provisioning.

Channel Optional 1-11 It specifies the channel number for the Android device.

Beacon Interval Optional50-1500Unit: milliseconds

It indicates the interval at which the Limited AP broadcasts the beacon frames. Note: Beacon Interval range of 50 is recommended in poor reception.

Broadcast SSID Optional• Enable• Disable

It specifies whether broadcasting SSID is enabled or disabled.

Security Optional OpenSecurity type Open with no authentication is being used in Group provisioning.

Stations Supported Optional 1-64 It specifies the number of stations supported during Group provisioning.

1VV0301463 Rev. 1.0 Page 397 of 430 2018-01-24

Page 398: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

8.2.3.3 Verified Provisioning

Verified provisioning is similar to normal provisioning with an additional verification step to check whether a node has been successfully provisioned or not.

Verified provisioning uses concurrent mode for verification purposes and performs the following:

1. Provisioning - A node is started in concurrent mode and both interfaces (STA interface and AP interface) are initialized. The STA interface is the one which is finally provisioned and verified and the provisioning and verification information between the STA interface and the user (smartphone/laptop) is exchanged via the AP interface. The user (smartphone/laptop) connects to the AP interface and opens the provisioning page (IP address/gsprov.html). After the provisioning information is submitted to the AP interface, it gets applied to the STA interface, and the STA interface connects to the provisioned standard Access Point in the vicinity.

2. Verification - After this point,

– STA interface sends information about status of provisioning to AP interface and the same is conveyed to the host (IP Address of STA) as well as user (laptop/smartphone).

– This step is performed with a specific HTTP POST (client-verify) done by user (laptop/smartphone) to the AP interface after sending the provisioning data. The AP interface returns the provisioned information such as SSID, BSSID, Channel, IP Address, and so on to the user.

– After successful provisioning, the system boots up in single interface mode being an STA, connected to the configured Access Point in the provisioning step. In cases of failure, the AP interface remains intact for further provisioning to be done.

Example Use Case with Procedure:

• Enable concurrent mode in the node.

• Configure index 0 for the client interface and index 1 for the AP interface.

• Configure the node to use a fixed IP address (in this example, 192.168.91.1).

• Configure the GainSpan node as a limited access point (in this example, setting it up with the SSID= GS_LAP and operating in WiFi channel 11).

• Enable the GainSpan node’s DHCP server so that clients that associate to the DHCP server can obtain an IP address automatically.

NOTE: 1.) As Verified Provisioning uses concurrent mode, the concurrent mode limitation applies and the operation may take longer and or fail intermittently. 2.)In the current firmware (5.2.1 onwards), when Select an Existing Network under Client Settings is selected, make sure that the Advanced Settings check box is checked for a successful verified provisioning. When Manual Configuration to Join a Network is selected, Verified provisioning works fine without selecting the Advanced Settings check box.

1VV0301463 Rev. 1.0 Page 398 of 430 2018-01-24

Page 399: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

• Enable the GainSpan provisioning webserver.

• Configure “storeOption”=2 (For sending the provisioned information to the serial interface and for storing the provisioned information in the GainSpan profile).

• Enable NCM auto connection so that once the system resets, it automatically connects to the provisioned AP settings.

AT+NIFCMODE=1AT+NIF=0AT+WM=0AT+NIF=1AT+WM=2AT+WRXACTIVE=1AT+NSET=192.168.91.1,255.255.255.0,192.168.91.1AT+WA=GS_LAP,,11AT+DHCPSRVR=1AT+NSTAT=?AT+WEBPROV=,,0,2,,1

1VV0301463 Rev. 1.0 Page 399 of 430 2018-01-24

Page 400: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

8.2.3.4 WPS

This command is used to associate to an access point using WPS. Upon execution of this command, the GS node uses either push button or pin method or default pin method as per the METHOD parameter to associate to the WPS enabled AP.

Enrollee If the interface is in STA mode, the GS node uses either push button or pin method as per the METHOD parameter to associate to the WPS enabled AP.

Registrar If the interface is in AP mode and the WPA registrar was initialized using AT+WA command (See 5.3.5 Association, page 140), the GS node will trigger the WPS procedure using either push button or pin method. The WPS enrollee can now join with WPS enabled AP.

Command Syntax AT+WWPS=<METHOD>[,PIN][,StoreL2ConInfo][,SSID]

For Push Button (PBC) method:

AT+WWPS=<METHOD>[,PIN][,StoreL2ConInfo][,WPS Deauth Timeout]

For Pin method and Default Pin method:

AT+WWPS=<METHOD>[,PIN][,SSID][,StoreL2ConInfo][,WPS Deauth Timeout]

Parameter Description

Table 365, page 400 describes the WPS parameters.

NOTE: a.) WPS WEP security is not supported. b.) WPS TKIP security is not supported when strict WPS 2.0 compliance is enabled. c.)GainSpan expects the MCU to enter valid pin in case of WPS registrar as per WPS 2.0 specification. d.) When a client connects to Registrar (GS Limited AP) using WPS, it receives PSK as PASSPHRASE. Refer Example.

Table 365 WPS Parameters

Parameter Optional/Mandatory Value Description

METHOD Mandatory1 Push Button method (PBC)2 Pin method3 Default Pin method

PIN Optional N/AThe pin can be any valid WPS pin (valid for pin method only). For example, 95644691.

1VV0301463 Rev. 1.0 Page 400 of 430 2018-01-24

Page 401: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

Synchronous Response

Table 366, page 401 describes the synchronous responses and remarks for the WPS command.

Command Note Upon success, host shall issue AT+NDHCP=1 to acquire network address (IP address) or configure the IP address statically (AT+NSET).

Example 1 - Push Button Configuration (PBC) method

AT+WWPS=1,,1SSID=GainSpanDemoCHANNEL=11OK

Example 2 - PIN method

AT+WWPS=2,40057583,,1SSID=GainSpanDemoCHANNEL=11OK

StoreL2ConInfo Optional0

Disable - WiFi layer (L2) configuration parameters will not be stored in the profile.

1 Enable - WiFi layer (L2) configuration parameters are stored in the profile.

Note: The StoreL2ConInfo parameter stores the WiFi layer configuration parameters which will be used during auto connection mode.

SSID

OptionalNote: It is mandatory when default PIN method (3) is used.

N/A SSID of the AP which associates with WPS procedure.

WPS Deauth Timeout Optional N/A

Time out in milliseconds between the WPS procedure and the next association with the received credential.

Table 365 WPS Parameters

Parameter Optional/Mandatory Value Description

Table 366 WPS Synchronous Responses

Responses RemarksSSID=<ssid>\r\nCHANNEL=<channel>\r\nOK

Success

ERROR:INVALID INPUT If parameters are not valid.

ERROR

Valid parameters are provided but PBC is not started or PIN is not registered in AP. GS node will scan for 2 minutes in case of PBC and PIN methods.

1VV0301463 Rev. 1.0 Page 401 of 430 2018-01-24

Page 402: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

Example 3 - Default PIN method

AT+WWPS=3,40057583,GainSpanDemoSSID=GainSpanDemoCHANNEL=11OK

Example 4 - PIN method: AP configuration with WPA/WPA2 PSK

AT+WWPS=1SSID=GainSpanDemoCHANNEL=9PASSPHRASE=917b62ce9106a8147de71d1e8dbf36f8822642013b4d51b58ef440ec35f827c0

Example 5 - GS Limited AP as Registrar

The following example shows GS Limited AP as Registrar and another GS node as Client.

Execute the following commands to configure GS Limited AP as Registrar:

AT+WRXACTIVE=1OKAT+WM=2OKAT+NSET=192.168.99.1,255.255.255.0,192.168.99.1OKAT+WSEC=8OKAT+WWPA=12345678 //*PASSPHRASE*//OKAT+WA=GainSpanDemo,,9,,1IP SubNet Gateway192.168.99.1:255.255.255.0:192.168.99.1OKAT+DHCPSRVR=1OKAT+WWPS=1OK

Execute the following commands on Client (GS Node 2) to connect to Registrar (GS Node 1):

AT+WWPS=1SSID= GainSpanDemoCHANNEL=9PASSPHRASE=917b62ce9106a8147de71d1e8dbf36f8822642013b4d51b58ef440ec35f827c0 //*PSK is recieved in the PASSPHRASE field from Registrar*//

NOTE: If the string in PASSPHRASE field is of 0-63 characters, then it is Passphrase. If the string is of 64 characters, then it is PSK.

1VV0301463 Rev. 1.0 Page 402 of 430 2018-01-24

Page 403: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

OK

8.2.3.4.1 Get WPS Status

This command is used to check the status of the WPS registrar.

Command Syntax AT+WWPS=?

Synchronous Response

Table 367, page 403 describes the synchronous responses and remarks for the WPS Status Command.

Example AT+WSEC=64OKAT+WWPA=1234567890OKAT+WM=2OKAT+NSET=192.168.91.1,255.255.255.0,192.168.91.1OKAT+WA=GainSpan_AP,,,,1 IP SubNet Gateway192.168.91.1:255.255.255.0:192.168.91.1OKAT+WWPS=?READYOKAT+WWPS=1OKAT+WWPS=?IN PROGRESS

NOTE: This command is only applicable when GS node is in limited AP mode and configured with WPA/WPA2 security.

Table 367 WPS Status Synchronous Responses

Responses RemarksREADYOK

GS node is in Limited AP mode and WPS Registrar is not initialized.

IN PROGRESSOK

GS node is in Limited AP mode and WPS Registrar is initialized (selected registrar is set to true for two minutes). Any client connects to the network using WPS within two minutes.

ERROR: INVALID INPUT GS node is not in Limited AP mode.

1VV0301463 Rev. 1.0 Page 403 of 430 2018-01-24

Page 404: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

OK

8.2.3.4.2 WPS Configuration

This command is used to print all the credentials received from AP during WPS procedure.

Command Syntax AT+WPSCONF=n

Parameter Description

Table 368, page 404 describes the WPS Configuration parameters.

Table 368 WPS Configuration Parameters

Parameter Optional/Mandatory Value Description

n Mandatory0 - Default Disable all credentials received from

AP.

1 Enable all credentials received from AP.

NOTE: a.) The command has to be issued before association (AT+WWPS=1). b.) It only displays SSID and Passphrase.

1VV0301463 Rev. 1.0 Page 404 of 430 2018-01-24

Page 405: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

8.2.3.5 WAC - Apple Wireless Authentication

This command is used to start or stop Apple’s Wireless Accessory Configuration (WAC).

Command Syntax AT+WACSTART=n

Parameter Description

Table 369, page 405 describes the WAC parameters.

Synchronous Response

Table 370, page 405 describes the synchronous responses and remarks for WAC command.

NOTE: 1.) This command can be used only when WAC ADK and Apple MFI license is purchased. 2.) For more information about WAC, refer to Apple’s documentation. 3.)WEP is not supported in WAC provisioning. 4.)It is recommended to configure the node with radio in active mode(AT+WRACTIVE=1) and store it in profile for higher success rate of WAC provisioning (during association to the provisioned AP). 5.) When binary is built using WAC provisioning S2W boots up in Limited-AP mode. For more information, see Example, page 406. 6) When binary is built using HomeKit and WAC provisioning, the radio will be in active mode by default as per design. To change the radio to power save mode, issue respective radio commands (See Radio Receiver Setting, page 431). Ensure that this is done only after pairing as power save can adversely affect or delay pairing process in some scenarios. 7) Parameter values are not stored in NCM during WAC provisioning.

Table 369 WAC Parameters

Parameter Optional/Mandatory Value Description

n Mandatory0,10: Stop1: Start

Start or stop WAC.

Table 370 WAC Synchronous Responses

Responses RemarksOK SuccessERROR: INVALID INPUT If parameter is not valid.

1VV0301463 Rev. 1.0 Page 405 of 430 2018-01-24

Page 406: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

Example To perform MCU controlled WAC Provisioning, perform the following steps:

1. Program the binary build by enabling WAC provisioning feature in SDK Builder.

2. S2W boots up as Limited-AP and WAC Start is started.

3. Stop WAC Start.

4. Stop NCM.

5. Perform a system reset and issue commands to create Limited-AP and start WAC provisioning.

AT+WACSTART=0AT+NCMAUTO=0,0,0AT&W0AT+RESET=1

AT+WM=2AT+WRXACTIVE=1AT+NSET=172.168.55.65,255.255.0.0,172.168.55.65AT+WA=GS_LAP,,11AT+DHCPSRVR=1AT+NSTAT=?AT+WEBPROV=,,0,2,,1AT+WACSTART=1

1VV0301463 Rev. 1.0 Page 406 of 430 2018-01-24

Page 407: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

8.2.4 TR50 SupportTR50 is an M2M Smart Device Communications framework which describes a transport agnostic protocol to enable bi-directional communication and monitoring of events and information between logical entities within a system.

The below AT commands showcases a standard way to package and transmit information relating to GSNode (station) with CloudWISE Server over MQTT transport.

8.2.4.1 deviceWISE Configuration

This command sets the parameters related to the deviceWISE functionality.

Command Syntax AT+DWCFG=<serverUrl>,<deviceIDSelector>,<appToken>,<security>,<heartBeat>,<autoReconnect>,<overflowHandling>,<atrunInstanceId>,[<serviceTimeout>,<contextID>[,<unused_1>[,<unused_2>]]]

Parameter Description

Table 371, page 407 describes the deviceWISE Configuration parameters.

Table 371 deviceWISE Configuration Parameters

Parameter Optional/Mandatory Value Description

serverUrl MandatoryValue range: N/AFormat: StringDefault value: N/A

It specifies the string parameter indicating the URL of the M2MService instance.

deviceID Selector MandatoryValue range:0, 1 Format: IntegerDefault value: 0

0-specifies the IMEI details of the SIM card or the CDMA ID1-specifies CCID/ESN

appToken MandatoryValue range: N/A Format: StringDefault value: N/A

It specifies the secured application token provided in the Management Portal, typically a string of 16 characters

security MandatoryValue range: 0,1 Format: IntegerDefault value: 0

0 - specifies the flag of SSL encryption being disabled.1- specifies the flag of SSL encryption enabled

heartBeat Mandatory

Value range: 10 to 86400 Format: IntegerDefault value: 60

If no packets are received in the number of seconds specified in the heartbeat field, a heartbeat message will be sent to keep the connection alive.

1VV0301463 Rev. 1.0 Page 407 of 430 2018-01-24

Page 408: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

Synchronous Response

Table 372, page 408 describes the synchronous responses and remarks for deviceWISE Configuration command.

Example 1 AT+DWCFG=api-dev.devicewise.com,0,S2WMQTTTR50TOKEN,0,3600,3,0OK

Example 2 AT+DWCFG=api-dev.devicewise.com,0,S2WMQTTTR50TOKEN,0,-3600,3,0

autoReconnect MandatoryValue range: 0, 1, 2, 3 Format: IntegerDefault value: N/A

It specifies the flag indicating connection manager to automatically reconnect to the service, where:0 – auto-reconnect disabled1 – auto-reconnect lazy - reconnect on next send and every 3600 seconds.2 – auto-reconnect moderate (default) - reconnect 120 seconds, then every 3600 seconds after the first day.3 – auto-reconnect aggressive - reconnect every 120 seconds.

overflowHandling MandatoryValue range: 0, 1Format: IntegerDefault value: 0

It specifies the flag indicating the data management overflow, where:0 – FIFO (default)1 – LIFO

atruninstanceID OptionalValue range: 0 to 4Format: IntegerDefault value: 4

It specifies the AT instance used by the service to run the AT Command.

serviceTimeout OptionalValue range: 1 to 20Format: IntegerDefault value: 5

It specifies the maximum time interval for a service request to the server in seconds

contextID OptionalValue range: 1 to 5Format: IntegerDefault value: 1

It specifies the PDP context used for network connection

Table 371 deviceWISE Configuration Parameters (Continued)

Parameter Optional/Mandatory Value Description

Table 372 deviceWISE Configuration Synchronous Responses

Responses RemarksOK Success

ERROR: <Error code> If parameter is not valid or any other error occurs. It gives the type of error too.

1VV0301463 Rev. 1.0 Page 408 of 430 2018-01-24

Page 409: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

ERROR: -18001

8.2.4.1.1 Read deviceWISE Configuration

This command provides the current configuration setting for deviceWISE Cloud server.

Command Syntax AT+DWCFG?

Synchronous Response

Table 373, page 409 describes the synchronous responses and remarks for Read deviceWISE Configuration command.

Example AT+DWCFG?#DWCFG: api-dev.devicewise.com,0,S2WMQTTTR50TOKEN,0,3600,3,0,4,5,1,0,0OK

Table 373 Read deviceWISE Configuration Synchronous Responses

Responses Remarks

<serverUrl>,<deviceIDSelector>,<appToken>,<security>,<heartBeat>,<autoReconnect>,<overflowHandling>,<atrunInstanceId>,<serviceTimeout>,<contextID>,,0,0

serverUrl: It specifies the string parameter indicating the URL of the M2MService instance.

deviceID Selector: 0-specifies the IMEI details of the SIM card or the CDMA ID1-specifies CCID/ESN

appToken: It specifies the secured application token provided in the Management Portal, typically a string of 16 characters

Security: 0 - specifies the flag of SSL encryption being disabled.1- specifies the flag of SSL encryption enabled

Note: For all the parameter explaion please see Parameter Description of AT+DWCFG command.

1VV0301463 Rev. 1.0 Page 409 of 430 2018-01-24

Page 410: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

8.2.4.1.2 Test deviceWISE Configuration

This command provides the supported range for each of the deviceWISE configuration parameters.

Command Syntax AT+DWCFG=?

Synchronous Response

Table 374, page 410 describes the synchronous responses and remarks for Test deviceWISE Configuration command.

Example AT+DWCFG=?0-1,0-1,10-86400,0-3,0-1,0-4,1-120,1-5,128,16OK

8.2.4.2 deviceWISE Connection

This command connects or disconnects to m2m service on deviceWISE cloud.

Command Syntax AT+DWCONN=<connect>

Parameter Description

Table 375, page 411 describes the deviceWISE Connection parameters.

Table 374 Test deviceWISE Configuration Synchronous Responses

Responses Remarks

<deviceIDSelector>, <security>, <heartBeat>,<AutoReconnect>,<overflowHandling>,<atrunInstanceId>,<serviceTimeout> and <contextID>, and the maximum length of <serverUrl> and <appToken> parameters.

deviceID Selector: 0-specifies the IMEI details of the SIM card or the CDMA ID1-specifies CCID/ESN

Security: 0 - specifies the flag of SSL encryption being disabled.1- specifies the flag of SSL encryption enabled

Note: For all the parameter explaion please see Parameter Description of AT+DWCFG command.

1VV0301463 Rev. 1.0 Page 410 of 430 2018-01-24

Page 411: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

Synchronous Response

Table 376, page 411 describes the synchronous responses and remarks for deviceWISE Connection command.

Example For successful deviceWISE Connection:AT+DWCONN=1OK

For a failed deviceWISE Connection:AT+DWCONN=1ERROR: -18315

8.2.4.2.1 Read deviceWISE Connection

This command provides the current configuration setting in the below format:

Command Syntax AT+DWCONN?Synchronous Response

Table 377, page 412 describes the synchronous responses and remarks for Read deviceWISE Connection command.

Table 375 deviceWISE Connection Parameters

Parameter Optional/Mandatory Value Description

connect MandatoryValue range: 0, 1Format: IntegerDefault value: 0

It specifies the flag to connect or disconnect to the M2M Services0 - performs socket Disconnection1 - performs socket Connection and MQTT Connection

Table 376 deviceWISE Connection Synchronous Responses

Responses RemarksOK Success

ERROR: <Error code> If parameter is not valid or any other error occurs.

1VV0301463 Rev. 1.0 Page 411 of 430 2018-01-24

Page 412: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

Example AT+DWCONN?#DWCONN: 1,3OK

Table 377 Read deviceWISE Connection Synchronous Responses

Responses Remarks

<connect>,<status>

Connect : It specifies the flag to connect or disconnect to the M2M Services0 - performs socket Disconnection1 - performs socket Connection and MQTT Connection.

Status : It specifies the connection state of M2M service.0 = disconnected1 = trying to connect2 = connected3 = waiting to connect

1VV0301463 Rev. 1.0 Page 412 of 430 2018-01-24

Page 413: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

8.2.4.2.2 Test deviceWISE Connection

This command provides the supported range of parameters for test deviceWISE connection commands.

Command Syntax AT+DWCONN=?

Parameter Description

Table 378, page 413 describes the synchronous responses and remarks for Test deviceWISE Connection command.

Example AT+DWCONN=?0-1OK

There is no failure case for this command.

8.2.4.3 deviceWISE Connection Status

This command provides the status of the connection, including runtime statistics in a generic structure.

Command Syntax AT+DWSTATUS

Synchronous Response

Table 376, page 411 describes the synchronous responses and remarks for deviceWISE Connection Status command.

Table 378 Test deviceWISE Connection Synchronous Responses

Responses Remarks

<connect>

Connect: It specifies the flag to connect or disconnect to the M2M Services0 - performs socket Disconnection1 - performs socket Connection and MQTT Connection.

1VV0301463 Rev. 1.0 Page 413 of 430 2018-01-24

Page 414: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

Example AT+DWSTATUS#DWSTATUS: 3,0,-1,0,0,0,0OK

8.2.4.3.1 Test deviceWISE Connection Status

This command provides the current status of the deviceWISE connection with an OK response.

Command Syntax AT+DWSTATUS=?Synchronous Response

Table 376, page 411 describes the synchronous responses and remarks for Test deviceWISE Connection Status command.

Table 379 deviceWISE Connection Status Synchronous Responses

Responses Remarks

<connected>, <lastErrorCode>, <latency>,<pktsIn>, <pktsOut>, <bytesIn>, <bytesOut>

<connected>: 3 - waiting to connect, 2 - connected, 1 - trying to connect, 0 - disconnected

<lastErrorCode>: specifies the last error code encountered by the client

<latency>: specifies the time milliseconds measured between last request and reply.

<pktsIn>: specifies number of packets received, tracked by the server

<pktsOut>: specifies number of packets sent.

<bytesIn>: specifies number of bytes received, TCP/IP payload

<bytesOut>: specifies the number of bytes sent.

1VV0301463 Rev. 1.0 Page 414 of 430 2018-01-24

Page 415: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

Example AT+DWSTATUS=?OK

8.2.4.4 Send deviceWISE Data

This command sets permits to send formatted data to M2M service.

Command Syntax AT+DWSEND=<type>,<param_1>[,<param_2>[,…[<param_n>]]]

Parameter Description

Table 381, page 417,describes the Send deviceWISE Data Parameters.

Table 380 Test deviceWISE Connection Status Synchronous Responses

Responses RemarksOK Success

1VV0301463 Rev. 1.0 Page 415 of 430 2018-01-24

Page 416: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

1VV0301463 Rev. 1.0 Page 416 of 430 2018-01-24

Page 417: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

Para

type

an

se

f the

0 is

iates

ame nt.

Note: ng, that cNote: t the respo d AT+DThe reIt is p

Table 381 Send deviceWISE Data Parameter

meter Optional/Mandatory Value Description

MandatoryValue range: 0,1,2,3Format: IntegerDefault value: 0

It specifies the type code for the type of message to send.0 - for normal request1 - for method request2 - for method update3 - for method acknowledgmentType 0 message format:<param_1> - command – the api command to execute.<param_i> - string parameter indicating the i-th parameter Type 1 message format:<param_1> - “thingKey” – the key of a thing to execute.<param_2> - timeout – time to wait in seconds before returningerror for the request.<param_3> - method – the method key of a thing to execute.<param_4> - is singleton – 0 or 1. 1 if no more than one of theinstance can exist.<param_5+> - parameters for the method. String parameter indicating the n-th parameter, with n=1,…,20. Type 2 message format:<param_1> - id – the identification of the method instance.<param_2> - message – a message represents the current status omethod. Type 3 message format:<param_1> - id – the identification of the method instance.<param_2> - status – the integer result status for the execution.reserved for OK.<param_3 when status is set to non-zero> - error message assocwith the status.<param_3 when status is set to zero> - return parameters for themethod. Key value pair should be used. param_n should be the nof the element and param_n+1 should be the value of the eleme

There is no limit on the length of the single <param_n>, but there is a limit in the total length of the AT command striannot exceed 256 characters. If this threshold is exceeded, then an ERROR is raised. There is also a limit of 20 messages on the receive queue. If the queue is full, the consequent send will still succeed bunse for that particular request will be dropped until an item is removed from this queue (See command AT+DWRCV anWRCVR).sponse to the AT+DWSEND command reports the <msgId> value that identifies the sending.

ossible to issue AT+DWSEND only if the connection has been opened with AT+DWCONN

1VV0301463 Rev. 1.0 Page 417 of 430 2018-01-24

Page 418: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

Table 382, page 418, describes the synchronous response and remarks for Send deviceWISE Data command

Example 1 AT+DWSEND=0,property.publish,key,light,value,2.5OK

Example 2 AT+DWSEND=0,property,publish,key,light1,value,1993#DWSEND:1OK

8.2.4.4.1 Test Send deviceWISE Data

This command provides the supported range of parameter <type> for the send deviceWISE data command.

Command Syntax AT+DWSEND=?

Synchronous Response

Table 383, page 418, describes the synchronous response and remarks for Test Send deviceWISE Data command

Example AT+DWCONN=?0-3OK

There is no failure case for this command.

Table 382 Send deviceWISE Data Synchronous Responses

Responses RemarksOK Success

ERROR If parameter is not valid or any other error occurs.

Table 383 Test Send deviceWISE Data Synchronous Responses

Responses Remarks

<type>

<type>: specifies the type code for the type of message to send. 0 for normal request;1 for method request; 2 for method update; 3 for method acknowledgment.

1VV0301463 Rev. 1.0 Page 418 of 430 2018-01-24

Page 419: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

8.2.4.5 deviceWISE Enable

This command provides the user to Enable or Disable up to 8 different deviceWISE features.

Command Syntax AT+DWEN=<feature>,<enable>[,<option1>,<option2>,<option3>, <option4>,<option5>]

Parameter Description

Table 384, page 419 describes the deviceWISE Enable parameters.

Example 1 AT+DWEN=0,1OK

Example 2 AT+DWEN=0,1-6,8ERROR: -18001

8.2.4.5.1 Read deviceWISE Enable

This command returns the current setting of each feature.

Command Syntax AT+DWEN?

Synchronous Response

Table 385, page 420, describes the synchronous response and remarks for Read deviceWISE Enable command

Table 384 deviceWISE Enable Parameters

Parameter Optional/Mandatory Value Description

feature MandatoryValue range: 0 - 7Format: IntegerDefault value: N/A

It specifies the range of deviceWISE features that is enabled.0 - remote AT commands1 - location reporting2 to 7 - reserved for future use.

enable MandatoryValue range: 0, 1Format: IntegerDefault value: N/A

0 - enables the deviceWISE feature1 - disables the deviceWISE feature.Note: The value is considered only at the very first connection to M2M Service (AT+DWCONN=1) after a device power on or reboot

option(1 to 5) OptionalValue range: 0, 1Format: StringDefault value: N/A

It specifies the option depending on the featureNote: Feature 0 (remote AT commands) as no option.

1VV0301463 Rev. 1.0 Page 419 of 430 2018-01-24

Page 420: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

Example AT+DWEN?#DWEN: 0,0#DWEN: 1,0OK

Table 385 Read deviceWISE Enable Synchronous Responses

Responses Remarks

<feature>,<enable>,<option1>,<option2>, <option3>,<option4>,<option5>

<feature> - feature to enable or disable; range (0-7)0 – remote at commands2 … 7 – reserved for future use.

<enable> - enable or disable the features0 – disable the feature1 – enable the feature

<optionX>: where X=1,.,5 - optional parameters depending on the feature(string)

Note: Feature 0 has no option and the <en> value is considered only at the very first connection to M2M service (AT+DWCONN=1) after the device power ON or reboots.

1VV0301463 Rev. 1.0 Page 420 of 430 2018-01-24

Page 421: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

8.2.4.5.2 Test deviceWISE Enable

This command provides the range of values for the feature, enable and optional parameters of deviceWISE Enable.

Command Syntax AT+DWEN=?

Example AT+DWEN=?0-7,0-1,0OK

1VV0301463 Rev. 1.0 Page 421 of 430 2018-01-24

Page 422: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

8.2.4.6 Send Raw deviceWISE Data

This command sets permits to send raw data to M2M service.

Command Syntax AT+DWSENDR=<datalen>

Parameter Description

Table 386, page 422 describes the Send Raw deviceWISE Data parameters.

Synchronous Response

Table 387, page 422 describes the synchronous responses and remarks for Send Raw deviceWISE Data command.

Example 1 AT+DWSENDR=129> [After this send below data:]{ "0" : { "command" : "diag.echo", "params" : { "param1" : "value1", "param2" : 2, "param3" : true } }} #DWSENDR: 1

NOTE: Content must be valid JSON.

Table 386 Send Raw deviceWISE Data Parameters

Parameter Optional/Mandatory Value Description

datalen MandatoryValue range: 1-1500Format: IntegerDefault value: N/A

It specifies the number of bytes to be sent.

Note: The response to AT+DWSENDR command reports the <msgID> value that identifies the sending, the module responds with a prompt <greater_than><space> and waits for the data to send.When <dataLen> bytes have been sent, operation is automatically completed.There is also a limit of 20 messages on the receive queue. If the queue is full, the consequent send will still succeed but the response for that particular request will be dropped until an item is removed from this queue (See command AT+DWRCV and AT+DWRCVRIt is possible to issue AT+DWSENDR only if the connection has been opened with AT+DWCONN

Table 387 Send Raw deviceWISE Data Synchronous Responses

Responses Remarks#DWSENDR: <msgID> Success

ERROR: <Error code> If parameter is not valid or any other error occurs.

1VV0301463 Rev. 1.0 Page 422 of 430 2018-01-24

Page 423: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

Example 2 AT+DWSENDR=129> [After this send below data:]{ "0" : { "command" : "diag.echo", "params" : { "param1" : "value1", "param2" : 2, "param3" : true } ERROR: -18007

8.2.4.6.1 Test Send Raw deviceWISE Data

This command provides the range of value for <datalen> parameter.

Command Syntax AT+DWSENDR=?

8.2.4.7 deviceWISE Ring

The incoming Server data from the device is notified by the “URC #DWRING” with the following format

Command Syntax AT+DWRING=<type>,<msgID>,<length>

Parameter Description

Table 388, page 423 describes the deviceWISE Ring parameters.

8.2.4.8 Receive deviceWISE Data

This command provides the user to read formatted data arriving from the M2M Service and the module is notified of these data by the URC #DWRING.

Table 388 deviceWISE Ring Parameters

Parameter Optional/Mandatory Value Description

type MandatoryValue range: N/AFormat: IntegerDefault value: N/A

It specifies the type of message to receive.

msgID MandatoryValue range: >=1Format: IntegerDefault value: N/A

It specifies the value that identifies the sending from the device.

length MandatoryValue range: N/AFormat: IntegerDefault value: N/A

It is the length of the data

1VV0301463 Rev. 1.0 Page 423 of 430 2018-01-24

Page 424: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

Command Syntax AT+DWRCV=<msgID>

Parameter Description

Table 389, page 424 describes the Receive deviceWISE Data parameters.

Synchronous Response

Table 390, page 424 describes the synchronous responses and remarks for Recieve deviceWISE Data command.

Example 1 AT+DWRCV=1#DWDATA:1,0,2,OKOK

Example 2 AT+DWRCV=1ERROR: Failed : -18103

NOTE: 1). If the data received is the consequence of data send using command AT+DWSEND then the <msgID> value is the same as the AT+DWSEND <msgID>. 2).This incoming data is notified by URC #DWRING.

Table 389 Receive deviceWISE Data Parameters

Parameter Optional/Mandatory Value Description

msgID MandatoryValue range: >=1Format: IntegerDefault value: N/A

It specifies the index of the data to be received, as indicated in the URC #DWRING.

NOTE: 1).AT+DWRCV command can be issued only if the connection is open with AT+DWCONN, else there would be an error indication. 2).If the data received is the consequence of previous data send issued using the command AT+DWSEND, then the data can be read using AT+DWRCV command. 3).AT+DWRCV and AT+DWRCVR are not interchangeable.

Table 390 Recieve deviceWISE Data Synchronous Responses

Responses RemarksOK Success

ERROR: <Error code> If parameter is not valid or any other error occurs.

1VV0301463 Rev. 1.0 Page 424 of 430 2018-01-24

Page 425: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

8.2.4.8.1 deviceWISE Data

If the incoming data are accepted with AT+DWRCV, then the formatted data are received is:

Command Syntax AT+DWDATA=<msgID>,<errorCode>,<length>,<parameter_1>[,<parameter_2>[....,[prameter_n>]]]

Parameter Description

Table 391, page 425 describes the deviceWISE Data parameters.

8.2.4.8.2 Test Receive deviceWISE Data

This command provides the value of all the parameter.

Command Syntax AT+DWRCV=?

Example AT+DWRCV=?>=1OK

There is no failure case for this command.

Table 391 deviceWISE Data Parameters

Parameter Optional/Mandatory Value Description

msgID MandatoryValue range: >=1Format: IntegerDefault value: N/A

It specifies the length of the data to be received.

error MandatoryValue range: 0Format: IntegerDefault value: N/A

It specifies the error code of the message received.0 - specifies no error.

length MandatoryValue range: N/AFormat: IntegerDefault value: N/A

It is the length of the data

parameter_n MandatoryValue range: N/AFormat: StringDefault value: N/A

It specifies the string parameter indicating the i-th parameter associated to the type specified

1VV0301463 Rev. 1.0 Page 425 of 430 2018-01-24

Page 426: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

8.2.4.9 Receive Raw deviceWISE Data

This command provides the user to read raw data arriving from the M2M Service and the module is notified of these data by the URC #DWRING.

Command Syntax AT+DWRCVR=<msgID>

Parameter Description

Table 392, page 426 describes the Receive Raw deviceWISE Data parameters.

Synchronous Response

Table 393, page 426 describes the synchronous responses and remarks for Receive Raw deviceWISE Data command.

NOTE: 1). If the data received is the consequence of data send using command AT+DWSENDR then the <msgID> value is the same as the AT+DWSENDR <msgID>. 2).This incoming data is notified by URC #DWRING.

Table 392 Receive Raw deviceWISE Data Parameters

Parameter Optional/Mandatory Value Description

msgID MandatoryValue range: >=1Format: IntegerDefault value: N/A

It specifies the index of the data to be received, as indicated in the URC #DWRING.

NOTE: 1).AT+DWRCVR command can be issued only if the connection is open with AT+DWCONN, else there would be an error indication. 2).If the data received is the consequence of previous data send issued using the command AT+DWSENDR, then the data can be read using AT+DWRCVR command. 3).AT+DWRCV and AT+DWRCVR are not interchangeable.

Table 393 Receive Raw deviceWISE Data Synchronous Responses

Responses RemarksOK Success

ERROR: <Error code> If parameter is not valid or any other error occurs.

1VV0301463 Rev. 1.0 Page 426 of 430 2018-01-24

Page 427: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

Example 1 AT+DWRCVR=2#DWDATA:2,0,76,{"0":{"success":true,"params":{"param1":"value1","param2":2,"param3":true}}}OK

Example 2 AT+DWRCVR=2ERROR: Failed : -18103

8.2.4.9.1 deviceWISE Data

If the incoming data are accepted with AT+DWRCVR, then the formatted data are received is:

Command Syntax AT+DWRDATA=<msgID>,<error>,<length>,<data>

Parameter Description

Table 394, page 427 describes the deviceWISE Raw Data parameters.

8.2.4.9.2 Test Receive Raw deviceWISE Data

This command provides the value of all the parameter.

Command Syntax AT+DWRCVR=?

Example AT+DWRCV=?>=1OK

There is no failure case for this command.

Table 394 deviceWISE Raw Data Parameters

Parameter Optional/Mandatory Value Description

msgID MandatoryValue range: >=1Format: IntegerDefault value: N/A

It specifies the length of the data to be received.

error MandatoryValue range: 0Format: IntegerDefault value: N/A

It specifies the error code of the message received.0 - specifies no error.

length MandatoryValue range: N/AFormat: IntegerDefault value: N/A

It is the length of the data

data MandatoryValue range: N/AFormat: StringDefault value: N/A

It specifies the data from M2M service

1VV0301463 Rev. 1.0 Page 427 of 430 2018-01-24

Page 428: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

8.2.4.10 List of Information on message Pending from deviceWISE server

This command provides the user to obtain information regarding the messages pending from M2M service in the following format:

Command Syntax AT+DWLRCV=<msg_number>[,<msgId_1>,<msg_1_len>[,<msgId_2>,<msg_2_len>[,……<msgId_n>,<msg_n_len>]]]

Parameter Description

Table 395, page 428 describes the List of Information on message Pending from deviceWISE server parameters.

Example AT+DWLRCV#DWLRCV:2,3,2,4,2OK

There is no failure case for this command.

8.2.4.10.1 Test List of Information on message Pending from deviceWISE server

This command provides the current status with a response OK.

Command Syntax AT+DWLRCV=?

Example AT+DWLRCV=? OK

There is no failure case for this command.

Table 395 List of Information on message Pending from deviceWISE serverParameters

Parameter Optional/Mandatory Value Description

msg_number MandatoryValue range: >=0Format: IntegerDefault value: N/A

It specifies the number of services pending for M2M service.

msg_n OptionalValue range: >=0Format: IntegerDefault value: N/A

It specifies the index of the n-th data message to receive

msg_n_length MandatoryValue range: >=0Format: IntegerDefault value: N/A

It specifies the length of the n-th data message to receive

NOTE: AT+DWRCVR command can be issued only if the connection is open with AT+DWCONN, else there would be an error indication.

1VV0301463 Rev. 1.0 Page 428 of 430 2018-01-24

Page 429: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

1VV0301463 Rev. 1.0 Page 429 of 430 2018-01-24

Page 430: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

1VV0301463 Rev. 1.0 Page 430 of 430 2018-01-24

Page 431: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

Chapter 9 Power Management - Radio and System

This chapter describes the commands for configurations and operations related to power management for radio and system.

• Radio Receiver Setting, page 431

• Battery Measurement, page 437

• System Power Save, page 441

9.1 Radio Receiver Setting

9.1.1 Active Radio ReceiveThis command is used to enable/disable the 802.11 radio receiver. This minimizes latency and ensures that packets are received at the cost of increased power consumption. The GS node cannot enter Deep Sleep (see 9.3.3 Deep Sleep, page 451) even if it is enabled (AT+PSDSLEEP). The Power Save mode (see 9.1.3 Custom Power Save Radio Receive, page 436) can be enabled but will not save power, since the receiver is left on.

Command Syntax AT+WRXACTIVE=n

Parameter Description

Table 396, page 431 describes the Enable/Disable 802.11 Radio parameters.

Synchronous Response

Table 397, page 431 describes the synchronous responses and remarks for the Enable/Disable 802.11 Radio command.

Table 396 Enable/Disable 802.11 Radio Parameters

Parameter Optional/Mandatory Value Description

n Mandatory0 (default) 802.11 radio receiver is off1 802.11 radio receiver is always on

Table 397 Enable/Disable 802.11 Radio Synchronous Responses

Responses RemarksOK Success

ERROR: INVALID INPUTInvalid parameter(If n value is other than 0 or 1)

1VV0301463 Rev. 1.0 Page 431 of 456 2018-01-24

Page 432: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

Example AT+WRXACTIVE=1OK

AT+WRXACTIVE=1OK

AT+WRXACTIVE=0OK

AT+WRXACTIVE=0OK

Example Use Case 1 Radio receiver is always on, Power Save mode is enabled but will not save power since the receiver is left on.

AT+WRXACTIVE=1OK

AT+WRXPS=1OK

Example Use Case 2 The receiver is switched off. The node will not receive any packets at this time.AT+WRXACTIVE=0OK

AT+WRXPS=0OK

NOTE: The number of times radio is enabled using AT+WRXACTIVE, that many times has to be disabled.

1VV0301463 Rev. 1.0 Page 432 of 456 2018-01-24

Page 433: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

9.1.2 Standard Power Save Radio Receive based on DTIM/Listen Interval

9.1.2.1 IEEE PS Poll Listen Interval

This command is issued once to configure the mode (DTIM based wakeup, Listen interval based wake up or Custom wake up) and then to enable the configuration (in commands issued when configured for listen interval based wakeup). Configuration is to be issued only once and then enable/disable can be done at run time to control radio.

Command Syntax AT+WIEEEPSPOLL=<enable>[,listenInterval][,wakeupType][,wakeupInterval][,BeaconWaitTimeout][,DataRxType][,ActiveToOffTimeout][,SwitchToActivePeriod]

Command Note The radio of the STA can be controlled only with 3 AT commands for GS node. They are AT+WRXACTIVE, AT+WRXPS, and AT+WIEEEPSPOLL.

Parameter Description

Table 398, page 433 describes the IEEE PS Poll Listen Interval parameters.

NOTE: 1).It is recommended that the users building a binary that supports PS Poll feature (using SDK Builder) do not enable Concurrent mode and WFD binary at the same time. This is done to avoid increase in boot time due to larger binary size which results in beacon miss. 2).NCM with PS-Poll is does not support web provisioning (web page related) features.

Table 398 IEEE PS Poll Listen Interval Parameters

Parameter Optional/Mandatory Value Description

enable Mandatory

0 Disable IEEE PS

1 Enable IEEE PS (wakeupType tells whether DTIM or Listen interval)

2 Configure IEEE PSNote: enable/disable is used run-time to control radio while remaining parameters will be used only for configuration when required. If configuration is not specified, last configuration will be used.

listenInterval Optional (if n is enabled then this parameter is valid) 1-65535

The GS node will set the listen interval for n beacons. Although this is a 16-bit value, the maximum recommended is 10-bit.

1VV0301463 Rev. 1.0 Page 433 of 456 2018-01-24

Page 434: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

Example - AT+WRXACTIVE

If AT+WRXACTIVE = 1, then the radio is always ON. No power save is done in this case. Regardless of what the parameters for the other two commands are, the radio will receive all the packets. Rest of the commands are “Don’t Care.”

Example - AT+WRXPS

If AT+WRXPS = 1, Regardless of what the parameters for AT+WIEEEPSPOLL are, the STA will wake up for every beacon. AT+WIEEEPSPOLL is a “Don’t Care” in this case.

If AT+WRXPS = 0, the STA will not wake up for every beacon. Based on the AT+WIEEEPSPOLL, the wake will be decided as explained further.

Example - AT+WIEEEPSPOLL

This command can be used for three purposes:

– To configure the Power Save behavior

– To Enable the Power Save

– To Disable the Power Save

Usage - Configuration of Power Save

To configure the Power Save behavior on the STA, the first parameter of the command should be 2. The STA can be configured in 3 ways:

– Wake up for Listen Interval

WakeupType Optional (valid if wakeup type is listen interval and custom) 0 - 3

0: DTIM based wakeup1: Listen interval based wakeup2: Custom wakeup3: DTIM aligned custom wakeup

wakeupInterval Optional beacon interval Wakeup Interval to be used for listening to beacons if it is custom wakeup.

BeaconWaitTimeout Optional 50ms (default) Maximum time allowed to wait for beacon reception after wakeup.

DataRxType Optional0

Receive buffered data using Legacy PS-POLL or WMM UAPSD, whatever AP supports.

1 Switch to active mode to receive buffered data.

ActiveToOffTimeout Optional N/A

Time to be in active radio state if DataRxType is switched to active mode. Time is extended whenever a frame is received and radio state is turned off after timeout. A null frame is sent to AP to indicate transition to doze state.

SwitchToActivePeriod Optional N/A

Time in milliseconds after which DUT switches to Active stateeven though TIM bit is not set in AP.

Note: All the Optional parameters need to configured with their default values.

Table 398 IEEE PS Poll Listen Interval Parameters (Continued)

Parameter Optional/Mandatory Value Description

1VV0301463 Rev. 1.0 Page 434 of 456 2018-01-24

Page 435: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

– Wake up for DTIM

– Wake up for a custom number of beacons

Wake up for Listen Interval

To configure the STA to wake up for the listen interval, the command is AT+WIEEEPSPOLL=2,10,1. This means that the STA will advertise in the Association Request that the listen interval will be for every 10 beacons. Once associated, the STA will wake up for every 10 beacons.

Wake up for DTIM To configure the STA to wake up for every DTIM interval, the command is AT+WIEEEPSPOLL=2,,0. Here we did not specify the listen interval as that will be the default. In this case, the STA will advertise the default Listen Interval in the Association Request. Once associated, the STA will wake up for every DTIM interval that has been configured on the AP.

Custom Wake up To configure the STA to wake up at a custom interval, the command is AT+WIEEEPSPOLL=2,,2,5. Here also, we did not specify the listen interval, that will be the default. The STA will advertise the default Listen Interval in the Association Request. Once associated, the STA will wake up for every 5 beacons.

Difference between Listen Interval based Wake up Versus Custom Wake up

At the outset, both of these options do the same thing - to wake the STA based on the number of beacons given.

Either of these options can be used to wake the STA. However, the use case is as follows:

Example Use Case Whenever the STA is needed to wake up at some configured interval, the Custom Wake up option should be used. While configuring the custom wake up parameters, the listen interval should not be entered; the default listen interval will be used in the association request. Usually, in the association request, the STA will advertise the listen interval as a large value (e.g., 10 beacons). The configuration of the custom wake up interval will be less than the listen interval (e.g., 5 beacons). In this case, the STA bluffs to the AP while associating telling that it will wake up for every 10 beacons. But, in reality, it will wake up for every 5 beacons. This is just to ensure that the AP shouldn’t drop the buffered frames in case the PS Poll request from the STA does not reach the AP.

Enable Power Save To enable the power save on the STA, the command is AT+WIEEEPSPOLL=1. Whenever AT+WIEEEPSPOLL is given as 1, the STA will take the last power save configuration into effect. So, the user should first configure the behavior and then enable the power save.

Disable Power Save To disable the power save on the STA, the command is AT+WIEEEPSPOLL=0. When this command is executed, the radio is fully off. Order of Precedence between commands - WRXACTIVE > WRXPS > WIEEEPSPOLL.

Command Note If the power save behavior is changed after the association is done, the new changes will take into effect only for the next association.

1VV0301463 Rev. 1.0 Page 435 of 456 2018-01-24

Page 436: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

9.1.3 Custom Power Save Radio ReceiveThis command is used to enter Power Save Mode. Once enabled, radio will be switched off (after informing AP) when ever possible (e.g., in between beacons intervals, when there is no data transmission). Since module inform AP about its inactivity, AP shall buffer all the incoming unicast traffic during this time.

Command Syntax AT+WRXPS=n

Parameter Description

Table 399, page 436 describes the Enable/Disable 802.11 Power Save Mode parameters.

Synchronous Response

Table 400, page 436 describes the synchronous responses and remarks for the Enable/Disable 802.11 Power Save Mode command.

Example AT+WRXACTIVE=0OK

AT+WRXPS=1OK

Prior to issuing this command the radio should be off (AT+WRXACTIVE=0), otherwise there is no effect of power save, if radio receiver is on.

In this case the node will inform the Access Point that it will go to sleep, and the Access Point will buffer any packets addresses to that node. The node will awaken to listen to periodic beacons from the Access Point that contains a Traffic Indication Map (TIM) that will inform the Station if packets are waiting for it. Buffered packets can be retrieved at that time, using PSPoll commands sent by the node. In this fashion, power consumed by the radio is reduced (although the benefit obtained depends on traffic load and beacon timing), at the cost of some latency. The latency encountered depends in part on the timing of

NOTE: Refer to the AT+WIEEEPSPOLL command for 802.11 power save mode.

Table 399 Enable/Disable 802.11 Power Save Mode Parameters

Parameter Optional/Mandatory Value Description

n Mandatory0 Power Save mode is disabled1 (default) Power Save mode is enabled

Table 400 Enable/Disable 802.11 Power Save Mode Synchronous Responses

Responses RemarksOK Success

ERROR:INVALID INPUTIf parameters are not valid(If n value is other than 0 or 1)

1VV0301463 Rev. 1.0 Page 436 of 456 2018-01-24

Page 437: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

beacons, set by the Access Point configuration. Many Access Points default to 100msec between beacons; in most cases this parameter can be adjusted.

9.2 Battery Measurement

9.2.1 Battery Check Start

This command is used to send out a unit of battery check frequency in number of packets from the Serial-to-WiFi Application, and store the resulting values in nonvolatile memory. Only the most recent value is stored. Battery checks are performed during packet transmission to ensure that they reflect loaded conditions. Battery checks can be used to ensure that a battery-powered system is provided with sufficient voltage for normal operation. Low supply voltages can result in data corruption when profile data is written to flash memory.

Command Syntax AT+BCHKSTRT=<Frequency>

Parameter Description

Table 401, page 437 describes the Battery Check Start parameters.

Synchronous Response

Table 402, page 437 describes the synchronous responses and remarks for Battery Check Start command.

Table 401 Battery Check Start Parameters

Parameter Optional/Mandatory Value Description

Frequency Mandatory 1-100 packets

It specifies the number of packets GS node sends before performing the battery check.Example: When Frequency is configured as 10, GS node performs the battery check after every 10 packets are transmitted.

Table 402 Battery Check Start Synchronous Responses

Responses RemarksOK SuccessERROR:INVALID INPUT If parameters are not valid.

1VV0301463 Rev. 1.0 Page 437 of 456 2018-01-24

Page 438: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

9.2.2 Battery Warning/Standby Level Set

This command is used to set the battery warning/standby level to and enable the GS node’s internal battery level monitoring logic starts. This command should be executed before the battery check start command (see 9.2.1 Battery Check Start, page 437).

Command Syntax AT+BATTLVLSET=<Warning Level>,<Warning Frequency>,<Standby Level>

Parameter Description

Table 403, page 438 describes the Battery Warning/Standby Level Set parameters.

Synchronous Response

Table 404, page 438 describes the synchronous responses and remarks for Battery Warning/Standby Level Set command.

Table 403 Battery Warning/Standby Level Set Parameters

Parameter Optional/Mandatory Value Description

Warning Level Mandatory N/A

The battery voltage, in millivolts. When the GS node batter voltage is less than this level, it sends a message “Battery Low” to the serial interface.

Warning Frequency Mandatory N/A

This is the frequency at which the GS node sends the “Battery Low” message to the serial interface once the GS node’s battery check detected low battery.

Standby Level Mandatory N/A

The battery voltage, in millivolts. When the GS node battery voltage reaches this level, it sends the message “Battery Dead” to the serial interface and goes into a long Standby mode.

Table 404 Battery Warning/Standby Level Set Synchronous Responses

Responses RemarksOK SuccessERROR:INVALID INPUT If parameters are not valid.

1VV0301463 Rev. 1.0 Page 438 of 456 2018-01-24

Page 439: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

9.2.3 Battery Check Set

This command is used to set/reset the battery check period after the battery check has been started. Upon receipt, the GS node records the new value of the battery check frequency so that GS node performs the battery voltage check with the new value set.

Command Syntax AT+BCHK=<Battery check frequency>

Alternate Command

The same command can be used to get the current configured battery check period, the usage as follows:

AT+BCHK=?

Parameter Description

Table 405, page 439 describes the Battery Check Set parameters.

Synchronous Response

Table 406, page 439 describes the synchronous responses and remarks for Battery Check Set command.

Table 405 Battery Check Set Parameters

Parameter Optional/Mandatory Value Description

Battery check frequency Mandatory 1-100 The valid range for Battery check frequency is between 1 and 100.

Table 406 Battery Check Set Synchronous Responses

Responses RemarksOK SuccessERROR:INVALID INPUT If parameters are not valid.

1VV0301463 Rev. 1.0 Page 439 of 456 2018-01-24

Page 440: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

9.2.4 Battery Check Stop

This command is used to halt battery check.

Command Syntax AT+BCHKSTOP

ResponseThis command returns standard command response or ERROR, if the operation fails.

9.2.5 Battery Value Get

This command is used to retrieve the results of battery check operations.

Command Syntax AT+BATTVALGET

ResponseThis command should return a message with the latest value, e.g., Battery Value: 3.4 V, followed by the standard command response.

If this command is issued before issuing the command to start battery checks, it returns ERROR or 1, depending on the current verbose setting.

1VV0301463 Rev. 1.0 Page 440 of 456 2018-01-24

Page 441: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

9.3 System Power Save

9.3.1 HibernateThis command is used to enable the GS nodes to enter the hibernate mode. In this mode, the power consumption is at the lowest possible value and no information is retained in latch memory. The GS node wakes up only upon an alarm input.

Command Syntax AT+HIBERNATE=<ALARM1 POL>[,<ALARM2 POL>]

Parameter Description

Table 407, page 441 describes the hibernate mode parameters.

Synchronous Response

Table 408, page 441 describes the synchronous responses and remarks for Hibernate mode command.

Table 407 Hibernate Mode Parameters

Parameter Optional/Mandatory Value Description

ALARM1 POL Mandatory

0: high-to-low (default)

This is the polarity of the transition at pin RTC_IO_1 of the module that will trigger an alarm input and waken the GS node from hibernation. A value of 0 specifies a high-to-low transition as active; a value of 1 specifies low-to-high.

1: low-to-high

ALARM2 POL Optional0: high-to-low 1: low-to-high32-bit

This is the polarity of the transition at pin RTC_IO_2 of module that will trigger an alarm input, using the same convention used for Alarm1. A value of 0 specifies a high-to-low transition as active; a value of 1 specifies low-to-high.

Table 408 Hibernate mode Synchronous Responses

Responses RemarksSerial2WiFi APP SuccessERROR:INVALID INPUT If parameters are not valid.

1VV0301463 Rev. 1.0 Page 441 of 456 2018-01-24

Page 442: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

9.3.2 Standby

9.3.2.1 Storing or Restoring System Information for Standby

9.3.2.1.1 Store Network Context

This command will is used to store the network context and configuration parameters prior to a transition to standby. This command will store the network connection parameters (WiFi layer and network layer information) in RTC memory, when the GS node is sent to standby mode using request standby command (see 9.3.2.2 Putting the System in Standby, page 445).

Command Syntax AT+STORENWCONN

Command Note CIDs are lost when the transition to Standby occurs.

With ARP cache enabled this command stores the ARP entries to the non-volatile memory.

If a device is operating in P2P mode as a client or GO, then this command can be used to store the P2P context.

Synchronous Response

Table 409, page 442 describes the synchronous responses and remarks for the Store Network Context command.

Table 409 Store Network Context Synchronous Responses

Responses Remarks

OKSuccessAssociate to a network. Upon issue of this command will store the network parameters into the RTC memory.

DISASSOCIATEDFailureIf the node is not associated before issuing this command it will display the network context.

1VV0301463 Rev. 1.0 Page 442 of 456 2018-01-24

Page 443: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

Example Use Case - GS node is configured as a TCP client and stored in the network parameters prior to a transition to standby

AT+NDHCP=1OK

AT+WA=GainSpanDemo,,11IP SubNet Gateway192.168.23.135:255.255.255.0:192.168.23.1OK

AT+NCTCP=192.168.23.102,9000CONNECT 0OK

AT+STORENWCONNOK

AT+PSSTBY=10000Out of StandBy-Timer

AT+RESTORENWCONNOK

AT+NCTCP=192.168.23.102,9000CONNECT 1OK

9.3.2.1.2 Restore Network Context

This command is used to read the IP layer network connection parameters saved by Store Network Context (see 7.11.1 IP Multicast Join, page 335), and reestablishes the connection that existed before the transition to Standby. If needed, the node will re-associate and re-authenticate with the specified SSID. With ARP cache enabled, this command restores the ARP entries stored in the non-volatile memory to the nodes network stack.

Command Syntax AT+RESTORENWCONN

Synchronous Response

Table 410, page 444 describes the synchronous responses and remarks for the Restore Network Context command.

1VV0301463 Rev. 1.0 Page 443 of 456 2018-01-24

Page 444: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

Example AT+NDHCP=1OK

AT+WA=GainSpanDemo,,11IP SubNet Gateway192.168.44.110:255.255.255.0:192.168.44.1OK

AT+STORENWCONNOK

AT+PSSTBY=10000Out of Standby-Timer

AT+RESTORENWCONNOK

Table 410 Restore Network Context Synchronous Responses

Responses Remarks

OKSuccessReads the IP layer network connection parameters saved by “Store Network Context” and reestablishes the connection that existed before the transition to standby.

ERRORFailureIf the command is issued, prior to storing the network connection, or after storing the network connection but before a transition to Standby has occurred.

1VV0301463 Rev. 1.0 Page 444 of 456 2018-01-24

Page 445: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

9.3.2.2 Putting the System in Standby

This command is used to request a transition to ultra-low-power Standby operation.

Command Syntax AT+PSSTBY=x[,<DELAY TIME>,<ALARM1 POL>,<ALARM2 POL>]

Usage When this command is issued, the GS node will enter the ultra-low-power Standby state (after the optional delay time if present), remaining there until x milliseconds have passed since the command was issued, or an enabled alarm input is received. Any current CIDs are lost on transition to Standby. On wakeup, the GS node sends the message Out of Standby-<reason of wakeup> or the corresponding error code, depending on verbose status.

In Standby, only the low-power clock and some associated circuits are active. Serial messages sent to the UART port will not be received. The radio is off and packets cannot be sent or received. Therefore, before requesting a transition to Standby, the requesting application should ensure that no actions are needed from the interface until the requested time has passed, or provide an alarm input to awaken the module when needed. The alarm should trigger about 10 msec prior to issuance of any serial commands.

The dc_dc_cntl programmable counter is 48-bits and provides up to 272 years worth of standby duration. Standby is not entered until all pending tasks are completed, and a few milliseconds are required to store any changes and enter the Standby state; a similar delay is encountered in awaking from Standby at the end of the requested time. Therefore, we do not recommend Standby times less than about 32 milliseconds.

Parameter Description

Table 411, page 446 describes the Request Standby Mode parameters.

NOTE: 1.) Before the system enters Standby mode, the GS node sends a NULL frame with PM bit set to 1. Once the system is out of Standby mode, the GS node sends another NULL frame with PM bit set to 0. This behavior occurs only when radio is in Active ON mode. 2.) Standby can be issued only when an interface or both interfaces in concurrent mode is/are set to STA mode. 3.) Only Station Mode supports DeepSleep and Standby (AT+PSSTBY and AT+PSDSLEEP).

1VV0301463 Rev. 1.0 Page 445 of 456 2018-01-24

Page 446: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

Synchronous Response

Table 412, page 446 describes the synchronous responses and remarks for Request Standby Mode command.

Table 411 Request Standby Mode Parameters

Parameter Optional/Mandatory Value Description

x Mandatory x=Standby time in milliseconds

This is the Standby time in milliseconds. If a delay time is provided, the Standby count begins after the delay time has expired.

DELAY TIME Optional in milliseconds

This is the delay in milliseconds from the time the command is issued to the time when the module goes to Standby.

ALARM1 POL Optional

0 (high-to-low) This is the polarity of the transition at pin RTC_IO_1 of the module which will trigger an alarm input and waken the GS node from Standby. A value of 0 specifies a high-to-low transition as active; a value of 1 specifies low-to-high.

1 (low-to-high)

ALARM2 POL Optional 1 (low-to-high)

This is the polarity of the transition at pin RTC_IO_2 that triggers an alarm input, using the same convention used for Alarm1.

Note: Specifying an alarm polarity also enables the corresponding alarm input.

Table 412 Request Standby Mode Synchronous Responses

Responses RemarksOK SuccessERROR:INVALID INPUT If parameters are not valid.

1VV0301463 Rev. 1.0 Page 446 of 456 2018-01-24

Page 447: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

9.3.2.3 Enabling Standby Mode Between Beacons

This command is used to enable the GS node to transition to ultra low power standby mode between beacons.

Command Syntax AT+PSSTBYBWBEACON=1

Parameter Description

Table 413, page 447 describes the Enabling standby mode between beacons parameters.

Synchronous Response

Table 414, page 447 describes the synchronous responses and remarks for Request Standby Mode command.

Table 413 Enable Standby Mode Between Beacons Parameters

Parameter Optional/Mandatory Value Description

1 Mandatory

Value range: 1Format: DecimalDefault value: N/A

It enables the GS node to transition to ultra low power standby mode between beacons.

Table 414 Enable Standby Mode Between Beacons Synchronous Responses

Responses RemarksOK SuccessERROR:INVALID INPUT If parameters are not valid.

NOTE: Enable ARP cache to transfer HTTP Data/L4 Data after PS-Poll Standby.

1VV0301463 Rev. 1.0 Page 447 of 456 2018-01-24

Page 448: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

9.3.2.4 Configuring Standby Between Beacons

This command is used to configure GS node to support transitioning to ultra low power standby mode between beacons.

Command Syntax AT+PSSTBYBWBEACONCONF = <Conf ID>,<Value>

Parameter Description

Table 415, page 448 describes the Configuring standby mode between beacons parameters.

Table 415 Configure Standby Mode Between Beacons Parameters

Parameter Optional/Mandatory Conf ID Value Description

Conf ID, Value

Mandatory 0

Alarm 1 wakeupValue range: 0, 1Format: DecimalDefault value: 0

This combination of Conf ID and Value configures Alarm 1 to wakeup GS node from Standby mode or not.• 0: Disable Alarm 1 wakeup• 1: Enable Alarm 1 wakeup

Mandatory 1

Alarm 1 polarityValue range: 0, 1Format: DecimalDefault value: 0

This combination of Conf ID and Value specifies the polarity of the transition at pin RTC_IO_1 of the module which triggers an alarm input and wakes up the GS node from Standby.• 0: high-to-low transition as active• 1: low-to-high transition

Mandatory 2

Alarm 2 wakeupValue range: 0, 1Format: DecimalDefault value: 0

This combination of Conf ID and Value configures Alarm 2 to wakeup GS node from Standby mode or not.• 0: Disable Alarm 2 wakeup• 1: Enable Alarm 2 wakeup

Mandatory 3

Alarm 2 polarityValue range: 0, 1Format: DecimalDefault value: 0

This combination of Conf ID and Value specifies the polarity of the transition at pin RTC_IO_2 of the module which triggers an alarm input and wakes up the GS node from Standby.• 0: high-to-low transition as active• 1: low-to-high transition

1VV0301463 Rev. 1.0 Page 448 of 456 2018-01-24

Page 449: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

Synchronous Response

Table 416, page 451 describes the synchronous responses and remarks for Request Standby Mode command.

1VV0301463 Rev. 1.0 Page 449 of 456 2018-01-24

Page 450: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

1VV0301463 Rev. 1.0 Page 450 of 456 2018-01-24

Page 451: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

9.3.3 Deep Sleep This command is used to enable the GS node’s power-saving Deep Sleep processor mode.

Command Syntax AT+PSDPSLEEP

Usage When enabled, the GS node will enter the power-saving Deep Sleep mode when no actions are pending. In Deep Sleep mode, the processor clock is turned off, and GS node power consumption is reduced.

The processor can be awakened by sending data on the serial port from the host. However, several milliseconds are required to stabilize the clock oscillator when the system awakens from Deep Sleep. Since the clock oscillator must stabilize before data can be read, the initial data will not be received; “dummy” (discardable) characters or commands should be sent until an indication is received from the application.

Response These commands do not return any response code to the serial interface. The S2W application sends the message “Out of Deep Sleep” along with the standard response once it comes out from deep sleep.

Parameter Description

A similar command can be used to enable the deep sleep with a timeout and alarm. Table 417, page 452 describes the Enable/Disable GS node Deep Sleep parameters.

AT+PSDPSLEEP=[<timeout>,,<ALARM2 POL>]<CR>

Table 416 Configure Standby Mode Between Beacons Synchronous Responses

Responses RemarksOK SuccessERROR:INVALID INPUT If parameters are not valid.

NOTE: 1.) Other components external to the GS node may continue to dissipate power during this time, unless measures are taken to ensure that they are also off or disabled. 2.) Only Station Mode supports DeepSleep and Standby (AT+PSDSLEEP and AT+PSSTBY).

1VV0301463 Rev. 1.0 Page 451 of 456 2018-01-24

Page 452: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

Synchronous Response

Table 418, page 452 describes the synchronous responses and remarks for Enable/Disable module Deep Sleep command.

Table 417 Enable/Disable GS node Deep Sleep Parameters

Parameter Optional/Mandatory Value Description

Timeout Optional Integer by 32bit value

Node goes to deep sleep state for the configured time in milliseconds and upon time out exits the node from deep sleep state.Max time out value is 32 bit.

ALARM2 POL Optional0 - high to low1 - low to high

This is the polarity of the transition at pin RTC_IO_2 that triggers an alarm input, using the same convention used for Alarm1.

Table 418 Enable/Disable module Deep Sleep Synchronous Responses

Responses RemarksOK SuccessERROR:INVALID INPUT If parameters are not valid.

1VV0301463 Rev. 1.0 Page 452 of 456 2018-01-24

Page 453: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

9.3.4 Power Save in Limited AP This command is used to configure power save in Limited AP Mode.

Command Syntax AT+WAPPSCFG=<Power-Save Configuration>,<Reserved>,<Receiver on-time after Tx>,<Power-save behavioral control>

Usage When enabled, the module will enter the power saving mode when no actions are pending. In power save mode, the processor clock is turned OFF, and the module power consumption is reduced.

Parameter Description

Table 419, page 453 describes power save in Limited AP Mode parameters

Table 419 Deep Sleep in Limited AP Mode parametersParameter Optional/Mandatory Value Description

Power-Save Configuration Mandatory 0,1This parameter decides the state of radio (on/off) in conjunction with ‘Power-Save Control’ parameter.

Reserved parameter Mandatory 0 Always issue zero (0) for this parameter.

Receiver on-time after Transmission Mandatory

0 to Beacon intervalUnit: millisecond

It specifies the time the receiver will be kept on after any transmission (beacon).

Receiver on-time after Transmission (Contd)

Example: When this parameter is configured as 10, the receiver will be switched on for 10 milliseconds after transmitting the beacons.Note: a> If system decides to transmit a frame in the mean time (within 10ms as mentioned in the above example), then receiver on-time will restart from that instant.b> Maximum ‘Receiver on-time after Transmission’ should not exceed beacon interval.

Power-save behavioral control Mandatory 0,1

This parameter decides the state of radio (on/off) in conjunction with ‘Power-Save Configuration’.Refer to the Table 420, page 454.

1VV0301463 Rev. 1.0 Page 453 of 456 2018-01-24

Page 454: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

The following table provides the behavior of an AP corresponding to the combination of values configured for Power-save control and Power-save configuration parameters.

Synchronous Response

Table 421, page 454 describes the synchronous responses and remarks for Deep Sleep in Limited AP mode command.

9.3.5 Hardware CryptographyThis command is used to enable or disable hardware cryptography block. This feature is used when user uses security features such as SSL, WPS, EAP, and so on. Hardware cryptography is enabled by default in Serial to WiFi.

Table 420 AP behavior based on Power-Save Control and Power-Save ConfigurationPower-Save Control Power-Save Configuration

0 1

0

Exit power save immediately.(Radio will be switched on immediately)Note: Exits power save only after all pending transmit and receive events.

Enter power save immediately.(Radio will be switched off immediately)Note: Enters power save only after all pending transmit and receive events.

1 Exit power save at the next TBTT (beacon interval).

Enter power save only after all associated clients are in power save.Note: System will exit power save as soon as any one of the STAs exit the power save mode, but will not automatically re-enter the power save state. This is supported only from 5.2.x.

Table 421 Deep Sleep in Limited AP Mode Synchronous Responses Responses Remarks

OK SuccessERROR FailureERROR:INVALID INPUT If parameters are not valid.

1VV0301463 Rev. 1.0 Page 454 of 456 2018-01-24

Page 455: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

Command Syntax AT+CRYPTOEN=n

Parameter Description

Table 422, page 455 describes the Hardware cryptography parameters.

NOTE: If the user wants to save power or does not want to use this feature, then they are allowed to switch off the hardware crypto block. The SW internally keeps a count of ON and OFF requests and when the count becomes 0, it is switched off.

Table 422 Hardware Cryptography Parameters

Parameter Optional/Mandatory Value Description

n Mandatory1 It enables the hardware crypto block.0 It disables the hardware crypto block.

1VV0301463 Rev. 1.0 Page 455 of 456 2018-01-24

Page 456: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

1VV0301463 Rev. 1.0 Page 456 of 456 2018-01-24

Page 457: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

Chapter 10 Peripherals

This chapter describes commands for configurations and operations related to GainSpan supported peripherals such as I2C, PWM, GPIO, and so on.

• I2C Commands, page 457

• PWM Commands, page 461

• GPIO Commands, page 465

• EMU Commands, page 467

10.1 I2C CommandsThis section contains I2C specific commands.

10.1.1 I2C ConfigurationThis command is used to configure the I2C device.

Command Syntax AT+I2CCONF=<conf id>,<value>

Parameter Description

Table 423, page 457 describes the I2C Configuration parameters.

Table 423 I2C Configuration Parameters

Parameter Conf id Optional/Mandatory Value Description

Master/Slave 1 Mandatory0 - Slave1 - MasterValue range: 0,1

Whether the device is Master or Slave.

Slave device address 2 Mandatory Device address

It is the slave device address which is of 7 bits excluding the lsb.Note: Hexadecimal addresses do not use the 0x prefix. For example, If address is 0x10, then only provide 10.

Addressing mode 3 Mandatory

0 - 7 bit mode1 - 10 bit modeValue range: 0,1

Whether the slave address is 7 bit or 10 bit.

1VV0301463 Rev. 1.0 Page 457 of 474 2018-01-24

Page 458: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

Synchronous Response

Table 424, page 458 describes the synchronous responses and remarks for I2C Configuration command.

Example AT+I2CCONF=1,1

This command configures the device as Master.

AT+I2CCONF=2,10This command configures the device as Slave when Slave device address is 0x20.

Clock Rate 4 Mandatory

Value range: 10 to 34000Unit: KHzNote:• Value 0 can be

used to configure100 KHz

• Value 1 can be used to configure 400 KHz

It specifies the clock rate for I2C.

Address Mode 5 Mandatory

0 - Current address1 - Random address

Whether memory access is in current mode or random mode.

SlaveLocAddr 6 Mandatory Value It is the address location when random mode is selected.

Memory Address Sel 8 Mandatory

0 - Single byte1 - Two bytes

Whether Memory Address Sel is single byte for 7 bit mode or two bytes for 10 bit mode.

Source Clock 10 Mandatory 0 - HSRC It is the source clock for I2C.

Table 423 I2C Configuration Parameters (Continued)

Parameter Conf id Optional/Mandatory Value Description

Table 424 I2C Configuration Synchronous Responses

Responses RemarksOK SuccessERROR INVALID INPUT If parameters are not valid.

1VV0301463 Rev. 1.0 Page 458 of 474 2018-01-24

Page 459: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

10.1.2 I2C StartThis command is used to start I2C device.

Command Syntax AT+I2CSTART

Synchronous Response

Table 425, page 459 describes the synchronous responses and remarks for I2C Start command.

10.1.3 I2C WriteThis command is used for write operation.

Command Syntax AT+I2CWRITE=<No. of bytes>,<bytes>

Parameter Description

Table 426, page 459 describes the I2C Write parameters.

Synchronous Response

Table 427, page 459 describes the synchronous responses and remarks for I2C Write command.

Example AT+I2CWRITE=4,01020304

The first parameter specifies number of bytes which is 4 and the second parameter specifies the bytes to be written which is 01 02 03 04.

Table 425 I2C Start Synchronous Responses

Responses RemarksOK SuccessERROR If device open fails.

Table 426 I2C Write Parameters

Parameter Optional/Mandatory Value Description

No of bytes Mandatory 1-128 It specifies the range in which the I2CWrite operation is done.

bytes Mandatory NA It is the actual data in bytes.

Table 427 I2C Write Synchronous Responses

Responses RemarksOK SuccessERROR INVALID INPUT If parameters are not valid.

1VV0301463 Rev. 1.0 Page 459 of 474 2018-01-24

Page 460: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

10.1.4 I2C ReadThis command is used for read operation.

Command Syntax AT+I2CREAD=<No. of bytes>

Parameter Description

Table 428, page 460 describes the I2C Read parameters.

Synchronous Response

Table 429, page 460 describes the synchronous responses and remarks for I2C Read command.

Example AT+I2CREAD=4

The parameter specifies the number of bytes to be read which is 4.

10.1.5 I2C StopThis command is used to stop the I2C device.

Command Syntax AT+I2CSTOP

Synchronous Response

Table 430, page 461 describes the synchronous responses and remarks for I2C Stop command.

Table 428 I2C Read Parameters

Parameter Optional/Mandatory Value Description

No of bytes Mandatory 1 - 128 It specifies the range in which the I2C Read operation is done.

Table 429 I2C Read Synchronous Responses

Responses RemarksOK SuccessERROR INVALID INPUT If parameters are not valid.

1VV0301463 Rev. 1.0 Page 460 of 474 2018-01-24

Page 461: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

10.2 PWM Commands

10.2.1 PWM StartThis command is used to start the PWM specified.

Command Syntax AT+PWMSTART=<pwm_id>,<start_state>,<polarity>,<period>,<frequency>,<clock_sel>,<prescalar_value>,[<phase_delay01>,<phase_delay12>]

In GS 2000 modules, 40 MHz is used as a reference clock by default and the formula for calculating PWM clock is:

PWM clock frequency= Reference clock (40MHz)/period

Where, the maximum period value is 1000.

This formula is applicable only when clock_sel parameter is set to bus clock. The minimum PWM clock frequency generated when clock_sel is set to bus clock is 40KHz.

The prescalar_value parameter is used along with the PWM clock frequency formula to generate lesser PWM clock frequency as shown below:

PWM clock frequency= Reference clock (40MHz)/(period * prescalar_value)

Parameter Description

Table 431, page 461 describes the PWM Start parameters.

Table 430 I2C Stop Synchronous Responses

Responses RemarksOK SuccessERROR If device close fails.

Table 431 PWM Start Parameters

Parameter Optional/Mandatory Value Description

pwm_id Mandatory

1: pwm1

PWM identifier.2: pwm23: pwm34: 3 pwm’s at a time

start_state Mandatory0: 0 on state Whether the PWM should start with 0 on state

or duty cycle.1: 50% duty cycle

polarity Mandatory0: normal

It is the polarity of the channel1: inverted

1VV0301463 Rev. 1.0 Page 461 of 474 2018-01-24

Page 462: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

Synchronous Response

Table 432, page 462 describes the synchronous responses and remarks for PWM Start command.

Example 1 To generate PWM clock frequency of 40KHz, execute the following AT command:

AT+PWMSTART=1,1,0,1000,0,1,1,0,0

Where,

• pwm_id = 1

• start_state = 1

period Mandatory 1 to 65535

It is used to calculate the PWM clock frequency.PWM clock frequency formula:PWM clock frequency = Reference clock frequency/period

frequency Mandatory 0: 40MHz It is the frequency of the clock selected for PWM.

clock_sel Mandatory0: Bus clock The clock should be selected for the PWM. It is

either bus clock or output of a prescalar.1: Output of prescalar

prescalar_value Mandatory 1 to 64

If the clock_sel is 1, then this parameter is used to calculate the PWM clock frequency.PWM clock frequency formula:PWM clock frequency = Reference clock frequency/(period * prescalar_value)

phase_delay01 Mandatory N/A

It is the delay between the PWM0 and PWM1 pulses if select all PWMs at one time. The value is in the number of PWM clock and should be greater than 0. This parameter is valid, the PWM is selected all (pwm_id is 4).

phase_delay12 Mandatory N/A

It is the delay between the PWM1 and PWM2 pulses if select all PWMs at one time. The value is in the number of PWM clocks and should be greater than 0. This parameter is valid, the PWM is selected all (pwm_id is 4).

Table 431 PWM Start Parameters (Continued)

Parameter Optional/Mandatory Value Description

Table 432 PWM Start Synchronous Responses

Responses RemarksOK SuccessERROR INVALID INPUT If parameters are not valid.

1VV0301463 Rev. 1.0 Page 462 of 474 2018-01-24

Page 463: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

• polarity = 0

• period=1000

• frequency=0

• clock_sel = 1

• prescalar_value = 1

• phase_delay01 = 0

• phase_delay12 = 0

As per the given values, the formula will be as follows:

PWM clock frequency = 40MHz/(1000*1)

Example 2 To generate PWM clock frequency of 4MHz, execute the following AT command:AT+PWMSTART=1,1,0,10,0,1,1,0,0

Example 3 To generate PWM clock frequency of 400KHz, execute the following AT command:AT+PWMSTART=1,1,0,10,0,1,10,0,0

Example 4 To generate PWM clock frequency of 100KHz, execute the following AT command:AT+PWMSTART=1,1,0,10,0,1,40,0,0

Example 5 To generate PWM clock frequency of 1KHz, execute the following AT command:AT+PWMSTART=1,1,0,1000,0,1,40,0,0

1VV0301463 Rev. 1.0 Page 463 of 474 2018-01-24

Page 464: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

10.2.2 PWM StopThis command is used to stop the PWM that has started using the AT+PWMSTART command.

Command Syntax AT+PWMSTOP=<pwm_id>

Parameter Description

Table 433, page 464 describes the PWM Stop parameters.

Synchronous Response

Table 434, page 464 describes the synchronous responses and remarks for PWM Stop command.

10.2.3 PWM ControlThis command is used to change the duty cycle of the pulse generated by PWM.

Command Syntax AT+PWMCNTRL=<pwm_id>,<duty_cycle>

Parameter Description

Table 435, page 464 describes the PWM Control parameters.

Table 433 PWM Stop Parameters

Parameter Optional/Mandatory Value Description

pwm_id Mandatory

1: pwm1

PWM identifier.2: pwm23: pwm34: 3 pwm’s at a time

Table 434 PWM Stop Synchronous Responses

Responses RemarksOK SuccessERROR If parameters are not valid.

Table 435 PWM Control Parameters

Parameter Optional/Mandatory Value Description

pwm_id Mandatory

Value range: 1 to 41: PWM12: PWM23: PWM34: 3 PMWs at a time

It specifies the PMW identifier.

duty_cycle Mandatory 1 to 99 It specifies the duty cycle of the pulse.

1VV0301463 Rev. 1.0 Page 464 of 474 2018-01-24

Page 465: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

Synchronous Response

Table 436, page 465 describes the synchronous responses and remarks for PWM Control command.

10.3 GPIO Commands

10.3.1 GPIO Out HIGH/LOWThis command is used to set or reset the GPIO ‘GPIO-NO’ pin level to high or low as per the SET/RESET parameter.

Command Syntax AT+DGPIO=<GPIO-NO>,<SET/RESET(0/1)>

Parameter Description

Table 437, page 465 describes the GPIO Out HIGH/LOW parameters.

Table 436 PWM Control Synchronous Responses

Responses RemarksOK SuccessERROR INVALID INPUT If parameters are not valid.

NOTE: Only the GPIO pins which are not mixed with any used IOs such as UART, SPI, and so on can be set high or low with this command.

Table 437 GPIO Out HIGH/LOW Parameters

Parameter Optional/Mandatory Value DescriptionGPIO30 Optional 30 General Purpose Input Output 30GPIO31 Optional 31 General Purpose Input Output 31

1VV0301463 Rev. 1.0 Page 465 of 474 2018-01-24

Page 466: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

1VV0301463 Rev. 1.0 Page 466 of 474 2018-01-24

Page 467: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

10.4 EMU Commands

10.4.1 EMU Get VersionThis command is used to return the EMU software version.

Command Syntax AT+EMUVER=?

Synchronous Response

Table 162, page 183 describes the synchronous responses and remarks for EMU Get Version command.

10.4.2 EMU Get Supported Module ListThis command is used to return the supported module lists.

Command Syntax AT+EMUSUPMOD=?

Parameter Description

Table 439, page 467 describes the EMU supported module list parameters.

Synchronous Response

Table 440, page 467 describes the synchronous responses and remarks for EMU supported module list command.

Table 438 EMU Get Version Synchronous Responses

Responses RemarksOK SuccessERROR INVALID INPUT If parameters are not valid.

Table 439 EMU Supported Module List Parameters

Parameter Description

?• 3 - if both Signal Delta ADC and PL722X are supported• 2 - if only PL722X is supported• 1 - if only Sigma Delta ADC is supported

Table 440 EMU Supported Module List Synchronous Responses

Responses RemarksOK SuccessERROR INVALID INPUT If parameters are not valid.

1VV0301463 Rev. 1.0 Page 467 of 474 2018-01-24

Page 468: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

10.4.3 EMU StartThis command is used to start the EMU.

Command Syntax AT+EMUSTART

Synchronous Response

Table 441, page 468 describes the synchronous responses and remarks for EMU Start command.

10.4.4 EMU StopThis command is used to stop the EMU.

Command Syntax AT+EMUSTOP

Synchronous Response

Table 442, page 468 describes the synchronous responses and remarks for EMU Stop command.

Table 441 EMU Start Synchronous Responses

Responses RemarksOK SuccessERROR INVALID INPUT If parameters are not valid.

Table 442 EMU Stop Synchronous Responses

Responses RemarksOK SuccessERROR INVALID INPUT If parameters are not valid.

1VV0301463 Rev. 1.0 Page 468 of 474 2018-01-24

Page 469: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

10.4.5 EMU Mode/Channel Configuration

10.4.5.1 Mode Configuration

This command is used to configure EMU mode.

Command Syntax AT+EMUSETCONF=<Param>,<Value>

Parameter Description

Table 443, page 469 describes the EMU mode configuration parameters.

Synchronous Response

Table 444, page 469 describes the synchronous responses and remarks for EMU Mode Configuration command.

Table 443 EMU Mode Configuration Parameters

Parameter Description

Param

Select sdadc (1)Set voltage scaling factor (44)Set current scaling factor (45)Set sampling frequency (46)Select gpio-28 for load control (47)Select adc-2 for voltage (54)Select adc-1 for current (55)

Value

• 1 - 1 or 2• 44 - Value based on computation• 45 - Value based on computation• 46 - Value set to 4000• 47 - 28• 54 - 2• 55 - 1

Table 444 EMU Mode Configuration Synchronous Responses

Responses RemarksOK SuccessERROR INVALID INPUT If parameters are not valid.

1VV0301463 Rev. 1.0 Page 469 of 474 2018-01-24

Page 470: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

10.4.5.2 Channel Configuration

This command is used to configure EMU channel for a given gain value.

Command Syntax AT+EMUSETCONF=<channel>,<Enable/Disable>,[<GainValue>]

Parameter Description

Table 445, page 470 describes the EMU channel configuration for a given gain value.

Synchronous Response

Table 446, page 470 describes the synchronous responses and remarks for EMU Channel Configuration command.

Table 445 EMU Mode Configuration Channel Gain Value

Parameter Description

Channel• 56 - Channel 0• 57 - Channel 1• 58 - Channel 2

Enable/Disable• 1 - Enable• 0 - Disable

GainValue

• 0 - 5dB gain• 1 - 12dB gain• 2 - 18dB gain• 3 - 24dB gain

Table 446 EMU Channel Configuration Synchronous Responses

Responses RemarksOK SuccessERROR INVALID INPUT If parameters are not valid.

1VV0301463 Rev. 1.0 Page 470 of 474 2018-01-24

Page 471: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

10.4.6 EMU Get ConfigurationThis command is used to get the configuration values which have been set for the EMU.

Command Syntax AT+EMUGETCONF=<Param>

Parameter Description

Table 447, page 471 describes the configuration values which have been set for the EMU.

Synchronous Response

Table 448, page 471 describes the synchronous responses and remarks for EMU Get Configuration command.

Table 447 EMU Get Configuration Parameters

Parameter Description

Param

Select sdadc (1)Set voltage scaling factor (14)Set current scaling factory (45)Set sampling frequency (46)Select gpio-28 for load control (47)Select adc-2 for voltage (54)Select adc-1 for current (55)

Table 448 EMU Get Configuration Synchronous Responses

Responses RemarksOK SuccessERROR INVALID INPUT If parameters are not valid.

1VV0301463 Rev. 1.0 Page 471 of 474 2018-01-24

Page 472: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

10.4.7 EMU Get ValuesThis command is used to print the several parameters which are computed by the EMU.

Command Syntax AT+EMUGETVALUES

Parameter Description

The parameters include: Voltage (rms), Current (rms), Activepower, Powerfactor, Frequency, and Accumulated Energy.

Synchronous Response

Table 449, page 472 describes the synchronous responses and remarks for EMU Get Values command.

10.4.8 EMU Load ControlThis command is used to switch on or off the EMU load.

Command Syntax AT+EMULOADCTRL=<1/0>

Parameter DescriptionParameters

Table 450, page 472 describes the EMU load control parameters.

Synchronous Response

Table 451, page 472 describes the synchronous responses and remarks for EMU Load Control command.

Table 449 EMU Get Values Synchronous Responses

Responses RemarksOK SuccessERROR INVALID INPUT If parameters are not valid.

Table 450 EMU Load Control Parameters

Parameter Description

1/0• 0 - is for switching OFF the load• 1 - is for switching ON the load

Table 451 EMU Load Control Synchronous Responses

Responses RemarksOK SuccessERROR INVALID INPUT If parameters are not valid.

1VV0301463 Rev. 1.0 Page 472 of 474 2018-01-24

Page 473: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

10.4.9 EMU Reset EnergyThis command is used to reset the Accumulated Energy.

Command Syntax AT+EMURESETENERGY

Synchronous Response

Table 452, page 473 describes the synchronous responses and remarks for EMU Reset Energy command.

10.4.10 EMU Get StatusThis command is used to return the status of the EMU.

Command Syntax AT+EMUGETSTATUS

Parameter Description

Table 453, page 473 describes the EMU get status parameters.

Synchronous ResponseTable 446, page 470 describes the synchronous responses and remarks for EMU Get Status command.

Table 452 EMU Reset Energy Synchronous Responses

Responses RemarksOK SuccessERROR INVALID INPUT If parameters are not valid.

Table 453 EMU Get Status Parameters

Parameter Description

Running/Stopped• Running - this runs the EMU status• Stopped - this stops the EMU status

Table 454 EMU Get Status Synchronous Responses

Responses RemarksOK SuccessERROR INVALID INPUT If parameters are not valid.

1VV0301463 Rev. 1.0 Page 473 of 474 2018-01-24

Page 474: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

10.4.11 EMU Get Load StatusThis command is used to return the load status of the EMU.

Command Syntax AT+EMULOADSTATUS

Parameter Description

Table 455, page 474 describes the EMU load status parameters.

Synchronous Response

Table 456, page 474 describes the synchronous responses and remarks for EMU load status command.

Table 455 EMU Get Load Status Parameters

Parameter Description

ON/OFF• ON - this returns the load status of the EMU• OFF - this stops the load status of the EMU

Table 456 EMU Load Status Configuration Synchronous Responses

Responses RemarksOK SuccessERROR INVALID INPUT If parameters are not valid.

1VV0301463 Rev. 1.0 Page 474 of 474 2018-01-24

Page 475: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

Chapter 11 Production and Debug

This chapter describes commands for configurations and operations used in Production and helpful in debugging.

• RF Test, page 475

• Live Calibration, page 490

• Debug, page 495

11.1 RF Test

11.1.1 Regulatory and Transmit Tests using RF Test Commands

11.1.1.1 Regulatory Testing

NOTE: Enable this feature when the code is built in SDK Builder tool.

For regulatory testing, use the RF test commands provided in the following sections. Use the lowest data rate of each standard (802.11b, 802.11g, and 802,11n) as the transmit power is highest at these rates. The RF commands already include the Gain Control Table limits. If the data rate field is changed in one of the commands, then check if the gain field in the command is as per the GCT value in Table 457 Gain Control Table.

Regulatory testing does not provide Packet Error Rate (PER). If PER is measured, then the displayed number of packets is the number of good packets received. It does not include packets with errors.

PER = No. of Packets received/No. of packets sent by the signal generator.

11.1.1.2 Transmit Testing

For transmit testing, the RF commands allow the user to specify the gain value from 0 to 27.

1VV0301463 Rev. 1.0 Page 475 of 504 2018-01-24

Page 476: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

Dat psGCDatGC

11.1.1.3 Gain Control Table

11.1.1.4 Start RF Test

This command is used to enable the radio test mode.

Command Syntax AT+WRFTESTSTART

11.1.1.5 Stop RF Test

This command is used to disable the radio test mode.

Command Syntax AT+WRFTESTSTOP

11.1.1.6 Asynchronous Frame Transmission

This command is used to enable the frame transmission. This command enables the asynchronous data transmission with the parameters configured. After issuing this command the transmission will go with the default payload.

Command Syntax AT+WFRAMETXTEST=<Channel>,<BandWidth>,<NumFrames>,<FrameLen>,<TxRate>,<TxPower>,<DestAddr>,<Bssid>,<HtEnable>,<GuardInterval>,<GreenField>,<PreambleType>,<QosEnable>,<AckPolicy>,<Scrambler>,<AifsnVal>,<Antenna>,<ccaBypass>

Parameter Description

Table 458, page 476 describes the Asynchronous Frame Transmission parameters.

Table 457 Gain Control Table

a Rate 1 Mbps 2 Mbps 5.5 Mbps 11 Mbps 6 Mbps 9 Mbps 12 Mbps 18 Mbps 24 Mbps 36 MbT 18 8 14 11 27 27 27 27 26 25a Rate 48 Mbps 54 Mbps MCS0 MCS1 MCS2 MCS3 MCS4 MCS5 MCS6 MCS7T 24 19 27 27 27 27 25 24 20 16

Table 458 Asynchronous Frame Transmission Parameters

Parameter Optional/Mandatory Value Description

Channel Mandatory 1-14 The channel on which the data to be sent (1-14).

BandWidth Mandatory 0 The values of 0 is 20MHz.Note: The GS node currently supports 20MHz operation.

NumFrames Mandatory 1-65535 The number of asynchronous frames to be sent (1-65535).

1VV0301463 Rev. 1.0 Page 476 of 504 2018-01-24

Page 477: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

Table 459, page 478 describes the Asynchronous Frame Transmission Data Rates

Note: for continuous transmission, configure this parameter with the value 99. Once configured in continuous transmission mode, to come out of this mode, stop the test mode and start the test mode again (i.e., AT+WRFTESTSTOP, AT+WRFTESTSTART).FrameLen Mandatory 32 to 1500 The length of the payload.

TxRate Mandatory N/A The rate at which the data need to be sent. See Table 459, page 478.

Note: This also depends on the HtEnable field. If HtEnable bit is set, the configured TxRate is taken as MCS index, otherwise legacy rate.

TxPower Mandatory 0 to 27

The value of this parameter can range from 0 to 27. Where 27 is the index corresponding to the maximum TxPower GS node will support.

DestAddr Mandatory N/A The MAC address of the node target to reach.

BSSID Mandatory N/AThe MAC address of any arbitrary AP, which will be the source MAC address.

HtEnable Mandatory0 High throughput disabled1 High throughput enabled

GuardInterval Mandatory1 Short guard interval0 Long guard interval

GreenField Mandatory0 11n disabled1 11n only

PreambleType Mandatory0 short1 long

QosEnable Mandatory 0 Enable QoSAckPolicy (Debug parameter) Mandatory 4 N/A

Scrambler (Debug parameter) Mandatory0 OFF1 ON

AifsnVal Mandatory N/A N/AAntenna Mandatory N/A N/AccaBypass Mandatory N/A N/A

Table 458 Asynchronous Frame Transmission Parameters

Parameter Optional/Mandatory Value Description

1VV0301463 Rev. 1.0 Page 477 of 504 2018-01-24

Page 478: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

Example AT+WFRAMETXTEST=1,0,50000,1000,11,16,00:11:22:33:44:55,00:50:c2:5e:10:99,0,0,0,0,0,4,0,2,0,1

11.1.1.7 Start Asynchronous Frame Reception

The command is used to enable the asynchronous frame reception.

Command Syntax AT+WRXTEST=<Channel>,<BandWidth>,<RxFrameTypeFilter>,<RxAddrFilter>,<Antenna>

Parameter Description

Table 460, page 479 describes the Asynchronous Frame Reception Start parameters.

Table 459 Asynchronous Frame Transmission Data Rates

TxRate HtEnable Data Rate (Mbps)1 0 12 0 25 0 5.511 0 116 0 69 0 912 0 1218 0 1824 0 2436 0 3648 0 4854 0 540 1 MCS01 1 MCS12 1 MCS23 1 MCS34 1 MCS45 1 MCS56 1 MCS67 1 MCS7

NOTE: Check the wireless sniffer to see if the frames are on air.

1VV0301463 Rev. 1.0 Page 478 of 504 2018-01-24

Page 479: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

Example Serial2WiFi APPAT+NMAC=?00:1d:c9:17:8d:b1OKAT+WRXTESTSTARTOKAT+WRXTEST=6, 0, 4294930106, 00:1d:c9:17:8d:b1, 0OkAT+WRXSTOPNo of packets recieved = 6988No of byte recieved = 6988000No of packets received with CRC Errors = 6933No of packets received with Security Errors = 0No of duplicate packets received = 0No of header errors received = 237Average RSSI of the received packets = -21No of packets received at 1M and Long Preamble = 0No of packets received at 2M and Long Preamble = 0No of packets received at 5M and Long Preamble = 0No of packets received at 11M and Long Preamble = 0No of packets received at 2M and Short Preamble = 0No of packets received at 5M and Short Preamble = 0No of packets received at 11M and Short Preamble = 0No of packets received at 6M = 0No of packets received at 9M = 0No of packets received at 12M = 0No of packets received at 18M = 0No of packets received at 24M = 0No of packets received at 36M = 0

Table 460 Asynchronous Frame Reception Start Parameters

Parameter Optional/Mandatory Value Description

Channel Mandatory 1 to 14 The channel on which the data is to be sent (1-14).

BandWidth Mandatory 0 The values of 0 is 20MHz.Note: Currently supports only 20MHz operation.

RxFrameTypeFilter Mandatory 32-bitThis is a 32-bit variable, where each bit corresponds to one type of packet filter.

RxAddrFilter Mandatory N/A The MAC address of the GS node is same as the Destination address.

Note: The Rx filter is based on destination address. For PER test, transmit from another GS node or some other source specifying the destination address and set up the receiver to receive frames only destined to its address. Receiver can be set up to receive all frames by setting filter to zero but that’s not useful for PER because you don’t know how many frames were sent. Source address based filtering is not supported.Antenna N/A N/A Not supported

1VV0301463 Rev. 1.0 Page 479 of 504 2018-01-24

Page 480: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

No of packets received at 48M = 0No of packets received at 54M = 6988No of packets received atrespective MCS Index with Short GI=00000000No of packets received atrespective MCS Index with Long GI=00000000

From Tx side, transmit frames with MAC address specified in Rx command. Use the following command:

AT+WFRAMETXTEST=6,0,10000,1000,24,16,00:11:22:33:44:55,00:33:44:55:66:77,0,0,0,0,0,4,0,2,0,1

AT+WRXTEST=1,0,0,00:11:22:33:44:55,0

AT+WRXTEST=1,0, 536870912,00:11:22:33:44:55,0 – To fliter FCS Fail packets

Issue the AT+WRXSTOP to find the Rx statics details.

NOTE: This will receive frames with MAC address 00:1d:c9:17:8d:b1.

NOTE: RxFrameTypeFilter is set to 0xFFFF6EBA (42949301206) to receive unicast directed management and data frames. This is setup to receive all kinds of frames destined to the receiver node.

1VV0301463 Rev. 1.0 Page 480 of 504 2018-01-24

Page 481: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

11.1.1.8 Stop Asynchronous Frame Reception

This command is used to stop RF reception.

Command Syntax AT+WRXSTOP

Example When the command is executed it stops the frame reception and displays the PER stats:

AT+WRXTEST=6,0,4294930106,00:11:22:33:44:55,0OK

AT+WRXSTOPNo of packets received = 9613No of bytes received = 9613000No of packets received with CRC Errors = 1432No of packets received with Security Errors = 0No of duplicate packets received = 0No of header errors received = 58Average RSSI of the received packets = -49No of packets received at 1M and Long Preamble = 0No of packets received at 2M and Long Preamble = 0No of packets received at 5M and Long Preamble = 0No of packets received at 11M and Long Preamble = 0No of packets received at 2M and Short Preamble = 0No of packets received at 5M and Short Preamble = 0No of packets received at 11M and Short Preamble = 0No of packets received at 6M = 0No of packets received at 9M = 0No of packets received at 12M = 0No of packets received at 18M = 0No of packets received at 24M = 9613No of packets received at 36M = 0No of packets received at 48M = 0No of packets received at 54M = 0No of packets received atrespective MCS Index with Short GI=00000000No of packets received atrespective MCS Index with Long GI=00000000

NOTE: FCS and header errors are on all received frames. For PER calculation, compare the total filtered received frames with the total sent frames. You cannot use FCS and header errors for address filtering because only good frames are considered.

1VV0301463 Rev. 1.0 Page 481 of 504 2018-01-24

Page 482: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

11.1.1.9 Asynchronous Frame Transmission (TX99 mode)

This command is used to enable TX99 mode.

Command Syntax AT+WTX99TEST=<Channel>,<BandWidth>,<NumFrames>,<FrameLen>,<TxRate>,<TxPower>,<DestAddr>,<Bssid>,<GuardInterval>,<GreenField>,<Antenna>,<Cca>,<Agc>,<ContPreambleMode>,<Spreader>,<Scrambler>,<Preamble>,<PreambleType>,<TestPatternType>,<PhyTestTxRate>,<ModeSelect>

Usage This command enables the asynchronous data transmission with the parameters configured.

Parameter Description

Table 461, page 482 describes the Asynchronous Frame Transmission (TX99 mode) parameters.

NOTE: Issue AT+WRFTESTSTART command before issuing the FrameTX test or the TX99 test commands; otherwise a WLAN exception/reset will occur.

Table 461 Asynchronous Frame Transmission Parameters

Parameter Optional/Mandatory Value Description

Channel Mandatory 1 to 14 The channel on which the data is to be sent (1-14).

BandWidth Mandatory 0 The values of 0 is 20MHz.Note: Currently the GS node supports only 20MHz operation.

NumFrames Mandatory 1-65535 The number of asynchronous frames to be sent (1-65535).

Note: For continuous transmission, configure this parameter with the value 99.FrameLen Mandatory 32-1500 The length of the payload.

TxRate Mandatory 0 to 7• Non HT Rates - 0• Ht Rate - 0 to 7 (MCS Index)

Note: Use PhyTestTxRate and ModeSelect fields to change the transmission rate.

TxPower Mandatory 0 to 27

The value of this parameter can range from 0 to 27. Where 27 is the index corresponding to Maximum TxPower GS node will support.

DestAddr Mandatory N/A The MAC address of the node targeted to reach.

BSSID Mandatory N/AThe MAC address of any arbitrary AP, which will be the source MAC address.

1VV0301463 Rev. 1.0 Page 482 of 504 2018-01-24

Page 483: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

GuardInterval Mandatory0, 1• 0 - Short guard interval• 1 - Long guard interval

It specifies the guard interval.

GreenField Mandatory0, 1• 0 - 11n disabled• 1 - 11n only

It specifies whether to enable or disable 11n.

Antenna Optional N/A It specifies the antenna used.

Cca Optional

0,1• 0 - Normal mode• 1 - Removes the control

of CCA module on the receiver state machine in PHY

It specifies whether to enable normal mode or remove the control of CCA module on the receiver state machine in PHY.

Agc Mandatory

0, 1• 0 - Normal mode• 1 - Removes the control

of AGC module on the receiver state machine in PHY

It allows to enable normal mode or remove the control of ACG module on the receiver state machine in PHY.

ContpreambleMode Mandatory

0, 1• 0 - Disable Continuous

Preamble Mode• 1 - Enable Continuous

Preamble Mode

It allows to enable or disable the continuous preamble mode.

Spreader Mandatory0, 1• 0 - Spreader is OFF• 1 - Spreader is ON

It allows to enable or disable Spreader.

Scrambler Mandatory0, 1• 0 - Scrambler is OFF• 1 - Scrambler is ON

It allows to enable or disable Scrambler.

Preamble Mandatory

0, 1• 0 - Normal mode• 1 - Disables short and

long preamble in the transmitter

It allows to enable normal mode or disable short and long preamble in the transmitter.

PreambleType Mandatory0, 1• 0 - Short Preamble• 1 - Long Preamble

It specifies the Preamble type.

Table 461 Asynchronous Frame Transmission Parameters

Parameter Optional/Mandatory Value Description

1VV0301463 Rev. 1.0 Page 483 of 504 2018-01-24

Page 484: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

Table 462, page 484 describes ModeSelect, TxRate, and PHY test transmit rates for corresponding Data rates (TX99 mode).

TestPatternType Mandatory

• 000 (0)- All 1’s• 001 (1)- All 0’s • 010 (2)- Alternate 1’s

and 0’s• 011 (3)- PN15 random

sequence• 100 (4)- PN9 random

sequence• 111 (7)- PN7 random

sequence

It specifies the type of test pattern to be used.

PhyTestTxRate Mandatory 0 to 7

It specifies the PHY test transmission rates.The rates differ depending on the ModeSelect parameter.

ModeSelect Mandatory

0, 1, 2• 0 - 11g mode• 1 - 11b mode• 2 - 11n mode

It specifies the mode to be used.

Table 461 Asynchronous Frame Transmission Parameters

Parameter Optional/Mandatory Value Description

Table 462 ModeSelect, TxRate, PHY test transmit rates for corresponding Data rates (TX99 mode)

Data Rate (Mbps) ModeSelect Mode TxRate PhyTestTxRate1 1

802.11b

0 02 1 0 1

5.5 1 0 211 1 0 36 0

802.11g

0 39 0 0 712 0 0 218 0 0 624 0 0 136 0 0 548 0 0 054 0 0 4

1VV0301463 Rev. 1.0 Page 484 of 504 2018-01-24

Page 485: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

Example for Mode 802.11b

To support data rate of 11 Mbps, configure the ModeSelect parameter to 1, TxRate parameter to 0, and PhyTestTxRate to 3.

AT+WTX99TEST=1,0,25000,1000,0,20,00:11:22:33:44:55,00:50:c2:5e:10:99,0,0,0,0,1,0,1,1,1,0,1,3,1

Check the wireless sniffer to see the frame on air. Though some sniffers capture these packets, the best way to validate these packets will be using litepoint device.

Example for Mode 802.11g

To support data rate of 18 Mbps, configure the ModeSelect parameter to 0, TxRate parameter to 0, and PhyTestTxRate to 6.

AT+WTX99TEST=1,0,25000,1000,0,20,00:11:22:33:44:55,00:50:c2:5e:10:99,0,0,0,0,1,0,1,1,1,0,1,3,1

Example for Mode 802.11n

To support data rate of MCS5, configure the ModeSelect parameter to 2, TxRate parameter to 5, and PhyTestTxRate to 5.

AT+WTX99TEST=1,0,25000,1000,0,20,00:11:22:33:44:55,00:50:c2:5e:10:99,0,0,0,0,1,0,1,1,1,0,1,3,1

Table 463, page 485 table provides examples of Tx99 mode command for corresponding Data rates.

MCS0 2

802.11n

0 0MCS1 2 1 1MCS2 2 2 2MCS3 2 3 3MCS4 2 4 4MCS5 2 5 5MCS6 2 6 6MCS7 2 7 7

Table 462 ModeSelect, TxRate, PHY test transmit rates for corresponding Data rates (TX99 mode)

Data Rate (Mbps) ModeSelect Mode TxRate PhyTestTxRate

Table 463 Examples for Asynchronous Frame Transmission (TX99 mode)

Data Rate (Mbps) Example

1 AT+WTX99TEST=1,0,99,1000,0,18,00:11:22:33:44:55,00:50:c2:5e:10:99,0,0,0,0,1,0,1,1,1,0,3,0,1

2 AT+WTX99TEST=1,0,99,1000,0,8,00:11:22:33:44:55,00:50:c2:5e:10:99,0,0,0,0,1,0,1,1,1,0,3,1,1

5.5 AT+WTX99TEST=1,0,99,1000,0,14,00:11:22:33:44:55,00:50:c2:5e:10:99,0,0,0,0,1,0,1,1,1,0,3,2,1

11 AT+WTX99TEST=1,0,99,1000,0,11,00:11:22:33:44:55,00:50:c2:5e:10:99,0,0,0,0,1,0,1,1,1,0,3,3,1

1VV0301463 Rev. 1.0 Page 485 of 504 2018-01-24

Page 486: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

6 AT+WTX99TEST=1,0,99,1000,0,27,00:11:22:33:44:55,00:50:c2:5e:10:99,0,0,0,0,0,0,0,0,0,0,3,3,0

9 AT+WTX99TEST=1,0,99,1000,0,27,00:11:22:33:44:55,00:50:c2:5e:10:99,0,0,0,0,0,0,0,0,0,0,3,7,0

12 AT+WTX99TEST=1,0,99,1000,0,27,00:11:22:33:44:55,00:50:c2:5e:10:99,0,0,0,0,0,0,0,0,0,0,3,2,0

18 AT+WTX99TEST=1,0,99,1000,0,27,00:11:22:33:44:55,00:50:c2:5e:10:99,0,0,0,0,0,0,0,0,0,0,3,6,0

24 AT+WTX99TEST=1,0,99,1000,0,26,00:11:22:33:44:55,00:50:c2:5e:10:99,0,0,0,0,0,0,0,0,0,0,3,1,0

36 AT+WTX99TEST=1,0,99,1000,0,25,00:11:22:33:44:55,00:50:c2:5e:10:99,0,0,0,0,0,0,0,0,0,0,3,5,0

48 AT+WTX99TEST=1,0,99,1000,0,24,00:11:22:33:44:55,00:50:c2:5e:10:99,0,0,0,0,0,0,0,0,0,0,3,0,0

54 AT+WTX99TEST=1,0,99,1000,0,19,00:11:22:33:44:55,00:50:c2:5e:10:99,0,0,0,0,0,0,0,0,0,0,3,4,0

MCS0 AT+WTX99TEST=1,0,99,1000,0,27,00:11:22:33:44:55,00:50:c2:5e:10:99,0,0,0,0,0,0,0,0,0,0,3,0,2

MCS1 AT+WTX99TEST=1,0,99,1000,1,27,00:11:22:33:44:55,00:50:c2:5e:10:99,0,0,0,0,0,0,0,0,0,0,3,1,2

MCS2 AT+WTX99TEST=1,0,99,1000,2,27,00:11:22:33:44:55,00:50:c2:5e:10:99,0,0,0,0,0,0,0,0,0,0,3,2,2

MCS3 AT+WTX99TEST=1,0,99,1000,3,27,00:11:22:33:44:55,00:50:c2:5e:10:99,0,0,0,0,0,0,0,0,0,0,3,3,2

MCS4 AT+WTX99TEST=1,0,99,1000,4,25,00:11:22:33:44:55,00:50:c2:5e:10:99,0,0,0,0,0,0,0,0,0,0,3,4,2

MCS5 AT+WTX99TEST=1,0,99,1000,5,24,00:11:22:33:44:55,00:50:c2:5e:10:99,0,0,0,0,0,0,0,0,0,0,3,5,2

MCS6 AT+WTX99TEST=1,0,99,1000,6,20,00:11:22:33:44:55,00:50:c2:5e:10:99,0,0,0,0,0,0,0,0,0,0,3,6,2

MCS7 AT+WTX99TEST=1,0,99,1000,7,16,00:11:22:33:44:55,00:50:c2:5e:10:99,0,0,0,0,0,0,0,0,0,0,3,7,2

Table 463 Examples for Asynchronous Frame Transmission (TX99 mode)

Data Rate (Mbps) Example

1VV0301463 Rev. 1.0 Page 486 of 504 2018-01-24

Page 487: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

11.1.1.10 Asynchronous Frame Transmission (TX100 mode)

This command is used to enable the TX100.

Command Syntax AT+WTX100TEST=<Channel>,<BandWidth>,<TxPower>,<Antenna>,<Cca>,<Agc>,<ContPreambleMode>,<Spreader>,<Scrambler>,<Preamble>,<PreambleType>,<TestPatternType>,<PhyTestTxRate>,<ModeSelect>

Parameter Description

Table 464, page 487 describes the Asynchronous Frame Transmission (TX100 mode) parameters.

Table 464 Asynchronous Frame Transmission (TX100 mode)

Parameter Optional/Mandatory Value DescriptionChannel Mandatory 1-14 The channel on which the data is sent.BandWidth Mandatory 0 The values of 0 is 20MHz.Note: Currently the GS node supports only 20MHz operation.

TxPower Mandatory 0-27

The value of this parameter can range from 0 to 27. Where, 27 is the index corresponding to Maximum TxPower supported by GS node.

Antenna Optional 0 Antenna

Cca Mandatory 0,1• 0 - Normal mode• 1 - Removes the control CCA module on

the receiver state machine in PHY

Agc Mandatory 0,1• 0 - Normal mode• 1 - Removes the control of AGC module

on the receiver state machine in PHY

ContpreambleMode Mandatory 0,1• 0 - Disable Continuous Preamble Mode• 1 - Enable Continuous Preamble Mode

Spreader Mandatory 0,1 • 0 - Spreader is OFF• 1 - Spreader is ON

Scrambler Mandatory 0,1• 0 - Scrambler is OFF• 1 - Scrambler is ON

Preamble Mandatory 0,1• 0 - Normal mode• 1 - Disables short and long preamble in

the transmitter

PreambleType Mandatory 0,1• 0 - Short Preamble• 1 - Long Preamble

1VV0301463 Rev. 1.0 Page 487 of 504 2018-01-24

Page 488: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

Table 465, page 488 describes the PHY Test Transmit Rates (TX100 mode).

AT+WTX100TEST=1,0,16,0,0,1,0,0,1,1,0,1,3,1

TestPatternType Mandatory 0,1Selects the test pattern to be transmitted.• 0 - All 1s• 1 - All 0s

PhyTestTxRate Mandatory 0 to 7 The rate will differ depending on the ModeSelect (see Table 465, page 488).

ModeSelect Mandatory 0 to 2• 0 - 11g mode• 1 - 11b mode• 2 - 11n mode

Table 464 Asynchronous Frame Transmission (TX100 mode) (Continued)

Parameter Optional/Mandatory Value Description

Table 465 PHY Test Transmit Rates (TX100 mode)

Mode Select PhyTestTxRate Data Rate (Mbps)1 0 11 1 21 2 5.51 3 110 3 60 7 90 2 120 6 180 1 240 5 360 0 480 4 542 0 MCS02 1 MCS12 2 MCS22 3 MCS32 4 MCS42 5 MCS52 6 MCS62 7 MCS7

NOTE: Special equipment may need to be setup in order to observe the signals.

1VV0301463 Rev. 1.0 Page 488 of 504 2018-01-24

Page 489: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

11.1.1.11 Carrier Wave Transmission

This command is used to enable the carrier wave transmission.

Command Syntax AT+WCARWAVTEST=<Channel>,<BandWidth>,<TxPower>,<Antenna>, <CustomWavePeriod>

Parameter Description

Table 466, page 489 describes the Carrier Wave Transmission parameters.

Example AT+WCARWAVTEST=11,0,27,0,2

Table 466 Carrier Wave Transmission Parameters

Parameter Optional/Mandatory Value DescriptionChannel Mandatory 1-14 The channel on which the data is sent.BandWidth Mandatory 0 The values of 0 is 20MHz.Note: Currently GS node only supports 20MHz operation.

TxPower Mandatory 0-27

The value of this parameter can range from 0 to 27. Where, 27 is the index corresponding to Maximum TxPower supported by GS node.

Antenna Optional 0 Unused

CustomWavePeriod Optional N/A The period in which the carrier wave is transmitted.

1VV0301463 Rev. 1.0 Page 489 of 504 2018-01-24

Page 490: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

11.2 Live Calibration

11.2.1 Enable Live Calibration

This command is used to enable or disable live calibration.

When live calibration is enabled,

• It is scheduled to start in the next boot based on the commands related to the following:

– Scan

– Associated state

– Unsolicited Tx and unsolicited Rx

– RF commands

– Standby

• It enables RF calibration on a fully assembled unit.

• Factory calibration data from OTP-one time programmable data is used until live calibration data is available in flash.

• The configured parameter value remains the same unless manually changed.

When live calibration is disabled,

• It aborts any live calibration that is in progress.

• Partial data is not written and not erased from flash.

• Factory calibration data from OTP data is used for RF calibration.

• The configured parameter value remains the same unless manually changed.

Command Syntax AT+WLCALEN=<value>

NOTE: This command is obsolete and it is retained for backward compatibility.

NOTE: 1.) Erase command deletes all the settings and enables live calibration by default. When fresh live calibration data is required, issue Erase command before enabling live calibration 2.) Once live calibration is enabled, a cold boot reset/reset need to be performed for it to take effect. Standby option is not allowed. 3.) Live calibration is enabled by default.

1VV0301463 Rev. 1.0 Page 490 of 504 2018-01-24

Page 491: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

Parameter Description

Table 467, page 491 describes the Live Calibration parameters.

Synchronous Response

Table 468, page 491 describes the synchronous responses and remarks for the Live calibration command.

Example AT+WLCALEN=1OK

Table 467 Live Calibration Parameters

Parameter Optional/Mandatory Value Description

value Mandatory0, 1, ? Default value - 1

0:Disables live calibration.1:Enables live calibration. ?:Provides the current value of the live calibration flag. Returns value 1 when live calibration is enabled or return 0 when live calibration is disabled.

Table 468 Live Calibration Synchronous Responses

Responses RemarksOK Success

ERROR:INVALID INPUTIf parameters are not valid(If value is other than 0, 1, or ? )

NOTE: This command needs to be used with caution only during assembly and manufacturing. The following steps need to be performed during assembly (if required): 1.) Erase live calibration data. 2.) Once the system boots up, disable live calibration, as it is automatically enabled when the system boots up. 3.) Live calibration is scheduled to start in the next boot based on the following triggers: - During scan - In associated state - Unsolicited Tx and unsolicited Rx - RF commands or RF stop command - Going to standby

1VV0301463 Rev. 1.0 Page 491 of 504 2018-01-24

Page 492: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

11.2.2 Erase Live CalibrationThis command is used to erase the live calibration data in flash and reset live calibration to factory default settings. It invalidates any previous settings related to live calibration, erases all the previous information such as enable or disable live calibration from flash, and enables live calibration.

Command Syntax AT+WLCALERASE

Synchronous Response

Table 469, page 492 describes the synchronous responses and remarks for the Live calibration Erase command.

Example AT+WLCALERASEOK

NOTE: Live calibration is scheduled to start in the next boot based on the following triggers: - During scan - In associated state - Unsolicited Tx and unsolicited Rx - RF commands or RF stop command - Going to standby

Table 469 Live Calibration Erase Synchronous Responses

Responses RemarksOK Success

NOTE: 1.)This command should be used with caution only during assembly and manufacturing. 2.)Once the command is issued, a cold boot reset needs to be performed for the command to be effective. 3.) WLCALERASE resets live calibration to factory default where the live calibration data is cleared and live calibration is enabled.The first time live calibration starts automatically after reset. 3.)Standby option is not allowed.

1VV0301463 Rev. 1.0 Page 492 of 504 2018-01-24

Page 493: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

11.2.3 Start Live CalibrationThis command and associated API is added to support all-channel calibration for customers that want to perform all-channel calibration in their production line to get better performance right from beginning. The calibration is performed for ambient temperature range. Other temperature ranges are still calibrated in the field with incremental calibration.

The GS2000 module is not available for any other (normal) operations during this time. Calibrations are performed in open air with antenna and un-controlled environment. In open air environment, this operation is expected to be completed in under 2 seconds. However, in crowded environment, it may take up to 3 seconds. If placed in a shielded box, this operation is expected to be completed in 1 second or less.

Command Syntax AT+WLCALSTART=<value>

Parameter Description

Table 470, page 493 describes the Start Live Calibration parameters.

Synchronous Response

Table 471, page 494 describes the synchronous responses and remarks for the Start Live Calibration command.

NOTE: If the status is FAIL, this command can be executed again multiple times (if needed) without any side effect. Every invocation of this command starts fresh Live calibration by erasing any previous data.

Table 470 Start Live Calibration Parameters

Parameter Optional/Mandatory Value Description

value Mandatory1Default value - 1

Runs live calibration

1VV0301463 Rev. 1.0 Page 493 of 504 2018-01-24

Page 494: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

Example 1 AT+WLCALSTART=1Calibration Info:status = SUCCESSLength = 133Data: 0 41 0 47 49 43 41 41 0 47 4b 43 42 0 41 43 4b 42 42 0 41 44 4c 42 42 0 41 44 4c 42 42 0 41 45 4c 43 43 0 41 45 4d 43 43 0 41 46 4d 43 43 0 41 47 4d 43 43 0 41 47 4d 43 43 0 41 48 4d 43 43 0 41 48 4d 43 43 0 41 49 4e 44 43 0 41 49 4e 43 43 0 41 49 4e 43 43 0 41 49 4e 43 43 0 fd fb f2 11 fb 0 c d ef b fc f1 0 5 3 f1 9 3 9 f7 f1 3 ff c49 932 a01 c8 5 a52 ec2 8fa e15 125e 1218 12aa 101bOK

Example 2 AT+WLCALSTART=1Calibration Info:status = FAILLength = 133Data: 80000020 0 1 12 1 a 5 0 1 12 2 9 5 1 41 12 b 9 7 1 41 11 a 9 7 1 41 11 a 9 7 1 41 10 9 9 7 1 41 f 9 9 7 1 41 e 9 9 7 1 41 d 8 8 7 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 6 fffffffc fffffff6 ffffffef 13 1 a fffffff7 3 a fffffffb b ffffffff fffffff3 ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff 4828 109c c2e c49 a0d 10fc 5adb ffff ffff ffff ffff ffff OK

Table 471 Start Live Calibration Synchronous Responses

Responses RemarksCalibration Info:status = SUCCESSLength = Length of Calibration dataData: Calibration dataOK

Success

Calibration Info:status = FAILLength = Length of Calibration dataData: Calibration dataOK

Failure

1VV0301463 Rev. 1.0 Page 494 of 504 2018-01-24

Page 495: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

11.2.4 For Complete Sequence of Live CalibrationAfter cold boot, it is highly recommended to issue following live calibration commands before performing any of the Wi-Fi operations:

AT+WLCALERASE

AT+RESET

AT+WLCALSTART=1

11.3 Debug

11.3.1 Log LevelThis command is used to configure the debug level so that the response of a command will include more information (error reason) in case of an error.

Command Syntax AT+LOGLVL=<level>

Command Note This command can also be used for domain check as well.

Parameter Description

Table 472, page 495 describes the Error Code parameters.

Synchronous Response

Table 473, page 496 describes the synchronous responses and remarks for the Error Code command.

Table 472 Error Code Parameters

Parameter Optional/Mandatory Value Description

level Mandatory

0 (Default) No error code or warning message along with the command response.

1 Error code or warning message along with the command response.

2

It gives additional information with Error code or warning message along with the command response.If the domain name feature is enabled the node displays buffer content which contains alternate names (domain names) provided in the incoming server certificate.

1VV0301463 Rev. 1.0 Page 495 of 504 2018-01-24

Page 496: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

Example - AT+LOGLVL=1OKAT+WA=GSDEMOSSID NOT FOUNDERROR

11.3.2 Echo

This command is used to enable or disable the echo back to host (MCU).

Command Syntax ATEn

Parameter Description

Table 474, page 496 describes the Echo parameters.

Table 473 Error Code Synchronous Responses

Responses RemarksOK SuccessERROR Failure

NOTE: This command is applicable for all the AT Commands, but not to their Responses.

Table 474 Echo Parameters

Parameter Value Description

n

0 Disabled

1 (default)EnabledIf echo is enabled, every character received from host (MCU) is transmitted back to host.

Note: When Echo command is enabled, ensure that:• Host sends either “\r” or “\n” after any AT Command, as all the commands are passed after

receiving either “\r” or “\n” only.• Host should not send any “\r” or “\n” after sending data (bulk data or any data) using ESC

sequence.Example: Send only AT+CID=?\rDo not send AT+CID=?\r\n

1VV0301463 Rev. 1.0 Page 496 of 504 2018-01-24

Page 497: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

Synchronous Response

Table 475, page 497 describes the synchronous responses and remarks for the Echo command.

11.3.3 VerboseThis command is used to enable or disable verbose mode for synchronous and asynchronous responses.

Command Syntax ATVn

Parameter Description

Table 476, page 497 describes the Verbose parameters.

Synchronous Response

Table 477, page 497 describes the synchronous responses and remarks for the Verbose command.

Table 475 Echo Synchronous Responses

Synchronous Responses RemarksOK SuccessERROR: INVALID INPUT If parameters are not valid.

Table 476 Verbose Parameters

Parameter Value Description

n

0

Verbose response is disabled, the status response is in the form of numerical codes.For more information about the numerical codes when Verbose is disabled.

1 (default)EnabledVerbose responses are enabled. The status response is in the form of ASCII strings.

Table 477 Verbose Synchronous Responses

Responses RemarksOK Success

ERROR: INVALID INPUTIf parameters are not valid.(n other than 0 or 1)

1VV0301463 Rev. 1.0 Page 497 of 504 2018-01-24

Page 498: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

11.3.4 RSSIThis command is used to get information regarding the received signal strength of the incoming packets in dBm. All incoming management and data frames are considered.

Command Syntax AT+WRSSI=?

Synchronous Response

Table 478, page 498 describes the synchronous responses and remarks for the Get RSSI command.

Example AT+WRSSI=?-33OK

11.3.5 WLAN StatusThis command is used to retrieve information about the current wireless status.

Command Syntax AT+WSTATUS

Synchronous Response

Table 479, page 498 describes the synchronous responses and remarks for the alternate Status command.

Table 478 Get RSSI Synchronous Responses

Responses RemarksRSSIOK

Success

Table 479 Alternate Status Synchronous Responses

Responses Remarks

MODE:<mode> CHANNEL:<channel> SSID:<ssid>BSSID:<bssid> SECURITY:<security>OK

SuccessThe GS node reports the current network configuration to the serial host:• Mode• Channel• SSID• BSSID• Security

NOT ASSOCIATEDOK

If module is not associated with an access point.

1VV0301463 Rev. 1.0 Page 498 of 504 2018-01-24

Page 499: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

Example 1 - Not associated state

AT+WSTATUSNOT ASSOCIATEDOK

Example 2 - Associated state

AT+WA=GainSpanDemo,,11IP SubNet Gateway192.168.1.99:255.255.255.0:192.168.1.1OK

AT+WSTATUSMODE:0CHANNEL:11 SSID:”GainSpanDemo”BSSID:98:fc:11:4a:b8:56SECURITY:NONEOK

11.3.6 Network StatusThis command is used to retrieve information about the current network status.

Command Syntax AT+NSTAT=?

Synchronous Response

Table 480, page 500 describes the synchronous responses and remarks for the Status command.

1VV0301463 Rev. 1.0 Page 499 of 504 2018-01-24

Page 500: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

Alternate Command AT+WSTATUS

This alternate command is used to retrieve information about the current wireless status.

Synchronous Response

Table 479, page 498 describes the synchronous responses and remarks for the alternate Status command.

Table 480 Status Synchronous Responses

Responses Remarks

MAC=00:1d:c9:d0:70:ccWSTATE=CONNECTED MODE=APBSSID=c8:d7:19:75:74:fbSSID="GainSpanDemo" CHANNEL=11 SECURITY=NONERSSI=-32IP addr=192.168.1.99 SubNet=255.255.255.0 Gateway=192.168.1.1DNS1=0.0.0.0 DNS2=0.0.0.0Rx Count=22 Tx Count=75090OK

• Success• Upon deployment of this command, the

GS node reports the current network configuration to the serial host:

• MAC address• WLAN state: CONNECTED or NOT

CONNECTED• Mode: STA, LAP, NONE• BSSID: In case of STA mode, it specifies the MAC address of the connected AP.In case of LAP mode, it specifies the MAC address of the module itself.• SSID:In case of STA mode, it specifies the SSID of the connected AP.In case of LAP mode, it specifies the SSID of the module itself.• Channel: 1 to 11• Security: NONE, WPA2-PERSONAL,

WPA-PERSONAL, WPA2-ENTERPRISE (only for Station mode)

• RSSI: It is the Received signal strength indication. The range will be in db.

• Network configuration: IP Address, Subnet mask, Gateway address, DNS1 address, DNS2 address

• RX count: Packets received by WLAN• TX count: Packets transferred by WLAN

1VV0301463 Rev. 1.0 Page 500 of 504 2018-01-24

Page 501: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

Example 1 - Not associated state

AT+WSTATUSNOT ASSOCIATEDOK

Example 2 - Associated state

AT+WA=GainSpanDemo,,11IP SubNet Gateway192.168.1.99:255.255.255.0:192.168.1.1OK

AT+WSTATUSMODE:0CHANNEL:11 SSID:”GainSpanDemo”BSSID:98:fc:11:4a:b8:56SECURITY:NONEOK

11.3.7 WLAN StatisticsThis command is used to transmit or request statistics from WLAN. After providing the statistics it resets all the counters. Every issuance of this command gives the statistics from the previous issuance.

Command Syntax AT+WLANSTATS

Usage When the statistics are sent to the host, the clears them so that a new set of statistics are collected for the next report.

This command returns the statistics counters in the following order separated. Some fields have multiple values and for that failure and success counts are separated by a comma. Each set is delimited by “:” character.

Table 481 Alternate Status Synchronous Responses

Responses Remarks

MODE:<mode> CHANNEL:<channel> SSID:<ssid>BSSID:<bssid> SECURITY:<security>OK

SuccessThe GS node reports the current network configuration to the serial host:• Mode• Channel• SSID• BSSID• Security

NOT ASSOCIATEDOK

If module is not associated with an access point.

NOTE: This command is used for testing and debugging purpose only.

1VV0301463 Rev. 1.0 Page 501 of 504 2018-01-24

Page 502: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

Table 482, page 502 describes GS node WLAN TX Statistic counters.

Table 483, page 503 describes GS node WLAN RX Statistic counters.

Table 482 GS Node WLAN TX Statistic Counters

WLAN Statistic Counters Descriptionitxs TX Successitxto TX Timeoutitxf TX Failedwep40 WEP-40 encryptedwep104 WEP-104 encryptedtkip TKIP encryptedccmp CCMP encryptedunencryp Not encryptedukencryp Unknown encryptionleg Legacy framesht20l HT-LongGl-20MHzht20s HT-Shrtl-20MHzht40l HT-LongGl-40MHzht40s HT-ShrtGl-40MHZmcs32s MCS-32 ShortGlmcs32l MCS-32 LongGlprobersp Probe responseproberreq Probe requestmc_data Multicase datauc_data Unicast dataqos_uc_data Unicast QoS dataqos_mc_data Multicast QoS dataamsdu_uc_data Unicast AMSDU dataamsdu_mc_data Multicast AMSDU dataampdu_uc_data Unicast AMPDU dataampdu_mc_data Multicast AMPDU dataoth_mgmt Other managementoth Other framesctrl Control framesretries Retriesmultiple_retries Multiple retriesfragments Fragments

1VV0301463 Rev. 1.0 Page 502 of 504 2018-01-24

Page 503: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

Table 483 GS Node WLAN RX Statistic Counters

WLAN Statistic Counters Descriptionirx0 Invalidirxf FCS Failureirxs RX Successfulirxd Duplicate Detectedirxmf MIC Failedirxkf Key Failedirxicvf ICV Failedirxtkipicvf ICV failed for TKIPirxtkipmf MIC failed for TKIPirxrf CCM Replay Failureirxtkiprf TKIP Replay Failureirxdip Defragmentation in Progressirxdf Defragmentation Failureirxex Exception - Reserved valuewep40 WEP-40 encryptedwep104 WEP-104 encryptedtkip TKIP encryptedccmp CCMP encryptedunencryp Not encryptedukencryp Unknown encryptionleg Legacyht20l HT-LongGl-20MHZht20s HT-ShrtGl-20MHzht40l HT-LongGl-40MHzht40s HT-ShrtGl-40MHzmcs32s MCS-32 ShortGlmcs32l MCS-32 LongGlbcn Beaconrts RTScts CTSack ACKprobersp Probe responseprobereq Probe requestatim ATIMcfend CF-End

1VV0301463 Rev. 1.0 Page 503 of 504 2018-01-24

Page 504: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

back Block-Ackbar Block-Ack Requestmc_data Multicast datauc_data Unicast dataoth_data Other dataqos_uc_data Multicast QoS dataqos_mc_data Unicast QoS dataqos_oth_data Other QoS dataamsdu_uc_data Multicast AMSDU dataamsdu_mc_data Unicast AMSDU dataamsdu_oth_data Other AMSDU dataoth_mgmt Other Management frameoth_ctrl Other Control frameoth Other type

Table 483 GS Node WLAN RX Statistic Counters (Continued)

WLAN Statistic Counters Description

1VV0301463 Rev. 1.0 Page 504 of 504 2018-01-24

Page 505: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

t all

s DP

Appendix A Response Codes

This appendix provides a list of response codes for Serial-to-WiFi AT commands.

• Synchronous Messages, page 505

• Asynchronous & Enhanced Asynchronous Messages, page 506

The possible responses sent by the Adapter to the serial host are categorized as follows:

• Synchronous messages

• Asynchronous messages

• Enhanced asynchronous messages

– Exception messages

– Boot messages

A.1 Synchronous MessagesTable 484, page 505lists the response codes with all characters including: <CR> or <LF> that would be seen on the MCU interface.

Table 484 Response codes for Synchronous MessagesEvents Synchronous Message Remarks

Verbose mode Non Verbose modeS2W_SUCCESS \r\nOK\r\n \r\n0\r\n Command Request SuccessS2W_FAILURE \r\nERROR\r\n \r\n1\r\n Command Request Failed

S2W_EINVAL \r\nERROR: INVALID INPUT\r\n \r\n2\r\n Invalid Command or Option or

Parameter

S2W_ENOCID \r\nERROR: NO CID\r\n \r\n4\r\nSupport only 16 CIDs, it will nocreate the 17th connection when16 CIDs are active

S2W_EBADCID \r\nERROR: INVALID CID\r\n \r\n5\r\n Invalid Connection Identifier

S2W_ENOTSUP \r\nERROR: NOT SUPPORTED\r\n \r\n6\r\n Feature is not supported

S2W_CON_SUCCESS \r\nCONNECT 0\r\n \r\n7\r\n GS node TCP/IP server/client created successfully

S2W_LINK_LOST \r\nDISASSOCIATED\r\n \r\n9\r\nGS node is not associated to a wireless network & MCU sendNSTCP/UDP or AT+NCTCP/U

1VV0301463 Rev. 1.0 Page 505 of 512 2018-01-24

Page 506: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

A.2 Asynchronous & Enhanced Asynchronous MessagesTable 485, page 506 lists the response codes of asynchronous and enhanced asynchronous messages in verbose and non verbose mode.

Asynchronous message format:

Starts with “CR” and “LF” and ends with “CR” and “LF” or “\r\n” or “\n\r\” or “\r\n\r\n” or “\r\n\n\r”.

Enhanced asynchronous message format:

<ESC><Type><Subtype><Length><message>

Table 485 Response codes for Asynchronous and Enhanced Asynchronous MessagesEvents Verbose mode Non Verbose Mode

Asynchronous message Enhanced asynchronous message

Asynchronous message

Enhanced asynchronous

messageERROR \r\nERROR\r\n <ESC>Ab05ERROR\r\n \r\n1\r\n <ESC>Ab01b\r\n

ERROR:SOCKET FAILURE<CID>

\r\nERROR: SOCKET FAILURE<CID>\r\n

<ESC>A017ERROR: SOCKET FAILURE 0\r\n

\r\n3<SP> 0\r\n <ESC>A0030 0\r\n

CONNECT<SP><CID> \r\nCONNECT<SP><CID>\r\n

<ESC>A10CONNECT<SP>0\r\n \r\n7<SP>0\r\n <ESC>A11b1<SP

>0\r\n

DISCONNECT <CID> \r\nDISCONNECT <CID>\r\n

<ESC>A20cDISCONNECT 0\r\n \r\n8<SP> 0\r\n <ESC>A2032

0\r\n

Disassociation Event \r\n\r\nDisassociation Event\r\n\r\n

<ESC>A314Disassociation Event\r\n \r\n10\r\n <ESC>A3013\r\n

Out of Standby-Timer \r\n\n\rOut of StandBy-Timer\r\n\r\n

<ESC>A414Out of StandBy-Timer\r\n \r\n11\r\n <ESC>A4014\r\n

Out of Standby-Alarm \r\n\n\rOut of StandBy-Alarm\r\n\r\n

<ESC>A514Out of StandBy-Alarm\r\n \r\n12\r\n <ESC>A5015\r\n

Out of Deep Sleep \r\n\r\nOut of Deep Sleep\r\n\r\n

<ESC>A611Out of Deep Sleep\r\n \r\n13\r\n <ESC>A6016\r\n

ERROR:IP CONFIG FAIL

\r\nERROR: IP CONFIG FAIL\r\n

<ESC>A815ERROR: IP CONFIG FAIL\r\n \r\n15\r\n <ESC>A8018\r\n

Serial2WiFi APP \r\nSerial2WiFi APP\r\n <ESC>A90fSerial2WiFi APP\r\n \r\n16\r\n <ESC>A9019\r\n

NWCONN-SUCCESS \r\nNWCONN-SUCCESS\r\n

<ESC>Ac0eNWCONN-SUCCESS\r\n \r\n18\r\n <ESC>Ac01c\r\n

IP CONFIG-NEW IP \r\nIP CONFIG-NEW IP\r\n

<ESC>Ad10IP CONFIG-NEW IP\r\n \r\n19\r\n <ESC>Ad01d\r\n

APP Reset-Wlan-Wd \r\n\n\rAPP Reset-Wlan-Wd\r\n\r\n

<ESC>Ae11APP Reset-Wlan-Wd\r\n \r\n20\r\n <ESC>Ae01e\r\n

APP Reset-App-Wd \r\n\n\rAPP Reset-App- Wd\r\n\r\n

<ESC>Af010APP Reset-App-Wd\r\n \r\n21\r\n <ESC>Af001f\r\n

1VV0301463 Rev. 1.0 Page 506 of 512 2018-01-24

Page 507: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

\

\

\

\

\

\

\

\

\

APP Reset-Wlan SW Reset

\r\n\n\rAPP Reset-Wlan SW Reset\r\n\r\n

<ESC>Af117APP Reset-Wlan SW Reset\r\n

\r\n22\r\n <ESC>Af10210\rn

APP Reset-APP SW Reset

\n\rAPP Reset-APP SW Reset\r\n”

<ESC>Af216APP Reset-APP SW Reset\r\n \r\n23\r\n <ESC>Af20211\r

n

APP Reset-Wlan Except \r\n\n\rAPP Reset-Wlan Except\r\n\r\n

<ESC>Af315APP Reset-Wlan Except\r\n \r\n24\r\n <ESC>Af30212\r

nAPP Reset External Flash FW-UP-SUCCESS

\r\nAPP Reset External Flash FW-UPSUCCESS\r\n

<ESC>Af426APP Reset External Flash FW-UP-SUCCESS\r\n

\r\n25\r\n <ESC>Af40213\rn

External Reset Boot \r\n\r\nExternal Reset Boot\r\n\r\n

<ESC>Af613External Reset Boot\r\n \r\n27\r\n <ESC>Af60215\r

n

IP Conflict Detected \r\n\n\rIP Conflict Detected\r\n\r\n

<ESC>Afa14IP Conflict Detected\r\n \r\n31\r\n <ESC>Afa0219\r

n

Registration Failed for mDNS host name

<SP>Registration Failed for mDNS host name\r\n

<ESC>Afb24 Registration Failed for mDNS host name\r\n

\r\n32\r\n <ESC>Afb021a\rn

Registration Success for mDNS host name

<SP>Registration Success for mDNS host name\r\n

<ESC>Afc27 Registration Success!! for RR: È! Qð\r\n

\r\n33\r\n <ESC>Afc021b\rn

Registration Success for mDNS service name

<SP>Registration Success for mDNS service name\r\n

<ESC>fc23 Registration Success! ! for RR:555\r\n \r\n33\r\n <ESC>fc021b\r\n

Registration Failed for mDNS service name

<SP>Registration Failed for mDNS service name\r\n

<ESC>fb20 Registration Failed for RR: 55\r\n \r\n32\r\n <ESC>fb021a\r\n

Service Discovery Failed <SP>Service Discovery Failed\r\n <ESC>Afd \r\n34\r\n <ESC>Afd021c\r

n

APP Reset OTH FW-UP-SUCCESS

<CR><LF>APP<SP>Reset<SP>OTH<SP> FW-UP-SUCCESS<CR><LF>

<ESC><A>fe1bAPP Reset OTH FW-UP-SUCCESS<CR><LF>

\r\n35\r\n <ESC>Afe021d<CR><LF>

Error parsing chunk length

<ESC>F<CR><LF>Error<SP>parsing<SP>chunk<SP>len\r\n

NA \r\n36\r\n NA

Error parsing <ESC><M>

<ESC>F<CR><LF>Error<SP>parsing<SP><ESC><M><CR><LF>

NA \r\n37\r\n NA

Error updating signature<ESC>F<CR><LF>Error<SP>Updating<SP>Signature<CR><LF>

NA \r\n38\r\n NA

Table 485 Response codes for Asynchronous and Enhanced Asynchronous MessagesEvents Verbose mode Non Verbose Mode

Asynchronous message Enhanced asynchronous message

Asynchronous message

Enhanced asynchronous

message

1VV0301463 Rev. 1.0 Page 507 of 512 2018-01-24

Page 508: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

\

r

r

r

Error writing flash<ESC>F<CR><LF>Error<SP>writing<SP>flash<CR><LF>

NA \r\n39\r\n NA

Error verifying signature<ESC>F<CR><LF>Error<SP>verifying<SP>signature<CR><LF>

NA \r\n40\r\n NA

p2p-Dev-found <SP>P2P Dev Found\r\n <ESC>Af0 r\n41\r\n <ESC>Af0021c\rn

p2p-find-complete <SP>P2P Find Complete\r\n

<ESC>Aff0111p2p-find-complete\r\n r\n42\r\n <ESC>Af1021f\r\

n

WAC Completed <SP>WAC Completed\r\n

<ESC>Aff040dWAC Completed\r\n r\n46\r\n <ESC>Aff40222\

\n

WAC Failed <SP>WAC Failed\r\n <ESC>Aff050aWAC Failed\r\n r\n47\r\n <ESC>Aff50223\

\n

WAC Timeout <SP>WAC Timeout\r\n <ESC>Aff060bWAC Timeout\r\n r\n48\r\n <ESC>Aff60224\

\n

Out of Standby-PS Poll\r\n\n\rOut ofStandBy-Pspoll\r\n\r\n

<ESC><A>ff0815Out of StandBy-Pspoll<CR><LF>

r\n50\r\n <ESC><A>ff080226<CR><LF>

Table 485 Response codes for Asynchronous and Enhanced Asynchronous MessagesEvents Verbose mode Non Verbose Mode

Asynchronous message Enhanced asynchronous message

Asynchronous message

Enhanced asynchronous

message

NOTE: a.) When verbose mode is disabled, an ASCII string gets replaced by its ASCII character. b.) MCU has to wait for an infinite time for a command response. c.) "\r\n" is appended to each asynchronous message and it is not included in the length.

1VV0301463 Rev. 1.0 Page 508 of 512 2018-01-24

Page 509: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

A.3.1 Exception MessagesThe possible exception messages sent by the Adapter to the serial host are enumerated in Table 486, page 509.

If the exception is due to one of the WLAN wd/SW Reset/Except, then the adapter send memory dump information of its WLAN registers to the serial host starts with the message \r\n---MEM-DUMP-START:\r\n and end with the message \n\r---MEM-DUMP-END:\r\n.

Table 486 Exception Messages

No. ASCII String Meaning

1 \r\n\n\rAPP Reset-Wlan SW Reset\r\n\r\n Adapter reset due to WLAN processor software reset.

2 \n\rAPP Reset-APP SW Reset\r\n

Adapter reset due to app processor software reset. This can also be triggered when AT+RESET command is issued and in this case it is not considered an asynchronous message.

3 \r\n\n\rAPP Reset-Wlan-Wd\r\n\r\n Adapter reset due to WLAN processor watchdog.

4 \r\n\n\rAPP Reset-App-Wd\r\n\r\n Adapter reset due to app processor watchdog.

5 \r\n\n\rAPP Reset-Wlan Except\r\n\r\n Adapter reset due to WLAN processor software abort or assert.

NOTE: a.) Exception messages a result of an undefined/unexpected behavior of the GS module that can occur at any time. b.) All exception messages are sent after a module reset. c.) After reset due to exception message, GS module comes back to the saved profile state before reset.

1VV0301463 Rev. 1.0 Page 509 of 512 2018-01-24

Page 510: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

A.3.2 Boot MessagesThe possible boot messages sent by the Adapter to the serial host are enumerated in Table 487, page 510.

Points to Remember

Understanding of how response messages are sent to HOST MCU from GainSpan

• Data from GainSpan can be:

– NETWORK DATA

– COMMAND RESPONSE

– ASYNCRONOUS MESSAGES.

• Data from GainSpan to S2W is not discrete. From S2W perspective, each type of data which is to be sent to HOST MCU is a separate WRITE (on serial interface UART/SPI/SDIO). But if HOST MCU delays in reading the data, then it can receive multiple messages at a time. For example, it can read ASYNCHRONOUS MESSAGE +DATA or COMMAND RSPONSE + DATA or 2 ASYNCHRONOUS MESSAGES.

• HOST MCU should parse the received data in such a way that it should separate all 3 types of data (mentioned above) and process accordingly as the HOST can receive the data which contains.

– DATA+ASYNCHRONOUS MESSAGE

Table 487 Boot Messages

No. ASCII String Meaning

1 \r\nSerial2WiFi APP\r\n

Normal Serial-to-WiFi adapter boot message with internal PA.This boot message is also applicable when reset is triggered from external reset pin.

2 \r\nAPP Reset External Flash FW-UP-SUCCESS\n\r\r\n

Boot message for an adapter reset with firmware update success

NOTE: a.) If the asynchronous message format is enabled in the saved profile, the boot messages are sent in the asynchronous message format. b.) If the asynchronous message format is disabled in the saved profile, the boot messages are sent in the format of standard responses depending on the verbose mode. c.) After the boot message has been received, the GS module is ready for commands.

1VV0301463 Rev. 1.0 Page 510 of 512 2018-01-24

Page 511: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

– COMMAND RESPONSE + DATA

– COMMAND RESPONSE + ASYNCHRONOUS MESSAGE

NOTE: a.) If S2W ECHO is disabled, then whenever HOST MCU issues any AT command, GainSpan only responds with corresponding COMMAND RESPONSE. Here, there is no way that HOST MCU can receive network DATA or ASYNCHRONOUS MESSAGE before COMMAND RESPONSE b.) If S2W ECHO is enabled, then there is a chance of receiving network DATA or ASYNCHRONOUS MESSAGE before COMMAND RESPONSE. This is because, S2W application is designed in such a way that, it reads only one character at a time from the Serial Buffer and when it receives '\r' or '\n', it starts processing the command. After S2W reads each character it checks whether ECHO is enabled or not. If enabled it will send the same character back to MCU. So during this time network data WRITE to HOST MCU is not blocked. c.) This is only blocked once S2W receives the complete command

NOTE: It is highly recommended to disable ECHO in the actual application.

1VV0301463 Rev. 1.0 Page 511 of 512 2018-01-24

Page 512: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

1VV0301463 Rev. 1.0 Page 512 of 512 2018-01-24

Page 513: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

Appendix B AT Commands Summary

This appendix provides a list of supported Serial-to-WiFi Adapter commands.

The following sections are covered in this appendix:

• Host Interaction, page 513

• General Operations, page 514

• Wireless, page 516

• Network, page 525

• Data Transfer, page 526

• Advance Services, page 533

• Power Management - Radio and System, page 538

• Peripherals, page 541

• Production and Debug, page 543

• Default Return Messages, page 545

• Escape Sequence Commands, page 546

B.1 Host InteractionTable 488, page 513 lists the Host Interaction AT commands.

Table 488 Host Interaction AT Supported Commands

Command Parameters Response / Effect

ATB<baudrate>[[,bitsperchar>][,<parity>][,<stopbits]]

UART parameters are immediately reset to values provided.

AT&Knn=0n=1

Enable or disable software flow control for the UART interface.

AT&Rnn=0 (disable)n=1 (enable)

IF 1, hardware flow control is enabled

AT+SPICONF <clockpolarity>,<clockphase>

Sets the SPI clock polarity and clock phase parameters.

AT None “OK”

1VV0301463 Rev. 1.0 Page 513 of 546 2018-01-24

Page 514: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

B.2 General OperationsTable 489, page 514 lists the General Operation interface AT commands.

Table 489 General Operations AT Supported Commands

Command Parameters Response / Effect

AT+VER ? Returns the current adapter firmware versions.

AT+VER ?? Gives more details of the S2W version.

AT+SETTIME<dd/mm/yyy><HH:MM:SS>

Sets the adapter system time.

AT+NTIMESYNC<Enable>,<ServerIP>,<Timeout>,<Periodic>,[<frequency>]

Sets the GS node system time using the SNTP.

AT+GETTIME ?

Provides the current system time followed by the standard command response to the serial interface.

The time format comes on the serial interface as follows:=<dd/mm/yyyy>,<HH:MM:SS>,System time in milliseconds since epoch (1970).

AT&V None Current and saved profile parameter values as ASCII.

AT&Wn (see Note 1)n=0 (profile 0)n=1 (profile 1)

Save profile specified by n.

ATZnn=0 (profile 0)n=1 (profile 1)

Load profile specified by n.

AT&Yn (see Note 1)n=0 (profile 0)n=1 (profile 1)

Set default profile to the value n.

AT&F None Restore profile to factory default values.

1VV0301463 Rev. 1.0 Page 514 of 546 2018-01-24

Page 515: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

Note 1: The GS2000 modules support two profiles.

ATSn=p (n=2 to 7,9; p=parameter value)

Not SupportedSets various timeout values:• 2= TCP Connection Timeout• 3= Association Retry Count• 4= Nagle Algorithm Wait Time• 5= • 6= L4 Retry Period• 7= L4 Retry Count• 8= AutoMode-Frame size

configuration • 9= Maximum number of

recv/recvfrom performed on socket• A= Auto connection exit sequence

(+++) enabled timeout

ATIn n=value

Various Adapter ID information:• 0=OEM ID• 1=Hardware Version• 2=Software Version

AT+CIDCONF <CID>,<n>,<Configuration ID>,<Configuration value>

It enables or disables Nagle timer on a CID.

AT+ASYNCMSGFMTn• 0 - Disable this feature• 1 - Enable this feature

Enables or disables enhanced asynchronous notification method.

AT+NMAC <MAC ADDRESS>

Sets the adapter MAC address (an 8-byte colon-delimited hexadecimal number), and stores the value in Flash memory.

AT+NMAC ? Returns the current adapter MAC address.

Table 489 General Operations AT Supported Commands

Command Parameters Response / Effect

1VV0301463 Rev. 1.0 Page 515 of 546 2018-01-24

Page 516: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

B.3 WirelessTable 490, page 516 lists the Wireless AT commands.

Table 490 Wireless AT Supported Commands

Command Parameters Response / Effect

AT+WREGDOMAIN <Regulatory Domain>

• FCC-supported channel range is 1 to 11.

• ETSI-supported channel range is 1 to 13.

• TELEC-supported channel range is 1 to 14.

AT+WM

n[,<beacon interval in AP mode>,<broadcast ssid in AP mode>,<no. of stations allowed in AP mode>,<dtim period in AP mode>,<inactivity timeout in AP mode>,<group key renewal interval in AP mode>,<Device type>,<Minimum application throughput>]

0 - station mode2 - limited AP5 - ISOTX

Set 802.11 Station operating mode.

AT+WRETRY <n>1 to 255 Sets the current retry count set to the supplied value.

AT+WSYNCINTRL <n> 1 to 65535 Configure the sync loss interval.

AT+WRTS <RTSTHRESHOLD>[,TXOP ENABLE] Sets the RTS threshold value

AT+WRATE

value<Transmit rate of data frame>[,<Transmit rate of management frame>,<Transmit rate of control frame>]

Sets the transmit rate

AT+WRATE ? Obtain the current transmit rate (in ASCII format) of the data frame.

AT+PWRDOWN None Prepares WLAN for graceful shutdown

1VV0301463 Rev. 1.0 Page 516 of 546 2018-01-24

Page 517: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

AT+UNSOLICITEDTX

<Frame Control>,<Sequence Control>,<Channel>,<DataRate>,<Power>,<CCA Enable/Disable>,<Frame Length>,<Reception Wait Time>,<DestAddr>,[<RxAddr3>],[<TxAddr4>],[Capture transmission time stamp in ticks],[Reception frame type],[Enable/Disable IE filter for reception frames],[Reception IE ID]

AT+UNSOLICITEDRX<TypeBitmape>,<IEFilterEnable>,<IEID>,<Channel>,<Rx_WaitTime>

Unsolicited data reception.

Rate: is the rate at which the data to be received and the possible values are:• RATE_1MBPS=130• RATE_2MBPS=132• RATE_5_5MBPS=139• RATE_11MBPS=150

AT+UNSOLICITEDRXSTOP N/A Stops the unsolicited data reception.

AT+UAMENC <Enable/Disable>,<Encryption Type>,<Encryption Key><IE ID>

Enables or disables encryption in unassociated mode.

AT+WSEC

• 0 - Auto security (All)• 1 - Open security• 2 - WEP security• 4 - WPA-PSK security• 8 - WPA2-PSK security• 16 - WPA Enterprise• 32 - WPA2 Enterprise• 64 - WPA2-AES+TKIP security

The S2W adapter supports either one of the values with default security configuration as “Auto.” This strict security compliance is not applicable for the WPS feature.

AT+WS [<SSID[,<BSSID>][,<Channel>][,<ScanTime]]

Network scan, returns list of found networks in the format:

<SSID>,<BSSID>,<Channel>,<RSSI>,<Mode>,<Security>

SSID may be a string of up to 32 ASCII characters in length.

Note: <Scan Time> is not used in GS2000. Use the AT+WST to set the for GS2000.

Table 490 Wireless AT Supported Commands

Command Parameters Response / Effect

1VV0301463 Rev. 1.0 Page 517 of 546 2018-01-24

Page 518: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

Note 1: The AT+WWEPn command specifies the Key to be used for Key number n of the WEP security to connect to an AP. APs can use 1 of 4 WEP keys (key 1 through 4).

For example,

If setting Key 1, the command would be:

AT+WA

<SSID>,[,[<BSSID>][,<Ch>],[Rssi Flag],[WPS Registrar],[Unscheduled automatic power save delivery configuration]]

Associate to specified SSID, BSSID, and channel. RSSI is an optional parameter with values:• 1 - associate to the AP specified by

SSID with highest RSSI value.• 0 - associate to the AP specified by

SSID without considering RSSI value. This is the default settings.

AT+WD None Disassociate from the current network.

AT+WST <Min >,<Reserved><CR>Min is the minimum per channel.This command also modifies the configured with the ATS5 command.

AT+WST ? Displays minimum and maximum in milliseconds.

AT+PSPOLLINTRL <n> 0 to 255 Keep-alive timing intervals associated with the GS node

AT+WKEEPALIVE <Interval>[,<Type>] Sets the keep-alive interval for n seconds.

AT+WAUTH n=1 to 2 Authentication mode setting

AT+WWEPn (see Note 1 below) n=1 to 4, <key> WEP key n is set to the value in <key>.

AT+WWEPCONF <enable/disable(1/0> Enables or disables the WEP key value entered

AT+WWPA <passphrase> WPA passphrase set to the value in <passphrase>.

AT+WPAPSK <SSID>,<passphrase> Computes and stores the WPA2 PSK value.

AT+WPSK <PSK> Sets the WPA2 pre-shared key to the <PSK>.

AT+APCLIENTINFO ?Get the information about the clients associated to the adapter when it acts as a limited AP.

Table 490 Wireless AT Supported Commands

Command Parameters Response / Effect

1VV0301463 Rev. 1.0 Page 518 of 546 2018-01-24

Page 519: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

AT+WWEP1=<key>

If setting Key 2, the command would be:

AT+WWEP2=<key>

1VV0301463 Rev. 1.0 Page 519 of 546 2018-01-24

Page 520: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

Table 491, page 520 lists the Wi-Fi Direct AT commands.

Table 491 Wi-Fi Direct AT Supported Commands

Command Parameters Response / Effect

AT+P2PSETDEV

<Group owner intent value>,<Operating class>,<Listen channel>,<Operating channel>,<WPS config methods>, <country code><CR>

group owner intent value: 0 to 15, group owner intent value to be used for group negotiation.

operating class:• 81-11g channels 1 to 13

listen channel: 1 byte value indicating channels 1, 6 & 11.

operating channel: 1 byte value indicating channels 1, 6 & 11.

WPS config methods: 2 byte value indicating the WPS config methods supported.

country code: indicates the country to operate in and it is a 3 char string.

AT+P2PSETWPS

<device name>,<primary device type category>,<primary device type subcategory>,<uuid>,[Num secondary device types],[secondary dev type subcategory],...upto 5 tuples

Set the important P2P WPS related attributes using single set command.

device name: 32 character string. This is the device name used to uniquely identify the device.

primary device type category: The 2 byte device category value.

primary device type subcategory: the 2 byte device subcategory value.

uuid: 16 byte UUIdAT+P2PSETATTR <attribute ID><attribute value> Sets the P2P attributes

1VV0301463 Rev. 1.0 Page 520 of 546 2018-01-24

Page 521: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

AT+P2PFIND <timeout>,<type>

timeout: if timeout is not specified, then it is considered as infinite.

type: 0 (social) or 1 (progressive). Social scan only channels 1, 6, 11. progressive scans all channels. Default is 0.

AT+P2PSTOPFIND NA Stops the P2P find operation that is currently in progress

AT+P2PPROVOK <WPS-KEYPAD PIN><CR> Triggers the WPS- registrar functionality for GO.

Table 491 Wi-Fi Direct AT Supported Commands

Command Parameters Response / Effect

1VV0301463 Rev. 1.0 Page 521 of 546 2018-01-24

Page 522: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

AT+P2PPD <peer address>,<config method>

Sends provisioning discovery request to given peer with the given config method and wait for provisioning discovery response.

peer address: MAC address of the peer P2P device to send provisioning discovery request.

config method: Config method to use.• 0 – Request peer to push

button• 1 – request peer to display PIN

that we would use for connect/join

• 2 – request peer to enter PIN we would display

Table 491 Wi-Fi Direct AT Supported Commands

Command Parameters Response / Effect

1VV0301463 Rev. 1.0 Page 522 of 546 2018-01-24

Page 523: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

AT+P2PGRPFORM

AT+P2PGRPFORM=<peer (p2p device)MAC address>,<peer (p2p device)listen channel>,<WPS config method>,<WPS PIN>,<group owner intent value>,<Trigger GO Negotiation Request>,<p2p group type><CR>

Group formation includes group owner negotiation, provisioning and establishing data connection.peer MAC address: MAC address of the peer P2P device to connect to.

peer listen channel: channel on which to connect.

WPS Config Method:4: Use push button for provisioning (PBC)2: Display configuration information (i.e., Displays a PIN that peer has to enter).3: Key-in configuration information. Enter the pin.

PIN: WPS pin, if 2 or 3 is selected above.

GO intent value: GO intent value for GO negotiation.

trigger GO negotiation request: If auth is specified as 1, 1500 is in listen mode, and it can respond to GO-Negotiation requests.

p2p group type: Set if the group should be a persistent group. If not specified, it is taken as zero.

Table 491 Wi-Fi Direct AT Supported Commands

Command Parameters Response / Effect

1VV0301463 Rev. 1.0 Page 523 of 546 2018-01-24

Page 524: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

Table 492, page 524 lists the Concurrent Mode AT commands.

AT+P2PJOIN <GO device address or interface address>,<wps method>,[pin]

Go device address or interface adddress: device address or interface address of group owner.

wps method: WPS method to use for WPS procedure:• 0 - pbc• 1 - display• 2 - keypad

pin (optional): it should be entered in the following cases:If wps_method is keypad, then the entered pin is passed (displayed by peer).If wps_method is displayed, then the pin displayed by us is passed (keyed by peer).

Table 491 Wi-Fi Direct AT Supported Commands

Command Parameters Response / Effect

Table 492 Concurrent Mode AT Supported Commands

Command Parameters Response / Effect

AT+NIFCMODE<mode type>[,<% time in mode 1>,<Enable STA reliability mode>]

Enables or disables concurrent mode and specifies percentage of time spent in each mode.

AT+NIF <Interface Number 0/1 or ?> Sets the interface or get current interface in use.

1VV0301463 Rev. 1.0 Page 524 of 546 2018-01-24

Page 525: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

B.4 NetworkTable 493, page 525 lists the Network AT commands.

Table 493 Network AT Supported Commands

Command Parameters Response / Effect

AT+L2CONFIG <Protocol>,<Enable/Disable> Configures the parameter bit wise.

AT+L2CONFIG ? Gives the configured current network interface filter.

AT+NDHCP n[,<hostname>,<radio mode>,<lease period>,<retry interval>]

Enable or disable DHCP client support for IPV4 parameters.

AT+NSET <Src Address>,<Net-mask>,<Gateway> Static network parameters overrides previous values.

AT+DHCPSRVR <Start/Stop[,<Dns Option Disable>,<Gateway Option Disable>]

Prior to start the server, the adapter should be configured with a valid static IP address.

Start/Stop: 1 is for starting the server and 0 is for stopping the server.

Dns Option Disable: 1 is for disabling and 0 is for enabling with enable as default setting.

Gateway Option Disable: 1 is for disabling and 0 is for enabling with enable as default setting.

AT+DHCPSRVRCFG

AT+DNSn,<url>n=0 (disable)n=1 (enable)

URL is the DNS name associated to the DNS IP address.

AT+DNSSET <DNS1 IP>,<DNS2 IP>] Sets the DNS server addresses to be used.

1VV0301463 Rev. 1.0 Page 525 of 546 2018-01-24

Page 526: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

B.5 Data TransferTable 494, page 526 lists the Data Transfer AT commands.

Table 494 Data Transfer AT Supported Commands

Command Parameters Response / Effect

AT+BDATA• 1 - Enable• 0 - Disable

Enables or disables bulk data.

AT+DROPDATAEN

n• 1 - Enable• 0 - Disable

Enables or disables dropping input data at Serial-to-WiFi level when there is a socket failure or disconnection.

AT+CID ? Returns the current CID configuration.

AT+NCLOSE <CID> Close connection identified by CID.

AT+NCLOSEALL None Closes all open connections.

AT+NXSETSOCKOPT <Cid>,<Type>,<Parameter>,<Value>,<Length>

Configures a socket which is identified by a CID.

AT+TCERTADD<Name>,<Format>,<Size>,<Location><CR><ESC>W<data of size above>

Configures the certificate for SSL/HTTPS and EAP/TLS

AT+TCERTDEL <certificate name> Deletes a certificate from memory.

AT+SRVVALIDATIONEN• 0 - Disable• 1 - Enable

Enables or disables server’s certificate validation on DUT.Default value = 1

AT+CERTINFOGET <certficate name> Provides the validation information of a certificate

1VV0301463 Rev. 1.0 Page 526 of 546 2018-01-24

Page 527: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

<Outer Authentication>,<Inner Authentication>,<user name>,<password>[, <common name and organizational unit>,<Enable/Disable Anonymous ID>,<Use CA Certificates>]

Sets the Outer authentication, Inner authentication, user name and password for EAP Security. This command returns the normal response codes.The valid outer authentication values are:• EAP-FAST:43• EAP-TLS:13• EAP-TTLS:21• EAP-PEAP:25The valid Inner authentication values are:• EAP-MSChAP:26• EAPGTC:6• EAP-PAP: 253For PEAP with Certificates, set the [Use CA Certificates] field to “1”.

AT+WEAP<Type>,<Format>,<Size>,<Location><CR><ESC>W<data of size above>

Configures certificate for EAP-TLS

AT+WEAPTIMECHK• 0 - Disable• 1 - Enable

Enables or disables time validation for EAP certificate.Default value = 1

AT+NCMAUTO <Mode>,<Start/Stop>[,Level],[<Nvds storeflag>]

Start/Stop the network connection manager

AT+NCMAUTOCONF <Conf Id>,<Value> Configures the NCM parameters for its state machine

AT+NCMAUTO?/?? Gives the status or the profile

information of network connection manager.

AT+APCONFEnable: 1 is for limited AP mode and 0 is for station mode, with default value as 0.

NCMAP parameters can be configured using the auto connect.

AT+NCMAUTOCONF <Param ID>,<Param Value>

Table 494 Data Transfer AT Supported Commands

Command Parameters Response / Effect

1VV0301463 Rev. 1.0 Page 527 of 546 2018-01-24

Page 528: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

Table 495, page 528 lists the Auto Mode AT commands.

Table 495 Auto Mode AT Supported Commands

Command Parameters Response / Effect

AT+WAUTO <mode>,<SSID>,<BSSID>,[channel]

Sets WiFi parameters to be used for Auto Connect.

AT+NAUTO <Type>,<Protocol>,<Destination IP>,<Destination Port>

Sets network parameters to be used for Auto Connect.

ATCnn=0 (disable)n=1 (enable)

IF 1, Auto Connect is enabled on next reboot or AT.

ATA None Starts Auto Connect, including association.

ATA2 None Initiates Auto Connect when GS node is associated with an Access Point

ATO NoneReturns to a previous Auto Connect sessions; returns an error if no such session exists.

AT+AUTOCON n Enable or Disable the new auto mode.

Table 496 Data Transfer AT Supported Commands

Command Parameters Response / Effect

AT+NCTCP <Dest-Address>,<Port>Attempts TCP client connection to Destination; CONNECT<CID> if successful.

AT+NCUDP <Dest-Address>,<Port>[<,Src.Port>]

Open UDP client socket to Destination; CONNECT<CID> if successful. The port range 0xBAC0 to 0XBACF may not be used.

AT+NSTCP<Port>, [max client connection],<TCP window size>

Start a TCP server on Port; CONNECT<CID> if successful.

AT+NSUDP <Port>

UDP server on Port; CONNECT<CID> if successful. The port range 0xBAC0 to 0xBACF may not be used.

AT+NCTCPSTORE <CID>Stores the connection parameters of a TCP client connected to aremote server with IPv4 address.

AT+NCTCPRESTORE <CID>Restores the connection parameters previously stored throughAT+NCTCPSTORE command.

1VV0301463 Rev. 1.0 Page 528 of 546 2018-01-24

Page 529: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

Table 497, page 529 lists the HTTP AT commands.

AT+DTLSOPEN<CID>,<Certificate Name>,<Client Certificate Name>,<Client Key Name>

Opens DTLS client connection.

AT+DTLSCLOSE <CID> Closes DTLS client connection.

AT+DTLSSTORE <CID>Stores the connection parameters of a DTLS client connected to aremote server with IPv4 address.

AT+DTLSRESTORE <CID>Restores the connection parameters previously stored throughAT+DTLSSTORE command.

AT+SSLCONF <enum>,<value>

Configures size of the SSL buffer and specify the number of DNS entries that can be copied into SSL certificate’s buffer.

AT+SSLCONF <enum>,<value> Configure SSL buffer

AT+SSLOPEN<cid>,[<certificate name>,<client certificate name>,<client key name>]

Opens an SSL connection.

AT+SSLCLOSE <CID> Closes an SSL connection.

Table 496 Data Transfer AT Supported Commands (Continued)

Command Parameters Response / Effect

Table 497 HTTP AT Supported Commands

Command Parameters Response / EffectAT+HTTPCONF <Param>,<Value> Configures an HTTP client

AT+HTTPCONFDEL <Param>The adapter removes the HTTP configuration specified by the param.

AT+HTTPOPEN

<host>,<Port Number>,[<SSL Flag>,<Certificate Name>,<Proxy>,<Connection Timeout>,<ClientCertificateName>,<ClientKeyName>]

Opens an HTTP client connection. This command opens an HTTP client on the adapter and connects the server specified by the host name or IP address.

AT+HTTPRECVCONF <cid>,<send status line>,<send HTTP response headers>

Configures for receiving HTTP response headers and response status line coming from HTTP server.

1VV0301463 Rev. 1.0 Page 529 of 546 2018-01-24

Page 530: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

Table 498, page 530 lists the CoAP AT commands.

AT+HTTPSEND

<cid>,<Type>,<Timeout>,<Page>,<Size of data>,[<Send response status line>,<Send response headers count>]

GET/POST HTTP data on the HTTP client connection.

AT+HTTPSTORE <CID>Stores the connection parameters of an HTTP client connected toa remote server with IPv4 address.

AT+HTTPRESTORE <CID>

Restores the connection parameters previously stored through AT+HTTPSTORE command.

AT+HTTPCLOSE <CID> Closes the HTTP client connection.

AT+NURIREDIR <URL> Redirects URL support.

AT+WEBSERVER

<0=Stop/1=Start>,<username>,<password>,[1=SSL enable/0=SSL disable],[idle timeout],[Response Timeout]

This command is used to start/stop the web server and register/de-register the default URI (/gainspan/profile/mcu).

AT+WEBSERVER ?Returns the current status of the webserver and the URIs registered.

Table 497 HTTP AT Supported Commands (Continued)

Command Parameters Response / Effect

Table 498 CoAP AT Supported Commands

Command Parameters Response / Effect

AT+CoAPOPTCONF <Param>,<Value> Configures the CoAP parameters and values

AT+CoAPOPTCONFDEL <Param> Removes CoAP client configuration

1VV0301463 Rev. 1.0 Page 530 of 546 2018-01-24

Page 531: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

Table 499, page 531 lists the AT commands.

AT+CoAPOPEN

<IP/host>,<Port Number>,[<DTLS Flag><certificate name>,<proxy>,<Connection Timeout>,<client certificate name>,<client key name>]

Opens a CoAP client and connects to the server specified by the host name or IP address when DTLS flag is set.

AT+CoAPSENDRECEIVE

<CID>,<coap-uri>,<connection method>,<connection type>,<response Timeout>,[<payload size>,<payload Type>,<payload>]

Opens a CoAP client and connects to the server specified by the host name and IP address.

AT+CoAPCLOSE <CID> Closes the CoAP client connection identified by the CID.

Table 498 CoAP AT Supported Commands (Continued)

Command Parameters Response / Effect

Table 499 AT Supported Commands

Command Parameters Response / Effect

AT+XMLPARSE n:Enable/Disable XML parsingThis command enables/disables xml parsing.

AT+XMLSEND

<CID>,<Type>,<Timeout>,<PageURI>,<Roottagname>[,<N>],<Send response status line>,<Send response headers count> <ESC>G<CID><len><tagname>:<value>

XML Data Send

AT+JSONPARSEn=0n=1

If 1, JSON parser is enabled

AT+JSONSEND<CID>,<Type>,<Timeout>,<URI>,<Root object>,<Number of objects in JSON>

Sends JSON elements one by one using <ESC>G sequence when GS node acts as HTTP server

AT+URIRECV

<URI>[,content Type,<Send CGI arguments>,<Send request line>,<Send HTTPD Headers>]

Modify the default adapter URI to the new one.

1VV0301463 Rev. 1.0 Page 531 of 546 2018-01-24

Page 532: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

Table 500, page 532 lists the Multicast AT commands.

Table 500 Multicast AT Supported Commands

Command Parameters Response / EffectAT+NIPMULTICASTJOIN <GroupIP> Joins the specified multicast group.AT+NIPMULTICASTLEAVE <GroupIP> Leaves the specified multicast group.

AT+MCSTSETn=0n=1

If 1, enables Multicast and Broadcast reception

1VV0301463 Rev. 1.0 Page 532 of 546 2018-01-24

Page 533: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

B.6 Advance ServicesTable 501, page 533 lists the Advance Services AT commands.

Table 501 Advance Services AT Supported Commands

Command Parameters Response / Effect

AT+PING<IP>,[[Counts],[<Interval>],[<Len>],[<TOS>],[<TTL>],[PAYLOAD>]]

Pings the IP address provided. Counts=0 will ping until <ESC>C is issued.

AT+MDNSSTART N/A Starts the mDNS module of the adapter.

AT+MDNSSTART ? Returns the current status of mDNS.

AT+MDNSV6START N/A Starts the mDNS module of the adapter.

AT+mDNSHNREG [<Hostname>],<Domain name>

Registers the host name for the mDNS.

AT+mDNSHNDEREG <host name>,<Domain name> De-registers the host name.

AT+MDNSSRVREG

<ServiceInstanceName>,[<ServiceSubType>],<ServiceType>,<Protocol>,<Domain,<port>,<Default Key=Val,<key 1=val 1>,<key 2=val 2>...

De-register sthe mDNC services.

AT+MDNSSRVDEREG<ServiceInstanceName>,[<ServiceSubType>],<ServiceType>,<Protocol>,<Domain>

De-registers the mDNS services.

AT+MDNSANNOUNCE None Announces the mDNS services.

AT+MDNSSD [<Service subtype>],<Service type>,<Protocol>,<Domain> Discovers the mDNC service.

AT+MDNSSTOP

AT+DNSLOOKUP <URL>,[<Retry count>,<Retry timeout>]

Queries DNS server for address of hostname URL.

AT+NARPCHACHEENEnable: 1 to start the cachingEnable: 0 to stop the caching

Caching of the ARP entries (max 8) in its non-volatile memory and available across standby wakeup cycle.

AT+NARPCHACHEDEL None Deletes the ARP entries from the adapter network stack.

AT+NARP ? Lists all ARP entries present.AT+NARPSET <Ip address>,<Mac address> Sets the static entry in the ARP table.

AT+NARPDELETE <Ip address>,<Mac address> Deletes the static entry in the ARP table.

1VV0301463 Rev. 1.0 Page 533 of 546 2018-01-24

Page 534: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

AT+NARPAUTO n Enables or disables updating ARP entries to network stack.

AT+GRATARP N/A Sends gratuitous ARP.

AT+ARPRESOLVE <IP><CR> Maps the IP address of the destination node.

Table 501 Advance Services AT Supported Commands (Continued)

Command Parameters Response / Effect

1VV0301463 Rev. 1.0 Page 534 of 546 2018-01-24

Page 535: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

Table 502, page 535 lists the Firmware Update AT commands.

Table 503, page 536 lists the HomeKit AT commands.

Table 502 Firmware Update AT Supported Commands

Command Parameters Response / Effect

AT+SOTAFWUPCONF <param>,<value>

• 0 - Server IP• 1 - Server Port• 2 - Proxy Preset (0|1)• 3 - Server IP if proxy preset=1• 4 - Server Port if proxy preset=1• 5 - SSL Enable (0|1)• 6 - CA Cert Name• 7 - GS2000 Binary Request URL• 9 - Server host name• 10 - GS2000 signature binary

request URL• 11 - Enables or disables domain

name check on incoming certificate from server.

• 12 - Client certificate name• 13 - Client key certificate

Note: In case of HTTP/S through Proxy, the request URL should be Absolute path and not the Relative path.

AT+SOTAFWUPSTART <value>

Using the header configured using AT++HTTPCONF command, it starts the HTTP connection, downloads the new images, and starts updating the firmware.The <value> indicates which of the 3 binaries need to be upgraded:• 3 - Only App0 and App1• 4 - Only WLAN• 7 - All three binaries

AT+SOTAFWUPROLLBACK N/A It is used to rollback to the previous firmware version.

AT+FWINFOGET N/A Gets the version numbers of available firmwares in flash.

AT+SOTHFWUPSTART <Image Type>,<Encoding format>,<Size>

Returns the standard command response to the serial host.

1VV0301463 Rev. 1.0 Page 535 of 546 2018-01-24

Page 536: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

Table 504, page 536 lists the Provisioning AT commands.

Table 503 HomeKit AT Supported Commands

Command Parameters Response / Effect

AT+HKSETUP

[<Accessory category>,<DiscoveryID>,<Configuration number>,<Model name>,<Setupcode>,<Event notification flag>]

it is used to initialize the HomeKit Services

AT+HKAAC [<Accessory ID>,<Number of services>] Adds and accessory.

AT+HKASC

[<Accessory ID>,<Service ID>,<ServiceType>,<Number of characteristics>]

Adds a service to an accessory

AT+HKACC

[<Acessory ID>,<Service ID>,<CharacteristicID>,<Characteristic Type>,<Flag>,<Format>,<Value>]

Adds characteristics to the service of an accessory

AT+HKDATA [<Format>,<Aid>,<ChracteristicsID>,<Status>,<Value>]

send data as a response to either a request or a notification

Table 504 Provisioning AT Supported Commands

Command Parameters Response / Effect

AT+WEBPROV

<user name>,<passwd>[,SSL Enabled,Param StoreOption,idletimeout,ncmautoconnect,dual interface, format version]

Through provisioning application (web pages, IOS and android).

AT+WEBPROV ?It gives the current status (started or stopped) of the web provisioning and display the URIs registered

AT+WEBPROVSTOP N/A Stops the web provisioning.

1VV0301463 Rev. 1.0 Page 536 of 546 2018-01-24

Page 537: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

Table 505, page 537 lists the Advance Services AT commands.

Table 505 Advance Services AT Supported Commands

Command Parameters Response / Effect

AT+WWPS

For Push Button (PBC) method:

<METHOD>[,PIN][,StoreL2ConInfo][,WPS Deauth Timeout]

For Pin method and Default Pin method:

<METHOD>[,PIN][,SSID][,StoreL2ConInfo] [,WPS Deauth Timeout]

Associate to an AP using WPS. Upon execution of this command, the GS node uses either push button or pin method as per the METHOD parameter to associate to the WPS enabled AP.Store L2connection stores the connection parameter into profile after successful WPS association.

AT+WWPS ? Current status of WPS registrar.

AT+WPSCONFn=0n=1

If 1, enables all the credentials from AP to print during WPS procedure

AT+WACSTART

n0,10: Stop1: Start

Starts or stops Apple’s Wireless Accessory Configuration (WAC).

1VV0301463 Rev. 1.0 Page 537 of 546 2018-01-24

Page 538: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

B.7 Power Management - Radio and SystemTable 506, page 538 lists the Power Management - Radio & Systems AT commands.

Table 506 Power Management - Radio & System AT Supported Commands

Command Parameters Response/ Effect

AT+WRXACTIVEn=0 (disable)n=1 (enable)

IF 1, 802.11 radio is enabled.

AT+WIEEEPSPOLL

<n>[,listen beacon interval][,WakeupType][,Wakeup Interval][,Beacon Wait timeout][,DataRxType][,ActiveToOffTimeout][,SwitchToActivePeriod]

n=0, to disablen=1 to enable

If it is enabled then the second parameter listen beacon interval is valid beacons intervals at which the WLAN wakes up for listening to the beacon. Although it’s a 16-bit value, the maximum recommended is 10-bit value.On execution of this command, the adapter will set the listen interval for n beacons.

For GS2000 based modules, the listen beacon interval is the listen interval that will be advertised in the association request. The valid values are:DTIM-0LISTEN INTERVAL-1CUSTOM-2Wake Up Interval -This is valid only if Wake Up type is Listen Interval and CUSTOM(2).

AT+WRXPSn=0 (disable)n=1 (enable)

IF 1, Power Save mode is enabled.

1VV0301463 Rev. 1.0 Page 538 of 546 2018-01-24

Page 539: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

Table 507, page 539 lists the Battery Check AT commands.

Table 508, page 539 lists the System Power Save AT commands.

Table 507 Battery Check AT Supported Commands

Command Parameters Response / Effect

AT+BCHKSTRT <Frequency>Start checking battery every <Frequency>(< 100) packets transmitted.

AT+BATTLVLSET <Warning Level>,<Warning Freq>,<Standby Level>

Set the battery warning/standby level to enable the adapters internal battery measuring logic.

AT+BCHK <Batt.chk.freq> Reset value of battery check frequency.

AT+BCHKSTOP N/A Stop checking battery.

AT+BATTVALGET N/A Retrieve the most recent battery check value.

Table 508 System Power Save AT Supported Commands

Command Parameters Response / Effect

AT+HIBERNATE <ALARM1 POL>[,<ALARM2 POL>]

Enables the GS nodes to enter hibernate mode.

AT+STORENWCONN NoneIt stores the network context and configuration parameters priorto a transition to standby

AT+RESTORENWCONN None

Reads the IP layer network connection parameters saved by Store Network Context and reestablishes the connectionthat existed before the transitionto standby.

AT+PSSTBY<x>[,<DELAY TIME>,<ALARM1POL.>,<ALARM2 POL>]

Requests transition to Standby for x milliseconds.

AT+PSSTBYBWBEACON 1Enables the GS node to transition the ultra low power standby modebetween beacons

AT+PSSTBYBWBEACONCONF <Conf ID>,<Value>

Configures GS node to support transitioning the ultra low powerstandby mode between beacons.

1VV0301463 Rev. 1.0 Page 539 of 546 2018-01-24

Page 540: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

Table 509, page 540 lists the Hardware Cryptography AT commands.

AT+PSDPSLEEP NoneEnables the GS node’s power-saving Deep Sleep processor mode

AT+PSDPSLEEP <timeout>,,<ALARM2 POL> Enable module Deep Sleep power saving mode.

AT+WAPPSCFG

<Power-Save Configuration>,<Reserved parameter>,<Receiver on-time after Tx><Power-Save Behavioral Control>

Enables module to enter the power saving mode when no actions are pending.

Table 508 System Power Save AT Supported Commands

Command Parameters Response / Effect

Table 509 Hardware Cryptography AT Supported Commands

Command Parameters Response / Effect

AT+CRYPTOENn• 1 - Enable• 0 - Disable

Enables or disables hardware cryptography block.

1VV0301463 Rev. 1.0 Page 540 of 546 2018-01-24

Page 541: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

B.8 PeripheralsTable 510, page 541 lists the I2C AT commands.

Table 511, page 541 lists the PWM AT commands.

Table 512, page 541 lists the GPIO AT commands.

Table 510 I2C AT Supported Commands

Command Parameters Response / Effect

AT+I2CCONF <conf id>,<value> This command configures the I2C device.

AT+I2CSTART <N/A This command starts the I2C device.

AT+I2CWRITE <No. of bytes>,<bytes> This command is used for Write operation.

AT+I2CREAD <No. of bytes> This command is used for Read operation.

AT+I2CSTOP N/A This command stops the I2C device.

Table 511 PWM AT Supported Commands

Command Parameters Response / Effect

AT+PWMSTART

<pwm_id>,<start_state>,<polarity>,<period>,<frequency>,<clock_sel>,<prescalar_value>,[<phase_delay01>,<phase_dealy12>]

This command starts the specified PWM.

AT+PWMSTOP <pwm_id> This command stops the PWM that was started.

AT+PWMCNTRL <pwm_id>,<duty_cycle>This command changes the duty cycle of the pulse generated by PWM.

Table 512 GPIO AT Supported Commands

Command Parameters Response / Effect

AT+DGPIO <GPIO-NO>,<SET/RESET0/1>

Sets or resets (high/low) a GPIO pin.

1VV0301463 Rev. 1.0 Page 541 of 546 2018-01-24

Page 542: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

Table 513, page 542 lists the EMU AT commands.

Table 513 EMU AT Supported Commands

Command Parameters Response / EffectAT+EMUVER ? Returns the EMU software version.

AT+EMUSUPMOD ? This command returns the supported module lists.

AT+EMUSTART N/A This command will start the EMU.AT+EMUSTOP N/A This command will stop the EMU.

AT+EMUSETCONF <Param>,<Value> This command configured the EMU parameters.

AT+EMUSETCONF <Channel>,<Enable\Disable>,[<GainValue>]

This command configures the channel to a given gain value.

AT+EMUGETCONF <Param>

This command returns a configuration value set for the EMU. Check adapter guide for Param details.

AT+EMUGETVALUES N/AThis command prints the last read raw ADC values of voltage and current.

AT+EMULOADCTRL <1/0>This command switches ON the load (1) or switches OFF the load (0).

AT+EMURESETENERGY N/A This command resets the energy.

AT+EMUGETSTATUS N/A This command gets the status of the EMU.

AT+EMULOADSTATUS N/A This command gets the load status of the EMU.

NOTE: Parameters in [ ] are optional. Values are expressed as ASCII text unless specified.

1VV0301463 Rev. 1.0 Page 542 of 546 2018-01-24

Page 543: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

B.9 Production and DebugTable 514, page 543 lists the RF Test AT commands.

Table 514 RF Test AT Supported Commands

Command Parameters Response / EffectAT+WRFTESTSTART N/A Start the RF Test mode.AT+WRFTESTSTOP N/A Stop the RF Test mode.

AT+WFRAMETXTEST

<Channel>,<bandWidth>,<numFrames>,<frameLen>,<txRate>,<txPower>,<destAddr>,<bssid>,<htEnable>,<guardInterval>,<greenField>,<preambleType>,<qosEnable>,<ackPolicy>,<scrambler>,<aifsnVal>,<antenna>

Enable the frame transmission with the given configurations.

AT+WRXTEST<Channel>,<bandWidth>,<rxFrameTypeFilter>,<rxaddrFilter>,<antenna>

Enables the frame reception.

AT+WRXSTOP N/A Stops the frame reception and displays the PER stats.

AT+WTX99TEST

<Channel>,<bandWidth>,<numFrames>,<frameLen>,<txRate>,<txPower>,<destAddr>,<bssid>,<guardInterval>,<greenField>,<antenna>,<cca>,<agc>,<contPreambleMode>,<spreader>,<scrambler>,<preamble>,<preambleType>,<phyTestTxtRate>,<modeSelect>

Starts TX99 mode with the given configurations.

AT+WTX100TEST

<Channel>,<bandWidth>,<txPower>,<antenna>,<cca>,<agc>,<contPreambleMode>,<spreader>,<scrambler>,<preamble>,<preambleType>,<testPatternType>,<phyTestTxRate>,<modeSelect>

Starts TX100 mode with the given configurations.

AT+WCARWAVTEST<Channel>,<bandWidth>,<txPower>,<antenna>,<customWavePeriod>

Starts Carrier Wave mode with the given configurations.

1VV0301463 Rev. 1.0 Page 543 of 546 2018-01-24

Page 544: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

Table 515, page 544 lists the Live Calibration AT commands.

Table 516, page 544 lists the Debug AT commands.

Table 515 Live Calibration AT Support Commands

Command Parameters Response / Effect

AT_WLCALEN <value> Enable or disable live calibration

AT+WLCALSTATUS ? Get the status of the live calibration

AT+WLCALERASE N/A Erases live calibration LUT in flash.

AT+WLCALSTART <value> Runs Live Calibration

Table 516 Debug AT Support Commands

Command Parameters Response / Effect

AT+LOGLVL <level>

Configures the debug level so that the response of a command will include more information (error reason) in case of an error.

ATEnn=0 (disable)n=1 (enable

IF 1, echo all input

ATVnn=0 (disable)n=1 (enable)

IF 1, responses are ASCII, else numerical codes

AT+WRSSI ? Current RSSI as ASCII

AT+WSTATUS NoneAdapter reports the current network configuration to the serial host

AT+NSTAT ? Current wireless and network configuration.

AT+WLANSTATS None

Requests the GS2000M to send the statistics that it maintains, including Rx, Tx, and encryption errors.

1VV0301463 Rev. 1.0 Page 544 of 546 2018-01-24

Page 545: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

B.10 Default Return MessagesTable 517, page 545 lists the Default Return Messages.

Table 517 Default Return Messages

Status Message (Verbose Enabled) Message (Verbose Disabled)Valid Input OK 0Invalid Input ERROR: Invalid Input 2

NOTE: Other commands can return different ERROR messages.

1VV0301463 Rev. 1.0 Page 545 of 546 2018-01-24

Page 546: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

B.11 Escape Sequence Commands

1VV0301463 Rev. 1.0 Page 546 of 546 2018-01-24

Page 547: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

Appendix C AT Commands (Alphabetical Order)

This appendix provides a list of supported AT commands in alphabetical oder.

Types of AT commands are:

• AT&X[n]

• ATX[n]=

• ATX[n]

• AT+XYZ[n]=

C.1 ATX[n]

1. AT

2. ATA

3. ATA2

4. ATC[N]

5. ATE[N]

6. ATI[N]

7. ATO

8. ATS[N]

9. ATV[N]

10. ATZ[N]

C.2 ATX[n]=11. ATB

1VV0301463 Rev. 1.0 Page 547 of 554 2018-01-24

Page 548: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

C.3 AT&X[n]

12. AT&F

13. AT&K[N]

14. AT&R[N]

15. AT&V

16. AT&W[N]

17. AT&Y[N]

C.4 AT+XYZ[n]=

18. AT+ADCCONF

19. AT+ADCREAD

20. AT+ADCSTART

21. AT+ADCSTOP

22. AT+AOTPRD

23. AT+APCLIENTINFO

24. AT+APCONF

25. AT+ASYNCMSGFMT

26. AT+AUTOCON

27. AT+BATTLVLSET

28. AT+BATTVALGET

29. AT+BCHK

30. AT+BCHKSTOP

31. AT+BCHKSTRT

32. AT+BDATA

33. AT+CERTINFOGET

34. AT+CID

35. AT+COAPCLOSE

36. AT+COAPOPEN

37. AT+COAPOPTCONF

1VV0301463 Rev. 1.0 Page 548 of 554 2018-01-24

Page 549: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

38. AT+COAPOPTCONFDEL

39. AT+COAPSENDRECEIVE

40. AT+CRYPTOEN

41. AT+DGPIO

42. AT+DHCPSRVR

43. AT+DHCPSRVRCFG

44. AT+DNS

45. AT+DNSLOOKUP

46. AT+DNSSET

47. AT+DROPDATAEN

48. AT+DTLSCLOSE

49. AT+DTLSOPEN

50. AT+ERRCOUNT

51. AT+EXTPA

52. AT+FACTORYRESTORE

53. AT+FWINFOGET

54. AT+GETTIME

55. AT+GRATARP

56. AT+HIBERNATE

57. AT+HKAAC

58. AT+HKACC

59. AT+HKASC

60. AT+HKDATA

61. AT+HKSETUP

62. AT+HTTPCLOSE

63. AT+HTTPCONF

64. AT+HTTPCONFDEL

65. AT+HTTPOPEN

66. AT+HTTPRECVCONF

67. AT+HTTPRESTORE

68. AT+HTTPSEND

69. AT+HTTPSTORE

1VV0301463 Rev. 1.0 Page 549 of 554 2018-01-24

Page 550: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

70. AT+I2CCONF

71. AT+I2CREAD

72. AT+I2CSTART

73. AT+I2CSTOP

74. AT+I2CWRITE

75. AT+JSONPARSE

76. AT+JSONSEND

77. AT+L2CONFIG

78. AT+LOGLVL

79. AT+MCSTSET

80. AT+MDNSANNOUNCE

81. AT+MDNSHNDEREG

82. AT+MDNSHNREG

83. AT+MDNSSD

84. AT+MDNSSRVDEREG

85. AT+MDNSSRVREG

86. AT+MDNSSTART

87. AT+MDNSSTOP

88. AT+MEMTRACE

89. AT+MEMWRITE

90. AT+NARP

91. AT+NARPAUTO

92. AT+NARPCHACHEDEL

93. AT+NARPCHACHEEN

94. AT+NARPDELETE

95. AT+NARPSET

96. AT+NAUTO

97. AT+NCLOSE

98. AT+NCLOSEALL

99. AT+NCMAUTO

100.AT+NCMAUTOCONF

101.AT+NCTCP

1VV0301463 Rev. 1.0 Page 550 of 554 2018-01-24

Page 551: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

102.AT+NCUDP

103.AT+NDHCP

104.AT+NIF

105.AT+NIFCMODE

106.AT+NIPMULTICASTJOIN

107.AT+NIPMULTICASTLEAVE

108.AT+NMAC

109.AT+NMAC

110.AT+NMAC2

111.AT+NSET

112.AT+NSTAT

113.AT+NSTCP

114.AT+NSUDP

115.AT+NTIMESYNC

116.AT+NURIREDIR

117.AT+NXSETSOCKOPT

118.AT+P2PFIND

119.AT+P2PGRPFORM

120.AT+P2PJOIN

121.AT+P2PPD

122.AT+P2PPROVOK

123.AT+P2PSETDEV

124.AT+P2PSETWPS

125.AT+P2PSTOPFIND

126.AT+PING

127.AT+PSDPSLEEP

128.AT+PSPOLLINTRL

129.AT+PSSTBY

130.AT+PSSTBYBWBEACON

131.AT+PSSTBYBWBEACONCONF

132.AT+PWMCNTRL

133.AT+PWMSTART

1VV0301463 Rev. 1.0 Page 551 of 554 2018-01-24

Page 552: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

134.AT+PWMSTOP

135.AT+RESET

136.AT+RESTORENWCONN

137.AT+RFSTOP

138.AT+RFWAVETXSTART

139.AT+SOTAFWUPCONF

140.AT+SOTAFWUPROLLBACK

141.AT+SOTAFWUPSTART

142.AT+SPICONF

143.AT+SRVVALIDATIONEN

144.AT+SSLCLOSE

145.AT+SSLCONF

146.AT+SSLOPEN

147.AT+STORENWCONN

148.AT+TCERTADD

149.AT+TCERTDEL

150.AT+TEMPVALGET

151.AT+TRACEROUTE

152.AT+UAMENC

153.AT+UNSOLICITEDRX

154.AT+UNSOLICITEDRXSTOP

155.AT+UNSOLICITEDTX

156.AT+URIRECV

157.AT+VER

158.AT+WA

159.AT+WACSTART

160.AT+WAPPSCFG

161.AT+WAPSM

162.AT+WAUTH

163.AT+WAUTO

164.AT+WBACKEN

165.AT+WCALIB

1VV0301463 Rev. 1.0 Page 552 of 554 2018-01-24

Page 553: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

166.AT+WCARWAVTEST

167.AT+WD

168.AT+WEAP

169.

170.AT+WEAPTIMECHK

171.AT+WEBPROV

172.AT+WEBPROVSTOP

173.AT+WEBSERVER

174.AT+WFRAMETXTEST

175.AT+WIEEEPSPOLL

176.AT+WKEEPALIVE

177.AT+WLANSTATS

178.AT+WLCALEN

179.AT+WLCALERASE

180.AT+WLCALSTATUS

181.AT+WM

182.AT+WOTPRD

183.AT+WP

184.AT+WPAPSK

185.AT+WPARAMSET

186.AT+WPHYMODE

187.AT+WPSK

188.AT+WRATE

189.AT+WREGDOMAIN

190.AT+WRETRY

191.AT+WRFTESTSTART

192.AT+WRFTESTSTOP

193.AT+WRSSI

194.AT+WRTS

195.AT+WRXACTIVE

196.AT+WRXPS

197.AT+WRXSTOP

1VV0301463 Rev. 1.0 Page 553 of 554 2018-01-24

Page 554: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview

GS2101M S2W Adapter Command Reference Guide

198.AT+WRXTEST

199.AT+WS

200.AT+WSEC

201.AT+WST

202.AT+WSTATUS

203.AT+WSYNCINTRL

204.AT+WTEMPREAD

205.AT+WTX100TEST

206.AT+WTX99TEST

207.AT+WWEP N

208.AT+WWEPCONF

209.AT+WWPA

210.AT+WWPS

211.AT+XMLPARSE

212.AT+XMLSEND

1VV0301463 Rev. 1.0 Page 554 of 554 2018-01-24

Page 555: GS2101M S2W Adapter Command Reference Guide S2W Adapter Command Reference Guide 1VV0301463 Rev. 1.0 Page 5 of 12 2018-01-24 Table of Contents Chapter 1 Getting Started 23 1.1 Overview