558
GS2101M S2W Adapter Command Reference Guide 1VV0301498 Rev. 2.0 – 2020-05-05

GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

  • Upload
    others

  • View
    10

  • Download
    0

Embed Size (px)

Citation preview

Page 1: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

1VV03014 98 Rev. 2.0 1 2020-05-05

GS2101MS2W Adapter Command

Reference Guide 1VV0301498 Rev. 2.0 – 2020-05-05

Page 2: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

1V

SPECIFICATIONS ARE SUBJECT TO CHANGE WITHOUT NOTICE

NOTICE

While 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 for inaccuraciesor omissions. Telit reserves the right to make changes to any products described herein andreserves the right to revise this document and to make changes from time to time in contenthereof with no obligation to notify any person of revisions or changes. Telit does not assumeany liability arising out of the application or use of any product, software, or circuit describedherein; 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.

COPYRIGHTS

This 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 COPYRIGHTS

The Telit and 3rd Party supplied Software (SW) products described in this instruction manualmay include copyrighted Telit and other 3rd Party supplied computer programs stored insemiconductor memories or other media. Laws in the Italy and other countries preserve forTelit and other 3rd Party supplied SW certain exclusive rights for copyrighted computerprograms, including the exclusive right to copy or reproduce in any form the copyrightedcomputer program. Accordingly, any copyrighted Telit or other 3rd Party supplied SWcomputer programs contained in the Telit products described in this instruction manual maynot be copied (reverse engineered) or reproduced in any manner without the express writtenpermission of Telit or the 3rd Party SW supplier. Furthermore, the purchase of Telit productsshall not be deemed to grant either directly or by implication, estoppel, or otherwise, anylicense under the copyrights, patents or patent applications of Telit or other 3rd Party suppliedSW, except for the normal non-exclusive, royalty free license to use that arises by operation oflaw in the sale of a product.

V03014 98 Rev. 2.0 2 2020-05-05

Page 3: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

1V

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 FROMANY THIRD PARTIES REGARDING ANY SEPARATE FILES, ANY THIRD PARTYMATERIALS INCLUDED IN THE SOFTWARE, ANY THIRD PARTY MATERIALS FROMWHICH THE SOFTWARE IS DERIVED (COLLECTIVELY “OTHER CODE”), AND THE USEOF ANY OR ALL THE OTHER CODE IN CONNECTION WITH THE SOFTWARE,INCLUDING (WITHOUT LIMITATION) ANY WARRANTIES OF SATISFACTORY QUALITYOR FITNESS FOR A PARTICULAR PURPOSE.NO THIRD PARTY LICENSORS OF OTHERCODE SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL,SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUTLIMITATION LOST PROFITS), HOWEVER CAUSED AND WHETHER MADE UNDERCONTRACT, TORT OR OTHER LEGAL THEORY, ARISING IN ANY WAY OUT OF THEUSE OR DISTRIBUTION OF THE OTHER CODE OR THE EXERCISE OF ANY RIGHTSGRANTED UNDER EITHER OR BOTH THIS LICENSE AND THE LEGAL TERMSAPPLICABLE TO ANY SEPARATE FILES, EVEN IF ADVISED OF THE POSSIBILITY OFSUCH DAMAGES.

V03014 98 Rev. 2.0 3 2020-05-05

Page 4: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

1V

APPLICABILITY TABLE

PRODUCT

GS2101M

Software Release

5.8.1

V03014 98 Rev. 2.0 4 2020-05-05

Page 5: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

Table of Contents

Chapter 1 Getting Started ................................................................................................................ 221.1 Overview ................................................................................................................................221.2 Using SDK Builder .................................................................................................................24

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

Chapter 2 Architecture ..................................................................................................................... 262.1 Overview ................................................................................................................................262.2 System Initialization ...............................................................................................................27

2.2.1 Network Configuration ..................................................................................................282.2.2 Profile Definition ...........................................................................................................33

2.3 Command Processing Mode .................................................................................................332.3.1 Auto Connection ...........................................................................................................342.3.2 Auto Connection Operation ..........................................................................................36

2.4 .Data Handling .......................................................................................................................372.4.1 Bulk Data Tx and Rx ....................................................................................................392.4.2 Unsolicited/Unassociated/Beacon Mode Data Handling ..............................................392.4.3 Software Flow Control ..................................................................................................402.4.4 Hardware Flow Control ................................................................................................40

2.5 Serial Data Handling ..............................................................................................................412.6 Connection Management ......................................................................................................41

2.6.1 Packet Reception .........................................................................................................412.6.2 Remote Close ..............................................................................................................422.6.3 TCP Server Connections .............................................................................................42

2.7 Wireless Network Management .............................................................................................432.7.1 Scanning ......................................................................................................................432.7.2 Association ...................................................................................................................432.7.3 SSID and Passphrase ..................................................................................................43

Chapter 3 Host Interaction ............................................................................................................... 453.1 Startup Handling ....................................................................................................................46

3.1.1 Single Interface Startup Handling ................................................................................463.1.2 Dual Interface Startup Handling ...................................................................................47

3.2 Interface .................................................................................................................................473.2.1 UART ...........................................................................................................................47

3.2.1.1 UART Parameters ...............................................................................................473.2.1.2 Software Flow Control .........................................................................................493.2.1.3 Hardware Flow Control ........................................................................................50

3.2.2 SPI Interface and Configuration ...................................................................................513.2.2.1 SPI Byte Stuffing (Legacy SPI, SPI-NO-DMA) ....................................................523.2.2.2 SPI Command Response (SPI-DMA) ..................................................................533.2.2.3 Annexure - HI Frame Format (From Host) ...........................................................643.2.2.4 Annexure - HI Frame Response (From GS Node) ..............................................653.2.2.5 Pin Connection for SPI Interface .........................................................................66

3.2.3 SDIO Interface .............................................................................................................673.2.3.1 Capabilities ..........................................................................................................673.2.3.2 SDIO Host Slave Initialization and Communication .............................................683.2.3.3 SDIO Host Recommendations ............................................................................713.2.3.4 Pin Description ....................................................................................................73

3.2.4 Interface Verification ....................................................................................................73

1VV03014 98 Rev. 2.0 5 2020-05-05

Page 6: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

Chapter 4 General Operations ........................................................................................................744.1 Version ..................................................................................................................................744.2 Time Setting ..........................................................................................................................76

4.2.1 Set System Time ..........................................................................................................764.2.1.1 Manual Setting .....................................................................................................764.2.1.2 Dynamic Setting ..................................................................................................77

4.2.2 Get System Time .........................................................................................................804.3 Profile Setting ........................................................................................................................81

4.3.1 Get Profile ....................................................................................................................814.3.2 Save Profile ..................................................................................................................834.3.3 Load Profile ..................................................................................................................844.3.4 Select Default Profile ....................................................................................................854.3.5 Restore Profile .............................................................................................................864.3.6 Define Profile ................................................................................................................864.3.7 Configure Profile ..........................................................................................................894.3.8 Identification Information ..............................................................................................914.3.9 Nagle Timer ..................................................................................................................924.3.10 Enhanced Asynchronous Notification ........................................................................93

4.4 Reset .....................................................................................................................................954.5 MAC .......................................................................................................................................96

4.5.1 Set MAC Address .........................................................................................................964.5.2 Get MAC Address ........................................................................................................98

Chapter 5 Wireless ......................................................................................................................... 995.1 Wireless Generic ...................................................................................................................99

5.1.1 Regulatory Domain ......................................................................................................995.1.1.1 Set Regulatory Domain .......................................................................................995.1.1.2 Get Regulatory Domain .....................................................................................100

5.1.2 Operation Mode .........................................................................................................1015.1.3 MAC Retry ...............................................................................................................1045.1.4 Sync Loss Interval ......................................................................................................1065.1.5 Set RTS Threshold .....................................................................................................1075.1.6 Transmit Data Rate ....................................................................................................108

5.1.6.1 Set Transmit Rate ..............................................................................................1085.1.6.2 Get Transmit Rate .............................................................................................110

5.1.7 Graceful Shutdown of WLAN .....................................................................................1115.1.8 SSID Hide ..................................................................................................................112

5.2 Beacon Mode (Unassociated Mode) ...................................................................................1135.2.1 Unassociated/Unsolicited Tx ......................................................................................1135.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 .............................................................................1225.2.4 Unassociated/Unsolicited Data Encryption ................................................................122

5.3 Station/AP Mode ..................................................................................................................1235.3.1 Scan Time Settings ....................................................................................................123

5.3.1.1 Set Scan Time ...................................................................................................1235.3.1.2 Get Scan Time ...................................................................................................125

5.3.2 Authentication Mode ..................................................................................................1265.3.3 Security Configuration ................................................................................................127

5.3.3.1 Security Setting .................................................................................................1275.3.3.2 WEP Keys .........................................................................................................1285.3.3.3 WEP Key Type Configuration ............................................................................1305.3.3.4 WPA-PSK and WPA2-PSK Passphrase ............................................................1325.3.3.5 WPA-PSK and WPA2-PSK Key Calculation ......................................................133

1VV03014 98 Rev. 2.0 6 2020-05-05

Page 7: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

5.3.3.6 WPA-PSK and WPA2-PSK Key ........................................................................1345.3.4 Scanning ....................................................................................................................1365.3.5 Association .................................................................................................................1385.3.6 Disassociation ............................................................................................................1425.3.7 Connection Maintenance ...........................................................................................142

5.3.7.1 Keep Alive Timer ...............................................................................................1425.3.7.2 WLAN Keep Alive Interval .................................................................................143

5.3.8 Advanced Commands ................................................................................................1455.3.8.1 Get Client Information ........................................................................................145

5.4 WiFi Direct Mode .................................................................................................................1465.4.1 Set Device ..................................................................................................................1465.4.2 Set WPS .....................................................................................................................1485.4.3 Start Find ....................................................................................................................1495.4.4 Stop Find ....................................................................................................................1515.4.5 Provoke ......................................................................................................................1525.4.6 Provision Discovery ....................................................................................................1535.4.7 Group Form (Group Owner Negotiation) ....................................................................155

5.4.7.1 Provision Discovery Request Handling ..............................................................1585.4.8 Client Join ..................................................................................................................1605.4.9 Invitation Procedures .................................................................................................1625.4.10 Disconnect ...............................................................................................................163

5.5 Concurrent Mode (STA Plus AP) ........................................................................................1645.5.1 Enable/Disable Concurrent Mode ..............................................................................1655.5.2 Set the Interface Number ...........................................................................................1665.5.3 Indicating Interface .....................................................................................................1685.5.4 Example Usage of Concurrent Mode .........................................................................169

Chapter 6 Network ......................................................................................................................... 1726.1 Network Interface Filter .......................................................................................................1726.2 Get Network Interface Filter Configuration ..........................................................................1756.3 DHCP Client ........................................................................................................................1756.4 IP Address ...........................................................................................................................1776.5 DHCP Server .......................................................................................................................1796.6 DHCP Server Configuration ................................................................................................1816.7 DNS Server .........................................................................................................................1826.8 DNS Address .......................................................................................................................1836.9 DNS Spoofing ......................................................................................................................184

Chapter 7 Data Transfer ................................................................................................................ 1857.1 Data Transfer Configuration ................................................................................................185

7.1.1 Data Transfer in Bulk Mode .......................................................................................1857.1.2 Data Drop ...................................................................................................................1867.1.3 Connection Status ......................................................................................................1877.1.4 Closing a Connection .................................................................................................1887.1.5 Closing All Connections .............................................................................................1897.1.6 Socket Options Configuration ....................................................................................189

7.2 Security Configuration .........................................................................................................1947.2.1 Certificate Addition .....................................................................................................1947.2.2 Certificate Deletion .....................................................................................................1987.2.3 Certificate Validation ..................................................................................................1997.2.4 Get Certificate Information .........................................................................................2007.2.5 EAP-Configuration .....................................................................................................2007.2.6 EAP Certificate Upload ..............................................................................................2047.2.7 EAP Time Validation ..................................................................................................205

1VV03014 98 Rev. 2.0 7 2020-05-05

Page 8: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

7.3 Network Connection Management (NCM) ...........................................................................2087.3.1 NCM Start/Stop ..........................................................................................................2087.3.2 Configure NCM ..........................................................................................................2117.3.3 NCM Status Get .........................................................................................................2147.3.4 Enable NCM AP Configuration ...................................................................................216

7.3.4.1 Examples for NCM Commands .........................................................................2177.3.5 Roaming .....................................................................................................................219

7.4 Auto Mode ...........................................................................................................................2217.4.1 Auto Mode (Common) ................................................................................................221

7.4.1.1 Enable Auto Connection ....................................................................................2217.4.1.2 Initiate Auto Connect .........................................................................................2227.4.1.3 Initiate Auto Connect – TCP/UDP Level ............................................................2237.4.1.4 Exit from Auto Connect Data Mode ...................................................................2237.4.1.5 Return to Auto Connect Mode ...........................................................................224

7.4.2 Legacy Auto Mode .....................................................................................................2247.4.2.1 Enable/Disable New Auto Mode ........................................................................224

7.4.3 Examples for Auto Connect Mode .............................................................................2267.4.4 Wireless Parameters ..................................................................................................2297.4.5 Network Parameters ..................................................................................................231

7.5 UDP/TCP .............................................................................................................................2347.5.1 Basic ..........................................................................................................................234

7.5.1.1 Create TCP Clients ............................................................................................2347.5.1.2 Create UDP Client .............................................................................................2377.5.1.3 Start TCP Server ...............................................................................................2387.5.1.4 Start UDP Server ...............................................................................................2427.5.1.5 Store TCP Client Configuration .........................................................................2437.5.1.6 Restore TCP Client Configuration .....................................................................244

7.5.2 Secured (DTLS/SSL) .................................................................................................2457.5.2.1 Open DTLS Client .............................................................................................2457.5.2.2 Close DTLS Client .............................................................................................2467.5.2.3 Store DTLS Client Configuration .......................................................................2477.5.2.4 Restore DTLS Client Configuration ...................................................................2487.5.2.5 Configure SSL ...................................................................................................2497.5.2.6 Open SSL ..........................................................................................................2547.5.2.7 Close SSL ..........................................................................................................255

7.5.3 Data Handling ............................................................................................................2577.5.3.1 Normal Data Handling .......................................................................................2577.5.3.2 Bulk Data Handling ............................................................................................265

7.6 HTTP ...................................................................................................................................2687.6.1 HTTP(S) Client ...........................................................................................................268

7.6.1.1 Configure HTTP Client ......................................................................................2687.6.1.2 Clear HTTP Client Configuration .......................................................................2717.6.1.3 Open HTTP Client Connection ..........................................................................2727.6.1.4 Configure Receive Response Headers/Status Line ..........................................2787.6.1.5 Exchange/Send Data with HTTP Client .............................................................2807.6.1.6 Store HTTP Client Configuration .......................................................................2827.6.1.7 Restore HTTP Client Configuration ...................................................................2837.6.1.8 Close HTTP Client .............................................................................................284

7.6.2 HTTP(S) Server .........................................................................................................2857.6.2.1 HTTP Server Redirection ..................................................................................2857.6.2.2 Start/Stop Web Server .......................................................................................2867.6.2.3 Web Server Status ............................................................................................2877.6.2.4 Send HTTP Request to AGPS Server ...............................................................288

7.7 MQTT Client ........................................................................................................................290

1VV03014 98 Rev. 2.0 8 2020-05-05

Page 9: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

7.7.1 MQTT Client Connect ................................................................................................2917.7.2 MQTT Client Publish ..................................................................................................2937.7.3 MQTT Client Subscribe ..............................................................................................2947.7.4 MQTT Client Disconnect ............................................................................................2957.7.5 Store MQTT Client .....................................................................................................2967.7.6 Restore MQTT Client .................................................................................................2977.7.7 MQTT Ping .................................................................................................................2987.7.8 Receive MQTT Data ..................................................................................................298

7.8 WebSocket Client ................................................................................................................3007.8.1 WebSocket Client Configuration ................................................................................3007.8.2 Store WebSocket Client Configuration .......................................................................3017.8.3 Restore WebSocket Client Configuration ...................................................................3027.8.4 Clear WebSocket Client Configuration .......................................................................3027.8.5 Open WebSocket Client Connection ..........................................................................3037.8.6 Send Data with WebSocket Client .............................................................................3057.8.7 Receive WebSocket Data ..........................................................................................3067.8.8 Close WebSocket Client ............................................................................................3077.8.9 WebSocket Ping .........................................................................................................3087.8.10 WebSocket Pong .....................................................................................................309

7.9 CoAP Client .........................................................................................................................3097.9.1 CoAP Client Option Configuration ..............................................................................3097.9.2 CoAP Client Option Configuration Removal ..............................................................3117.9.3 CoAP Client Connection Open ...................................................................................3127.9.4 CoAP Client Connection Send ...................................................................................3157.9.5 CoAP Client Connection Close ..................................................................................317

7.10 GSLink ..............................................................................................................................3187.10.1 GSLink with HTTP ...................................................................................................3187.10.2 Receive Request ......................................................................................................3197.10.3 Enable XML Parser ..................................................................................................3207.10.4 Send XML Data ........................................................................................................3207.10.5 Receive XML Data ...................................................................................................3237.10.6 Send Raw HTTP Data ..............................................................................................3247.10.7 Receive Raw HTTP Data .........................................................................................3267.10.8 Enable JSON Data ...................................................................................................3277.10.9 Send JSON Data ......................................................................................................3287.10.10 Receive JSON Data ...............................................................................................3307.10.11 URI Registration (Modification) ..............................................................................3317.10.12 Receive CGI Arguments ........................................................................................3337.10.13 Receive Request Line ............................................................................................3357.10.14 Receive HTTP Headers .........................................................................................336

7.11 Multicast ............................................................................................................................3377.11.1 IP Multicast Join .......................................................................................................3377.11.2 IP Multicast Leave ....................................................................................................3387.11.3 Enable Multicast Reception ......................................................................................339

Chapter 8 Advanced Service ......................................................................................................... 3428.1 Network ...............................................................................................................................342

8.1.1 Ping ............................................................................................................................3428.1.2 Service Discovery Using mDNS .................................................................................344

8.1.2.1 mDNS Module Initialization ...............................................................................3448.1.2.2 mDNS Status .....................................................................................................3458.1.2.3 mDNS Host Name Registration .........................................................................3458.1.2.4 mDNS Host Name De-registration .....................................................................3468.1.2.5 mDNS Services Registration .............................................................................347

1VV03014 98 Rev. 2.0 9 2020-05-05

Page 10: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

8.1.2.6 mDNS Services De-registration .........................................................................3508.1.2.7 mDNS Services Announce ................................................................................3518.1.2.8 mDNS Service Discover ....................................................................................3518.1.2.9 mDNS Module De-Initialization ..........................................................................3548.1.2.10 Example for mDNS Commands .......................................................................354

8.1.3 DNS Lookup (Client) ..................................................................................................3568.1.4 ARP ............................................................................................................................358

8.1.4.1 ARP Cache Enable ............................................................................................3588.1.4.2 ARP Cache Delete ............................................................................................3598.1.4.3 ARP Entry Listing ..............................................................................................3598.1.4.4 ARP Entry Set ...................................................................................................3608.1.4.5 ARP Entry Delete ..............................................................................................3618.1.4.6 ARP Learning ....................................................................................................3628.1.4.7 Gratuitous ARP ..................................................................................................3638.1.4.8 ARP Resolve .....................................................................................................363

8.1.5 NAT Functionality .......................................................................................................3658.1.5.1 Enable NAT .......................................................................................................3658.1.5.2 IP Packet Handling ............................................................................................366

8.2 Application Features ............................................................................................................3678.2.1 Firmware Update ........................................................................................................367

8.2.1.1 Over the Air Firmware Upgrade Using Module Flash ........................................3678.2.1.2 Over the Host Firmware Upgrade (OTHFU) ......................................................371

8.2.2 HomeKit .....................................................................................................................3758.2.2.1 Add Accessory ...................................................................................................3758.2.2.2 Delete Accessory ...............................................................................................3768.2.2.3 Add Service .......................................................................................................3778.2.2.4 Delete Service ...................................................................................................3788.2.2.5 Add Characteristic .............................................................................................3798.2.2.6 Delete Characteristic .........................................................................................3828.2.2.7 Set Software Token ...........................................................................................3838.2.2.8 Get Manufacturing Information ..........................................................................3848.2.2.9 HomeKit as Link Service ...................................................................................3858.2.2.10 Initialize HomeKit .............................................................................................3868.2.2.11 Send Data as Response ..................................................................................3918.2.2.12 Erase HomeKit Configuration ..........................................................................3928.2.2.13 Update HomeKit Configuration ........................................................................393

8.2.3 Provisioning ................................................................................................................3948.2.3.1 Web Provisioning ...............................................................................................3958.2.3.2 Group Provisioning ............................................................................................4038.2.3.3 Verified Provisioning ..........................................................................................4058.2.3.4 WPS ..................................................................................................................4078.2.3.5 WAC - Apple Wireless Authentication ...............................................................412

8.2.4 TR50 Support .............................................................................................................4148.2.4.1 deviceWISE Configuration .................................................................................4148.2.4.2 deviceWISE Connection ....................................................................................4178.2.4.3 deviceWISE Connection Status .........................................................................4208.2.4.4 Send deviceWISE Data .....................................................................................4228.2.4.5 deviceWISE Enable ...........................................................................................4268.2.4.6 Send Raw deviceWISE Data .............................................................................4298.2.4.7 deviceWISE Ring ...............................................................................................4308.2.4.8 Receive deviceWISE Data ................................................................................4308.2.4.9 Receive Raw deviceWISE Data ........................................................................4338.2.4.10 List of Information on message Pending from deviceWISE server ..................435

1VV03014 98 Rev. 2.0 10 2020-05-05

Page 11: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

Chapter 9 Power Management - Radio and System ..................................................................... 4369.1 Radio Receiver Setting ........................................................................................................436

9.1.1 Active Radio Receive .................................................................................................4369.1.2 Standard Power Save Radio Receive based on DTIM/Listen Interval .......................438

9.1.2.1 IEEE PS Poll Listen Interval ..............................................................................4389.1.3 Custom Power Save Radio Receive ..........................................................................441

9.2 Battery Measurement ..........................................................................................................4429.2.1 Battery Check Start ....................................................................................................4429.2.2 Battery Warning/Standby Level Set ...........................................................................4439.2.3 Battery Check Set ......................................................................................................4449.2.4 Battery Check Stop ....................................................................................................4459.2.5 Battery Value Get .......................................................................................................445

9.3 System Power Save ............................................................................................................4469.3.1 Hibernate ....................................................................................................................4469.3.2 Standby ......................................................................................................................447

9.3.2.1 Storing or Restoring System Information for Standby .......................................4479.3.2.2 Putting the System in Standby ..........................................................................4509.3.2.3 Enabling Standby Mode Between Beacons ......................................................4529.3.2.4 Configuring Standby Between Beacons ............................................................453

9.3.3 Deep Sleep ................................................................................................................4569.3.4 Power Save in Limited AP ..........................................................................................4589.3.5 Hardware Cryptography .............................................................................................459

Chapter 10 Peripherals .................................................................................................................. 46110.1 I2C Commands ..................................................................................................................461

10.1.1 I2C Configuration .....................................................................................................46110.1.2 I2C Start ...................................................................................................................46310.1.3 I2C Write ..................................................................................................................46310.1.4 I2C Read ..................................................................................................................46410.1.5 I2C Stop ...................................................................................................................464

10.2 PWM Commands ..............................................................................................................46510.2.1 PWM Start ................................................................................................................46510.2.2 PWM Stop ................................................................................................................46810.2.3 PWM Control ............................................................................................................468

10.3 GPIO Commands ..............................................................................................................46910.3.1 GPIO Out HIGH/LOW ..............................................................................................469

10.4 EMU Commands ...............................................................................................................47010.4.1 EMU Get Version .....................................................................................................47010.4.2 EMU Get Supported Module List .............................................................................47010.4.3 EMU Start .................................................................................................................47110.4.4 EMU Stop .................................................................................................................47110.4.5 EMU Mode/Channel Configuration ..........................................................................472

10.4.5.1 Mode Configuration .........................................................................................47210.4.5.2 Channel Configuration .....................................................................................473

10.4.6 EMU Get Configuration ............................................................................................47410.4.7 EMU Get Values ......................................................................................................47510.4.8 EMU Load Control ....................................................................................................47510.4.9 EMU Reset Energy ..................................................................................................47610.4.10 EMU Get Status .....................................................................................................47610.4.11 EMU Get Load Status ............................................................................................477

Chapter 11 Production and Debug ................................................................................................ 47811.1 RF Test ..............................................................................................................................478

11.1.1 Regulatory and Transmit Tests using RF Test Commands .....................................478

1VV03014 98 Rev. 2.0 11 2020-05-05

Page 12: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

11.1.1.1 Regulatory Testing ..........................................................................................47811.1.1.2 Transmit Testing ..............................................................................................47811.1.1.3 Gain Control Table ..........................................................................................47911.1.1.4 Start RF Test ...................................................................................................47911.1.1.5 Stop RF Test ...................................................................................................47911.1.1.6 Asynchronous Frame Transmission ................................................................47911.1.1.7 Start Asynchronous Frame Reception .............................................................48111.1.1.8 Stop Asynchronous Frame Reception .............................................................48411.1.1.9 Asynchronous Frame Transmission (TX99 mode) ..........................................48511.1.1.10 Asynchronous Frame Transmission (TX100 mode) ......................................49011.1.1.11 Carrier Wave Transmission ...........................................................................492

11.2 Live Calibration ..................................................................................................................49311.2.1 Enable Live Calibration ............................................................................................49311.2.2 Erase Live Calibration ..............................................................................................49511.2.3 Start Live Calibration ................................................................................................49611.2.4 For Complete Sequence of Live Calibration ............................................................498

11.3 Debug ................................................................................................................................49811.3.1 Log Level ..................................................................................................................49811.3.2 Echo .........................................................................................................................49911.3.3 Verbose ....................................................................................................................50011.3.4 RSSI .........................................................................................................................50111.3.5 WLAN Status ............................................................................................................50111.3.6 Network Status .........................................................................................................50211.3.7 WLAN Statistics .......................................................................................................504

Appendix A Response Codes ........................................................................................................ 508A.1 Synchronous Messages ......................................................................................................508A.2 Asynchronous & Enhanced Asynchronous Messages ........................................................509

A.3.1 Exception Messages ..................................................................................................512A.3.2 Boot Messages ..........................................................................................................513

Appendix B AT Commands Summary ........................................................................................... 515B.1 Host Interaction ...................................................................................................................515B.2 General Operations .............................................................................................................516B.3 Wireless ..............................................................................................................................518B.4 Network ...............................................................................................................................527B.5 Data Transfer ......................................................................................................................528B.6 Advance Services ...............................................................................................................535B.7 Power Management - Radio and System ...........................................................................540B.8 Peripherals ..........................................................................................................................543B.9 Production and Debug ........................................................................................................545B.10 Default Return Messages ..................................................................................................547B.11 Escape Sequence Commands ..........................................................................................548

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

1VV03014 98 Rev. 2.0 12 2020-05-05

Page 13: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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 19

• Returning Products to Telit, page 20

• Accessing the Telit Wi-Fi Portal, page 20

Revision History

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

Audience

This 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 Remarks

1.0 February 2020 Initial Release

2.0 May 2020Corrected AT Command Syntax for AT+SOTHFWUPSTART AT Command

Updated AT+TCERTADD AT Command for certEncrypt parameter.

1VV0301498 Rev. 2.0 13 2020-05-05

Page 14: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

Standards

The standards that are supported by the Telit GS module series are:

– IEEE 802.11 b/g/n

Documentation Conventions

This 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 syntax

monospaced font

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

AT XXXX

Proportional font

description

Gives specific details about a parameter.

<Data> DATA

UPPERCASE

Variable parameter

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

lowercase

Keyword 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 markUsed 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

1VV0301498 Rev. 2.0 14 2020-05-05

Page 15: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

<CR>

Carriage returnEach command is terminated by a carriage return.

<LF>

Line feedEach command is terminated by a line feed.

<CR> <LF>

Carriage return

Line 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.D

IP address

IPv4-style address.

10.0.11.123

LINE

End-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

WORD

Single token

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

singlewordnospaces

Table 2 Document Text Conventions (Continued)

Convention Type Description

1VV0301498 Rev. 2.0 15 2020-05-05

Page 16: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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.

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

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

WarningWarns 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.

1VV0301498 Rev. 2.0 16 2020-05-05

Page 17: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

Documentation

The Telit 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 Telit Wi-Fi Portal. Refer to Accessing the Telit Wi-Fi Portal, page 20 for details.

Table 4 Documentation List

1VV0301416GS2101M Evaluation Board Quick Start Guide

Provides an easy to follow guide on how to unpack and setup GainSpan GS2000 based module kit for the GS2000 based modules.

1VV0301437 GS2K Module Programming User Guide

Provides users steps to program the on-board Flash on the GainSpan GS2000 based modules using DOS or Graphical User Interface utility provided by GainSpan. The user guide uses the evaluation boards as a reference example board.

1VV0301435GS2K Module Evaluation Board Hardware User Guide

Provides instructions on how to setup and use the GS2000 based module evaluation board along with component description, jumper settings, board specifications, and pinouts.

1VV0301395GS2101M Low Power Wi-Fi Module Hardware User Guide

Provides information to help WiFi system designers to build systems using GainSpan GS2101M module and develop wireless applications.

1VV0301438 GS2K SDK Builder User Guide

Allows OEMs and system developers to configure and generate custom firmware binary images for GainSpan low power embedded GS2000 based WiFi modules. The SDK Builder supports the GainSpan GEPS software released, including the corresponding WLAN firmware.

1VV0301409 GS2K SDK Quick Start Guide

Provides an easy to follow guide that will walk you through easy steps to setup, evaluation, develop, and debug the full capabilities and features of the embedded platform software.

1VV0301444 GS2K S2W Use Case Reference Guide

Provides references for using GainSpan

AT commands and its usage in different

scenarios using different features and

protocols.

1VV0301498 Rev. 2.0 17 2020-05-05

Page 18: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

Documentation Feedback

We 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 email, 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)

References

The references listed in Table 5, page 18 are available on the Telit Wi-Fi Portal. Refer to Accessing the Telit Wi-Fi Portal, page 20 for details.

Table 5 Other Documents and References

Title Description

SchematicsGS Based Module Evaluation Board schematics supporting:

GS2101M

Module Firmware and Programming Utilities

• Serial-to-WiFi (S2W) based firmware

• Firmware Release Notes

• GSFlashprogram utility for programming the modules

Software Utilities

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

– gs2k_flashprogram.exe

1VV0301498 Rev. 2.0 18 2020-05-05

Page 19: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

Contact Information, Support

For 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 https://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 Telit Wi-Fi portal https://wifi.telit.com/secure/login

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:

https://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.

1VV0301498 Rev. 2.0 19 2020-05-05

Page 20: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

Returning Products to Telit

If a problem cannot be resolved by Telit 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 email 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 Shipment

To 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 Telit Wi-Fi Portal

To find the latest version of Telit documentation supporting the Telit Wi-Fi product release you are interested in, you can search the Telit Wi-Fi Portal website by performing the following steps:

NOTE: Do not return any components to Telit unless you have first obtained an RMA number. Telit 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.

1VV0301498 Rev. 2.0 20 2020-05-05

Page 21: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

1. Visit https://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 Telit Wi-Fi portal https://wifi.telit.com/secure/login

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 Telit Wi-Fi 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 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 Non-Disclosure Agreement (NDA).

10. Click the Certifications tab to view GS certifications.

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

1VV0301498 Rev. 2.0 21 2020-05-05

Page 22: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

Chapter 1 Getting Started

This chapter describes how to get started.

• Overview, page 22

• Using SDK Builder, page 24

1.1 Overview

The 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)

1VV0301498 Rev. 2.0 22 2020-05-05

Page 23: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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 47, SPI Interface and Configuration, page 51 and SDIO Interface, page 67 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.

1VV0301498 Rev. 2.0 23 2020-05-05

Page 24: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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.

1VV0301498 Rev. 2.0 24 2020-05-05

Page 25: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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.

1VV0301498 Rev. 2.0 25 2020-05-05

Page 26: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

Chapter 2 Architecture

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

• Overview, page 26

• System Initialization, page 27

• Command Processing Mode, page 33

• .Data Handling, page 37

• Serial Data Handling, page 41

• Connection Management, page 41

• Wireless Network Management, page 43

2.1 Overview

Figure 2, page 26 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 27

• Command Processing Mode, page 33

1VV0301498 Rev. 2.0 26 2020-05-05

Page 27: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

• .Data Handling, page 37

• Serial Data Handling, page 41

• Connection Management, page 41

• Wireless Network Management, page 43

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 28). 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 222) and terminated using a special escape sequence (see 2.4 .Data Handling, page 37).

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 85).

2.2 System Initialization

Upon startup, the Serial-to-WiFi (S2W) interface performs the following actions as displayed in Figure 3, page 28

– 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.

1VV0301498 Rev. 2.0 27 2020-05-05

Page 28: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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 229). 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 47) 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 83) and AT&Y (see 4.3.4 Select Default Profile, page 85).

2.2.1 Network Configuration

Once 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

1VV0301498 Rev. 2.0 28 2020-05-05

Page 29: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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 446), 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 29) is created with the serial command AT+NCTCP (see 7.5.1.1 Create TCP Clients, page 234). 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 37) 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 30 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.

1VV0301498 Rev. 2.0 29 2020-05-05

Page 30: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

Figure 5 Creation and Use of a TCP Server

1VV0301498 Rev. 2.0 30 2020-05-05

Page 31: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

A UDP client’s life is depicted in Figure 6, page 31. 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

1VV0301498 Rev. 2.0 31 2020-05-05

Page 32: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

Figure 7, page 32 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).

1VV0301498 Rev. 2.0 32 2020-05-05

Page 33: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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 Mode

In 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.

1VV0301498 Rev. 2.0 33 2020-05-05

Page 34: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

2.3.1 Auto Connection

If 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 89).

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 89). 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 34).

Figure 8 TCP Client Operation in Auto Connect Mode

1VV0301498 Rev. 2.0 34 2020-05-05

Page 35: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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 35).

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 35).

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 36).

1VV0301498 Rev. 2.0 35 2020-05-05

Page 36: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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 36.

2.3.2 Auto Connection Operation

The 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.

1VV0301498 Rev. 2.0 36 2020-05-05

Page 37: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

In auto connection mode, the Nagle Algorithm Wait Time (see 4.3.7 Configure Profile, page 89) 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 89.

In Enhanced Auto Connection, NCM runs in the background so that if there isdisconnection on L2/L3/L4, the NCM re-establishes the connection without any messageto the host.Here, the host checks whether the GPIO9 is high to send data via the data pipe created byauto connection.When L2, L3, or L4 disconnects, GPIO9 goes low and the host stops sending data via thedata 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 Handling

In 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 38. 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 548 for a complete description of all the Escape <ESC> sequences used for data handling (see Table 6, page 39).

1VV0301498 Rev. 2.0 37 2020-05-05

Page 38: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

Figure 12 Data Processing Flow

1VV0301498 Rev. 2.0 38 2020-05-05

Page 39: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

2.4.1 Bulk Data Tx and Rx

In 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 265

2.4.2 Unsolicited/Unassociated/Beacon Mode Data Handling

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. For more details, see 5.2.1 Unassociated/Unsolicited Tx, page 113)

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.

1VV0301498 Rev. 2.0 39 2020-05-05

Page 40: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

2.4.3 Software Flow Control

The 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 51)

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 Control

The 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.

1VV0301498 Rev. 2.0 40 2020-05-05

Page 41: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

2.5 Serial Data Handling

The 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 Management

The 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 Reception

When 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 37. 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.

1VV0301498 Rev. 2.0 41 2020-05-05

Page 42: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

2.6.2 Remote Close

If 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 Connections

Upon 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 37 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 500), the word CONNECT in the unsolicited response is replaced by the number 7.

1VV0301498 Rev. 2.0 42 2020-05-05

Page 43: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

2.7 Wireless Network Management

2.7.1 Scanning

The 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 Association

The 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 136

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

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

– 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 175

2.7.3 SSID and Passphrase

The following rules apply:

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

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 Characters

Numerical 0-9

Alphabets a-z and A-Z

Special Characters 1SP ! # $ % & ' ( ) * + , ‐ . / : ; < = > ? @ [ \ ] ^ _ ` { | } ~ ”

1VV0301498 Rev. 2.0 43 2020-05-05

Page 44: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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 44).

Table 8 Expected and Input SSID

Expected SSID Input SSID Remarks

TEST 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)

1VV0301498 Rev. 2.0 44 2020-05-05

Page 45: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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 45).

Table 9 Serial-to-WiFi Dual Interface Combinations

Command Interface Data Interface

UART0 UART1

UART0 SPI

UART0 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.

1VV0301498 Rev. 2.0 45 2020-05-05

Page 46: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

3.1 Startup Handling

3.1.1 Single Interface Startup Handling

For 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 52 and SPI Command Response (SPI-DMA), page 53.

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 70.

1VV0301498 Rev. 2.0 46 2020-05-05

Page 47: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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 Handling

For 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 Interface

The 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 Parameters

This 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 83). The profile used

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.

1VV0301498 Rev. 2.0 47 2020-05-05

Page 48: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

in that command must also be set as the power-on profile using AT&Y (see 4.3.4 Select Default Profile, page 85.

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

Usage

Parameter Description

Table 10, page 48 describes the UART interface parameters.

Synchronous Response

Table 11, page 48 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 parity

o - odd parity

stopbits Optional 1 (default) 1 or 2 stop bits

Table 11 UART Parameters Responses

Responses Remarks

OK Success

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

1VV0301498 Rev. 2.0 48 2020-05-05

Page 49: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

3.2.1.2 Software Flow Control

This command is used to enable or disable software flow control for the UART interface.

Command Syntax AT&Kn

Parameter Description

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

Synchronous Response

Table 13, page 49 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 Remarks

OK Success

ERROR:INVALID INPUTIf parameter is not valid.

(other than 0 or 1)

1VV0301498 Rev. 2.0 49 2020-05-05

Page 50: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

3.2.1.3 Hardware Flow Control

This command is used to enable or disable hardware flow control for the UART interface.

Command Syntax AT&Rn

Parameter Description

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

Synchronous Response

Table 15, page 50 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 Remarks

OK Success

ERROR:INVALID INPUTIf parameter is not valid.

(other than 0 or 1)

1VV0301498 Rev. 2.0 50 2020-05-05

Page 51: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

3.2.2 SPI Interface and Configuration

For 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 83). 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 85).

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

Parameter Description

Table 16, page 51 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.

1VV0301498 Rev. 2.0 51 2020-05-05

Page 52: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

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

Synchronous Response

Table 18, page 52 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 52.

Table 17 SPI Modes, Clock Polarity, and Clock Phase

SPI Mode Clock Polarity Clock Phase

0 0 0

1 0 1

2 1 0

3 1 1

Table 18 SPI Interface Configuration Synchronous Responses

Responses Remarks

OK Success

ERROR:INVALID INPUT If parameters are invalid.

Table 19 SPI Transmit Data Handling Link Pattern

Pattern Encoded as Description

0xFD 0xFB 0xDD Flow control XON

0xFA 0xFB 0xDA Flow control XOFF

0x00 0xFB 0x20 Inactive link detection

1VV0301498 Rev. 2.0 52 2020-05-05

Page 53: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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 ESCAPE

0xF5 0xFB 0xD5 IDLE character

0xFF 0xFB 0xDF Inactive link detection

0xF3 0xFB 0xD3 SPI link ready indication

Table 19 SPI Transmit Data Handling Link Pattern

Pattern Encoded as Description

1VV0301498 Rev. 2.0 53 2020-05-05

Page 54: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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 64 and 3.2.2.4 Annexure - HI Frame Response (From GS Node), page 65.

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

1VV0301498 Rev. 2.0 54 2020-05-05

Page 55: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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.

1VV0301498 Rev. 2.0 55 2020-05-05

Page 56: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

Figure 13, page 56 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.

1VV0301498 Rev. 2.0 56 2020-05-05

Page 57: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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 57 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

1VV0301498 Rev. 2.0 57 2020-05-05

Page 58: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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.

1VV0301498 Rev. 2.0 58 2020-05-05

Page 59: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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.

1VV0301498 Rev. 2.0 59 2020-05-05

Page 60: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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.

1VV0301498 Rev. 2.0 60 2020-05-05

Page 61: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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.

1VV0301498 Rev. 2.0 61 2020-05-05

Page 62: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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 62 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.

GPIO goes low after 16bytes , when MCU is sending data <= 1024bytes

GPIO LOW after PING Interrupt

WRITE_REQUEST from HOST DATA

HOST CLOCK

CMD PHASE RESPONSE PHASE DATA PHASE

WRITE_RESPONSE

DATA_HEADER

1 3 4 5 6 82 70 1 3 4 5 6 82 70 9 10 11 12 13 14 15 16

1VV0301498 Rev. 2.0 62 2020-05-05

Page 63: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

Figure 16, page 63 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 63 shows the timing diagram for MCU Read (<=1024 Bytes) to GS node.

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

1 3 4 5 6 82 70 1 3 4 5 6 82 70 9 10 11 12 13 14 15 16

WRITE_REQUEST from HOST DATA

HOST CLOCK

CMD PHASE RESPONSE PHASE DATA PHASE

WRITE_RESPONSE

DATA_HEADER

GPIO goes LOW after 16+X bytes , when MCU sending more than 1024bytes to GS (Where X= actual data size – 1024 Byte).

GPIO37 goes HIGH when GS is ready with WRITE_RESPONSE

READ_REQUEST from HOST DATA

CMD PHASE RESPONSE PHASE DATA PHASE

READ_RESPONSE

DATA_HEADER

GPIO37 goes LOW after receiving 4bytes of READ_REQUEST.

GPIO37 goes HIGH when GS is ready with READ_RESPONSE

GPIO goes low after 16bytes , when MCU is receiving data <= 1024bytes

GPIO LOW after PING Interrupt

1VV0301498 Rev. 2.0 63 2020-05-05

Page 64: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

Figure 18, page 64 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 64.

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)

1 3 4 5 6 82 70

READ_REQUEST from HOST DATA

CMD PHASE RESPONSE PHASE DATA PHASE

READ_RESPONSE

DATA_HEADER

GPIO37 goes HIGH when GS is ready with READ_RESPONSE

GPIO37 goes LOW after receiving 4bytes of READ_REQUEST.

GPIO goes LOW after 16+X bytes , when GS is sending more than 1024bytes to MCU (Where X= actual data size – 1024 Byte).

1VV0301498 Rev. 2.0 64 2020-05-05

Page 65: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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 65).

3.2.2.4 Annexure - HI Frame Response (From GS Node)

Figure 20, page 65 shows the HI Frame Response from GS node.

Figure 20 HI Frame Response (from GS Node)

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

Table 20 HI Parameters Service Class Identifiers

Identifiers Description

Start of frame 0xA5

Class

0x01 - WRITE_REQUEST from MCU side

0x02 - READ_REQUEST from MCU side

0x03 - DATA from MCU side

Reserved 0x00

Additional Info 0x00,0x00

Length 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).

1VV0301498 Rev. 2.0 65 2020-05-05

Page 66: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

3.2.2.5 Pin Connection for SPI Interface

Table 22, page 66 describes the pin connection for the SPI interface.

Table 21 HI Frame Response (from GS Node)

Identifier Description

Start of frame 0xA5

Class

0x11 - WRITE_RESPONSE_OK to MCU side

0x12 - READ_RESPONSE_OK to MCU side

0x13 - WRITE_RESPONSE_NOK to MCU side

0x14 - READ_RESPONSE_NOK to MCU side

0x15 - DATA to MCU side

Reserved 0x00

Additional Info0x00,0x00

0x00, 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 Remarks

MSPI_DOUT SSPI_DIN N/A

MSPI_DIN SSPI_DOUT N/A

MSPI_SS SSPI_SS N/A

MSPI_CLK SSPI_CLK N/A

GPIO GPIO37 Host wake-up signal or Ready to Send.

Ground Ground Ground

1VV0301498 Rev. 2.0 66 2020-05-05

Page 67: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

3.2.3 SDIO Interface

GS 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 Capabilities

1. 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.

1VV0301498 Rev. 2.0 67 2020-05-05

Page 68: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

3.2.3.2 SDIO Host Slave Initialization and Communication

This 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.

1VV0301498 Rev. 2.0 68 2020-05-05

Page 69: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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 0x01SD Specification Revision

0x02 0x02

3 0x02 I/O Enable 0x00 0x02

4 0x03 I/O Ready 0x00 0x02

5 0x04 Int Enable 0x00 0x03

6 0x05 Int Pending 0x00 0x02

7 0x06 I/O Abort 0x00 0x00

8 0x07 Bus Interface Control 0x02 0x02

9 0x08 Card Capability 0x1f 0x1f

10 0c09 Common CIS Pointer 0x00 0x00

11 0x0a Common CIS Pointer 0x10 0x10

12 0x0b Common CIS Pointer 0x00 0x00

13 0x0c Bus Suspend 0x00 0x00

14 0x0d Function Select 0x00 0x00

15 0x0e Exec Flags 0x00 0x00

16 0x0f Ready Flags 0x00 0x00

17 0x10 FN0 Block Size 0x00 0x00

18 0x11 FN0 Block Size 0x00 0x00

19 0x12 Power Control 0x01 0x01

20 0x13 High Speed 0x03 0x03

1VV0301498 Rev. 2.0 69 2020-05-05

Page 70: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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

1VV0301498 Rev. 2.0 70 2020-05-05

Page 71: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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 Recommendations

Following 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.

1VV0301498 Rev. 2.0 71 2020-05-05

Page 72: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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.

1VV0301498 Rev. 2.0 72 2020-05-05

Page 73: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

3.2.3.4 Pin Description

The following are the pin descriptions in GS module:

3.2.4 Interface Verification

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

Command Syntax AT

Synchronous Response

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

Table 24 Pin Descriptions

Pin DIR Description

GPIO_35/SDIO_CLK/SPI0_CLK IN SDIO Clock/ SPI0 Clock

GPIO_34/SDIO_CMD/SPI0_DIN IN SD4 bit mode, command line

SD1 bit mode, command line

SPI mode, Data input

GPIO_37/SDIO_DAT1_INT IN/OUTSD4 bit mode, Data line 1/Interrupt

SD1 bit mode, Interrupt

SPI mode, Interrupt

GPIO_32/SDIO_DAT2 IN/OUT SD4 bit mode, Data line 2

SD1 bit mode, not used

SPI mode, Data input

GPIO_33/SDIO_DAT3/SPI0_CS_n_0 IN/OUT SD4 bit mode, Data line 3

SD1 bit mode, not used

SPI mode, Chip Select

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

SD1 bit mode, Data line

SPI mode, Data Output

Table 25 Interface Verification Synchronous Responses

Responses Remarks

OK Success

No responseFailure

Interface not operating correctly.

1VV0301498 Rev. 2.0 73 2020-05-05

Page 74: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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 74

• Time Setting, page 76

• Profile Setting, page 81

• Reset, page 95

• MAC, page 96

4.1 Version

This 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=??

Response

This 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

1VV0301498 Rev. 2.0 74 2020-05-05

Page 75: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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

1VV0301498 Rev. 2.0 75 2020-05-05

Page 76: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

4.2 Time Setting

4.2.1 Set System Time

4.2.1.1 Manual Setting

This 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 76 describes the Set System Time parameters.

Synchronous Response

Table 27, page 76 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 Description

dd/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)

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

Table 27 Set System Time Synchronous Responses

Responses Remarks

OK Success

ERROR:INVALID INPUT For invalid input

1VV0301498 Rev. 2.0 76 2020-05-05

Page 77: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

4.2.1.2 Dynamic Setting

This 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 77 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/AThe 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/AIf 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.

1VV0301498 Rev. 2.0 77 2020-05-05

Page 78: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

Synchronous Response

Table 29, page 78 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 Remarks

OK Success

ERROR:INVALID INPUT For invalid input

SNTP BusyIf previous time synchronization is not completed.

1VV0301498 Rev. 2.0 78 2020-05-05

Page 79: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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

1VV0301498 Rev. 2.0 79 2020-05-05

Page 80: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

4.2.2 Get System Time

This 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 80 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>Success

Displays date and time in the provided format.

ERROR:INVALID INPUT For invalid input

1VV0301498 Rev. 2.0 80 2020-05-05

Page 81: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

4.3 Profile Setting

GS 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 Profile

This 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 83.

Command Syntax AT&V

Synchronous Response

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

1VV0301498 Rev. 2.0 81 2020-05-05

Page 82: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

Table 31 Get Profile Synchronous Responses

Responses Remarks

ACTIVE PROFILE

C0 &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 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=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=0

OK

Success

1VV0301498 Rev. 2.0 82 2020-05-05

Page 83: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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 83 describes the Save Profile parameters.

Synchronous Response

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

Table 32 Save Profile Parameters

Parameter Optional/Mandatory Value Description

n Mandatory

0 For profile 0

1 For profile 1

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

Table 33 Save Profile Synchronous Responses

Responses Remarks

OK Success

ERROR:INVALID INPUTIf parameters are not valid.

(n value is other than 0 or 1)

NOTE: GS node supports two profiles.

1VV0301498 Rev. 2.0 83 2020-05-05

Page 84: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

4.3.3 Load Profile

This 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 84 describes the Load Profile parameters.

Synchronous Response

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

Table 34 Load Profile Parameters

Parameter Optional/Mandatory Value Description

n Mandatory

0 For profile 0

1 For profile 1

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

Table 35 Load Profile Synchronous Responses

Responses Remarks

OK Success

ERROR:INVALID INPUTIf parameters are not valid.

(n value is other than 0 or 1)

1VV0301498 Rev. 2.0 84 2020-05-05

Page 85: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

4.3.4 Select Default Profile

This 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 85 describes the Select Default Profile parameters.

Synchronous Response

Table 37, page 85 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 Mandatory

0 For profile 0

1 For profile 1

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

Table 37 Select Default Profile Synchronous Responses

Responses Remarks

OK Success

ERROR:INVALID INPUTIf parameters are not valid.

(n value is other than 0 or 1)

1VV0301498 Rev. 2.0 85 2020-05-05

Page 86: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

4.3.5 Restore Profile

This 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 86 describes the synchronous responses and remarks for the Restore Profile command.

4.3.6 Define Profile

The 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 86.

Table 38 Restore Profile Synchronous Responses

Responses Remarks

OK 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 Reference

General Wireless Parameter

802.11 Operating Mode STA, Limited AP 5.1.2 Operation Mode, page 101

Transmit Power Configuration N/A

802.11 Transmit Retry Count 5.1.3 MAC Retry, page 104

Power Save Mode Enabled, Disabled9.1.3 Custom Power Save Radio Receive, page 441

1VV0301498 Rev. 2.0 86 2020-05-05

Page 87: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

802.11 Radio Mode Enabled, Disabled 9.1.1 Active Radio Receive, page 436

Auto Connect Mode, Wireless Interface Settings

802.11 Operating Mode STA

7.4.4 Wireless Parameters, page 229Operating Channel 1 to 14

SSID Parameter Any valid SSID

BSSID Parameter Any valid BSSID

Maximum 4.3.7 Configure Profile, page 89

Auto Connect Mode, Network Interface Settings

Mode Server, Client

6.3 DHCP Client, page 175

Protocol TCP, UDP

Server Port Number Any valid port

Server IP Address Any valid IP address

Host Name Valid Domain name

Wireless Interface Security Configuration

Authentication Mode Open, Shared 5.3.8 Advanced Commands, page 145

PSK Valid Valid, Invalid5.3.3.5 WPA-PSK and WPA2-PSK Key Calculation, page 133PSK-SSID

Any valid SSID, used for PSK key computation

WEP Key Configuration 5.3.8 Advanced Commands, page 145

WPA Pass Phrase5.3.3.4 WPA-PSK and WPA2-PSK Passphrase, page 132

TCP/IP Configuration

DHCP Mode Enabled, Disabled 6.3 DHCP Client, page 175

IP Address Valid IP address

6.4 IP Address, page 177Net Mask Address Valid mask

Default Gateway Address Valid IP address

DNS1 Valid DNS1 IP address6.8 DNS Address, page 183

DNS2 Valid DNS2 IP address

UART Configuration

Echo Mode Enabled, Disabled 11.3.2 Echo, page 499

Verbose Mode Enabled, Disabled 11.3.3 Verbose, page 500

Bits Per Character 5, 6, 7, 8

3.2.1.1 UART Parameters, page 47Number of Stop Bits 1, 2

Parity Type None, Odd, Even

Software Flow Control Mode Enabled, Disabled 3.2.1.2 Software Flow Control, page 49

Hardware Flow Control Mode Enabled, Disabled 3.2.1.3 Hardware Flow Control, page 50

Table 39 Define Profile Parameters (Continued)

Parameter Values Reference

1VV0301498 Rev. 2.0 87 2020-05-05

Page 88: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

Baud Rate 3.2.1.1 UART Parameters, page 47

Limits and Timeouts

Network Connection Timeout Units of 10 milliseconds

4.3.7 Configure Profile, page 89

Auto Association Timeout Units of 10 milliseconds

TCP Connection Timeout Units of 10 milliseconds

Association Retry Count Units of milliseconds

Nagle Wait Time Units of 10 milliseconds

Units of milliseconds

NCM L4 Reconnect Interval Units of milliseconds

NCM L4 Reconnect Count Units of numbers

SPI Configuration

SPI Clock Polarity and Clock Phase

0, 1 3.2.2 SPI Interface and Configuration, page 51

Table 39 Define Profile Parameters (Continued)

Parameter Values Reference

1VV0301498 Rev. 2.0 88 2020-05-05

Page 89: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

4.3.7 Configure Profile

This 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 89 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 Time10, 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 123).

Allowed values: 5 to 1200 (but at the high limit a 14-channel scan will consume 16.8 seconds).

6NcmAutoMode-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.

1VV0301498 Rev. 2.0 89 2020-05-05

Page 90: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

7NcmAutoMode-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.

8AutoMode-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 3

3 (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.

AAuto 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

1VV0301498 Rev. 2.0 90 2020-05-05

Page 91: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

Synchronous Response

Table 41, page 91 describes the synchronous responses and remarks for the Configure Profile command.

4.3.8 Identification Information

This command is used to return various identification information of GS node.

Command Syntax ATIn

Parameter Description

Table 42, page 91 describes the Identification Information parameters.

Synchronous Response

Table 43, page 91 describes the synchronous responses and remarks for the Identification Information command.

Table 41 Configure Profile Synchronous Responses

Responses Remarks

OK Success

ERROR:INVALID INPUT If parameters are not valid.

Table 42 Identification Information Parameters

Parameter Optional/Mandatory Value Description

n Mandatory

0 OEM identification

1 Hardware version

2 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 Remarks

GainSpan OK Success

ATI1:GSxxxx

OKThe hardware version will change whenever the code in the ROM gets changed.

ATI2:x.x.x

OKThe software version will change whenever a new feature is added.

ERROR:INVALID INPUTIf parameters are not valid.

(n value is other than 0-2)

1VV0301498 Rev. 2.0 91 2020-05-05

Page 92: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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 92 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-16It is the allocated connection identifier for a connection in decimal format.

n Mandatory

0, 1

0: Disable

1: 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 OptionalFor 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

1VV0301498 Rev. 2.0 92 2020-05-05

Page 93: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

4.3.10 Enhanced Asynchronous Notification

This command is used to support enhanced asynchronous notification method.

Command Syntax AT+ASYNCMSGFMT=n

Parameter Description

Table 45, page 93 describes the Enhanced Asynchronous Notification parameters.

Synchronous Response

Table 46, page 93 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 feature

1 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

TYPEType 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 509.

LENGTHLength of the asynchronous message in hex. This field length is 2 bytes. See A.2 Asynchronous & Enhanced Asynchronous Messages, page 509.

MESSAGE Exact asynchronous message as string.

Table 46 Enhanced Asynchronous Notification Synchronous Responses

Responses Remarks

OK Success

ERROR: INVALID INPUTIf parameters are not valid.

(If n value is other than 0 and 1)

1VV0301498 Rev. 2.0 93 2020-05-05

Page 94: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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

1VV0301498 Rev. 2.0 94 2020-05-05

Page 95: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

4.4 Reset

This 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 95 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,2

Format: Decimal

1:Resets the whole system including the RTC domain.

2: Resets and restores the system to factory default setting

1VV0301498 Rev. 2.0 95 2020-05-05

Page 96: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

4.5 MAC

All 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 96 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 Mandatoryxx: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).

1VV0301498 Rev. 2.0 96 2020-05-05

Page 97: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

Table 49, page 97 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 Remarks

OK Success

ERROR: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.

1VV0301498 Rev. 2.0 97 2020-05-05

Page 98: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

4.5.2 Get MAC Address

This 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 98 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 Remarks

OK Success

1VV0301498 Rev. 2.0 98 2020-05-05

Page 99: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

Chapter 5 Wireless

This chapter describes commands for configurations and operations related to WLAN layer.

• Wireless Generic, page 99

• Beacon Mode (Unassociated Mode), page 113

• Station/AP Mode, page 123

• WiFi Direct Mode, page 146

• Concurrent Mode (STA Plus AP), page 164

5.1 Wireless Generic

5.1.1 Regulatory Domain

5.1.1.1 Set Regulatory Domain

This 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 100 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.

1VV0301498 Rev. 2.0 99 2020-05-05

Page 100: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

Synchronous Response

Table 52, page 100 describes the synchronous responses and remarks for the Set Regulatory Domain command.

5.1.1.2 Get Regulatory Domain

This 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 100 describes the synchronous responses and remarks for the Get Regulatory Domain command.

Example AT+WREGDOMAIN=?REG_DOMAIN=FCCOK

Table 51 Set Regulatory Domain Parameters

Parameter Optional/Mandatory

Value Regulatory Domain

Supported Channels

Regulatory Domain Mandatory

0 (default) FCC 1 to 11

1 ETSI 1 to 13

2 TELEC 1 to 14

The Regulatory domain set is required only once since it is being updated in the Flash.

Table 52 Set Regulatory Domain Synchronous Responses

Responses Remarks

OK 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 Remarks

REG_DOMAIN=FCC

OKSuccess

1VV0301498 Rev. 2.0 100 2020-05-05

Page 101: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

Where possible values of REG_DOMAIN are: FCC, ETSI, TELEC

5.1.2 Operation Mode

This 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 102 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.

1VV0301498 Rev. 2.0 101 2020-05-05

Page 102: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

Table 54 Mode Parameters

Parameter Optional/Mandatory Value Description

wireless mode Mandatory

0: WiFi station mode

1: Reserved

2: WiFi limited AP mode

3: WiFi direct mode(P2P)

4: Reserved

6: Provisioning AP mode

Default 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 1500

Unit: milliseconds

Default value: 100ms

Time between two successive beacon frames transmitted by the Limited AP mode.

broadcast SSID in LAP mode

Optional

0, 1

0: Enable

1: Disable

Default 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.

No. of stations allowed to associate in LAP mode

Optional

1 - 16

Minimum value: 1

Maximum value: 16

Default 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: 1

Maximum value: 255

Default 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.

1VV0301498 Rev. 2.0 102 2020-05-05

Page 103: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

Synchronous Response

Table 55, page 104 describes the synchronous responses and remarks for the Mode command.

inactivity time-out in LAP mode

Optional

Minimum value: 1

Maximum value: 65535

Default 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,1

0: Battery powered /Ultra low power profile

1: Line powered/Throughput profile

0(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:

rate adaptation-minimum application throughput

Optional0-22 Mbps

Default 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 pair

3.) 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

1VV0301498 Rev. 2.0 103 2020-05-05

Page 104: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

Su

Fa

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

5.1.3 MAC Retry

This command is used to set the current retry count set to the supplied value.

Command Syntax AT+WRETRY=<n>

Parameter Description

Table 56, page 104 describes the Set Retry Count parameters.

Table 55 Mode Synchronous Responses

Events Verbose mode Non Verbose mode Remarks

ccess <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 inincorrect format.

Table 56 Set Retry Count Parameters

Parameter Optional/Mandatory Value Description

n Mandatory1 to 255

Default 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.

1VV0301498 Rev. 2.0 104 2020-05-05

Page 105: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

Synchronous Response

Table 57, page 105 describes the synchronous responses and remarks for the Set Retry Count command.

Example AT+WRETRY=5OK

Table 57 Set Retry Count Synchronous Responses

Responses Remarks

OK Success

ERROR:INVALID INPUTIf parameters are not valid

(If value is more than 1 to 255)

1VV0301498 Rev. 2.0 105 2020-05-05

Page 106: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

5.1.4 Sync Loss Interval

This 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 106 describes the Sync Loss Interval parameters.

Synchronous Response

Table 59, page 106 describes the synchronous responses and remarks for the Sync Loss Interval command.

Asynchronous Response

Table 60, page 107 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-63325

Default 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 Remarks

OK Success

ERROR:INVALID INPUT Invalid parameter (out of range)

1VV0301498 Rev. 2.0 106 2020-05-05

Page 107: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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 Threshold

This command is used to set the RTS threshold value.

Command Syntax AT+WRTS=<RTSTHRESHOLD>[,TXOP ENABLE]

Parameter Description

Table 61, page 107 describes the RTS Threshold parameters.

Synchronous Response

Table 62, page 108 describes the synchronous responses and remarks for the RTS Threshold command.

Table 60 Sync Loss Interval Asynchronous Responses

Responses Remarks

314Disassociation Event

Where,

Subtype - 3

Length - 14 (ASCII equivalent decimal is 20 characters, i.e., length of the actual message)

Actual message - Disassociation Event

The 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.

1VV0301498 Rev. 2.0 107 2020-05-05

Page 108: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

Example AT+WRTS=0OK

5.1.6 Transmit Data Rate

5.1.6.1 Set Transmit Rate

This 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 109 describes the Set Transmit Rate parameters.

Table 62 RTS Threshold Synchronous Responses

Responses Remarks

OK 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.

1VV0301498 Rev. 2.0 108 2020-05-05

Page 109: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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 MBPS

11 5.5 MBPS

13 6.5 MBPS

12 6 MBPS

18 9 MBPS

22 11 MBPS

24 12 MBPS

36 18 MBPS

39 19.5 MBPS

48 24 MBPS

52 26 MBPS

72 36 MBPS

78 39 MBPS

96 48 MBPS

104 52 MBPS

108 54 MBPS

117 58.5 MBPS

130 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

OptionalThis parameter specifies the transmission rate for control frames.

1VV0301498 Rev. 2.0 109 2020-05-05

Page 110: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

Synchronous Response

Table 64, page 110 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 110 describes the synchronous responses and remarks for the Get Transmit Rate command.

Example AT+WRATE=?0OK

Table 64 Set Transmit Rate Synchronous Responses

Responses Remarks

OK 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 Remarks

WRATE OK

WRATE 0Success

Module will return one of the values listed in Table 63, page 109.

1VV0301498 Rev. 2.0 110 2020-05-05

Page 111: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

5.1.7 Graceful Shutdown of WLAN

This command is used to prepare WLAN for graceful shutdown. It writes intermediate calibration data in SRAM to flash.

This command needs to be used when there is a possibility of loosing calibration data and other WLAN related data stored in RAM or RTC memory. It also needs to be used before hibernate mode or system reset.

Command Syntax AT+PWRDOWN

Synchronous Response

Table 66, page 111 describes the synchronous responses and remarks for the Graceful shutdown of WLAN command.

Example AT+PWRDOWNOK

Table 66 Graceful Shutdown of WLAN Synchronous Responses

Responses Remarks

OK Success

ERROR: INVALID INPUTFailure

When application is unable to set graceful shutdown of WLAN.

1VV0301498 Rev. 2.0 111 2020-05-05

Page 112: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

5.1.8 SSID Hide

This command is used to hide the SSID information in a wireless network.

Command Syntax AT+SSIDHIDE=<n>

Parameter Description

Table 67, page 112 describes the SSID Hide parameters.

Synchronous Response

Table 68, page 112 describes the synchronous responses and remarks for SSID Hide command.

Example N/A

Table 67 SSID Hide Parameters

Parameter Optional/Mandatory Value Description

n Mandatory0 to 2

Default value - N/A

This parameter specifies the status of the hidden SSID, where:

0 - Disables hidden SSID, beacon frames will contain SSID information,

1 - Enables hidden SSID, beacon frames will not contain SSID information,

2 - Disables probe response to broadcast the probe request with wildcard SSID information.

Table 68 SSID Hide Synchronous Responses

Responses Remarks

OK Success

ERROR: INVALID INPUT If parameters are not valid

1VV0301498 Rev. 2.0 112 2020-05-05

Page 113: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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 69, page 113 describes the Unassociated/Unsolicited Tx parameters.

NOTE: Size of Payload has to be in multiples of 4.

Table 69 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.

1VV0301498 Rev. 2.0 113 2020-05-05

Page 114: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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 70, page 116It 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 - 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 after transmission to receive other frames of interest.

Address 1 Mandatory Refer 802.11 specification Refer 802.11 specification

Address 3 Optional Refer 802.11 specification Refer 802.11 specification

Address 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 69 Unassociated/Unsolicited Tx Parameters (Continued)

Parameter Optional/Mandatory Value Description

1VV0301498 Rev. 2.0 114 2020-05-05

Page 115: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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 69 Unassociated/Unsolicited Tx Parameters (Continued)

Parameter Optional/Mandatory Value Description

1VV0301498 Rev. 2.0 115 2020-05-05

Page 116: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

Table 70, page 116 provides the transmission rate and the corresponding input value range for Power in Unassociated/unsolicited Tx command.

Synchronous Response

Table 71, page 116 describes the synchronous responses and remarks for Unassociated/Unsolicited Tx command.

Example 1 Table 72, page 117provides the examples for Unassociated/unsolicited Tx.

Table 70 Transmission Rate and input value range for Power

Transmission Rate Input Value Range for Power

1 1 to 8

2 1 to 4

5.5 1 to 7

6 1 to 13

6.5 1 to 13

9 1 to 13

11 1 to 5

12 1 to 13

18 1 to 13

19.5 1 to 13

24 1 to 13

26 1 to 13

36 1 to 12

39 1 to 12

48 1 to 12

54 1 to 9

58.5 1 to 10

65 1 to 8

Table 71 Unassociated/Unsolicited Tx Synchronous Responses

Responses Remarks

OK Success

ERROR:INVALID INPUTFailure

If parameters are not valid.

1VV0301498 Rev. 2.0 116 2020-05-05

Page 117: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

0

0

0

0

0

0

0

0

0

0

0

0

0

0

1

1

Table 72 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 Command

Type Type Description Subtype

Bits-B7B6B5B4

Subtype Description

0

Management

0000Association request

AT+UNSOLICITEDTX=0,0,1,2,1,1,5,0,00:1d:c9:aa:bb:dd

0 0001Association response

AT+UNSOLICITEDTX=16,0,1,2,1,1,5,0,00:1d:c9:aa:bb:dd

0 0010Reassociation Request

AT+UNSOLICITEDTX=32,0,1,2,1,1,5,0,00:1d:c9:aa:bb:dd

0 0011Reassociation response

AT+UNSOLICITEDTX=48,0,1,2,1,1,5,0,00:1d:c9:aa:bb:dd

0 0100 Probe requestAT+UNSOLICITEDTX=64,0,1,2,1,1,5,0,00:1d:c9:aa:bb:dd

0 0101 Probe responseAT+UNSOLICITEDTX=80,0,1,2,1,1,5,0,00:1d:c9:aa:bb:dd

0 1000 BeaconAT+UNSOLICITEDTX=128,0,1,2,1,1,4,0,ff:ff:ff:ff:ff:ff

0 1010 DisassociationAT+UNSOLICITEDTX=160,0,1,2,1,1,5,0,00:1d:c9:aa:bb:dd

0 1011 AuthenticationAT+UNSOLICITEDTX=176,0,1,2,1,1,5,0,00:1d:c9:aa:bb:dd

0 1100 DeauthenticationAT+UNSOLICITEDTX=192,0,1,2,1,1,5,0,00:1d:c9:aa:bb:dd

1

Control

1010Power Save PS-(Poll)

AT+UNSOLICITEDTX=164,1,1,2,1,0,10,0,00:1d:c9:aa:bb:dd

1 1011Request To Send (RTS)

AT+UNSOLICITEDTX=184,1,1,2,1,0,10,0,00:1d:c9:aa:bb:dd

1 1100Clear To Send (CTS)

AT+UNSOLICITEDTX=196,0,1,2,1,1,5,0,00:1d:c9:1b:82:df

1 1101Acknowledgment (ACK)

AT+UNSOLICITEDTX=212,1,1,2,1,0,2,0,00:1d:c9:1b:82:df

1Data

0000 DataAT+UNSOLICITEDTX=8,1,1,2,1,0,10,0,00:1d:c9:aa:bb:dd

1 0100Null Function (no data)

AT+UNSOLICITEDTX=72,1,1,2,1,0,10,0,00:1d:c9:aa:bb:dd

1VV0301498 Rev. 2.0 117 2020-05-05

Page 118: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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

1VV0301498 Rev. 2.0 118 2020-05-05

Page 119: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

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 73, page 119 describes the Unassociated/Unsolicited Rx parameters.

Table 73 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.

1VV0301498 Rev. 2.0 119 2020-05-05

Page 120: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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

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.

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-14It 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 73 Unassociated/Unsolicited Rx Parameters (Continued)

Parameter Optional/Mandatory Value Description

1VV0301498 Rev. 2.0 120 2020-05-05

Page 121: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

– 0x03: Probe response

– 0x04: Unicast data

– 0x05: Multicast data

– 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

NOTE: Address 3 and address 4 of Unsolicited Tx has to be set appropriately working of both unsolicited Tx and Rx commands together.

1VV0301498 Rev. 2.0 121 2020-05-05

Page 122: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

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

5.2.3 Unassociated/Unsolicited Rx Stop

This command is used to stop the unsolicited data reception.

Command Syntax AT+UNSOLICITEDRXSTOP

5.2.4 Unassociated/Unsolicited Data Encryption

This 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 74, page 122 describes the Unassociated/unsolicited data encryption parameters.

Table 74 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 MandatoryUser 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.

1VV0301498 Rev. 2.0 122 2020-05-05

Page 123: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

5.3 Station/AP Mode

5.3.1 Scan Time Settings

5.3.1.1 Set Scan Time

This 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 75, page 123 describes the Set Scan Time parameters.

Synchronous Response

Table 76, page 123 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 89).

Table 75 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 76 Set Scan Time Synchronous Responses

Events Verbose Mode Non Verbose Mode Remarks

Success <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

1VV0301498 Rev. 2.0 123 2020-05-05

Page 124: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

OK

1VV0301498 Rev. 2.0 124 2020-05-05

Page 125: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

5.3.1.2 Get Scan Time

This command is used to display minimum and maximum scan time in milliseconds.

Command Syntax AT+WST=?

Synchronous Response

Table 77, page 125 describes the synchronous responses and remarks for the Get Scan Time command.

Example AT+WST=?MinScanTime=150MaxScanTime=150

Table 77 Get Scan Time Synchronous Responses

Responses Remarks

MinScanTime=150

MaxScanTime=150

OK

Success

Displays “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.

1VV0301498 Rev. 2.0 125 2020-05-05

Page 126: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

5.3.2 Authentication Mode

This command is used to configure the authentication mode.

Command Syntax AT+WAUTH=n

Parameter Description

Table 78, page 126 describes the WiFi Security Configuration Authentication Mode parameters.

Synchronous Response

Table 79, page 126 describes the synchronous responses and remarks for the WiFi Security Configuration Authentication Mode command.

Example AT+WAUTH=0OK

Table 78 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 79 WiFi Security Configuration Authentication Mode Synchronous Responses

Responses Remarks

OK Success

ERROR:INVALID INPUTIf parameters are not valid.

(n value is other than 0, 1, and 2)

1VV0301498 Rev. 2.0 126 2020-05-05

Page 127: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

5.3.3 Security Configuration

5.3.3.1 Security Setting

This command is used to configure the GS node with different security configuration.

Command Syntax AT+WSEC=n

Parameter Description

Table 80, page 127 describes the Security Configuration parameters.

Table 80 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 security

2 WEP security

4WPA-PSK security (TKIP only)

8WPA2-PSK security (AES only)

16 WPA Enterprise

32 WPA2 Enterprise

64 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

1VV0301498 Rev. 2.0 127 2020-05-05

Page 128: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

Synchronous Response

Table 81, page 128 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 Keys

This 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 82, page 129 describes the WEP Keys parameters.

Table 81 Security Configuration Synchronous Responses

Responses Remarks

OK 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.

1VV0301498 Rev. 2.0 128 2020-05-05

Page 129: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

Synchronous Response

Table 83, page 129 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 82 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 83 WEP Keys Synchronous Responses

Responses Remarks

OK Success

ERROR:INVALID INPUTIf parameters are not valid.

(n value is other than 1,2,3, and 4 or key is invalid)

1VV0301498 Rev. 2.0 129 2020-05-05

Page 130: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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 Configuration

This 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 84, page 131 describes the WEP Key Type Configuration parameters.

1VV0301498 Rev. 2.0 130 2020-05-05

Page 131: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

Table 84 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.

1VV0301498 Rev. 2.0 131 2020-05-05

Page 132: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

5.3.3.4 WPA-PSK and WPA2-PSK Passphrase

This 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 85, page 132 describes the WPA-PSK and WPA2-PSK Passphrase parameters.

Synchronous Response

Table 86, page 132 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 133.

Table 85 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 43 for details.

Table 86 WPA-PSK and WPA2-PSK Phassphrase Synchronous Responses

Responses Remarks

OK Success

ERROR:INVALID INPUT Invalid passphrase

1VV0301498 Rev. 2.0 132 2020-05-05

Page 133: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

5.3.3.5 WPA-PSK and WPA2-PSK Key Calculation

This 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 87, page 133 describes the WPA-PSK and WPA2-PSK Key Calculation parameters.

Synchronous Response

Table 88, page 133 describes the synchronous responses and remarks for the WPA-PSK and WPA2-PSK Calculation command.

Table 87 WPA-PSK and WPA2-PSK Key Calculation Parameters

Parameter Optional/Mandatory Value Description

SSID Mandatory 1-32The SSID is a string of between 1 and 32 ASCII characters. See 2.7.3 SSID and Passphrase, page 43.

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 43.

Table 88 WPA-PSK and WPA2-PSK Calculation Synchronous Responses

Responses Remarks

Computing PSK from SSID and Passphrase

OK

Success

The 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 89). 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 85 for profile management.

ERROR:INVALID INPUT If parameters are not valid.

1VV0301498 Rev. 2.0 133 2020-05-05

Page 134: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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 Key

This 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 89, page 134 describes the WPA-PSK and WPA2-PSK Key parameters.

NOTE: This command should be used along with the AT+WM command.

Table 89 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.

1VV0301498 Rev. 2.0 134 2020-05-05

Page 135: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

Synchronous Response

Table 90, page 135 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 90 WPA-PSK and WPA2-PSK Key Synchronous Responses

Responses Remarks

OK

Success

After 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 85 for more information on profile management.

ERROR:INVALID INPUT Invalid PSK (if PSK is not 32 bytes)

1VV0301498 Rev. 2.0 135 2020-05-05

Page 136: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

5.3.4 Scanning

This 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 91, page 136 describes the Scanning parameters.

Synchronous Response

Table 92, page 137 describes the synchronous responses and remarks for the Scanning command.

Table 91 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 43).

When SSID is specified, the GS node only scans the configured SSID.

BSSID Optional N/AThis 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 123)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 123).

1VV0301498 Rev. 2.0 136 2020-05-05

Page 137: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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 92 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

Success

Type is INFRA for infrastructure network and

ADHOC for ad-hoc networks.

1VV0301498 Rev. 2.0 137 2020-05-05

Page 138: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

5.3.5 Association

This 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],[Unscheduled automatic power save delivery configuration]]

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 136) 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 101). 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 101), The node creates an infrastructure (Limited AP) network with the specified SSID. Issue AT+WSEC=n (refer 5.3.4 Scanning, page 136 for values) to create Limited AP with security as specified in Table 80Security Configuration Parameters, page 127.

Parameter Description

Table 93, page 139 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.

1VV0301498 Rev. 2.0 138 2020-05-05

Page 139: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

Table 93 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 43 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 99)

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.

1VV0301498 Rev. 2.0 139 2020-05-05

Page 140: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

Rssi Flag Optional

0: Disable

1: Enable

Default 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 94, page 141.

WPS Registrar

Optional 1Initialize WPS registrar.

This will not trigger WPS procedure.Note: WPS registrar with hidden ssid is not supported

Unscheduled automatic power save delivery (UAPSD) configuration

Optional

0,1

0: Disable

1: Enable

It is a bitmap that indicates whether UAPSD is enabled or not.

• Bit#0 – AC_BK

• Bit#1 – AC_BE

• Bit#2 – AC_VI

• Bit#3 – AC_VO

Table 93 Associate with Network or Create an AP Network Parameters (Continued)

Parameter Optional/Mandatory Value Description

1VV0301498 Rev. 2.0 140 2020-05-05

Page 141: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

Table 94 GS node’s behavior based on RSSI Flag and Channel

Table 95, page 141 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 Flag

0 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 95 Associate with Network or Create an AP Network Synchronous Responses

Responses Remarks

IP SubNet Gateway IPaddress: SubNetaddress: Gateway address Success

ERROR:INVALID INPUT If parameters are not valid.

ERROR

See 11.3.1 Log Level, page 498.

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.

1VV0301498 Rev. 2.0 141 2020-05-05

Page 142: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

5.3.6 Disassociation

This 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 96, page 142 describes the synchronous responses and remarks for the Disassociation command.

Asynchronous Response

Table 97, page 142 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 98, page 143 describes the Association Keep Alive Timer parameters.

Table 96 Disassociation Synchronous Responses

Responses Remarks

OK Success

Table 97 Disassociation Asynchronous Responses

Responses Remarks

314Dissassociation 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.

1VV0301498 Rev. 2.0 142 2020-05-05

Page 143: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

Synchronous Response

Table 99, page 143 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 Interval

This 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 100, page 144 describes the WLAN Keep Alive Interval parameters.

Table 98 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 99 Association Keep Alive Timer Synchronous Responses

Responses Remarks

OK Success

ERROR:INVALID INPUT If parameters are not valid

1VV0301498 Rev. 2.0 143 2020-05-05

Page 144: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

Synchronous Response

Table 101, page 144 describes the synchronous responses and remarks for the WLAN Keep Alive Interval command.

Table 100 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 101 WLAN Keep Alive Interval Synchronous Responses

Responses Remarks

OK Success

ERROR:INVALID INPUT If parameters are not valid

1VV0301498 Rev. 2.0 144 2020-05-05

Page 145: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

5.3.8 Advanced Commands

5.3.8.1 Get Client Information

This 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 102, page 145 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 102 Get Clients Information Synchronous Responses

Responses Remarks

No. Of Stations Connected=<NoOfClients>

<MacAddr> IP <no>

OK

Success

Limited 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=0

OKNo clients are connected.

ERRORIf 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.

1VV0301498 Rev. 2.0 145 2020-05-05

Page 146: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

5.4 WiFi Direct Mode

This section contains P2P specific commands.

5.4.1 Set Device

This 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 103, page 146 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 103 Set Device Parameters

Parameter Optional/Mandatory Value Description

Group owner intent value

Mandatory0 to 15

Maximum 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 channel

82: 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

1VV0301498 Rev. 2.0 146 2020-05-05

Page 147: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

Synchronous Response

Table 104, page 147 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 103 Set Device Parameters

Parameter Optional/Mandatory Value Description

Table 104 Set Device Synchronous Responses

Events Verbose mode Non Verbose mode Remarks

Success <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.

1VV0301498 Rev. 2.0 147 2020-05-05

Page 148: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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 105, page 148 describes the Set WPS parameters.

Synchronous Response

Table 106, page 148 describes the synchronous responses and remarks for the Set WPS command.

Example 1 AT+P2PSETWPS=Debvice ID,0006,0001,11223344556677881122334455667788OK

Table 105 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 106 Set WPS Synchronous Responses

Events Verbose mode Non Verbose mode Remarks

uccess <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.

1VV0301498 Rev. 2.0 148 2020-05-05

Page 149: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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 107, page 149 describes the Start Find parameters.

Synchronous Response

Table 108, page 149 describes the synchronous responses and remarks for the Set P2P Find command.

Asynchronous Response

Table 107 Start Find Parameters

Parameter Optional/Mandatory Value Description

Timeout Mandatory

0 (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 108 Start Find Synchronous Responses

Events Verbose mode Non Verbose mode Remarks

uccess <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.

1VV0301498 Rev. 2.0 149 2020-05-05

Page 150: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

Up

e

WP2reprP2sta

e

>

e

e

>

Table 109, page 150 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 109 Start Find Asynchronous Responses

Events Verbose mode Non Verbose mode Remarks

AsynchronousEnhanced Asynchronous

AsynchronousEnhanced 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>

1VV0301498 Rev. 2.0 150 2020-05-05

Page 151: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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 Find

This 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 110, page 151 describes the synchronous responses and remarks for the P2P Stop Find command.

Asynchronous Response

Table 111, page 151 describes the asynchronous responses and remarks for the P2P Stop Find command.

Table 110 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 isincorrect.

Table 111 Stop Find Asynchronous Responses

Events Verbose mode Non Verbose mode Remarks

AsynchronousEnhanced Asynchronous

AsynchronousEnhanced 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.

1VV0301498 Rev. 2.0 151 2020-05-05

Page 152: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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 112, page 152 describes the Provoke parameters.

Synchronous Response

Table 113, page 152 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 112 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 113 Provoke Synchronous Responses

Events Verbose mode Non Verbose mode Remarks

uccess <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.

1VV0301498 Rev. 2.0 152 2020-05-05

Page 153: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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 114, page 153 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 114 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

1Request 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.

1VV0301498 Rev. 2.0 153 2020-05-05

Page 154: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

UrepdrefrP

F

Synchronous Response

Table 115, page 154 describes the synchronous responses and remarks for the Provision discovery command.

Example -1 Provision Discovery using Push Button Method

AT+p2ppd=00:1d:c9:1b:94:08,0

Example -2 Provision Discovery using Display Method

AT+p2ppd=00:1d:c9:1b:94:08,1

Table 115 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).

1VV0301498 Rev. 2.0 154 2020-05-05

Page 155: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

Example -3 Provision Discovery using Keypad Method

AT+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 116, page 155 describes the Group Form (Group Owner Negotiation) parameters.

Table 116 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/Ait 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)

1Displays 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/AThe 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

1VV0301498 Rev. 2.0 155 2020-05-05

Page 156: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

E

SUC

p SK

ver.

SUC

rts

Synchronous Response

Table 117, page 156 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 30

Timeout 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 Optional

0- Temporary group

1- persistent group

0()

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 116 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 117 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

1VV0301498 Rev. 2.0 156 2020-05-05

Page 157: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

FAIL

FAIL

Not<SP P><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 1

Push Button Method

Intent value of 13

Don’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><SP><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 117 Group Form (Group Owner Negotiation) Synchronous Responses (Continued)

vents Verbose mode Non Verbose mode Remarks

1VV0301498 Rev. 2.0 157 2020-05-05

Page 158: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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

1VV0301498 Rev. 2.0 158 2020-05-05

Page 159: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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

1VV0301498 Rev. 2.0 159 2020-05-05

Page 160: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

GO

WP

WP

5.4.8 Client Join

This 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 118, page 160 describes the Client Join parameters.

Synchronous Response

Table 119, page 161 describes the synchronous responses and remarks for the Client Join command.

Table 118 Client Join Parameters

Parameter Optional/mandatory Value Description

MAC address Mandatory N/AThe 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 pinis 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.

1VV0301498 Rev. 2.0 160 2020-05-05

Page 161: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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 119 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

1VV0301498 Rev. 2.0 161 2020-05-05

Page 162: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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 120, page 162 describes the Invitation Procedures parameters.

Synchronous Response

Table 121, page 162 describes the synchronous responses and remarks for the Invitation Procedure command.

Asynchronous Response

Table 122, page 163 describes the asynchronous responses and remarks for the Invitation Procedure command.

NOTE: This does not support sending invitation to invoke a persistent group.

Table 120 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 121 Invitation Procedures Synchronous Responses

Events Verbose mode Non Verbose mode Remarks

CCESS <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

1VV0301498 Rev. 2.0 162 2020-05-05

Page 163: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

FAI ies

SUC

e

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 142 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 122 Invitation Procedure Asynchronous Responses

Events Verbose mode Non Verbose mode Remarks

AsynchronousEnhanced Asynchronous

AsynchronousEnhanced 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 thinvitation request

1VV0301498 Rev. 2.0 163 2020-05-05

Page 164: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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

NOTE: 1.) Presently mDNS is the exclusive Multicast protocol that works in concurrent mode, as Multicast ping is not supported in concurrent mode. 2.) Use AT+WEBSERVER command to stop a webserver as it is not stopped after disassociation or after issuing AT+WD on any interface command. 3) The concurrent mode STA is recommended to operate in power save mode. 4) 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. 5) When concurrent mode is enabled using AT+NIFCMODE command and concurrent mode is again enabled multiple times using the same command, the response displayed in TeraTerm VT is “OK” though it is only enabled the first time. 6) 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.

1VV0301498 Rev. 2.0 164 2020-05-05

Page 165: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

5.5.1 Enable/Disable Concurrent Mode

This 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 123, page 165 describes the Enable/Disable Concurrent Mode parameters.

Table 123 Enable/Disable Concurrent Mode Parameters

Parameter Optional/Mandatory Value Description

mode type Mandatory

0, 1

0: Disable

1: Enable

Default value: 0

Enables or disables Concurrent mode.

% time in STA interfaceOptional

1

20% - Station

20%, 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, 1

0 - Disable

1 - Enable

Default 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 138)

• Set Concurrent AP DTIM (DTIM period in LAP mode parameter) to 1 (See AT+WM command in Operation Mode, page 101)

1VV0301498 Rev. 2.0 165 2020-05-05

Page 166: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

Synchronous Response

Table 124, page 166 describes the synchronous responses and remarks for Enable/Disable Concurrent Mode command.

5.5.2 Set the Interface Number

This 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 125, page 167 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 124 Enable/Disable Concurrent Mode Synchronous Responses

Responses Remarks

OK Success

ERROR Failure

ERROR:INVALID INPUTIf parameters values are not valid.

(Other than 0 and 1)

NOTE: Interface 0 should always be initialized first with STA

1VV0301498 Rev. 2.0 166 2020-05-05

Page 167: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

Synchronous Response

Table 126, page 167 describes the synchronous responses and remarks for Set Interface Number command.

Example AT+NIF=<Interface number>\r\nOK\r\n

Table 125 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 126 Set Interface Number Synchronous Responses

Responses Remarks

OK Success

ERROR Failure

ERROR:INVALID INPUTIf parameters are not valid.

(Other than 0 and 1)

0 or 1 Returns the active interface number.

1VV0301498 Rev. 2.0 167 2020-05-05

Page 168: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

5.5.3 Indicating Interface

ASYNC 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

1VV0301498 Rev. 2.0 168 2020-05-05

Page 169: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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)....

1VV0301498 Rev. 2.0 169 2020-05-05

Page 170: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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

1VV0301498 Rev. 2.0 170 2020-05-05

Page 171: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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

1VV0301498 Rev. 2.0 171 2020-05-05

Page 172: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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 172

• Get Network Interface Filter Configuration, page 175

• DHCP Client, page 175

• IP Address, page 177

• DHCP Server, page 179

• DHCP Server Configuration, page 181

• DNS Server, page 182

• DNS Address, page 183

• DNS Spoofing, page 184

All connection commands except for the transport of Raw Ethernet data (see 7.6.1.8 Close HTTP Client, page 284), 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 Filter

This 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 127, page 173 describes the Network Interface Filter parameters.

1VV0301498 Rev. 2.0 172 2020-05-05

Page 173: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

Synchronous Response

Table 128, page 173 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 127 Network Interface Filter Parameters

Parameter Optional/Mandatory Value Description

Protocol Mandatory

1 For ICMP

2 For UDP and TCP

Parameter is configured as a bit wise.

Enable/Disable Mandatory

0 (default) For Disable

1 For Enable

Parameter is configured as bit wise.

Table 128 Network Interface Filter Synchronous Responses

Responses Remarks

OK Success

ERROR:INVALID INPUTFailure

If the parameters are not valid.

1VV0301498 Rev. 2.0 173 2020-05-05

Page 174: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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

1VV0301498 Rev. 2.0 174 2020-05-05

Page 175: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

6.2 Get Network Interface Filter Configuration

This command is used to get the configured current network interface filter.

Command Syntax AT+L2CONFIG=?

Synchronous Response

Table 129, page 175 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 Client

This 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 130, page 175 describes the DHCP Client parameters.

Table 129 Get Network Interface Filter Configuration Synchronous Responses

Responses Remarks

CONFIG MAP:<value>

OKvalue is the configured network interface filter.

Table 130 DHCP Client Parameters

Parameter Optional/Mandatory Value Description

n Mandatory0 (default) Disable

1 Enable

hostname Optional

Value: String of 1 to 15 characters

Default 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.

1VV0301498 Rev. 2.0 175 2020-05-05

Page 176: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

Synchronous Response

Table 131, page 176 describes the synchronous responses and remarks for the DHCP Client command.

Asynchronous Response

Table 132, page 177 describes the asynchronous responses and remarks for the DHCP Client command.

radio mode Optional

1 Active mode

2 (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 seconds

It 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 130 DHCP Client Parameters

Parameter Optional/Mandatory Value Description

Table 131 DHCP Client Synchronous Responses

Responses Remarks

OKSuccess

If 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>

Success

If 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.

1VV0301498 Rev. 2.0 176 2020-05-05

Page 177: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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 Address

This 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 183).

Command Syntax AT+NSET=<Device IPv4 Address>,<IPv4 Subnet Mask>,<Gateway IPv4 Address><CR>

Parameter Description

Table 133, page 178 describes the Static Configuration of Network Parameters.

Table 132 DHCP Client Asynchronous Responses

Responses Remarks

815ERROR: IP CONFIG FAIL

Where:

Subtype - 8

Length - 15 (ASCII equivalent decimal is 21 characters, i.e., length of the actual message).

Actual message - ERROR: IP CONFIG FAIL

The 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.

1VV0301498 Rev. 2.0 177 2020-05-05

Page 178: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

Succe

Succe

Failur

Synchronous Response

Table 134, page 178 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 133 Static Configuration of Network Parameters

Parameter Optional/Mandatory Value Description

device IPv4 Address Mandatory192.168.1.99 (default value)

IP address of the source in the form xxx.xxx.xxx.xxx

IPv4 Subnet Mask Mandatory255.255.255.0 (default value)

Net mask is in the form of xxx.xxx.xxx.xxx

Gateway IPv4 Address Mandatory192.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 134 Static Configuration of Network Parameters Synchronous Responses

Events Verbose Mode Non Verbose Mode Remarks

ss in unassociated state <CR><LF>OK<CR><LF> <CR><LF>0<CR><LF> VALID Parameter

ss 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.

1VV0301498 Rev. 2.0 178 2020-05-05

Page 179: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

6.5 DHCP Server

This 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 183, 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 135, page 179 describes the DHCP Server parameters.

Table 135 DHCP Server Parameters

Parameter Optional/Mandatory Value Description

Start/Stop DHCPv4 Server

Mandatory

0 Stops the DHCPv4 server

1 Starts the DHCPv4 Server

Note: 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.

1Disable, 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.

1Disable, does not advertise the gateway IP address.

Note: Gateway IP address is taken from AT+NSET.

1VV0301498 Rev. 2.0 179 2020-05-05

Page 180: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

Event

Success

Failure age 179

Failure

Synchronous Response

Table 136, page 180 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 136 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 135, p

<CR><LF>ERROR<SP>INVALID<SP>INPUT<CR><LF>

<CR><LF>2<CR><LF> Parameters are valid.

1VV0301498 Rev. 2.0 180 2020-05-05

Page 181: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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 137, page 181 describes the DHCP Server Configuration parameters.

Synchronous Response

Table 138, page 181 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 137 DHCP Server Configuration Parameters

Parameter Optional/Mandatory Value Description

DHCP-Client’s starting IP address

Mandatory N/AThe 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

Mandatory1 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 138 DHCP Server Configuration Synchronous Responses

Events Verbose Mode Non Verbose Mode Remarks

ccess <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

1VV0301498 Rev. 2.0 181 2020-05-05

Page 182: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

6.7 DNS Server

This 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 344).

Command Syntax AT+DNS=<Start/stop>,<url>

Parameter Description

Table 139, page 182 describes the DNS Server parameters.

Synchronous Response

Table 140, page 182 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 139 DNS Server Parameters

Parameter Optional/Mandatory Value Description

Start/Stop Mandatory0 Stops the server

1 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 140 DNS Server Synchronous Responses

Responses Remarks

OK

Success

The 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)

1VV0301498 Rev. 2.0 182 2020-05-05

Page 183: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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 Address

This 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 141, page 183 describes the Static Configuration of DNS (Client) parameters.

Synchronous Response

Table 142, page 183 describes the synchronous responses and remarks for the Static Configuration of DNS (Client) command.

Table 141 Static Configuration of DNS (Client) Parameters

Parameter Optional/Mandatory Value Description

DNS1 IP Mandatory N/A DNS1 IP is the IP address of the DNS server.

DNS2 IP Optional N/ADNS2 IP should not be the same as DNS1 IP address.

Table 142 Static Configuration of DNS (Client) Synchronous Responses

Responses Remarks

OKSuccess

To take effect, this command should be given before associating to the network.

ERRORFailure

If the parameters are not valid.

1VV0301498 Rev. 2.0 183 2020-05-05

Page 184: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

6.9 DNS Spoofing

This 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

1VV0301498 Rev. 2.0 184 2020-05-05

Page 185: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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 185

• Security Configuration, page 194

• Network Connection Management (NCM), page 208

• Auto Mode, page 221

• UDP/TCP, page 234

• HTTP, page 268

• MQTT Client, page 290

• WebSocket Client, page 300

• CoAP Client, page 309

• GSLink, page 318

• Multicast, page 337

7.1 Data Transfer Configuration

7.1.1 Data Transfer in Bulk Mode

This command is used to enable or disable the bulk mode data transfer.

Command Syntax AT+BDATA=n

Parameter Description

Table 143, page 185 describes the Enable/Disable Bulk Mode Data Transfer parameters.

Table 143 Enable/Disable Bulk Mode Data Transfer Parameters

Parameter Optional/Mandatory Value Description

n MandatoryValue range: 0, 1

Default 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

1VV0301498 Rev. 2.0 185 2020-05-05

Page 186: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

7.1.2 Data Drop

This 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 144, page 186 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.

Table 144 Data Drop Parameters

Parameter Optional/Mandatory Value Description

n MandatoryValue range: 0, 1

Default 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

1VV0301498 Rev. 2.0 186 2020-05-05

Page 187: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

When <ESC> Z <CID> is executed for bulk data mode,

• <ESC> Z validates the specified CID>

• If the CID is invalid, then S2W exists from the data processing mode.

7.1.3 Connection Status

This 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 145, page 187 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 145 Output Connections Synchronous Responses

Responses Remarks

<CID> <TYPE> <MODE> <LOCALPORT> <REMOTE PORT> <REMOTE IP>

OKIf valid CIDs are present

No valid CIDs If no valid CIDs are present.

1VV0301498 Rev. 2.0 187 2020-05-05

Page 188: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

7.1.4 Closing a Connection

This 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 146, page 188 describes the Closing a Connection parameters.

Synchronous Response

Table 147, page 188 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 146 Closing a Connection Parameters

Parameter Optional/Mandatory Value Description

CID Mandatory 16 (maximum) CID is the allocated connection identifier.

Table 147 Closing a Connection Synchronous Responses

Responses Remarks

OKConnection with the given CID is closed, and this CID can be used for future connection.

INVALID CID If any invalid CID is provided.

1VV0301498 Rev. 2.0 188 2020-05-05

Page 189: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

7.1.5 Closing All Connections

This command is used to close all open connections.

Command Syntax AT+NCLOSEALL

Synchronous Response

Table 148, page 189 describes the synchronous responses and remarks for Closing All Connections command.

Example AT+NCLOSEALLOK

7.1.6 Socket Options Configuration

This command is used to configure a socket which is identified by a CID.

Command Syntax AT+NXSETSOCKOPT=<CID>,<Type>,<Parameter>,<Value>,<Length>

Parameter Description

Table 149, page 189 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 148 Closing All Connections Synchronous Responses

Responses Remarks

OK All open connections are closed.

Table 149 Socket Options Configuration Parameters

Parameter Optional/Mandatory Value Type/Name Description

CID Mandatory16 (maximum) connection identifiers are allowed.

N/ACID is the socket identifier received after opening a connection.

Type Mandatory

1 SOL_SOCKETIt specifies the category type for Socket.

2 IPPROTO_IPIt specifies the category type for IP

3 IP_PROTOTCPIt specifies the category type for TCP.

1VV0301498 Rev. 2.0 189 2020-05-05

Page 190: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

Parameter Mandatory

29 TCP_MAXRT

It specifies the maximum retransmission timeout in seconds.

9 TCP_KEEPALIVE

It allows to enable or disable sending keep alive packets after the predefined time of 30 seconds.

2A TCP_MAX_REXMITIt specifies the maximum number of retransmission count.

2BTCP_REX_TIMER_RATE

It is used to set the retransmission timer rate.

8 SO_RCVBUF

It sets the receive buffer size for TCP packets. The maximum limit is 64KB.

2E

max queue depth:20(default)

TCP_MAX_TX_Q_DEPTH

It specifies the TCP transmission queue depth in 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 the reception packets are dropped.

3.)For single socket only transmission is done.

2FTCP_REX_TIMER_RATE_IN_NW_TICKS

It specifies the transmission rate in terms of network ticks.

25 IP_DSCP

It specifies the type of field under the IP header DSCP (Differentiated Service Code Point).

By setting IP_DSCP, the priority of the data can be configured for the connection identifier.

The IP_DSCP(25) has following 4 values:

Table 149 Socket Options Configuration Parameters (Continued)

Parameter Optional/Mandatory Value Type/Name Description

1VV0301498 Rev. 2.0 190 2020-05-05

Page 191: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

Synchronous Response

224 - AC_VO WMM - voice priority

160 - AC_VI WMM - video priority

96 - AC_BE WMM - best effort priority

64 - AC_BK WMM - background priority

Note: The following NXSETSOCKOPTs are not supported in network stack.

• SO_SENDBUF

• SO_RESUSEPORT

• Enabling or disabling Nagle algorithm. It is disabled by default in the network stack.

Value 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 is to disable Keepalive.

• For buffer, the value is the size of buffer to be set in bytes.

Length Mandatory N/A N/A

It specifies the length of the value in bytes.

4 - Integer

2 - Short

1 - Char

Table 149 Socket Options Configuration Parameters (Continued)

Parameter Optional/Mandatory Value Type/Name Description

1VV0301498 Rev. 2.0 191 2020-05-05

Page 192: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

Table 150, page 192 describes the synchronous responses and remarks for Socket Options Configuration command.

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)

Table 150 Socket Options Configuration Synchronous Responses

Responses Remarks

OK Success

ERROR: SOCKET FAILURE 0 If parameters are not valid.

NOTE: TCP_KEEPALIVE timeout can only be enabled or disabled, with a timeout of 30 seconds.

1VV0301498 Rev. 2.0 192 2020-05-05

Page 193: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

Value - 100 (TCP_MAXRT is set to 100 seconds)

Length - 4 bytes (Integer)

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)

1VV0301498 Rev. 2.0 193 2020-05-05

Page 194: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

Example Use Case 6 Setting the priority of the data as voice for the connection identifier.

AT+NXSETSOCKOPT=0,2,25,224,4

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 Addition

This 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>[,CertEncrypt]<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.

1VV0301498 Rev. 2.0 194 2020-05-05

Page 195: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

Parameter Description

Table 151, page 196 describes the Certificate Addition parameters.

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.

1VV0301498 Rev. 2.0 195 2020-05-05

Page 196: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

Synchronous Response

Table 152, page 197 describes the synchronous responses and remarks for the Certificate Addition command.

Table 151 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 Mandatory

0,1

0: 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 Mandatory

Location to store the certificates

0 Flash

1 RAM

Note: There is a carriage return after the <Location> parameter.

CertEncrypt Optional N/A

This parameter specifies whether to encrypt the certificate or not.

Note: This parameter is available only if encrypt secure info is enabled from the SDK Builder and is valid only if cert store location is flash.

1VV0301498 Rev. 2.0 196 2020-05-05

Page 197: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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 152 Certificate Addition Synchronous Responses

Responses Remarks

OK Success

ERROR: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.

1VV0301498 Rev. 2.0 197 2020-05-05

Page 198: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

7.2.2 Certificate Deletion

This 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 153, page 198 describes the Certificate Deletion parameters.

Synchronous Response

Table 154, page 198 describes the synchronous responses and remarks for the Certificate Deletion command.

Example 1 AT+TCERTDEL=TLS_CAOK

Table 153 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 154 Certificate Deletion Synchronous Responses

Responses Remarks

OK Success

ERROR:INVALID INPUT Invalid parameter

ERROR Could not delete as the file does not exist.

1VV0301498 Rev. 2.0 198 2020-05-05

Page 199: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

7.2.3 Certificate Validation

This command is used to enable or disable Server’s certificate validation on DUT.

Command Syntax AT+SRVVALIDATIONEN=n

Parameter Description

Table 155, page 199 describes the certificate validation parameters.

Synchronous Response

Table 156, page 199 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 155 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 156 Certificate Validation Synchronous Responses

Responses Remarks

OK Success

ERROR:INVALID INPUT Invalid parameters

1VV0301498 Rev. 2.0 199 2020-05-05

Page 200: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

7.2.4 Get Certificate Information

This command is used to get the validation information of a certificate.

Command Syntax AT+CERTINFOGET=<certficate name>

Parameter Description

Table 157, page 200 describes the get certificate information parameters.

Synchronous Response

Table 158, page 200 describes the synchronous responses and remarks for the certificate validation command.

7.2.5 EAP-Configuration

This 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 157 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 158 Get Certificate Information Synchronous Responses

Responses Remarks

OK Success

ERROR: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.

1VV0301498 Rev. 2.0 200 2020-05-05

Page 201: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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>

Following is the command to enable or disable Pseudo-random Function (PRF) in EAP response identity:

AT+WEAPCONF=253, <Enable/Disable PRF 1.2>

Parameter Description

Table 159, page 201 describes the EAP Configuration parameters.

Table 159 EAP Configuration Parameters

Parameter Optional/Mandatory Value Description

Outer Authentication Mandatory

The valid outer authentication values are:

43 EAP-FAST

13 EAP-TLS

21 EAP-TTLS

25 EAP-PEAP

255Enables common name and organizational unit verification in incoming server certificate.

254Enables anonymous ID in EAP response identity

Note: The combination for Outer and Inner authentication parameters is provided in Table 160, page 202.

Inner Authentication Mandatory

The valid inner authentication values are:

26 EAP-MSCHAP

6 EAP-GTC

253 EAP-PAP

Note: The combination for Outer and Inner authentication parameters is provided in Table 160, page 202.

user name

Mandatory

Note: This parameter is not applicable for EAP-TLS.

N/AThe user name is an ASCII string with a maximum length of 32 ASCII characters.

password

Mandatory

Note: This parameter is not applicable for EAP-TLS.

N/AThe password is an ASCII string with a maximum length of 32 ASCII characters.

1VV0301498 Rev. 2.0 201 2020-05-05

Page 202: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

The following table lists the combination of Outer and Inner authentication parameters.

Common name and

Organizational UnitOptional

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

Optional0- 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.

Optional0- Disable (default)

1- Enable

PRF is the pseudo random function with version 1.2 that is enabled or disabled while associating with EAP.

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

Note: To enable PRF with version 1.2 during EAP configuration, issue command “AT+WEAPCONF=253,1”.If the version of the PRF is less then the version1.2, issue command “AT+WEAPCONF=253.1” to enable it.

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 159 EAP Configuration Parameters

Parameter Optional/Mandatory Value Description

Table 160 Combination of Outer and Inner Authentication

Outer Authentication Inner Authentication Combination of Outer and Inner

Authentication

EAP-FAST EAP-MSCHAP EAP-FAST-MSCHAP

EAP-FAST EAP-GTC EAP-FAST-GTC

EAP-TLS EAP-MSCHAP EAP-TLS-MSCHAP

EAP-TTLS EAP-MSCHAP EAP-TTLS-MSCHAP

EAP-PEAP V0 EAP-MSCHAP EAP-PEAP V0-MSCHAP

EAP-PEAP V1 EAP-GTC EAP-PEAP V1-GTC

EAP-TTLS EAP-PAP EAP-TTLS-PAP

1VV0301498 Rev. 2.0 202 2020-05-05

Page 203: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

Synchronous Response

Table 161, page 203 describes the synchronous responses and remarks for the EAP-Configuration command.

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 - Command to Enable/Disable PRF 1.2

To Enable PRF 1.2AT+WEAPCONF=253,1

To Disable PRF 1.2AT+WEAPCONF=253,0

Table 161 EAP-Configuration Synchronous Responses

Responses Remarks

OK Success

ERROR:INVALID INPUT Invalid parameters

1VV0301498 Rev. 2.0 203 2020-05-05

Page 204: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

7.2.6 EAP Certificate Upload

This 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>

MCU sends data using the following <ESC> sequence:<ESC>W<CID><Data of above size>

Parameter Description

Table 162, page 204 describes the EAP Certificate Upload parameters.

Synchronous Response

Table 163, page 205 describes the synchronous responses and remarks for the EAP command.

Table 162 EAP Certificate Upload Parameters

Parameter Optional/Mandatory Value Description

Type Mandatory

Type of the certificate

0Certification of CA where the radius server is certified from.

1Client certification also known as public keys of GS device.

2 Private key og the GS device.

Format Mandatory

Format of the certificate

0 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

0Flash, stored in file system in GS2000 module.

1RAM

Note: RAM will be lost when the power is cycled.

Note: There is a carriage return after <location>.

1VV0301498 Rev. 2.0 204 2020-05-05

Page 205: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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 Validation

This command is used to enable or disable time validation for EAP certificates.

Command Syntax AT+WEAPTIMECHK=n

Parameter Description

Table 164, page 206 describes the EAP time validation parameters.

Table 163 EAP Synchronous Responses

Responses Remarks

OK Success

ERROR:INVALID INPUT Invalid parameters

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

1VV0301498 Rev. 2.0 205 2020-05-05

Page 206: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

Synchronous Response

Table 165, page 206 describes the synchronous responses and remarks for the EAP time validation command.

Table 164 EAP Time Validation Parameters

Parameter Optional/Mandatory Value Description

n Mandatory0 Disable

1 Enable (Default)

Table 165 EAP Time Validation Synchronous Responses

Responses Remarks

OK Success

ERROR:INVALID INPUT Invalid parameters

1VV0301498 Rev. 2.0 206 2020-05-05

Page 207: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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

1VV0301498 Rev. 2.0 207 2020-05-05

Page 208: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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 229 and 7.4.5 Network Parameters, page 231. The security parameters can be configured using the commands specified in 5.3.3 Security Configuration, page 127.

7.3.1 NCM Start/Stop

This 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.

1VV0301498 Rev. 2.0 208 2020-05-05

Page 209: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

Parameter Description

Table 166, page 209 describes the NCM Start/Stop parameters.

Synchronous Response

Table 167, page 209 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 166 NCM Start/Stop Parameters

Parameter Optional/Mandatory Value Description

Mode Mandatory0 For station mode

1 For limited AP mode

Start/Stop Mandatory0 For stop the NCM

1 For start the NCM

Level Mandatory0 For L2+L3 connection

1 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 167 NCM Start/Stop Synchronous Responses

Responses Remarks

OK Success

ERROR:INVALID INPUT If parameters are not valid.

1VV0301498 Rev. 2.0 209 2020-05-05

Page 210: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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.

1VV0301498 Rev. 2.0 210 2020-05-05

Page 211: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

7.3.2 Configure NCM

This 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 168, page 211 describes the NCM Configuration parameters.

Table 168 NCM Configuration Parameters

Parameter Optional/Mandatory Conf Id Value Description

Conf Id, Value

Mandatory 01 to 65535 (default is 1000 milliseconds)

CPU Wait Period (1 to 6)

Not Supported 11 to 65535 (default 1000 milliseconds)

Power Save Periods (not supported)

Mandatory 21 to 65535 (default 1000 milliseconds)

Know Channel Scan Period

Not Supported 31 to 65535 (default 1000 milliseconds)

Specific Channels Scan Period (not supported)

Mandatory

41 to 65535 (default 1000 milliseconds)

All Channel Scan period

51 to 65535 (default 1000 milliseconds)

Layer 3 Connect Period

This 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 89

NCM Layer 4 Retry Period

This 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 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.

1VV0301498 Rev. 2.0 211 2020-05-05

Page 212: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

Conf Id, Value Mandatory 81 to 65535 (default 10)

Known channel scan retry count

Conf Id, Value Not Supported 91 to 65535 (default 10)

Specific channels scan retry count (not supported)

Conf Id, Value Mandatory 101 to 65535 (default 10)

All Channel scan retry count

Conf Id, Value Mandatory 111 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 12

0, 1 (default 0)

0 - enable

1 - 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 141 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,3

1 - Active mode

2 - PS poll mode (default)

3 - IEEE PS poll mode

It specifies the radio mode during DHCP process.

Table 168 NCM Configuration Parameters (Continued)

Parameter Optional/Mandatory Conf Id Value Description

1VV0301498 Rev. 2.0 212 2020-05-05

Page 213: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

Synchronous Response

Table 169, page 213 describes the synchronous responses and remarks for NCM Configuration command.

Example AT+NCMAUTOCONF=26,0xFFFFFFFFERROR: INVALID INPUT

AT+NCMAUTOCONF=26,10OK

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 defaultIt specifies the time interval between successive DHCP retries.

Conf Id, Value Mandatory 28

0, 1

0 - 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 168 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 89.

Table 169 NCM Configuration Synchronous Responses

Responses Remarks

OK Success

ERROR:INVALID INPUT If parameters are not valid.

1VV0301498 Rev. 2.0 213 2020-05-05

Page 214: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

7.3.3 NCM Status Get

This command is used to get the status or the profile information of network connection manager.

Command Syntax AT+NCMAUTO=?/??

Parameter Description

Table 170, page 214 describes the NCM Status Get parameters.

Table 171, page 214 lists the NCM State and their values.

Table 170 NCM Status Get Parameters

Parameter Optional/Mandatory Value Description

? Mandatory N/AThis 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 171 NCM State Description

NCM State Description

Following NCM state occurs when NCM is not initialized in the module.

NCM NOT STARTED NCM is not initialized

Following NCM states occur when NCM is initialized in the module.

NCM STARTED:0 NCM is not initialized

NCM STARTED:1 NCM is initialized and ready

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:4Scanning known AP with previously scanned MAC frame

NCM STARTED:5 Scanning known channel

NCM STARTED:6 Scanning specific channels

NCM STARTED:7 Scanning All channels

NCM STARTED:8 L2 connected and L3 is not connected yet

NCM STARTED:9 Both L2 and L3 are connected

NCM STARTED:10 NCM is waiting or in idle state

1VV0301498 Rev. 2.0 214 2020-05-05

Page 215: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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

1VV0301498 Rev. 2.0 215 2020-05-05

Page 216: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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 221. 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 172, page 216 describes the NCM AP Configuration Enable parameters.

Once it is enabled, the parameters configured using commands in 7.4.1 Auto Mode (Common), page 221 and 9.3.2 Standby, page 447, go to Limited-AP.

Table 173, page 216 describes the GS node value settings.

Table 172 NCM AP Configuration Enable Parameters

Parameter Optional/Mandatory Value Description

n MandatoryValue range: 0, 1

Default value: 0

It specifies whether NCM AP configuration is enabled or not.

0: For Station mode

1: For Limited-AP mode

Table 173 GS node Value Settings for NCM AP Configuration Enable

Parameter Description

SSID GainSpanProv

Channel 1

Security 0 (open)

WEP Key 1234567890

WEP Key Index 1

WEP Key Length 5

WPA Phassphrase GSDemo123

Beacon Interval 100

DHCP Server Enable TRUE (1)

DNS Server Enable TRUE (1)

IP Address 192.168.240.1

Subnet Mask 255.255.255.0

Gateway 192.168.240.1

DHCP Start IP Address 192.168.240.2

1VV0301498 Rev. 2.0 216 2020-05-05

Page 217: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

Synchronous Response

Table 174, page 217 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.gainspan

User Name admin

Pwd admin

Table 173 GS node Value Settings for NCM AP Configuration Enable (Continued)

Parameter Description

Table 174 NCM AP Configuration Enable Synchronous Responses

Responses Remarks

OK Success

ERROR:INVALID INPUTIf parameters are not valid.

(Other than 0 and 1)

1VV0301498 Rev. 2.0 217 2020-05-05

Page 218: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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

1VV0301498 Rev. 2.0 218 2020-05-05

Page 219: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

7.3.5 Roaming

The 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 175, page 219 describes the Roaming parameters.

Table 175 Roaming Parameters

Parameter Optional/Mandatory Value Description

Param ID

Mandatory

16

Roaming Feature Enabled/DisabledParam Value

0- Disabled (default)

1- Enable

Param IDMandatory

17Lower RSSI Threshold

Param Value 70db (default)

Param ID

Mandatory

18

Higher RSSI ThresholdParam Value50db (default)

Param ID

Mandatory

19

Time between Background ScansParam Value1000ms (default)

Param ID

Mandatory

20 Number of Times Low Threshold is crossed before roaming trigger is enabled - N1

Param Value3 (default)

Param ID

Mandatory

21Maintain L3 - there is a common DHCP Server.Param Value Maintain L3 enabled

(default)

1VV0301498 Rev. 2.0 219 2020-05-05

Page 220: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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 IDOptional

24 Delay after maximum number of scans. Configure the time in milliseconds.Param Value

ScanPauseTime = 5000msec (default)

Table 175 Roaming Parameters (Continued)

Parameter Optional/Mandatory Value Description

1VV0301498 Rev. 2.0 220 2020-05-05

Page 221: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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 176, page 221 describes the Enable Auto Connection parameters.

Synchronous Response

Table 177, page 221 describes the synchronous responses and remarks for Enable Auto Connection command.

Table 176 Enable Auto Connection Parameters

Parameter Optional/Mandatory Value Description

n Mandatory

0, 1

0: Disable

1: Enable

n is 0 to disable auto connection or 1 to enable auto connection.

Table 177 Enable Auto Connection Synchronous Responses

Responses Remarks

OK Success

ERROR:INVALID INPUT If parameters are not valid.

1VV0301498 Rev. 2.0 221 2020-05-05

Page 222: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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 221, using the parameters specified by the AT+WAUTO and AT+NAUTO commands (see 7.4.4 Wireless Parameters, page 229 and 7.4.5 Network Parameters, page 231).

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 221.

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 214.

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.

1VV0301498 Rev. 2.0 222 2020-05-05

Page 223: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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.

Response

If 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.

1VV0301498 Rev. 2.0 223 2020-05-05

Page 224: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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 89).

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.

Response

This 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.

1VV0301498 Rev. 2.0 224 2020-05-05

Page 225: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

Parameter Description

Table 180, page 229 describes the Enable new auto mode parameters.

Synchronous Response

Table 181, page 230 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 178 Enable new auto mode Parameters

Parameter Optional/Mandatory Value Description

n MandatoryValue range: 0, 1

Default value: 1It specifies whether new auto mode is enabled or disabled.

Table 179 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.

1VV0301498 Rev. 2.0 225 2020-05-05

Page 226: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

7.4.3 Examples for Auto Connect Mode

This 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.

1VV0301498 Rev. 2.0 226 2020-05-05

Page 227: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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

1VV0301498 Rev. 2.0 227 2020-05-05

Page 228: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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

1VV0301498 Rev. 2.0 228 2020-05-05

Page 229: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

ATAOK

7.4.4 Wireless Parameters

This 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 180, page 229 describes the Wireless parameters.

Synchronous Response

Table 181, page 230 describes the synchronous responses and remarks for Wireless Parameters command.

Table 180 Wireless Parameters

Parameter Optional/Mandatory Value Type Description

mode Mandatory Value range: 0, 2STA

Limited-AP mode

It specifies if GS node can be configured as an STA mode or Limited-AP mode.

• 0: STA

• 2: Limited-AP

SSID (Service Set Identifier)

Mandatory

Any valid SSID (see 2.7.3 SSID and Passphrase, page 43) 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/AIt 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.

1VV0301498 Rev. 2.0 229 2020-05-05

Page 230: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

Table 181 Wireless Parameters Synchronous Responses

Responses Remarks

OK Success

ERROR:INVALID INPUT If parameters are not valid.

1VV0301498 Rev. 2.0 230 2020-05-05

Page 231: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

7.4.5 Network Parameters

This 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 182, page 231 describes the Network parameters.

Table 182 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: Server

Note: 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: TCP

Note: 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.

1VV0301498 Rev. 2.0 231 2020-05-05

Page 232: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

Synchronous Response

Table 183, page 232 describes the synchronous responses and remarks for Network Parameters command.

Asynchronous Response

Table 184, page 232 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 182 Network Parameters (Continued)

Parameter Optional/Mandatory Value Description

Table 183 Network Parameters Synchronous Responses

Responses Remarks

OK Success

ERROR:INVALID INPUT If parameters are not valid.

Table 184 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.

1VV0301498 Rev. 2.0 232 2020-05-05

Page 233: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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.

1VV0301498 Rev. 2.0 233 2020-05-05

Page 234: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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 185, page 234 describes the TCP Clients for IPv4 parameters.

Synchronous Response

Table 186, page 235 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 185 TCP Clients for IPv4 Parameters

Parameter Optional/Mandatory Value Description

Dest-Address Mandatory N/ADest-Address is the destination (server) IP address.

Port Mandatory N/A Port is the destination (server) port.

1VV0301498 Rev. 2.0 234 2020-05-05

Page 235: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

Asynchronous Response

Table 187, page 235 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 186 TCP Clients for IPv4 Synchronous Responses

Responses Remarks

CONNECT <CID>

OKSuccess 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 187 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.

1VV0301498 Rev. 2.0 235 2020-05-05

Page 236: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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

1VV0301498 Rev. 2.0 236 2020-05-05

Page 237: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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 188, page 237 describes the UDP Clients IPv4 parameters.

Synchronous Response

Table 189, page 237 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 188 UDP Clients IPv4 Parameters

Parameter Optional/Mandatory Value Description

Dest-Address Mandatory N/ADest-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 189 UDP Clients IPv4 Synchronous Responses

Responses Remarks

CONNECT <CID>

OKSuccessful 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 CIDGS node support only 16 CIDs, it will not create the next connection (i.e., 17th connection) when all 16 CIDs are being active.

1VV0301498 Rev. 2.0 237 2020-05-05

Page 238: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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 190, page 239 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.

1VV0301498 Rev. 2.0 238 2020-05-05

Page 239: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

Po

M

TC

Synchronous Response

Table 191, page 239 describes the synchronous responses and remarks for the TCP Server command.

Asynchronous Response

Table 192, page 240 describes the asynchronous responses and remarks for the TCP Sever command.

Table 190 TCP Server Parameters

Parameter Optional/Mandatory Value Description

rt Mandatory N/AThe interface opens a socket on the specified port and listens for connections.

ax client connection Optional

Value range: 0-9, a-f

Format: Integer

Default 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 8192

Format: Integer

Default value: 8192

It specifies the size of the TCP window server.

Table 191 TCP Server Synchronous Responses

Responses Remarks

CONNECT <CID>

OK

Example: CONNECT 0

Success

TCP connection successful. <CID> = the new CID in hexadecimal format.

DISCONNECT <CID>

Example: DISCONNECT 1Client 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.

1VV0301498 Rev. 2.0 239 2020-05-05

Page 240: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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 192 TCP Server Asynchronous Responses

Responses Remarks

CONNECT <SERVER_ID> <CLIENT_ID> <CLIENT IP> <CLIENT_PORT>

Example: CONNECT 0 1 192.168.17.2 50569

Where,

0 - server_cid

1 - client_cid

192.168.23.100 - client_ip

50569 - client_port

Success

Successful 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).

1VV0301498 Rev. 2.0 240 2020-05-05

Page 241: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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

1VV0301498 Rev. 2.0 241 2020-05-05

Page 242: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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 193, page 242 describes the UDP Server parameters.

Synchronous Response

Table 194, page 242 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 193 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 194 UDP Server Synchronous Responses

Responses Remarks

CONNECT <CID>

OK

Example: CONNECT 0

Success

UDP connection successful. CID is the new socket identifier allocated to the socket on GS node.

ERROR:SOCKET FAILURE <CID>

Example: ERROR: SOCKET FAILURE 0When 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.

1VV0301498 Rev. 2.0 242 2020-05-05

Page 243: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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 195, page 243 describes the Store TCP client configuration command parameters.

Synchronous Response

Table 196, page 244 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 195 Store TCP Client Configuration Parameters

Parameter Optional/Mandatory Value Description

CID MandatoryValue range: 0 to F

Format: HexadecimalIt specifies the socket identifier allocated to a socket on GS node.

1VV0301498 Rev. 2.0 243 2020-05-05

Page 244: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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 197, page 244 describes the Restore TCP client configuration command parameters.

Synchronous Response

Table 198, page 244 describes the synchronous responses and remarks for the Restore HTTP client configuration command.

Table 196 Store TCP Client Configuration Synchronous Responses

Responses Remarks

OK Success

ERROR: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 197 Restore TCP Client Configuration Parameters

Parameter Optional/Mandatory Value Description

CID MandatoryValue range: 0 to F

Format: HexadecimalIt specifies the socket identifier allocated to a socket on GS node.

Table 198 Restore TCP Client Configuration Synchronous Responses

Responses Remarks

OK Success

ERROR:INVALID INPUT If parameters are not valid.

1VV0301498 Rev. 2.0 244 2020-05-05

Page 245: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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 199, page 245 describes the DTLS Open parameters.

Synchronous Response

Table 200, page 245 describes the synchronous responses and remarks for the DTLS Open command.

Table 199 DTLS Open Parameters

Parameter Optional/Mandatory Value Description

CID Mandatory

Value range: 0 to F

Format: Hexadecimal

It specifies the socket identifier allocated to a socket on GS node.

Certificate Name Mandatory N/A Name given to a certificate

Client Certificate Name Mandatory N/A Name given to a client certificate

Client Key Name Mandatory N/A Key name of a client.

Table 200 DTLS Open Synchronous Responses

Responses Remarks

OK Success

ERROR:INVALID INPUT If parameters are not valid.

1VV0301498 Rev. 2.0 245 2020-05-05

Page 246: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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 201, page 246 describes the DTLS Close parameters.

Synchronous Response

Table 202, page 246 describes the synchronous responses and remarks for the DTLS Close command.

Table 201 DTLS Close Parameters

Parameter Optional/Mandatory Value Description

CID MandatoryValue range: 0 to F

Format: HexadecimalIt specifies the socket identifier allocated to a socket on GS node.

Table 202 DTLS Close Synchronous Responses

Responses Remarks

OK Success

ERROR:INVALID INPUT If parameters are not valid.

1VV0301498 Rev. 2.0 246 2020-05-05

Page 247: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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 203, page 247 describes the Store DTLS client configuration command parameters.

Synchronous Response

Table 204, page 247 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 203 Store DTLS Client Configuration Parameters

Parameter Optional/Mandatory Value Description

CID MandatoryValue range: 0 to F

Format: HexadecimalIt specifies the socket identifier allocated to a socket on GS node.

Table 204 Store DTLS Client Configuration Synchronous Responses

Responses Remarks

OK Success

ERROR:INVALID INPUT If parameters are not valid.

1VV0301498 Rev. 2.0 247 2020-05-05

Page 248: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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 205, page 248 describes the Restore DTLS client configuration command parameters.

Synchronous Response

Table 206, page 248 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 205 Restore DTLS Client Configuration Parameters

Parameter Optional/Mandatory Value Description

CID MandatoryValue range: 0 to F

Format: HexadecimalIt specifies the socket identifier allocated to a socket on GS node.

Table 206 Restore DTLS Client Configuration Synchronous Responses

Responses Remarks

OK Success

ERROR:INVALID INPUT If parameters are not valid.

1VV0301498 Rev. 2.0 248 2020-05-05

Page 249: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

7.5.2.5 Configure SSL

This 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 207, page 251 describes the SSL configuration parameters.

1VV0301498 Rev. 2.0 249 2020-05-05

Page 250: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

1VV0301498 Rev. 2.0 250 2020-05-05

Page 251: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

Table 207 Configuring SSL Parameters

Parameter Optional/Mandatory Value Description

Configuration ID Mandatory

Value Range:

1 to 9

Format:

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: Selective display of any ciphers.

1VV0301498 Rev. 2.0 251 2020-05-05

Page 252: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

The following table list the selective display of all cipher suites:

Configuration value MandatoryValue Range: N/A

Format: 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 connection

When Configuration ID is 3,the configuration value is:

0 - to disables signature algorithm extension

1 - to enables signature algorithm extension

When Configuration ID is 4,the configuration value is:

0 - to disables max fragment length extension

1 - to enables max fragment length extension

When Configuration ID is 5,the configuration value is:

0 - to enable SSL De-negotiation extension

1 - to disable SSL De- negotiation extension

When Configuration ID is 6, the configuration value is:

0 - set version to TLS is 1.0

1 - set version to TLS is 1.1

2 - set version to TLS is 1.2

The default version is 1.2

When Configuration ID is 7, the configuration value is:

0 - to disables ECC ciphers

1 - to enables ECC ciphers

When 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 32bit cipher, where each bit takes binary value of either 0 or 1.

Table 207 Configuring SSL Parameters (Continued)

Parameter Optional/Mandatory Value Description

1VV0301498 Rev. 2.0 252 2020-05-05

Page 253: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

Synchronous Response

Table 209, page 253 describes the synchronous responses and remarks for Closing SSL Connection command.

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

Table 208 Selective Display of all ECC Ciphers

Cipher Name Bit Position

TLS_RSA_WITH_AES_128_CBC_SHA 0

TLS_RSA_WITH_3DES_EDE_CBC_SHA 1

TLS_RSA_WITH_RC4_128_SHA 2

TLS_RSA_WITH_RC4_128_MD5 3

TLS_RSA_WITH_AES_256_CBC_SHA 4

TLS_RSA_WITH_AES_128_CBC_SHA256 5

TLS_RSA_WITH_AES_256_CBC_SHA256 6

TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256 7

TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 8

TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 9

TLS_ECDHE_ECDSA_WITH_AES_128_CCM_8 10

Table 209 Configuring SSL Synchronous Responses

Responses Remarks

OK Success

ERROR: INVALID INPUT If parameters are not valid.

1VV0301498 Rev. 2.0 253 2020-05-05

Page 254: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

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 Configure SSL Client to selectively display the cipher suite.(see, Table 208, page 253)AT+SSLCONF=7,1 /*Enable the Cipher suiteAT+SSLCONF=9,7f8 /*Selectively displays the ECC Cipher

from (3 to 10)AT+SSLCONF=9,E0 /* Selective display of ECC cipher-6,7 and 8AT+SSLCONF=9,2AA /*Selective display if alternate ECC cipher

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>]

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.

1VV0301498 Rev. 2.0 254 2020-05-05

Page 255: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

Parameter Description

Table 210, page 255 describes the SSL Connection Open parameters.

Synchronous Response

Table 211, page 255 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 210 SSL Connection Open Parameters

Parameter Optional/Mandatory Value Description

CID Mandatory

Value range: 0 to F

Format: 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 211 SSL Connection Open Synchronous Responses

Responses Remarks

OK Success

1VV0301498 Rev. 2.0 255 2020-05-05

Page 256: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

Table 212, page 256 describes the Closing SSL Connection parameters.

Synchronous Response

Table 213, page 256 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 212 Closing SSL Connection Parameters

Parameter Optional/Mandatory Value Description

CID Mandatory

Value range: 0 to F

Format: Hexadecimal

It specifies the socket identifier allocated to a socket on GS node.

Table 213 Closing SSL Connection Synchronous Responses

Responses Remarks

OK Success

ERROR: INVALID CIDDisplays error message for invalid connection identifier.

NOTE: SSL renegotiation is not supported after SSL restore.

1VV0301498 Rev. 2.0 256 2020-05-05

Page 257: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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 257

• SPI Interface, page 261

7.5.3.1.1 UART Interface

Table 214, page 257 describes the Data Handling using ESC key sequences on the UART interface.

NOTE: 1). Use flow control when data sent is greater than 2048 bytes. 2).Binary data transfer is not supported in Normal mode. 3).Software flow control is not supported in binary data transfer.

Table 214 Data Handling Using ESC Sequences on UART Interface

Flow Control Data Mode (Data Type)

Connection Type

Description and Escape <ESC> Command Sequence

SW or HW Normal (ASCII Text)TCP client

TCP 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

1VV0301498 Rev. 2.0 257 2020-05-05

Page 258: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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 214 Data Handling Using ESC Sequences on UART Interface (Continued)

Flow Control Data Mode (Data Type)

Connection Type

Description and Escape <ESC> Command Sequence

1VV0301498 Rev. 2.0 258 2020-05-05

Page 259: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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.

HWBulk (ASCII Text or text Binary)

TCP client

TCP 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

HWBulk (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 214 Data Handling Using ESC Sequences on UART Interface (Continued)

Flow Control Data Mode (Data Type)

Connection Type

Description and Escape <ESC> Command Sequence

1VV0301498 Rev. 2.0 259 2020-05-05

Page 260: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

HWBulk (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><client local port><space><data length><data>

Example: when receiving a 5 byte user data (e.g., Hello) on CID 1, the format will be:

<ESC>Y1192.168.0.101<1001><horizontaltab>0005Hello

HW Bulk (ASCII or Binary)

TCP client

TCP server

UDP 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/ABinary data transfer with software flow control not supported.

Table 214 Data Handling Using ESC Sequences on UART Interface (Continued)

Flow Control Data Mode (Data Type)

Connection Type

Description and Escape <ESC> Command Sequence

1VV0301498 Rev. 2.0 260 2020-05-05

Page 261: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

7.5.3.1.2 SPI Interface

Table 215, page 261 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 214 Data Handling Using ESC Sequences on UART Interface (Continued)

Flow Control Data Mode (Data Type)

Connection Type

Description and Escape <ESC> Command Sequence

Table 215 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 client

TCP 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.

1VV0301498 Rev. 2.0 261 2020-05-05

Page 262: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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/ABinary 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 215 Data Handling Using ESC Sequences on the SPI Interface (Continued)

Data Mode (Data Type) Connection Type Description and Escape <ESC> Command Sequence

1VV0301498 Rev. 2.0 262 2020-05-05

Page 263: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

Bulk (ASCII Text or Binary)

TCP client

TCP 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 215 Data Handling Using ESC Sequences on the SPI Interface (Continued)

Data Mode (Data Type) Connection Type Description and Escape <ESC> Command Sequence

1VV0301498 Rev. 2.0 263 2020-05-05

Page 264: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

Esc

col)

<ESC

<ESC

<ESC

<ESC

<ESC

<ESC

<ESCNote: Re

Table 216, page 264, 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 215 Data Handling Using ESC Sequences on the SPI Interface (Continued)

Data Mode (Data Type) Connection Type Description and Escape <ESC> Command Sequence

Table 216 Response for SPI Byte Protocol & SPI Block Protocol

ape Sequence Events Response

UART 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)

1VV0301498 Rev. 2.0 264 2020-05-05

Page 265: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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 217, page 266) 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 216 Response for SPI Byte Protocol & SPI Block Protocol (Continued)

ape Sequence Events Response

NOTE: This is the recommended data handling method.

1VV0301498 Rev. 2.0 265 2020-05-05

Page 266: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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 217 Escape Sequences

Operation Escape Sequence Description

Bulk 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.

1VV0301498 Rev. 2.0 266 2020-05-05

Page 267: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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 39 when MCU transmits bulk data.

1VV0301498 Rev. 2.0 267 2020-05-05

Page 268: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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 218, page 268 describes the HTTP client configuration parameters.

Table 218 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)

1VV0301498 Rev. 2.0 268 2020-05-05

Page 269: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

Synchronous Response

Table 219, page 269 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 limitedto 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 seconds

Minimum value: 10 milliseconds

Table 218 HTTP Client Configuration Parameters (Continued)

Parameter Optional/Mandatory Description

Table 219 HTTP Client Configuration Synchronous Responses

Responses Remarks

OKSuccess

Successful HTTP connection

ERROR: INVALID INPUTFailure

If parameters are not valid.

1VV0301498 Rev. 2.0 269 2020-05-05

Page 270: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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:

1VV0301498 Rev. 2.0 270 2020-05-05

Page 271: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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 220, page 271 describes the HTTP Client Configuration Removal parameters.

Table 220 HTTP Client Configuration Removal Parameters

Parameter Optional/Mandatory Description

Param MandatoryGS 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)

1VV0301498 Rev. 2.0 271 2020-05-05

Page 272: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

Synchronous Response

Table 221, page 272 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 222, page 272 describes the HTTP Client Connection Open parameters.

Table 221 HTTP Client Configuration Removal Synchronous Responses

Responses Remarks

OK Success

ERRORTrying 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 222 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 Disabled

1 SSL Enabled

1VV0301498 Rev. 2.0 272 2020-05-05

Page 273: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

Synchronous Response

Table 223, page 273 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 Optional25seconds (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 194).

Table 222 HTTP Client Connection Open Parameters (Continued)

Parameter Optional/Mandatory Value Description

Table 223 HTTP Client Connection Open Synchronous Responses

Responses Remarks

<CID> OK Success

ERROR

Failure

If parameters are not valid or if the command is issued before associating to the network.

1VV0301498 Rev. 2.0 273 2020-05-05

Page 274: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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.

1VV0301498 Rev. 2.0 274 2020-05-05

Page 275: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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

1VV0301498 Rev. 2.0 275 2020-05-05

Page 276: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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>**//

1VV0301498 Rev. 2.0 276 2020-05-05

Page 277: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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

1VV0301498 Rev. 2.0 277 2020-05-05

Page 278: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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 224, page 278 describes the Configuration to Receive Response Headers/Request Line parameters.

Table 224 Configuration to Receive Response Headers/Request Line Parameters

Parameter Optional/Mandatory Value Description

CID MandatoryValue range: 0 to F

Format: HexadecimalIt specifies the socket identifier allocated to a socket on GS node.

send status line Mandatory

0, 1

0: Do not receive response status line

1: Receive response status line

Default 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 225, page 279 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 225, page 279.

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

1VV0301498 Rev. 2.0 278 2020-05-05

Page 279: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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 226, page 280 describes the synchronous responses and remarks for Configuration to Receive Headers/Status Line command.

Table 225 Send HTTP Response Headers

Header Name/Value

GSN_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)

1VV0301498 Rev. 2.0 279 2020-05-05

Page 280: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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 227, page 280 describes the HTTP Client Get/Post parameters.

Table 226 Configuration to Receive Response Headers/Status Line Synchronous Responses

Responses Remarks

OK Success

ERROR:INVALID INPUTIf parameters are not valid and if GSLink is not enabled in the binary.

Table 227 HTTP Client Get/Post Parameters

Parameter Optional/Mandatory Value Description

CID MandatoryValue range: 0 to F

Format: HexadecimalIt specifies the socket identifier allocated to a socket on GS node.

Type MandatoryValue range: 1 to 7

Format: 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: Decimal

Unit: SecondsTimeout value is in seconds

Page Mandatory Format: StringThe page/script being accessed (e.g., /index.html)

1VV0301498 Rev. 2.0 280 2020-05-05

Page 281: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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 228, page 281 describes the synchronous responses and remarks for HTTP Client Get/Post command.

Size of data MandatoryFormat: String

Maximum 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

OptionalValue range: 0, 1

Format: 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 227 HTTP Client Get/Post Parameters (Continued)

Parameter Optional/Mandatory Value Description

Table 228 HTTP Client Get/Post Synchronous Responses

Responses Remarks

OK Success

ERROR:INVALID INPUT If parameters are not valid.

1VV0301498 Rev. 2.0 281 2020-05-05

Page 282: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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 229, page 282 describes the Store HTTP client configuration command parameters.

Synchronous Response

Table 230, page 282 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 229 Store HTTP Client Configuration Parameters

Parameter Optional/Mandatory Value Description

CID MandatoryValue range: 0 to F

Format: HexadecimalIt specifies the socket identifier allocated to a socket on GS node.

Table 230 Store HTTP Client Configuration Synchronous Responses

Responses Remarks

OK Success

ERROR:INVALID INPUT If parameters are not valid.

1VV0301498 Rev. 2.0 282 2020-05-05

Page 283: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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 231, page 283 describes the Restore HTTP client configuration command parameters.

Synchronous Response

Table 232, page 283 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 231 Restore HTTP Client Configuration Parameters

Parameter Optional/Mandatory Value Description

CID MandatoryValue range: 0 to F

Format: HexadecimalIt specifies the socket identifier allocated to a socket on GS node.

Table 232 Restore HTTP Client Configuration Synchronous Responses

Responses Remarks

OK Success

ERROR:INVALID INPUT If parameters are not valid.

1VV0301498 Rev. 2.0 283 2020-05-05

Page 284: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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 233, page 284 describes the Close HTTP client command parameters.

Synchronous Response

Table 234, page 284 describes the synchronous responses and remarks for the Store HTTP client configuration command.

Table 233 Close HTTP Client Parameters

Parameter Optional/Mandatory Value Description

CID MandatoryValue range: 0 to F

Format: HexadecimalIt specifies the socket identifier allocated to a socket on GS node.

Table 234 Close HTTP Client Synchronous Responses

Responses Remarks

OK Success

ERROR:INVALID INPUT If parameters are not valid.

1VV0301498 Rev. 2.0 284 2020-05-05

Page 285: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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 235, page 285 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 235 HTTPD Redirection Parameters

Parameter Optional/Mandatory Value Description

URL MandatoryMax URL length is 64 bytes

URL is the address of the redirection page.

1VV0301498 Rev. 2.0 285 2020-05-05

Page 286: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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 236, page 286 describes the Start/Stop Webserver parameters.

Table 236 Start/Stop Webserver Parameters

Parameter Optional/Mandatory Value Description

n MandatoryValue range: 0,1

Default 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,1It 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)

OptionalMaximum 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

1VV0301498 Rev. 2.0 286 2020-05-05

Page 287: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

Synchronous Response

Table 237, page 287 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 238, page 287 describes the synchronous responses and remarks for the Web server status command.

Table 237 Start/Stop Webserver Synchronous Responses

Responses Remarks

OK Success

ERROR: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 238 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>

Failure

If parameter is not valid.

<CR><LF>ERROR<CR><LF> Failure

When double question mark (??) is issued.

1VV0301498 Rev. 2.0 287 2020-05-05

Page 288: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

7.6.2.4 Send HTTP Request to AGPS Server

This command is used to fetch the details of the location (latitude, longitude and altitude) from the requesting node.

Command Syntax AT+AGPSSND=<Command>,[<Response Type>]

Parameter Description

Table 239, page 288 describes the Send HTTP Request to AGPS Server parameters.

NOTE: GS node supports 8 connections when established.

Table 239 Send HTTP Request to AGPS Server Parameters

Parameter Optional/Mandatory Value Description

Command MandatoryValue range: 0,1

Default value: 0It specifies the reference location of the requesting node.

Response Type MandatoryValue range: 0,1

Default value: 1

It specifies the type of response, where;

0 - indicates synchronous response and

1- indicates Asynchronous response.

1VV0301498 Rev. 2.0 288 2020-05-05

Page 289: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

Synchronous Response

Table 240, page 290 describes the synchronous responses and remarks for the Web server status command.

Format

HTTP Status Code

Value range: N/A

Default value: N/A

Format: Integer

It specifies the numeric status code received from the server.

Latitude

Value range: -90.0 to +90.0

Default value: N/A

Format: Decimal

Unit: Degrees

It specifies the latitude in degrees.

Longitude

Value range: -180.0 to +180.0

Default value: N/A

Format: Decimal

Unit: Degrees

It specifies the longitude in degrees.

Altitude

Value range: N/A

Default value: N/A

Format: Decimal

Unit: Meters

It specifies the altitude - the height above the Mean Sea level.

Uncertainty

Value range: N/A

Default value: N/A

Format: Decimal

Unit: Meters

It specifies the horizontal radius of uncertainty

Error Message

Value range: N/A

Default value: N/A

Format: String

Unit: N/A

It specifies the server error message recieved from the Error tag.

AGPS Data Size

Value range: N/A

Default value: N/A

Format: Integer

Unit: N/A

It specifies the number of bytes AGPS data (Assisted GPS) received from the server.

Table 239 Send HTTP Request to AGPS Server Parameters (Continued)

Parameter Optional/Mandatory Value Description

1VV0301498 Rev. 2.0 289 2020-05-05

Page 290: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

Example AT+AGPSSND=0,1#AGPSSND: 200,12.925748,77.631569,0.000000,50.000000,"",0OK

7.7 MQTT Client

Table 240 Send HTTP Request to AGPS Server Synchronous Responses

Responses Remarks

<HTTP Status Code>,<Latitude>,<Longitude>,<Altitude>,<Uncertainity>,<Error Message>,<AGPS Data Size>

OK

Success

ERRORFailure

If parameter is not valid.

NOTE: AT+AGPSSND=0,1 is the only combination that is supported and valid.

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.

1VV0301498 Rev. 2.0 290 2020-05-05

Page 291: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

P

HostNa

QDN) the

PortNue pecify d port.

ClientI Client cters.

UserNa t.

Passwo by the

SSLFla ver.

Certific

rver

7.7.1 MQTT Client Connect

This 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,<websocket>,<websockreq>,<keepAliveInterval>,<lwtEnable>,<willTopicName>,<willMsg>,<willQos>,<willRetain>]

Parameter Description

Table 241, page 291 describes the MQTT Client Connect configuration parameters.

Table 241 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 Mandatory

Default 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 chara

Example: GS2K_001122.

me Optional

Value range: N/A

Format: String

Default value: N/A

It specifies the UTF-8 encoded string along with thepassword used by the server to authenticate the clien

rd Optional

Value range: N/A

Format: Integer

Default value: N/A

It specifies the binary data used along with usernameserver to authenticate the cloud.It is mandatory for TELIT device cloud.

g Optional

0- Disable,

1-Enable

Default - 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.

1VV0301498 Rev. 2.0 291 2020-05-05

Page 292: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

ClientCName

be

ClientK be

Connec

websoc

websoc

keepAl

lwtEna

willTop ssage.

willMs e.

willQoto be

willRet

P

Synchronous Response

Table 242, page 292 describes the synchronous responses and remarks for MQTT Client Connect Configuration command.

Example 1 AT+MQTTCONNECT=api.devicewise.com,1883,gs2k_178db1,,,,,,,,,,,,1,/lwt,offline,0,1

Where,

HostName – api.devicewise.com

PortNumber – 1883

ertificate Optional N/A

It is required for SSL client authentication and mustprovisioned before using this parameter.

ey Name Optional N/AIt is required for SSL client authentication and mustprovisioned before using this parameter.

tionTimeout OptionalDefault - 30Seconds It provides the maximum time limit for setting the

connection with the server.

ket Optional N/A For future use

kreq Optional N/A For future use

iveInterval Optional N/A For future use

ble Optional

0- Disable,

1-Enable

Default - 0

This is used to enable the LWT support.

icName Optional N/A It provides the topic name to be used by the will me

g Optional N/A It has a variable length and contains the will messag

s OptionalDefault Value -0 It provides information about the quality of service

used by the LWT.

ain OptionalDefault Value -0 It provides information whether the will should be

published with the will retain.

Table 241 MQTT Client Connect Configuration Parameters (Continued)

arameter Optional/Mandatory Value Description

Table 242 MQTT Client Connect Configuration Synchronous Responses

Responses Remarks

<IP>:<xxx.xxx.xxx.xxx>

<CID>

OK

Success

<IP>:< xxx.xxx.xxx.xxx>

ERROR

Failure

If Invalid Server IP/Host/client ID/Token

ERROR: INVALID INPUTFailure

If parameters are not valid.

1VV0301498 Rev. 2.0 292 2020-05-05

Page 293: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

CID sing

Topiata

Leng

QoS

Reta

re

ge ed

ClientID - gs2k_178db1

lwtEnable – 1

willTopicName – /lwt

willMsg – Offline

willQos – 0/1

willRetain – 0/1

7.7.2 MQTT Client Publish

This 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 243, page 293 describes the MQTT Client Publish configuration parameters.

Synchronous Response

Table 243 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 StringIt identifies the information channel to which payload dis published.

th Mandatory N/A It is the actual content size.

Mandatory

0,1,2

Currently supported in 0 and 1 only

It specifies the level of assurance for delivery of the application message.

inFlag Optional0,1

Default - 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.

1VV0301498 Rev. 2.0 293 2020-05-05

Page 294: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

Table 244, page 294 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 Subscribe

This 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 245, page 295 describes the MQTT Client Subscribe configuration parameters.

Table 244 MQTT Client Publish Configuration Synchronous Responses

Responses Remarks

OK Success

ERROR: INVALID CIDFailure

Invalid Socket/Client Identifier.

ERROR: INVALID INPUTFailure

If parameters are not valid.

1VV0301498 Rev. 2.0 294 2020-05-05

Page 295: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

CID sing

Topiata

QoSan

Timeor

Synchronous Response

Table 246, page 295 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 Disconnect

This command is used to close the MQTT client connection identified by the CID.

Command Syntax AT+MQTTDISCONNECT=<CID>

Table 245 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 StringIt identifies the information channel to which payload dis published.

Mandatory

0,1,2

Currently supported in 0 and 1 only

It gives the maximum QoS level at which the Server csend Application Messages to the Client.

out OptionalDefault - 60Seconds

It provides the Subscription Acknowledge time limit fsetting up the acknowledgment from the server.

Table 246 MQTT Client Publish Configuration Synchronous Responses

Responses Remarks

OK Success

ERROR: INVALID CIDFailure

Invalid Socket/Client Identifier.

ERROR: INVALID INPUTFailure

If parameters are not valid.

1VV0301498 Rev. 2.0 295 2020-05-05

Page 296: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

CID sing

CID

Parameter Description

Table 247, page 296 describes the MQTT Client Disconnect configuration parameters.

Synchronous Response

Table 248, page 296 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 Client

This 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 249, page 296 describes the Store MQTT Client configuration parameters.

Table 247 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 248 MQTT Client Disconnect Configuration Synchronous Responses

Responses Remarks

OK Success

ERROR: INVALID CIDFailure

Invalid Socket/Client Identifier.

ERROR: INVALID INPUTFailure

If parameters are not valid.

Table 249 Store MQTT Client Configuration Parameters

Parameter Optional/Mandatory Value Description

Mandatory 0-9, a-fIt specifies the socket or the client identifier (CID) allocated to a socket on GS node.

1VV0301498 Rev. 2.0 296 2020-05-05

Page 297: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

CID

Synchronous Response

Table 250, page 297 describes the synchronous responses and remarks for Store MQTT Client Configuration command.

Example 1 AT+MQTTSTORE=0

7.7.6 Restore MQTT Client

This command is used to restore the connection parameters which was previously stored using AT+MQTTSTORE command

Command Syntax AT+MQTTRESTORE=<CID>

Parameter Description

Table 251, page 297 describes the Restore MQTT Client configuration parameters.

Synchronous Response

Table 252, page 297 describes the synchronous responses and remarks for Restore MQTT Client Configuration command.

Table 250 Store MQTT Client Configuration Synchronous Responses

Responses Remarks

OK Success

ERROR: INVALID CIDFailure

Invalid Socket/Client Identifier.

ERROR: INVALID INPUTFailure

If parameters are not valid.

Table 251 Restore MQTT Client Configuration Parameters

Parameter Optional/Mandatory Value Description

Mandatory0-9, a-f

Format: Hexadecimal

It specifies the socket or the client identifier (CID) allocated to a socket on GS node.

Table 252 Restore MQTT Client Configuration Synchronous Responses

Responses Remarks

OK Success

ERROR: INVALID CIDFailure

Invalid Socket/Client Identifier.

ERROR: INVALID INPUTFailure

If parameters are not valid.

1VV0301498 Rev. 2.0 297 2020-05-05

Page 298: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

CID

Time

Example 1 AT+MQTTRESTORE=0

7.7.7 MQTT Ping

This 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 253, page 298 describes the MQTT Ping configuration parameters.

Example 1 AT+MQTTPING=0,30

OK

7.7.8 Receive MQTT Data

GS 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 254, page 298 describes the Receive MQTT data (ESC N) parameters.

Table 253 MQTT Ping Configuration Parameters

Parameter Optional/Mandatory Value Description

Mandatory 0-9, a-fIt specifies the socket or the client identifier (CID) allocated to a socket on GS node.

out MandatoryDefault: 30Seconds.

It specifies the time taken to receive the MQTT ping response from MQTT server

Table 254 Receive MQTT Data (ESC N) Parameters

Parameter Optional/Mandatory Value Description

ESC N N/A N/AThis is sent repeatedly for each fragment of the data frame.

CID N/AValue range: 0 to F

Format: HexaDecimal

It specifies the socket identifier allocated to a socket on GS node.

StartOf Frame N/AValue range: 0,1

Format: 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.

1VV0301498 Rev. 2.0 298 2020-05-05

Page 299: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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: 4Bytes

Format: DecimalIt specifies the length of the current data.

Total Length Of Frame

N/AValue range: 4Bytes

Format: DecimalIt specifies the total length of the data.

TopicName N/A Format: StringIt identifies the information channel to which data is subscribed.

Table 254 Receive MQTT Data (ESC N) Parameters (Continued)

Parameter Optional/Mandatory Value Description

1VV0301498 Rev. 2.0 299 2020-05-05

Page 300: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

P

Parame

n er per

l with oxy ified

shing proxy

Paramelue is

h.

7.8 WebSocket Client

7.8.1 WebSocket Client Configuration

This 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 255, page 300 describes the WebSocket Client configuration parameters.

Synchronous Response

Table 256, page 301 describes the synchronous responses and remarks for WebSocket Client Configuration command.

Table 255 WebSocket Client Configuration Parameters

arameter Optional/Mandatory Value Description

terType Mandatory

Value: 1,2,3

1: Connection Header

2: Proxy Header

3: 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 pat

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>”.

1VV0301498 Rev. 2.0 300 2020-05-05

Page 301: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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 Configuration

This command is used to store the connection parameters of WebSocket client connected to a remote server.

Command Syntax AT+WEBSOCKSTORE=<CID>

Parameter Description

Table 257, page 301 describes the Store WebSocket Client configuration parameters.

Synchronous Response

Table 258, page 301 describes the synchronous responses and remarks for Store WebSocket Client Configuration command.

Table 256 WebSocket Client Configuration Synchronous Responses

Responses Remarks

OK Success

ERROR: INVALID INPUTFailure

If parameters are not valid.

Table 257 Store WebSocket Client Configuration Parameters

arameter Optional/Mandatory Value Description

Mandatory Value: 0 to FIt specifies the socket identifier allocated to a socketNode.

Table 258 Store WebSocket Client Configuration Synchronous Responses

Responses Remarks

OK Success

ERROR: INVALID INPUTFailure

If parameters are not valid.

1VV0301498 Rev. 2.0 301 2020-05-05

Page 302: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

P

CID in GS

P

Valueusing

7.8.3 Restore WebSocket Client Configuration

This command is used to restore the connection parameters previously stored through the command AT+WEBSOCKSTORE

Command Syntax AT+WEBSOCKRESTORE=<CID>

Parameter Description

Table 259, page 302 describes the Restore WebSocket Client configuration parameters.

Synchronous Response

Table 259, page 302 describes the synchronous responses and remarks for Restore WebSocket Client Configuration command.

7.8.4 Clear WebSocket Client Configuration

This command is used to remove the WebSocket client configuration.

Command Syntax AT+WEBSOCKCONFDEL=<Value>

Parameter Description

Table 261, page 302 describes the Clear WebSocket Client configuration parameters.

Table 259 Restore WebSocket Client Configuration Parameters

arameter Optional/Mandatory Value Description

Mandatory Value: 0 to FIt specifies the socket identifier allocated to a socketNode.

Table 260 Restore WebSocket Client Configuration Synchronous Responses

Responses Remarks

OK Success

ERROR: INVALID INPUTFailure

If parameters are not valid.

Table 261 Clear WebSocket Client Configuration Parameters

arameter Optional/Mandatory Value Description

Mandatory N/AIt removes the websocket configuration configured AT+WEBSOCKCONF.

1VV0301498 Rev. 2.0 302 2020-05-05

Page 303: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

P

HostNach the

PortNuan

Reques

SSLFla ver.

Synchronous Response

Table 262, page 303 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 Connection

This 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 263, page 303 describes the Open WebSocket Client Connection configuration parameters.

Table 262 Clear WebSocket Client Configuration Synchronous Responses

Responses Remarks

OK Success

ERROR Failure

ERROR: INVALID INPUTFailure

If parameters are not valid.

Table 263 Open WebSocket Client Connection Configuration Parameters

arameter Optional/Mandatory Value Description

me/IP Address Mandatory N/AIt 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 Optional

0- Disable,

1-Enable

Default - 0

Thia is used to enable the SSL connection to the ser

1VV0301498 Rev. 2.0 303 2020-05-05

Page 304: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

Certific

rver

ProxyL

ClientCName

be

ClientK be

Connec

P

Synchronous Response

Table 264, page 304 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/AIt is required for SSL client authentication and mustprovisioned before using this parameter.

tionTimeout OptionalDefault - 25Seconds It provides the maximum time limit for setting the

connection with the server.

Table 263 Open WebSocket Client Connection Configuration Parameters (Continued)

arameter Optional/Mandatory Value Description

Table 264 Open WebSocket Client Connection Configuration Synchronous Responses

Responses Remarks

<IP>:<xxx.xxx.xxx.xxx>

<CID>

OK

Success

ERROR

ERROR: INVALID INPUTFailure

If parameters are not valid.

1VV0301498 Rev. 2.0 304 2020-05-05

Page 305: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

P

CID

socket

N

Timeou

Length

IsBinarext or et to

7.8.6 Send Data with WebSocket Client

This 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 265, page 305 describes the Send Data with WebSocket Client configuration parameters.

Synchronous Response

Table 266, page 306 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 265 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 Text

1-Data is Binary

It specifies the data sent over WebSocket can be in TBinary format, by default the data type (opcode) is s“Text”

1VV0301498 Rev. 2.0 305 2020-05-05

Page 306: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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 Data

GS 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 267, page 306 describes the Receive WebSocket data (ESC I) parameters.

Table 266 Send Data with WebSocket Client Configuration Synchronous Responses

Responses Remarks

OK Success

ERROR

ERROR: INVALID INPUTFailure

If parameters are not valid.

Table 267 Receive WebSocket Data (ESC I) Parameters

Parameter Optional/Mandatory Value Description

ESC I N/A N/AThis is sent repeatedly for each fragment of the data frame.

CID N/AValue range: 0 to F

Format: HexaDecimal

It specifies the socket identifier allocated to a socket on GS node.

1VV0301498 Rev. 2.0 306 2020-05-05

Page 307: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

P

CID

socket

N

7.8.8 Close WebSocket Client

This command is used to close the WebSocket client connection identified by the Connection Identifier.

Command Syntax AT+WEBSOCKCLOSE=<CID>

Parameter Description

Table 268, page 307 describes the Close WebSocket Client configuration parameters.

Synchronous Response

Table 269, page 307 describes the synchronous responses and remarks for Close WebSocket Client Configuration command.

EndofMessege N/AValue range: 0,1

Format: 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,2

1: Text Data

2: Binary Data

Format: Byte

It specifies the data type in the WebSocket message.

Data Length N/AValue range: 4Bytes

Format: DecimalIt specifies the length of the data.

Table 267 Receive WebSocket Data (ESC I) Parameters (Continued)

Parameter Optional/Mandatory Value Description

Table 268 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 269 Close WebSocket Client Configuration Synchronous Responses

Responses Remarks

OK Success

ERROR: INVALID INPUTFailure

If parameters are not valid.

1VV0301498 Rev. 2.0 307 2020-05-05

Page 308: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

P

CID

socket

N

Time Oer.

Payload

Example 1 AT+WEBSOCKCLOSE=0

Where, 0 – Connection Identifier

7.8.9 WebSocket Ping

This 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 270, page 308 describes the WebSocket Ping configuration parameters.

Synchronous Response

Table 271, page 308 describes the synchronous responses and remarks for WebSocket Ping Configuration command.

Example AT+WEBSOCKPING=0,10,Gainspan

Table 270 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,295

Format: Integer

It specifies the time taken in seconds to receive the WebSocket ping response from the WebSocket serv

MandatoryValue Range:1 to 64 bytes

Format: StringIt specifies the number of bytes sent from GS node

Table 271 WebSocket Ping Configuration Synchronous Responses

Responses Remarks

OK Success

ERROR: INVALID INPUTFailure

If parameters are not valid.

1VV0301498 Rev. 2.0 308 2020-05-05

Page 309: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

P

CID

socket

N

Payload

7.8.10 WebSocket Pong

This 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 272, page 309 describes the WebSocket Pong configuration parameters.

Synchronous Response

Table 273, page 309 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 272 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 bytes

Format: StringIt specifies the number of bytes sent from GS node

Table 273 WebSocket Pong Configuration Synchronous Responses

Responses Remarks

OK Success

ERROR: INVALID INPUTFailure

If parameters are not valid.

1VV0301498 Rev. 2.0 309 2020-05-05

Page 310: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

Parameter Description

Table 274, page 310 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 withthe priority from left to right.

Synchronous Response

Table 275, page 311 describes the synchronous responses and remarks for CoAP Client Option Configuration command.

Table 274 CoAP Client Option Configuration Parameters

Parameter Values

GSN_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.

1VV0301498 Rev. 2.0 310 2020-05-05

Page 311: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

7.9.2 CoAP Client Option Configuration Removal

This command is used to remove the CoAP configuration specified by “param”.

Command Syntax AT+CoAPOPTCONFDEL=<Param>

Parameter Description

Table 276, page 311 describes the CoAP Client Option Configuration Removal parameters.

Table 275 CoAP Client Option Configuration Synchronous Responses

Responses Remarks

OK Success

ERROR Failure

Table 276 CoAP Client Option Configuration Removal Parameters

Parameter

GSN_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)

1VV0301498 Rev. 2.0 311 2020-05-05

Page 312: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

Synchronous Response

Table 277, page 312 describes the synchronous responses and remarks for CoAP Client Option Configuration Removal command.

7.9.3 CoAP Client Connection Open

This 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 278, page 313 describes the CoAP Client Connection Open parameters.

Table 277 CoAP Client Option Configuration Removal Synchronous Responses

Responses Remarks

OK Success

ERROR Failure

1VV0301498 Rev. 2.0 312 2020-05-05

Page 313: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

Note: 1. Certificates and Key must be in DER (encoded certificate file) format.

Table 278 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 Mandatory5683 (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, 1

Default 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.

1VV0301498 Rev. 2.0 313 2020-05-05

Page 314: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

Synchronous Response

Table 279, page 314 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 279 CoAP Client Connection Open Synchronous Responses

Responses Remarks

<CID>

OKSuccess

ERROR Failure

1VV0301498 Rev. 2.0 314 2020-05-05

Page 315: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

7.9.4 CoAP Client Connection Send

This 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 280, page 315 describes the CoAP Client Connection Send parameters.

Table 280 CoAP Client Connection Send Parameters

Parameter Optional/Mandatory Value Description

CID Mandatory

Value range: 0 to F

Format: 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: Seconds

Default 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.

1VV0301498 Rev. 2.0 315 2020-05-05

Page 316: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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 281, page 316 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/ALength of the payload sent with the request. Optional in case of GET.

payload type Optional

Format: String

Value range:

• text/plain;charset=utf-8

• application/line-format

• application/xml

• application/octet-stream

• 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 280 CoAP Client Connection Send Parameters (Continued)

Parameter Optional/Mandatory Value Description

Table 281 CoAP Client Connection Send Synchronous Responses

Responses Remarks

OK Success

ERROR Failure

1VV0301498 Rev. 2.0 316 2020-05-05

Page 317: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

7.9.5 CoAP Client Connection Close

This 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 282, page 317 describes the CoAP Client Connection Close parameters.

Synchronous Response

Table 283, page 317 describes the synchronous responses and remarks for CoAP Client Connection Close command.

Table 282 CoAP Client Connection Close Parameters

Parameter Optional/Mandatory Value Description

CID Mandatory

Value range: 0 to F

Format: Hexadecimal

It specifies the socket identifier allocated to a socket on GS node.

Table 283 CoAP Client Connection Close Synchronous Responses

Responses Remarks

OKConnection with the given CID is closed, and this CID can be used for future connection.

INVALID CID If any invalid CID is provided.

1VV0301498 Rev. 2.0 317 2020-05-05

Page 318: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

7.10 GSLink

GSLink 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.

1VV0301498 Rev. 2.0 318 2020-05-05

Page 319: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

7.10.2 Receive Request

When 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 284, page 319 describes the HTTP Request (GET/POST) parameters.

Example <ESC>K000221/gainspan/profile/mcu

Table 284 HTTP Request (GET/POST) Parameters

Parameter Optional/Mandatory Value Description

ESCK Mandatory N/AThis escape sequence is sent once the URL is fetched by the remote HTTP client.

CID Mandatory

Value range: 0 to F

Format: Hexadecimal

It specifies the socket identifier allocated to a socket on GS node.

Len MandatoryFormat: 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 3

Format: Decimal

It specifies the type used.

• 1: GET REQUEST

• 3: POST REQUEST

URI Mandatory Format: StringIt 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.

1VV0301498 Rev. 2.0 319 2020-05-05

Page 320: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

7.10.3 Enable XML Parser

This 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 285, page 320 describes the Enable XML Parser parameters.

Synchronous Response

Table 286, page 320 describes the synchronous responses and remarks for Enabling or disabling XML Parser on HTTP Data command.

7.10.4 Send XML Data

This 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 289, page 323 for parametric description of <ESC>G sequence

ESC G is to sent N times, one for each tag.

Table 285 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 286 Enable or Disable XML Parser Synchronous Responses

Responses Remarks

OK Success

ERROR:INVALID INPUTIf parameters are not valid.

(n value is other than 0 or 1)

1VV0301498 Rev. 2.0 320 2020-05-05

Page 321: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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 287, page 321 describes the Send XML Data parameters.

NOTE: MCU should send complete data as mentioned in AT+XMLSEND or AT+HTTPSEND commands.

Table 287 Send XML Data Parameters

Parameter Optional/Mandatory Value Description

CID MandatoryValue range: 0 to F

Format: HexadecimalIt specifies the socket identifier allocated to a socket on GS node.

Type MandatoryValue range: 6 or 7

Format: Decimal

It specifies the type used which is either GETRESP or POSTRESP

• 6 (GETRESP)

• 7 (POSTRESP)

Timeout Mandatory

Format: Decimal

Example:

AT+XMLSEND=0,7,100,//environment/sensor,info,1,1,5

Timeout is the HTTP timeout for the get/post.

Page URI Mandatory

Format: String

Default 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.

1VV0301498 Rev. 2.0 321 2020-05-05

Page 322: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

Synchronous Response

Table 288, page 322 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.

– 0: CID

– 0009: Length

– STATUS:OK: XML data in <tag>:<value> format.

Root tag name Mandatory

Format: String

Example: AT+XMLSEND=0.7,100,//environment/sensor,info,1,1,5

It specifies the Root tag of XML data.

N Optional

Format: Decimal

Example: 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,1

Example: 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 sent

Example: 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 287 Send XML Data Parameters (Continued)

Parameter Optional/Mandatory Value Description

Table 288 Send XML Data Synchronous Responses

Responses Remarks

OK Success

ERROR:INVALID INPUT If parameters are not valid.

1VV0301498 Rev. 2.0 322 2020-05-05

Page 323: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

7.10.5 Receive XML Data

GS node sends XML data using the following Escape <ESC> sequence

Asynchronous Data <ESC>G[Opcode]<Len><Tag name>:<Value>

Asynchronous Data Parameter Description

Table 289, page 323 describes the Receive XML data (ESC G) parameters.

Example Following example demonstrate the message exchange between the Web clients, GS-Link Feature and Host MCU for HTTP POST request.

When the Web client does the HTTP POST of the following XML data on URL: "/gainspan/profile/tls"

<conf> <network> <ip>192.168.240.1</ip> <port>9100</port> </network> <serial> <comport>10</comport> <baudrate>115200</baudrate> </serial></conf>

The GSLink Feature will pass the following content to Host:

• Sequence of Characters received by HOST MCU for URL:<ESC>K000223/gainspan/profile/tls

Table 289 Receive XML Data (ESC G) Parameters

Parameter Optional/Mandatory Value Description

ESC G N/A N/AThis is sent repeatedly for each tag for the XML data.

Opcode N/A

Value range: 9998, 9997, 9996, 0000

Format: 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-9999

Format: 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/AIt 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.

1VV0301498 Rev. 2.0 323 2020-05-05

Page 324: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

• Sequence of Characters received by HOST MCU for Data:<ESC>G99980007network<ESC>G0016ip:192.168.240.1<ESC>G0009port:9100<ESC>G9997

<ESC>G99980006serial<ESC>G0010comport:10<ESC>G0015baudrate:115200<ESC>G9997<ESC>G0000

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 290, page 324 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 280, and it is only relevant for GSLink.

Table 290 Send Raw HTTP Data Parameters

Parameter Optional/Mandatory Value Description

CID MandatoryValue range: 0 to F

Format: HexadecimalIt specifies the socket identifier allocated to a socket on GS node.

Type MandatoryValue range: 6 or 7

Format: Decimal

GSN_HTTP_METHOD_GETRESP (6)

GSN_HTTP_METHOD_POSTRESP (7)

Timeout MandatoryFormat: Decimal

Unit: SecondsTimeout value is in seconds

Page Mandatory Format: StringThe page/script being accessed (e.g., /index.html)

1VV0301498 Rev. 2.0 324 2020-05-05

Page 325: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

Size of data Optional Format: String

Actual 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

OptionalValue range: 0,1

Format: 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

OptionalValue 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 290 Send Raw HTTP Data Parameters (Continued)

Parameter Optional/Mandatory Value Description

1VV0301498 Rev. 2.0 325 2020-05-05

Page 326: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

Synchronous Response

Table 291, page 326 describes the synchronous responses and remarks for sending Raw HTTP Data command.

7.10.7 Receive Raw HTTP Data

MCU receives raw HTTP data using the following Escape <ESC> sequence:

Asynchronous Data <ESC>H<CID><Length of data><data>

Asynchronous Data Parameter Description

Table 292, page 326 describes the Receive Raw HTTP Data (ESC H) parameters.

Table 291 Send Raw HTTP Data Synchronous Responses

Responses Remarks

OK Success

ERROR:INVALID INPUT If parameters are not valid.

Table 292 Receive Raw HTTP Data (ESC H) Parameters

Parameter Optional/Mandatory Value Description

ESCH N/A Format: StringThis 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/AFormat: 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

1VV0301498 Rev. 2.0 326 2020-05-05

Page 327: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

7.10.8 Enable JSON Data

This 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 293, page 327 describes the Enable or disable JSON Parser on HTTP Data parameters.

Synchronous Response

Table 294, page 327 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 331

Table 293 Enable or Disable JSON Parser on HTTP Data Parameters

Parameter Optional/Mandatory Value Description

n MandatoryValue range: 0, 1

Format: Decimal

If n is 0, JSON parser is disabled. If n is 1, JSON parser is enabled.

• 0: Disable

• 1: Enable

Table 294 Enable or Disable JSON Parser on HTTP Data Synchronous Responses

Responses Remarks

OK Success

ERROR:INVALID INPUTIf parameters are not valid.

(n value is other than 0 or 1)

1VV0301498 Rev. 2.0 327 2020-05-05

Page 328: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

7.10.9 Send JSON Data

This 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 289, page 323 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

1VV0301498 Rev. 2.0 328 2020-05-05

Page 329: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

Parameter Description

Table 295, page 329 describes the Send JSON Data parameters.

Synchronous Response

Table 296, page 329 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 289, page 323*//

Table 295 Send JSON Data Parameters

Parameter Optional/Mandatory Value Description

CID MandatoryValue range: 0 to F

Format: HexadecimalIt specifies the socket identifier allocated to a socket on GS node.

Type MandatoryValue range: 6, 7

Format: Decimal

GSN_HTTP_METHOD_GETRESP (6)

GSN_HTTP_METHOD_POSTRESP (7)

Timeout Mandatory Format: Decimal Timeout value is in seconds

URI MandatoryFormat: String

Default 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 296 Send JSON Data Synchronous Responses

Responses Remarks

OK Success

ERROR:INVALID INPUT If parameters are not valid.

1VV0301498 Rev. 2.0 329 2020-05-05

Page 330: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

7.10.10 Receive JSON Data

MCU receives JSON data using the following Escape <ESC> sequence

Asynchronous Data <ESC>G<CID>[Opcode]<Len><Object name>:<Value>

Asynchronous Data Parameter Description

Table 289, page 323 describes the Receive JSON data (ESC G) parameters.

Table 297 Receive JSON Data (ESC G) Parameters

Parameter Optional/Mandatory Value Description

ESC G N/A N/AThis is sent repeatedly for each object of the JSON data.

CID N/A

Value range: 0 to F

Format: Decimal

It specifies the socket identifier allocated to a socket on GS node.

Opcode N/A

Value range: 9998, 9997, 9996, 0000

Format: 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•

1VV0301498 Rev. 2.0 330 2020-05-05

Page 331: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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 298, page 331 describes the URI Modification parameters.

Len N/A

Value range: 0000-9999

Format: 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/AIt specifies name of the JSON tag being sent as part of HTTP data.

Value N/A Format: N/AIt specifies the value corresponding to the object name.

Table 297 Receive JSON Data (ESC G) Parameters (Continued)

Parameter Optional/Mandatory Value Description

Table 298 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 4

Format: Decimal

Content type for the URI.

• 0: application/xml (default)

• 1: application/json

• 2: application/html

• 3: Img/gif

• 4: application/octet-stream

1VV0301498 Rev. 2.0 331 2020-05-05

Page 332: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

Send CGI arguments Optional

Value range: 0, 1

Format: Decimal

Default value: 0

• 0: Do not forward CGI arguments to MCU.

• 1: Forward all CGI arguments to MCU.

Send request line Optional

Value range: 0, 1

Format: Decimal

Default value: 0

• 0: Do not forward request line to MCU.

• 1: Forward request line to MCU.

Send HTTPD Headers OptionalValue range: 1 to FFFFFFFF

Format: 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 299, page 332.

Example: If this parameter is set as FFFFFFFF, then all the headers listed in Table 299, page 332 are enabled.

Table 298 URI Modification Parameters (Continued)

Parameter Optional/Mandatory

Value Description

Table 299 Send HTTPD Headers

Header Name/Value

GSN_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)

1VV0301498 Rev. 2.0 332 2020-05-05

Page 333: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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 300, page 333 describes the synchronous responses and remarks for URI Modification command.

Example AT+HTTPRECVCONF=0,1,ffffffff

7.10.12 Receive CGI Arguments

MCU 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 301, page 334 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 299 Send HTTPD Headers (Continued)

Header Name/Value

Table 300 URI Modification Synchronous Responses

Responses Remarks

OK Success

ERROR:INVALID INPUT If parameters are not valid.

1VV0301498 Rev. 2.0 333 2020-05-05

Page 334: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

Table 301 Receive CGI Arguments (ESC G) Parameters

Parameter Optional/Mandatory Description

ESC G Mandatory This is sent repeatedly for each CGI argument.

CID MandatoryIt specifies the socket identifier allocated to a socket on GS node.

Reserved length value MandatoryReserved 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 MandatoryThe 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.

1VV0301498 Rev. 2.0 334 2020-05-05

Page 335: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

7.10.13 Receive Request Line

MCU 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 302, page 335 describes the Receive request line (ESC G) parameters.

Table 302 Receive Request Line (ESC G) Parameters

Parameter Optional/Mandatory Description

ESC G Mandatory This is sent repeatedly for each CGI argument.

CID MandatoryIt specifies the socket identifier allocated to a socket on GS node.

Reserved length value MandatoryReserved 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 MandatoryRequest uri string with size equal to <Length - 1> bytes.

1VV0301498 Rev. 2.0 335 2020-05-05

Page 336: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

7.10.14 Receive HTTP Headers

MCU 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 303, page 336 describes the Receive HTTP Headers (ESC G) parameters.

Table 303 Receive HTTP Headers (ESC G) Parameters

Parameter Optional/Mandatory Description

ESC G Mandatory This is sent repeatedly for each CGI argument.

CID MandatoryIt specifies the socket identifier allocated to a socket on GS node.

Reserved length value MandatoryReserved 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.

1VV0301498 Rev. 2.0 336 2020-05-05

Page 337: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

7.11 Multicast

7.11.1 IP Multicast Join

This command is used to join the specified multicast group (specified by the Group IP address).

Command Syntax AT+NIPMULTICASTJOIN=<Group IP>

Synchronous Response

Table 304, page 337 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 304 IP Multicast Join Synchronous Responses

Responses Remarks

OKSuccess

Prior to issuing this command, the GS node needs to be associated with a network.

ERROR Failure

ERROR: INVALID INPUT If parameter is not valid.

DISASSOCIATED If GS node is not associated with any network.

1VV0301498 Rev. 2.0 337 2020-05-05

Page 338: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

7.11.2 IP Multicast Leave

This command is used to leave the specified multicast group (specified by the IP address).

Command Syntax AT+NIPMULTICASTLEAVE=<Group IP>

Synchronous Response

Table 305, page 338 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 305 IP Multicast Leave Synchronous Responses

Responses Remarks

OK Success

ERRORFailure

If the given "Group IP" is wrong.

1VV0301498 Rev. 2.0 338 2020-05-05

Page 339: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

7.11.3 Enable Multicast Reception

This 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 306, page 339 describes the Enable/Disable Multicast Reception parameters.

Synchronous Response

Table 307, page 339 describes the synchronous responses and remarks for the Enable/Disable Multicast Reception command.

Table 306 Enable/Disable Multicast Reception Parameters

Parameter Optional/Mandatory Value Description

n Mandatory

0

Disable

802.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)

Enable

802.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 237).

NOTE: 1.) Multicast reception disable is supported only in station mode.

Table 307 Enable/Disable Multicast Reception Synchronous Responses

Responses Remarks

OK Success

ERROR:INVALID INPUTIf parameters are not valid

(If n value is other than 0 or 1)

1VV0301498 Rev. 2.0 339 2020-05-05

Page 340: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

Example Use Case

Table 308, page 340 lists the use cases for the Enable/Disable Multicast Reception.

Table 308 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 CareSetting 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.

1VV0301498 Rev. 2.0 340 2020-05-05

Page 341: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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

1VV0301498 Rev. 2.0 341 2020-05-05

Page 342: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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 342

• Application Features, page 367

8.1 Network

8.1.1 Ping

This 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 309, page 342 describes the Ping parameters.

Table 309 Ping Parameters

Parameter Optional/Mandatory Value Description

IP Address/ host name

Mandatory N/AThe 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.

1VV0301498 Rev. 2.0 342 2020-05-05

Page 343: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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 309 Ping Parameters

Parameter Optional/Mandatory Value Description

1VV0301498 Rev. 2.0 343 2020-05-05

Page 344: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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 310, page 344 describes the synchronous responses and remarks for the mDNS Module Initialization command.

Example AT+MDNSSTARTOK

Table 310 mDNS Module Initialization Synchronous Responses

Responses Remarks

OKSuccess

Prior to issuing of this command the node should be associated to the network.

ERRORFailure

If the node is not associated before issuing this command.

1VV0301498 Rev. 2.0 344 2020-05-05

Page 345: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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 311, page 345 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 312, page 345 describes the mDNS Host Name Registration parameters.

Synchronous Response

Table 313, page 346 describes the synchronous responses and remarks for the mDNS Host Name Registration command.

Table 311 mDNS Status Synchronous Responses

Responses Remarks

MDNS Started

OK

MDNS Stopped

OK

Success

ERROR: INVALID INPUT If parameter is not valid.

Table 312 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.”

1VV0301498 Rev. 2.0 345 2020-05-05

Page 346: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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 314, page 346 describes the mDNS Host Name De-Registration parameters.

Synchronous Response

Table 315, page 347 describes the synchronous responses and remarks for the mDNS Host Name De-Registration command.

Table 313 mDNS Name Registration Synchronous Responses

Responses Remarks

OK

Registration Success!! for RR: <Host name>

Success

Prior to issue this command, the node should be associated to the network.

ERRORFailure

If the node is not started in mDNS module, before issuing this command.

Table 314 mDNS Host Name De-Registration Parameters

Parameter Optional/Mandatory Value Description

Host name Mandatory N/AHost name is the host name which is registered using AT+MDNSHNREG.

Domain name Mandatory N/ADomain name is the domain name which is registered using AT+MDNSHNREG.

1VV0301498 Rev. 2.0 346 2020-05-05

Page 347: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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 316, page 347 describes the mDNS Services Registration parameters.

Table 315 mDNS Host Name De-Registration Synchronous Responses

Responses Remarks

OKSuccess

Prior to issuing this command the node should be registered with the host name.

ERROR:INVALID INPUTFailure

Before issuing this command, if the node is not registered with a host name.

Table 316 mDNS Services Registration Parameters

Parameter Optional/Mandatory

Value Description

ServiceInstanceName Mandatory N/AThis parameter specifies the name of the service. It can take up to 256 characters.

ServiceSubType Optional N/AThis parameter specifies the name of the service subtype if any.

ServiceType Mandatory N/AThis parameter specifies the type of service, such as HTTP, FTP, and so on.

Protocol Mandatory N/AThis parameter specifies the protocol used (TCP, UDP).

Domain Mandatory N/AThis parameter specifies the name of the domain and it should be “local”.

Port Mandatory N/AThis parameter specifies the port number used for communication (80 for HTTP).

1VV0301498 Rev. 2.0 347 2020-05-05

Page 348: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

Synchronous Response

Table 317, page 348 describes the synchronous responses and remarks for the mDNS Services Registration command.

DefaultKey Mandatory

0, 1, 2

Maximum 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, 2

Maximum 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 316 mDNS Services Registration Parameters (Continued)

Parameter Optional/Mandatory

Value Description

Table 317 mDNS Services Registration Synchronous Responses

Responses Remarks

OK Success

ERROR:INVALID INPUT

Failure

Command AT+MDNSSRVREG is issued. Before issuing AT+MDNSSTART (i.e, the node is not started with an MDNS module)

1VV0301498 Rev. 2.0 348 2020-05-05

Page 349: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

Asynchronous Response

Table 318, page 349 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 318 mDNS Services Registration Asynchronous Responses

Responses Remarks

OK

Registration Success!! for RR:<ServiceInstanceName>

Success

Prior to issuing this command, the node should be started with a mDNS module.

OK

Registration Failed!! for RR:<ServiceInstanceName>

Failure

Prior to issuing this command, the node should be started with a mDNS module.

1VV0301498 Rev. 2.0 349 2020-05-05

Page 350: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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 319, page 350 describes the mDNS Services De-Registration parameters.

Synchronous Response

Table 320, page 350 describes the synchronous responses and remarks for the mDNS Services De-Registration command.

Table 319 mDNS Services De-Registration Parameters

Parameter Optional/Mandatory Value Description

ServiceInstanceName Mandatory N/AServiceInstanceName is the name of the service. It can take up to 256 characters.

ServiceSubType Optional N/AServiceSubType is the name of the service subtype if any.

ServiceType Mandatory N/AServiceType 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 320 mDNS Services De-Registration Synchronous Responses

Responses Remarks

OK

Success

Prior to issuing this command, the node should be registered with the mDNS service through AT+MDNSSRVREG.

ERROR:INVALID INPUTFailure

Invalid parameters.

1VV0301498 Rev. 2.0 350 2020-05-05

Page 351: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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 321, page 351 describes the synchronous responses and remarks for the mDNS Services Announce command.

Example AT+MDNSANNOUNCEOK

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 322, page 351 describes the mDNS Service Discover parameters.

Table 321 mDNS Services Announce Synchronous Responses

Responses Remarks

OKSuccess

Prior to issuing this command, the node should start the mDNS module.

ERRORFailure

Before issuing this command, the node is not started with an mDNS module.

Table 322 mDNS Service Discover Parameters

Parameter Optional/Mandatory Value Description

ServiceSubType Optional N/AServiceSubType is the name of the service subtype if any.

ServiceType Optional N/AServiceType 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”

1VV0301498 Rev. 2.0 351 2020-05-05

Page 352: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

Synchronous Response

Table 323, page 352 describes the synchronous responses and remarks for the mDNS Service Discover command.

Asynchronous Response

Table 324, page 352 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 323 mDNS Service Discover Synchronous Responses

Responses Remarks

OK

A Service Discovered: <No of service discovered>

Service Instance name= Prov

Service app protocol= _http

Service protocol= _tcp

Service domain= local

Service IP address= <IP Address Port> = <Port>

Service Text Info= path=/<xxxx.html>

Success

Note: Prior to issuing this command, the node should start the mDNS module and should register the services.

ERROR:INVALID INPUTFailure

Before issuing this command, the node has not started with the mDNS module.

Table 324 mDNS Service Discover Asynchronous Responses

Responses Remarks

OK Success

OK

Service Discovery Failed

Failure

Prior to issuing this command, the node should start the mDNS module and should register the services.

1VV0301498 Rev. 2.0 352 2020-05-05

Page 353: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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

1VV0301498 Rev. 2.0 353 2020-05-05

Page 354: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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 325, page 354 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 325 mDNS Module De-Initialization Synchronous Responses

Responses Remarks

OKSuccess

Prior to issuing this command, the node should start the mDNS module.

ERRORFailure

Executing the command second time or more then once.

1VV0301498 Rev. 2.0 354 2020-05-05

Page 355: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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

1VV0301498 Rev. 2.0 355 2020-05-05

Page 356: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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 326, page 356 describes the DNS Lookup (Client) parameters.

Table 326 DNS Lookup (Client) Parameters

Parameter Optional/Mandatory Value Description

URL 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.

1VV0301498 Rev. 2.0 356 2020-05-05

Page 357: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

Synchronous Response

Table 327, page 357 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 327 DNS Lookup (Client) Synchronous Responses

Responses Remarks

IP:<ip address>

OK

Success

Prior to issuing this command the node should be associated to the network.

ERROR

Failure

If the node is not associated before issuing this command (Valid command is executed but DNS lookup fails).

ERROR:INVALID INPUTFailure

If valid command is not executed.

1VV0301498 Rev. 2.0 357 2020-05-05

Page 358: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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 183). 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 328, page 358 describes the ARP Cache Enable parameters.

Synchronous Response

Table 329, page 358 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 328 ARP Cache Enable Parameters

Parameter Optional/Mandatory Value Description

Enable Mandatory

1 - Enable (Default value)

Start caching

0 - Disable Stop caching

Table 329 ARP Cache Enable Synchronous Responses

Responses Remarks

OKSuccess

Prior to issuing this command the node should be associated to the network.

ERROR:INVALID INPUT

Failure

If the parameters are not valid.

(value other than 0 or 1)

1VV0301498 Rev. 2.0 358 2020-05-05

Page 359: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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 330, page 359 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 331, page 359 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 330 ARP Delete Synchronous Responses

Responses Remarks

OK Success

Table 331 ARP Entry Listing Synchronous Responses

Responses Remarks

Macaddress:IP address

OK

Success

Displays 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 INPUTFailure

If parameters are invalid (value other than ?).

1VV0301498 Rev. 2.0 359 2020-05-05

Page 360: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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 332, page 360 describes the ARP Entry Set parameters.

Synchronous Response

Table 333, page 360 describes the synchronous responses and remarks for the ARP Entry Set command.

Table 332 ARP Entry Set Parameters

Parameter Optional/Mandatory Description

Ip address Mandatory xxxx.xxxx.xxxx.xxxx format.

Mac address Mandatory xx:xx:xx:xx:xx:xx format.

Table 333 ARP Entry Set Synchronous Responses

Responses Remarks

OK Success

ERROR Failure

1VV0301498 Rev. 2.0 360 2020-05-05

Page 361: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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 334, page 361 describes the ARP Entry Delete parameters.

Synchronous Response

Table 335, page 361 describes the synchronous responses and remarks for the ARP Entry Delete command.

Table 334 ARP Entry Delete Parameters

Parameter Optional/Mandatory Description

Ip address Mandatory xxxx.xxxx.xxxx.xxxx format.

Mac address Mandatory xx:xx:xx:xx:xx:xx format.

Table 335 ARP Entry Delete Synchronous Responses

Responses Remarks

OK Success

ERRORFailure

If the ARP is entry is not found in the table.

1VV0301498 Rev. 2.0 361 2020-05-05

Page 362: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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 336, page 362 describes the parameter in ARP Learning command.

Parameter Description

Table 336, page 362 describes the ARP Learning parameters.

Synchronous Response

Table 337, page 362 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 336 ARP Learning Parameters

Parameter Optional/Mandatory Value Description

n Mandatory

0: Enable

1: Disable

Default 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 337 ARP Learning Synchronous Responses

Responses Remarks

OK Success

ERROR Failure - When the parameter is other than 0 or 1.

1VV0301498 Rev. 2.0 362 2020-05-05

Page 363: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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 338, page 363 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 339, page 363 describes the ARP Resolve parameters.

Synchronous Response

Table 340, page 363 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 338 Gratuitous ARP Synchronous Responses

Responses Remarks

OK Success

ERROR:INVALID INPUTIf the command is provided with any input values.

Example: AT+GRATARP=0.

Table 339 ARP Resolve Parameters

Parameter Optional/Mandatory Description

IP address Mandatory xxx.xxx.xxx.xxx format.

Table 340 ARP Resolve Synchronous Responses

Responses Remarks

OK Success

ERROR:INVALID INPUT For invalid input

1VV0301498 Rev. 2.0 363 2020-05-05

Page 364: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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

1VV0301498 Rev. 2.0 364 2020-05-05

Page 365: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

8.1.5 NAT Functionality

This 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 341, page 366 describes the Enable NAT parameters.

NOTE: Only the Host MCU does the Dial-Up not the S2W firmware.

1VV0301498 Rev. 2.0 365 2020-05-05

Page 366: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

En

W

.

men

s

N

t

Synchronous Response

Table 341, page 366 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 341 Enable NAT Parameter

Parameter Optional/Mandatory Value Description

able/Disable Mandatory1-Enable,

0-DisableIt 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 - 512It specifies the maximum number of entriein 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 342 Enable NAT Synchronous Responses

Responses Remarks

OK Success

ERROR:INVALID INPUT For invalid input

1VV0301498 Rev. 2.0 366 2020-05-05

Page 367: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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 343, page 367 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 343 FWUP Configuration Parameter Values

Parameters Value

0 Server IP address

1 Server Port

2 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)

6CA certification name (if it is already been added using the AT+TCERTADD command)

7 GS2000 binary request URL

1VV0301498 Rev. 2.0 367 2020-05-05

Page 368: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

Synchronous Response

Table 344, page 368 describes the synchronous responses and remarks for the FWUP Configuration command.

9 Server host name

10 GS2000 sigure binary request URL

11

Values: 0 or 1

0: 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 249) command should be configured before enabling domain name check using this parameter.

• AT+LOGLVL (See 11.3.1 Log Level, page 498) 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 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.

Table 343 FWUP Configuration Parameter Values

Parameters Value

Table 344 FWUP Configuration Synchronous Responses

Responses Remarks

OK Success

ERROR:INVALID INPUT For invalid input

1VV0301498 Rev. 2.0 368 2020-05-05

Page 369: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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 344, page 368 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 346, page 369 describes the synchronous responses and remarks for FWUP rollback command.

Table 345 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 346 FWUP Rollback Synchronous Responses

Responses Remarks

Serial2WiFi App

Note: HW Crypto Boot when rolled back to 5.1.5 or its previous versions.

Success

ERRORIf the rollback to the previous firmware version fails.

1VV0301498 Rev. 2.0 369 2020-05-05

Page 370: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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 347, page 370 describes the synchronous responses and remarks for Firmware information command.

Table 347 Firmware Information Synchronous Responses

Responses Remarks

CURRENT

APP VERSION=5.2.0.1

GEPS VERSION=5.2.0.1

WLAN VERSION=5.2.0.1

BACKUP

APP VERSION=5.2.0.1

GEPS VERSION=5.2.0.1

WLAN VERSION=5.2.0.1

BACKUP-1

APP VERSION=5.2.0.1

GEPS VERSION=5.2.0.1

WLAN VERSION=5.2.0.1

OK

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.

CURRENT

APP VERSION=5.2.0.1

GEPS VERSION=5.2.0.1

WLAN VERSION=5.2.0.1

BACKUP

APP VERSION=0

GEPS VERSION=0

WLAN VERSION=0

BACKUP-1

APP VERSION=0

GEPS VERSION=0

WLAN VERSION=0

OK

ERRORIf version information is not available in control block.

1VV0301498 Rev. 2.0 370 2020-05-05

Page 371: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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 signature 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>

1VV0301498 Rev. 2.0 371 2020-05-05

Page 372: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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.

1VV0301498 Rev. 2.0 372 2020-05-05

Page 373: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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 348, page 373 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 348 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 Mandatory

0- Binary Format

1- Hex Format

2- 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/AThis parameter specifies the size of digital sigure or firmware in bytes.

1VV0301498 Rev. 2.0 373 2020-05-05

Page 374: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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 349, page 374 describes the synchronous responses and remarks for the OTHFU Start.

Asynchronous Response

Table 350, page 374 describes the asynchronous responses and remarks for the OTHFU Start command.

Table 349 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 350 OTHFU Start Asynchronous Responses

vents Verbose mode Non Verbose mode Remar

Asynchronous Enhanced Asynchronous AsynchronousEnhanced 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

1VV0301498 Rev. 2.0 374 2020-05-05

Page 375: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

8.2.2 HomeKit

8.2.2.1 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 351, page 376 describes the add accessory 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.

1VV0301498 Rev. 2.0 375 2020-05-05

Page 376: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

Synchronous Response

Table 352, page 376 describes the synchronous responses and remarks for Add accessory command.

8.2.2.2 Delete Accessory

Command Syntax AT+HKDAC=<Accessory ID>

Parameter Description

Table 353, page 376 describes the Delete accessory command parameters.

Synchronous Response

Table 354, page 376 describes the synchronous responses and remarks for Delete accessory command.

Table 351 Add Accessory Parameters

Parameter Optional/Mandatory Value Description

Accessory ID Mandatory

Value range: 1 to 10

Format: Integer

Default value: N/A

It specifies the identifier of the newly added accessory.

Number of services Mandatory

Value range: 1 to 100

Format: Integer

Default value: N/A

It indicates the number of services supported by the added accessory.

Note: This number is not used.

Table 352 Add Accessory Responses

Responses Remarks

OK Success

ERROR:INVALID INPUT If parameters are not valid.

Table 353 Delete Accessory Parameters

Parameter Optional/Mandatory Value Description

Accessory ID Mandatory

Value range: 1 to 10

Format: Integer

Default value: N/A

It specifies the identifier of the added accessory.

Table 354 Delete Accessory Responses

Responses Remarks

OK Success

ERROR:INVALID INPUT If parameters are not valid.

1VV0301498 Rev. 2.0 376 2020-05-05

Page 377: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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 355, page 377 describes the add service command parameters.

Synchronous Response

Table 356, page 377 describes the synchronous responses and remarks for Add service command.

Table 355 Add Service Parameters

Parameter Optional/Mandatory Value Description

Accessory ID Mandatory

Value range: 1 to 10

Format: Integer

Default value: N/A

It specifies the identifier of the accessory.

Service ID Mandatory

Value range: 1 to 255

Format: Integer

Default value: N/A

It specifies the identifier of the service to be added.

Service Type Mandatory

Value range: N/A

Format: String

Default 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 Mandatory

Value range: 1 to 100

Format: Integer

Default value: N/A

It specifies the number of characteristics supported by the newly added service.

Note: This number is not used.

Primary Mandatory

Value range: N/A

Format: Integer

Default value: N/A

It specifies the service to be the primary service of the accessory.

Hidden Mandatory

Value range: N/A

Format: Integer

Default value: N/A

It specifies the service is the hidden service of the accessory.

Table 356 Add Service Responses

Responses Remarks

OK Success

ERROR:INVALID INPUT If parameters are not valid.

1VV0301498 Rev. 2.0 377 2020-05-05

Page 378: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

8.2.2.4 Delete Service

Command Syntax AT+HKDSC=<Accessory ID>,<Service ID>

Parameter Description

Table 357, page 378 describes the Delete Service command parameters.

Synchronous Response

Table 358, page 378 describes the synchronous responses and remarks for Delete Service command.

Table 357 Delete Service Parameters

Parameter Optional/Mandatory Value Description

Accessory ID Mandatory

Value range: 1 to 10

Format: Integer

Default value: N/A

It specifies the identifier of the added accessory.

Service ID Mandatory

Value range: 1 to 255

Format: Integer

Default value: N/A

It specifies the identifier of the added service.

Table 358 Delete Service Responses

Responses Remarks

OK Success

ERROR:INVALID INPUT If parameters are not valid.

1VV0301498 Rev. 2.0 378 2020-05-05

Page 379: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

8.2.2.5 Add Characteristic

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 359, page 379 describes the add characteristic command parameters.

Table 359 Add Characteristic Parameters

Parameter Optional/Mandatory Value Description

Accessory ID Mandatory

Value range: 1 to 10

Format: Integer

Default value: N/A

It specifies the identifier of the accessory.

Service ID Mandatory

Value range: 1 to 255

Format: Integer

Default value: N/A

It specifies the identifier of the service to which a new characteristic will be added.

Characteristic ID Mandatory

Value range: N/A

Format: Integer

Default value: N/A

It specifies the identifier of the characteristic to be added.

Note: Characteristic ID and Service ID of an Accessory need to be unique IDs.These IDs must be given sequentially in one accessory.

For example, If Service ID is set to 1, and number of characteristics is 4, then Characteristic IDs must be 2,3,4,5.

If a new service for the same accessory needs to be added, then it must be sequentially added that is the Service ID will be 6.

Characteristic Type Mandatory

Value range: N/A

Format: String

Default 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.

1VV0301498 Rev. 2.0 379 2020-05-05

Page 380: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

Flag Mandatory

Value range: 1, 2, 4

Format: Integer

Default value: N/A

It specifies if the characteristic supports one or more of the of following:

• 1: Readable

• 2: Writable

• 4: Event notifiable

• 8: Timed write

If 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 Mandatory

Value range: 0 to 6

Format: Integer

Default 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 Mandatory

Value range: N/A

Format: N/A

Default 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 359 Add Characteristic Parameters (Continued)

Parameter Optional/Mandatory Value Description

1VV0301498 Rev. 2.0 380 2020-05-05

Page 381: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

Synchronous Response

Table 360, page 381 describes the synchronous responses and remarks for Add characteristic command.

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: Celsius

1: Percentage

2: Arc-degrees

3: Lux

4: Seconds

Table 359 Add Characteristic Parameters (Continued)

Parameter Optional/Mandatory Value Description

Table 360 Add Characteristic Responses

Responses Remarks

OK Success

ERROR:INVALID INPUT If parameters are not valid

1VV0301498 Rev. 2.0 381 2020-05-05

Page 382: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

8.2.2.6 Delete Characteristic

Command Syntax AT+HKDCC=<Accessory ID>,<Service ID>,<Characteristic ID>

Parameter Description

Table 361, page 382 describes the Delete Characteristic command parameters.

Synchronous Response

Table 362, page 382 describes the synchronous responses and remarks for Delete Characteristic command.

Table 361 Delete Characteristic Parameters

Parameter Optional/Mandatory Value Description

Accessory ID Mandatory

Value range: 1 to 10

Format: Integer

Default value: N/A

It specifies the identifier of the added accessory.

Service ID Mandatory

Value range: 1 to 255

Format: Integer

Default value: N/A

It specifies the identifier of the added service.

Characteristic ID Mandatory

Value range: N/A

Format: Integer

Default value: N/A

It specifies the identifier of the added characteristic.

Note: The Service ID and the characteristic ID of an accessory has to be unique IDs.

Table 362 Delete Characteristic Responses

Responses Remarks

OK Success

ERROR:INVALID INPUT If parameters are not valid.

1VV0301498 Rev. 2.0 382 2020-05-05

Page 383: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

8.2.2.7 Set Software Token

This command is used to set the token of a file name.

Command Syntax AT+HKSSWTOKEN=<UUID>, <Token file name>

Parameter Description

Table 363, page 383 describes the Set Token command parameters.

Synchronous Response

Table 364, page 383 describes the synchronous responses and remarks for Set Token command.

Table 363 Set Token Parameters

Parameter Optional/Mandatory Value Description

UUID Mandatory

Value range: 36 bytes

Format: Hexa

Default value: N/A

It specifies the Token Id associated with the software token provisioned in the system using TCERTADD command.

Token file name Mandatory

Value range: N/A

Format: String

Default value: N/A

It specifies the software token to be used during software Authentication procedure. The software token must be loaded in the accessory using AT+TCERTADD command before using in this command. Note: The software token must be stored in the flash

file system.

Table 364 Set Token Responses

Responses Remarks

OK Success

ERROR:INVALID INPUT If parameters are not valid.

1VV0301498 Rev. 2.0 383 2020-05-05

Page 384: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

8.2.2.8 Get Manufacturing Information

This command is used to get the manufacturing information that was provided as setup ID, software token UUID and the software token stored in the system.

Command Syntax AT+HKGMINFO

Synchronous Response

Table 365, page 384 describes the synchronous responses and remarks for Get Manufacturing Information command.

Example AT+HKGMINFOSETUPID: 2D0CUUID: AB8314C0-9871-43B7-B74E-26E8046FAE84SwToken:MYGqME8CAQECAQEERzBFAiEA7OpOxDLU9A76VMSBhpcvzSITt04yPjM+GWZgIKN8TlECIAvCPpew1mDC/LiHhQLBnZfRfVIswXEqEluze62WTsJnMFcCAQICAQEETzFNMAkCAWYCAQEEAQEwEAIBZQIBAQQIwZo9GWYBAAAwFAICAMkCAQEECzI0MzQ0Ni0wMDU5MBgCAWcCAQEEEND+kMemDkCEv8wUd/QHFAAxgaowTwIBAQIBAQRHMEUCIFUZUa84G22CKU/e8+Cqp9Q0Lx4IgPHbBOo9REdnzpGlAiEAmmv2agkmiQWLuj+wUVJxlVzFzzFAzFnbBVZCI0KvTVIwVwIBAgIBAQRPMU0wCQIBZgIBAQQBATAQAgFlAgEBBAhe/Y8VZgEAADAUAgIAyQIBAQQLMjQzNDQ2LTAwNTkwGAIBZwIBAQQQSulRCZ9dTje2vitQDPSfgA==OK

Table 365 Get Manufacturing Information Responses

Responses Remarks

OK Success

1VV0301498 Rev. 2.0 384 2020-05-05

Page 385: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

8.2.2.9 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 366, page 385, describes the HomeKit as Linked Service parameters.

Synchronous Response

Table 367, page 385 describes the synchronous responses and remarks for HomeKit as Link Service command.

Table 366 HomeKit as Link Service Parameters

Parameter Optional/Mandatory Value Description

Accessory ID Mandatory

Value range: N/A

Format: String

Default value: N/A

It specifies the identifier of the accessory.

Service ID Mandatory

Value range: N/A

Format: String

Default value: N/A

It specifies the identifier of the services.

Number of Services Mandatory

Value range: 1 to 10

Format: Integer

Default value: N/A

It specifies the number of services to be linked.

IID Optional

Value range: 1 to 10

Format: Integer

Default value: N/A

It is the source IID of the service ID to which services with IIDs - ii1, ii2,... will be linked.

Table 367 HomeKit Link Service Responses

Responses Remarks

OK Success

1VV0301498 Rev. 2.0 385 2020-05-05

Page 386: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

8.2.2.10 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>, [<Featured Flag>, <Setup ID>]

Parameter Description

Table 368, page 387 describes the Initialize HomeKit command parameters.

NOTE: GS module support a maximum configuring device ID parameter of 32 characters only.

1VV0301498 Rev. 2.0 386 2020-05-05

Page 387: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

Table 368 Initialize HomeKit Parameters

Parameter Optional/Mandatory Value Description

Accessory category Mandatory

Value range: 1 to 30

Format: Integer

Default 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: Reserved

• 17: IP Camera

• 18: Video doorbell

• 19: Air purifier

• 20: Heater

• 21: Air conditioner

• 22: Humidifier

• 23: Dehumidifier

• 24 -27: Reserved

• 28: Sprinkler

• 29: Faucet

• 30: Shower system

• 30+: Reserved

Discovery ID Mandatory

Value range: 32 Byte

Format: String

Default value: N/A

It specifies an unique ID of an accessory. The name is used in mDNS HomeKit service.

This name should match with the device name provided while adding the accessory information service.

1VV0301498 Rev. 2.0 387 2020-05-05

Page 388: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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:

Configuration number Mandatory

Value range: 1 to 4294967295

Format: Integer

Default value: N/A

It specifies the current configuration number of an accessory and is updated only when an accessory, service, or characteristic is added or removed on the accessory server and during firmware upgrade.

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 Mandatory

Value range: N/A

Format: String

Default value: N/A

It specifies the model name of an accessory that should match with the model name provided while adding the accessory information service.

Setup code Mandatory

Value range: N/A

Format: String

Default value: 101-48-505

It specifies the password to pair a controller.

Format: XXX-XX-XXX

where X is a number.

Event notification flag Mandatory

Value range: 0 to FFFF

Format: Integer

Default value: N/A

It specifies the events those have to be notified to the host. Table 370, page 389 lists the available events along with their bit position. Use the bit position to get the hexadecimal value of the event.

Featured Flag Optional

Value range: 0 to 2

Format: Integer

Default value: 0

It specifies the one of the following supported feature,

0 - Apple authentication co-processor based authentication,

1- icloud,

2- software based authentication.

Setup ID Optional

Value range: 4Bytes

Format: String

Default value: 0

It specifies the ID to be used during the QR code generation.

If the setup ID is not provided then it is internally generated and the user can retrieve the value by issuing AT+HKGMINFO command.

It is a 4byte alpha numeric number from A-Z and 0-9 only.

Table 368 Initialize HomeKit Parameters (Continued)

Parameter Optional/Mandatory Value Description

1VV0301498 Rev. 2.0 388 2020-05-05

Page 389: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

<Esc>A<AsyncEventId>,[<data>]

Asynchronous Data Parameter Description

Table 369, page 389 describes the Asynchronous Event Notification parameters.

The following table lists the Asynchronous Event Notification IDs.

Table 369 Asynchronous Event Notification Parameters

Parameter Optional/Mandatory Value Description

AsyncEventId Mandatory N/A It identifies the event.

data Optional N/AIt is the data sent along with the event and is valid only for read, write and notification set request from Controller.

Table 370 Events Notification Flag Values

Event Notification Flag Value (Bit)

Pairing Initiated 0

Pairing failed 1

Pairing done 2

Pairing session closed 3

Verification initiated 4

Verification failed 5

Verification done 6

Verification session closed 7

Receive failed and session closed 8

Pairing removed 9

Pairing added 10

Identify response request 11

Accessory discovery request 12

Char read request 13

Char write request 14

Char event notification request 15

iCloud activation init 16

iCloud activation done 17

iCloud activation failed 18

iCloud pairing init 19

iCloud pairing done 20

iCloud pairing failed 21

1VV0301498 Rev. 2.0 389 2020-05-05

Page 390: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

Synchronous Response

Table 371, page 390 describes the synchronous responses and remarks for Initialize HomeKit command.

iCloud connected 22

iCloud disconnected 23

iCloud verification init 24

iCloud verification done 25

iCloud verification failed 26

iCloud verification session closed 27

iCloud accessory discovery 28

iCloud char read 29

iCloud char write 30

iCloud char event req 31

iCloud pair add 32

iCloud pair remove 33

Transient pairsetup init 34

Transient pair setup failed 35

Transient pairsetup done 36

Transient pairsetup closed 37

Split pairetup init 38

Split pairsetup failed 39

Split pairsetup done 40

Spilt pairing session closed 41

Software token update 42Note: 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 370 Events Notification Flag Values

Event Notification Flag Value (Bit)

Table 371 Initialize HomeKit Responses

Responses Remarks

OK Success

ERROR:INVALID INPUT If parameters are not valid.

1VV0301498 Rev. 2.0 390 2020-05-05

Page 391: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

8.2.2.11 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 372, page 391 describes Respond to a request or notification parameters.

Synchronous Response

Table 373, page 391 describes the synchronous responses and remarks for Respond to a request or notification.

Table 372 Send Data Parameters

Parameter Optional/Mandatory Value Description

Format Mandatory

Value range: 1 to 3

Format: Integer

Default 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 Mandatory

Value range: 1 to 10

Format: Integer

Default value: N/A

It specifies the identifier of the accessory.

Characteristics ID Mandatory

Value range: N/A

Format: Integer

Default value: N/A

It specifies the identifier of the characteristic.

Status Mandatory

Value range: N/A

Format: N/A

Default value: N/A

It specifies the status of the operation.

Value Optional

Value range: N/A

Format: N/A

Default 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 373 Send Data Responses

Responses Remarks

OK Success

ERROR:INVALID INPUT If parameters are not valid.

1VV0301498 Rev. 2.0 391 2020-05-05

Page 392: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

8.2.2.12 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 pairing is deleted and the GS node is reset.

Command Syntax AT+HKEC=<n>

Parameter Description

Table 374, page 392 describes the Erase Homekit Configuration command parameters.

Synchronous Response

Table 375, page 392 describes the synchronous responses and remarks for Erase HomeKit Configuration command.

Example AT+HKEC=0OK

Table 374 Erase HomeKit Configuration Parameters

Parameter Optional/Mandatory Value Description

n Mandatory

Value range: 0,1

Format: Integer

Default value: N/A

0 - to erase HomeKit configuration and the manufacturing information is retained.

1 - to erase complete HomeKit and Manufacturing information i.e, setup ID, setup verifier, software token information.

Note: It is recommended not use 1 as it erases the manufacturing information. It must be used for testing purpose only.

Table 375 Erase HomeKit Configuration Responses

Responses Remarks

OK Success

1VV0301498 Rev. 2.0 392 2020-05-05

Page 393: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

8.2.2.13 Update HomeKit Configuration

This command is used to update HomeKit configuration.

This command is recommended to use after completion of HomeKit operation like issuing the addition/deletion of accessory/service /characteristics after HomeKit configuration.

Command Syntax AT+HKUPDATE

Synchronous Response

Table 376, page 393 describes the synchronous responses and remarks for Update HomeKit Configuration command.

Table 376 Update HomeKit Configuration Responses

Responses Remarks

OK Success

1VV0301498 Rev. 2.0 393 2020-05-05

Page 394: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

8.2.3 Provisioning

GainSpan 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.

1VV0301498 Rev. 2.0 394 2020-05-05

Page 395: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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 377, page 395 describes the Web Provisioning Server Start parameters.

Table 377 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,1

Default 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

1VV0301498 Rev. 2.0 395 2020-05-05

Page 396: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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 - 2

Default 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 377 Web Provisioning Server Start Parameters (Continued)

Parameter Optional/Mandatory Value Description

1VV0301498 Rev. 2.0 396 2020-05-05

Page 397: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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=64

AP-DNSSRVR-ENABLE=1

AP-DNS-DOMAIN-NAME=<dns name>

NEW_USER_NAME=<new User Name>

NEW_PASS=<new Password>

Table 377 Web Provisioning Server Start Parameters (Continued)

Parameter Optional/Mandatory Value Description

1VV0301498 Rev. 2.0 397 2020-05-05

Page 398: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

Synchronous Response

Table 378, page 398 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, 1

0 (default)

0 - Do not start the NCM

1 - Start the NCM after storing the parameters

format version Optional 0,1

0: Prints the GS1011 compatible information

1: 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 Optional

0, 1

0: Disable

1: Enable

Enables or disables concurrent mode provisioning.

Table 377 Web Provisioning Server Start Parameters (Continued)

Parameter Optional/Mandatory Value Description

Table 378 Web Provisioning Start Synchronous Responses

Responses Remarks

OK Success

ERROR: INVALID INPUT If parameters are not valid.

1VV0301498 Rev. 2.0 398 2020-05-05

Page 399: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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.

1VV0301498 Rev. 2.0 399 2020-05-05

Page 400: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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.

1VV0301498 Rev. 2.0 400 2020-05-05

Page 401: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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 379, page 401 describes the synchronous responses and remarks for Web Provisioning Stop command.

Table 379 Web Provisioning Stop Synchronous Responses

Responses Remarks

OK Success

ERRORIf command is issued without starting web provisioning using AT+WEBPROV command.

1VV0301498 Rev. 2.0 401 2020-05-05

Page 402: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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 380, page 402 describes the synchronous responses and remarks for the Web Provisioning status command.

Table 380 Web Provisioning Status Synchronous Responses

Responses Remarks

Webprov Started

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

OK

Webprov Stopped

OK

Success

ERROR: INVALID INPUT If parameter is not valid.

1VV0301498 Rev. 2.0 402 2020-05-05

Page 403: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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.

1VV0301498 Rev. 2.0 403 2020-05-05

Page 404: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

Table 381 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 205.

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 MixedMode bgn Mixed is being used in Group provisioning.

Channel Optional 1-11It specifies the channel number for the Android device.

Beacon Interval Optional50-1500

Unit: 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-64It specifies the number of stations supported during Group provisioning.

1VV0301498 Rev. 2.0 404 2020-05-05

Page 405: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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.

1VV0301498 Rev. 2.0 405 2020-05-05

Page 406: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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

1VV0301498 Rev. 2.0 406 2020-05-05

Page 407: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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 138), 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 382, page 407 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 382 WPS Parameters

Parameter Optional/Mandatory Value Description

METHOD Mandatory

1 Push Button method (PBC)

2 Pin method

3 Default Pin method

PIN Optional N/AThe pin can be any valid WPS pin (valid for pin method only). For example, 95644691.

1VV0301498 Rev. 2.0 407 2020-05-05

Page 408: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

Synchronous Response

Table 383, page 408 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.

1Enable - 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

Optional

Note: It is mandatory when default PIN method (3) is used.

N/ASSID of the AP which associates with WPS procedure.

WPS Deauth Timeout

Optional N/ATime out in milliseconds between the WPS procedure and the next association with the received credential.

Table 382 WPS Parameters

Parameter Optional/Mandatory Value Description

Table 383 WPS Synchronous Responses

Responses Remarks

SSID=<ssid>\r\n

CHANNEL=<channel>\r\n

OK

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.

1VV0301498 Rev. 2.0 408 2020-05-05

Page 409: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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.

1VV0301498 Rev. 2.0 409 2020-05-05

Page 410: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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 384, page 410 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 384 WPS Status Synchronous Responses

Responses Remarks

READY

OKGS node is in Limited AP mode and WPS Registrar is not initialized.

IN PROGRESS

OK

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.

1VV0301498 Rev. 2.0 410 2020-05-05

Page 411: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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 385, page 411 describes the WPS Configuration parameters.

Table 385 WPS Configuration Parameters

Parameter Optional/Mandatory Value Description

n Mandatory0 - Default

Disable all credentials received from AP.

1Enable 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.

1VV0301498 Rev. 2.0 411 2020-05-05

Page 412: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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 386, page 412 describes the WAC parameters.

Synchronous Response

Table 387, page 412 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 413. 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 436). 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 386 WAC Parameters

Parameter Optional/Mandatory Value Description

n Mandatory

0,1

0: Stop

1: Start

Start or stop WAC.

Table 387 WAC Synchronous Responses

Responses Remarks

OK Success

ERROR: INVALID INPUT If parameter is not valid.

1VV0301498 Rev. 2.0 412 2020-05-05

Page 413: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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

1VV0301498 Rev. 2.0 413 2020-05-05

Page 414: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

8.2.4 TR50 Support

TR50 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 388, page 414 describes the deviceWISE Configuration parameters.

Table 388 deviceWISE Configuration Parameters

Parameter Optional/Mandatory Value Description

serverUrl Mandatory

Value range: N/A

Format: String

Default value: N/A

It specifies the string parameter indicating the URL of the M2MService instance.

deviceID Selector Mandatory

Value range:0, 1

Format: Integer

Default value: 0

0-specifies the IMEI details of the SIM card or the CDMA ID

1-specifies CCID/ESN

appToken Mandatory

Value range: N/A

Format: String

Default value: N/A

It specifies the secured application token provided in the Management Portal, typically a string of 16 characters

security Mandatory

Value range: 0,1

Format: Integer

Default 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: Integer

Default 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.

1VV0301498 Rev. 2.0 414 2020-05-05

Page 415: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

Synchronous Response

Table 389, page 415 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 Mandatory

Value range: 0, 1, 2, 3

Format: Integer

Default value: N/A

It specifies the flag indicating connection manager to automatically reconnect to the service, where:

0 – auto-reconnect disabled

1 – 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 Mandatory

Value range: 0, 1

Format: Integer

Default value: 0

It specifies the flag indicating the data management overflow, where:

0 – FIFO (default)

1 – LIFO

atruninstanceID Optional

Value range: 0 to 4

Format: Integer

Default value: 4

It specifies the AT instance used by the service to run the AT Command.

serviceTimeout Optional

Value range: 1 to 20

Format: Integer

Default value: 5

It specifies the maximum time interval for a service request to the server in seconds

contextID Optional

Value range: 1 to 5

Format: Integer

Default value: 1

It specifies the PDP context used for network connection

Table 388 deviceWISE Configuration Parameters (Continued)

Parameter Optional/Mandatory Value Description

Table 389 deviceWISE Configuration Synchronous Responses

Responses Remarks

OK Success

ERROR: <Error code>If parameter is not valid or any other error occurs. It gives the type of error too.

1VV0301498 Rev. 2.0 415 2020-05-05

Page 416: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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 390, page 416 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 390 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 ID

1-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.

1VV0301498 Rev. 2.0 416 2020-05-05

Page 417: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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 391, page 417 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 392, page 418 describes the deviceWISE Connection parameters.

Table 391 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 ID

1-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.

1VV0301498 Rev. 2.0 417 2020-05-05

Page 418: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

Synchronous Response

Table 393, page 418 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?

Table 394, page 419 describes the synchronous responses and remarks for Read deviceWISE Connection command.

Table 392 deviceWISE Connection Parameters

Parameter Optional/Mandatory Value Description

connect Mandatory

Value range: 0, 1

Format: Integer

Default value: 0

It specifies the flag to connect or disconnect to the M2M Services

0 - performs socket Disconnection

1 - performs socket Connection and MQTT Connection

Table 393 deviceWISE Connection Synchronous Responses

Responses Remarks

OK Success

ERROR: <Error code>If parameter is not valid or any other error occurs.

NOTE: The following sequence of commands has to be executed before issuing the above command: AT+DWCFG=api.devicewise.com,0,XzoQIqz3vmJFQsHG AT=DWCONN AT+DWCONN?

1VV0301498 Rev. 2.0 418 2020-05-05

Page 419: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

Example AT+DWCONN?#DWCONN: 1,3OK

Table 394 Read deviceWISE Connection Synchronous Responses

Responses Remarks

<connect>,<status>

Connect : It specifies the flag to connect or disconnect to the M2M Services

0 - performs socket Disconnection

1 - performs socket Connection and MQTT Connection.

Status : It specifies the connection state of M2M service.

0 = disconnected

1 = trying to connect

2 = connected

3 = waiting to connect

1VV0301498 Rev. 2.0 419 2020-05-05

Page 420: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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 395, page 420 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 393, page 418 describes the synchronous responses and remarks for deviceWISE Connection Status command.

Table 395 Test deviceWISE Connection Synchronous Responses

Responses Remarks

<connect>

Connect: It specifies the flag to connect or disconnect to the M2M Services

0 - performs socket Disconnection

1 - performs socket Connection and MQTT Connection.

1VV0301498 Rev. 2.0 420 2020-05-05

Page 421: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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 393, page 418 describes the synchronous responses and remarks for Test deviceWISE Connection Status command.

Table 396 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.

1VV0301498 Rev. 2.0 421 2020-05-05

Page 422: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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 398, page 424,describes the Send deviceWISE Data Parameters.

Table 397 Test deviceWISE Connection Status Synchronous Responses

Responses Remarks

OK Success

1VV0301498 Rev. 2.0 422 2020-05-05

Page 423: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

1VV0301498 Rev. 2.0 423 2020-05-05

Page 424: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

Para

type

an

se

f the

0 is

iates

ame nt.

Note: ng, that c

Note: t the respo d AT+D

The re

It is p

Table 398 Send deviceWISE Data Parameter

meter Optional/Mandatory Value Description

Mandatory

Value range: 0,1,2,3

Format: Integer

Default value: 0

It 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

Type 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

1VV0301498 Rev. 2.0 424 2020-05-05

Page 425: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

Table 399, page 425, 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 400, page 425, 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 399 Send deviceWISE Data Synchronous Responses

Responses Remarks

OK Success

ERRORIf parameter is not valid or any other error occurs.

Table 400 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.

1VV0301498 Rev. 2.0 425 2020-05-05

Page 426: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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 401, page 426 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 402, page 427, describes the synchronous response and remarks for Read deviceWISE Enable command

Table 401 deviceWISE Enable Parameters

Parameter Optional/Mandatory Value Description

feature Mandatory

Value range: 0 - 7

Format: Integer

Default value: N/A

It specifies the range of deviceWISE features that is enabled.

0 - remote AT commands

1 - location reporting

2 to 7 - reserved for future use.

enable Mandatory

Value range: 0, 1

Format: Integer

Default value: N/A

0 - enables the deviceWISE feature

1 - 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) Optional

Value range: 0, 1

Format: String

Default value: N/A

It specifies the option depending on the feature

Note: Feature 0 (remote AT commands) as no option.

1VV0301498 Rev. 2.0 426 2020-05-05

Page 427: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

Example AT+DWEN?#DWEN: 0,0#DWEN: 1,0OK

Table 402 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 commands

2 … 7 – reserved for future use.

<enable> - enable or disable the features

0 – disable the feature

1 – 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.

1VV0301498 Rev. 2.0 427 2020-05-05

Page 428: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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

1VV0301498 Rev. 2.0 428 2020-05-05

Page 429: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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 403, page 429 describes the Send Raw deviceWISE Data parameters.

Synchronous Response

Table 404, page 429 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 403 Send Raw deviceWISE Data Parameters

Parameter Optional/Mandatory Value Description

datalen Mandatory

Value range: 1-1500

Format: Integer

Default 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+DWRCVR

It is possible to issue AT+DWSENDR only if the connection has been opened with AT+DWCONN

Table 404 Send Raw deviceWISE Data Synchronous Responses

Responses Remarks

#DWSENDR: <msgID> Success

ERROR: <Error code>If parameter is not valid or any other error occurs.

1VV0301498 Rev. 2.0 429 2020-05-05

Page 430: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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 405, page 430 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 405 deviceWISE Ring Parameters

Parameter Optional/Mandatory Value Description

type Mandatory

Value range: N/A

Format: Integer

Default value: N/A

It specifies the type of message to receive.

msgID Mandatory

Value range: >=1

Format: Integer

Default value: N/A

It specifies the value that identifies the sending from the device.

length Mandatory

Value range: N/A

Format: Integer

Default value: N/A

It is the length of the data

1VV0301498 Rev. 2.0 430 2020-05-05

Page 431: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

Command Syntax AT+DWRCV=<msgID>

Parameter Description

Table 406, page 431 describes the Receive deviceWISE Data parameters.

Synchronous Response

Table 407, page 431 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 406 Receive deviceWISE Data Parameters

Parameter Optional/Mandatory Value Description

msgID Mandatory

Value range: >=1

Format: Integer

Default 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 407 Recieve deviceWISE Data Synchronous Responses

Responses Remarks

OK Success

ERROR: <Error code>If parameter is not valid or any other error occurs.

1VV0301498 Rev. 2.0 431 2020-05-05

Page 432: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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 408, page 432 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 408 deviceWISE Data Parameters

Parameter Optional/Mandatory Value Description

msgID Mandatory

Value range: >=1

Format: Integer

Default value: N/A

It specifies the length of the data to be received.

error Mandatory

Value range: 0

Format: Integer

Default value: N/A

It specifies the error code of the message received.

0 - specifies no error.

length Mandatory

Value range: N/A

Format: Integer

Default value: N/A

It is the length of the data

parameter_n Mandatory

Value range: N/A

Format: String

Default value: N/A

It specifies the string parameter indicating the i-th parameter associated to the type specified

1VV0301498 Rev. 2.0 432 2020-05-05

Page 433: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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 409, page 433 describes the Receive Raw deviceWISE Data parameters.

Synchronous Response

Table 410, page 433 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 409 Receive Raw deviceWISE Data Parameters

Parameter Optional/Mandatory Value Description

msgID Mandatory

Value range: >=1

Format: Integer

Default 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 410 Receive Raw deviceWISE Data Synchronous Responses

Responses Remarks

OK Success

ERROR: <Error code>If parameter is not valid or any other error occurs.

1VV0301498 Rev. 2.0 433 2020-05-05

Page 434: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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 411, page 434 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 411 deviceWISE Raw Data Parameters

Parameter Optional/Mandatory Value Description

msgID Mandatory

Value range: >=1

Format: Integer

Default value: N/A

It specifies the length of the data to be received.

error Mandatory

Value range: 0

Format: Integer

Default value: N/A

It specifies the error code of the message received.

0 - specifies no error.

length Mandatory

Value range: N/A

Format: Integer

Default value: N/A

It is the length of the data

data Mandatory

Value range: N/A

Format: String

Default value: N/A

It specifies the data from M2M service

1VV0301498 Rev. 2.0 434 2020-05-05

Page 435: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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 412, page 435 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 412 List of Information on message Pending from deviceWISE serverParameters

Parameter Optional/Mandatory Value Description

msg_number Mandatory

Value range: >=0

Format: Integer

Default value: N/A

It specifies the number of services pending for M2M service.

msg_n Optional

Value range: >=0

Format: Integer

Default value: N/A

It specifies the index of the n-th data message to receive

msg_n_length Mandatory

Value range: >=0

Format: Integer

Default 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.

1VV0301498 Rev. 2.0 435 2020-05-05

Page 436: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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 436

• Battery Measurement, page 442

• System Power Save, page 446

9.1 Radio Receiver Setting

9.1.1 Active Radio Receive

This 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 456) even if it is enabled (AT+PSDSLEEP). The Power Save mode (see 9.1.3 Custom Power Save Radio Receive, page 441) can be enabled but will not save power, since the receiver is left on.

Command Syntax AT+WRXACTIVE=n

Parameter Description

Table 413, page 436 describes the Enable/Disable 802.11 Radio parameters.

Synchronous Response

Table 414, page 436 describes the synchronous responses and remarks for the Enable/Disable 802.11 Radio command.

Table 413 Enable/Disable 802.11 Radio Parameters

Parameter Optional/Mandatory Value Description

n Mandatory0 (default) 802.11 radio receiver is off

1 802.11 radio receiver is always on

Table 414 Enable/Disable 802.11 Radio Synchronous Responses

Responses Remarks

OK Success

ERROR: INVALID INPUTInvalid parameter

(If n value is other than 0 or 1)

1VV0301498 Rev. 2.0 436 2020-05-05

Page 437: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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.

1VV0301498 Rev. 2.0 437 2020-05-05

Page 438: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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 415, page 438 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 415 IEEE PS Poll Listen Interval Parameters

Parameter Optional/Mandatory Value Description

enable Mandatory

0 Disable IEEE PS

1Enable IEEE PS (wakeupType tells whether DTIM or Listen interval)

2 Configure IEEE PS

Note: 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.

listenIntervalOptional (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.

1VV0301498 Rev. 2.0 438 2020-05-05

Page 439: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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

WakeupTypeOptional (valid if wakeup type is listen interval and custom)

0 - 3

0: DTIM based wakeup

1: Listen interval based wakeup

2: Custom wakeup

3: DTIM aligned custom wakeup

wakeupInterval Optional beacon intervalWakeup 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.

1Switch 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/ATime 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 415 IEEE PS Poll Listen Interval Parameters (Continued)

Parameter Optional/Mandatory Value Description

1VV0301498 Rev. 2.0 439 2020-05-05

Page 440: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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.

1VV0301498 Rev. 2.0 440 2020-05-05

Page 441: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

9.1.3 Custom Power Save Radio Receive

This command is used to enter Power Save Mode. Once disabled, 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 416, page 441 describes the Enable/Disable 802.11 Power Save Mode parameters.

Synchronous Response

Table 417, page 441 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 416 Enable/Disable 802.11 Power Save Mode Parameters

Parameter Optional/Mandatory Value Description

n Mandatory0 Power Save mode is disabled

1 (default) Power Save mode is enabled

Table 417 Enable/Disable 802.11 Power Save Mode Synchronous Responses

Responses Remarks

OK Success

ERROR:INVALID INPUTIf parameters are not valid

(If n value is other than 0 or 1)

1VV0301498 Rev. 2.0 441 2020-05-05

Page 442: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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 418, page 442 describes the Battery Check Start parameters.

Synchronous Response

Table 419, page 442 describes the synchronous responses and remarks for Battery Check Start command.

Table 418 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 419 Battery Check Start Synchronous Responses

Responses Remarks

OK Success

ERROR:INVALID INPUT If parameters are not valid.

1VV0301498 Rev. 2.0 442 2020-05-05

Page 443: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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 442).

Command Syntax AT+BATTLVLSET=<Warning Level>,<Warning Frequency>,<Standby Level>

Parameter Description

Table 420, page 443 describes the Battery Warning/Standby Level Set parameters.

Synchronous Response

Table 421, page 443 describes the synchronous responses and remarks for Battery Warning/Standby Level Set command.

Table 420 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 421 Battery Warning/Standby Level Set Synchronous Responses

Responses Remarks

OK Success

ERROR:INVALID INPUT If parameters are not valid.

1VV0301498 Rev. 2.0 443 2020-05-05

Page 444: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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 422, page 444 describes the Battery Check Set parameters.

Synchronous Response

Table 423, page 444 describes the synchronous responses and remarks for Battery Check Set command.

Table 422 Battery Check Set Parameters

Parameter Optional/Mandatory Value Description

Battery check frequency Mandatory 1-100The valid range for Battery check frequency is between 1 and 100.

Table 423 Battery Check Set Synchronous Responses

Responses Remarks

OK Success

ERROR:INVALID INPUT If parameters are not valid.

1VV0301498 Rev. 2.0 444 2020-05-05

Page 445: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

9.2.4 Battery Check Stop

This command is used to halt battery check.

Command Syntax AT+BCHKSTOP

Response

This 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

Response

This 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.

1VV0301498 Rev. 2.0 445 2020-05-05

Page 446: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

9.3 System Power Save

9.3.1 Hibernate

This 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 424, page 446 describes the hibernate mode parameters.

Synchronous Response

Table 425, page 446 describes the synchronous responses and remarks for Hibernate mode command.

Table 424 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 Optional

0: high-to-low

1: low-to-high

32-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 425 Hibernate mode Synchronous Responses

Responses Remarks

Serial2WiFi APP Success

ERROR:INVALID INPUT If parameters are not valid.

1VV0301498 Rev. 2.0 446 2020-05-05

Page 447: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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 450).

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 426, page 447 describes the synchronous responses and remarks for the Store Network Context command.

Table 426 Store Network Context Synchronous Responses

Responses Remarks

OKSuccess

Associate to a network. Upon issue of this command will store the network parameters into the RTC memory.

DISASSOCIATEDFailure

If the node is not associated before issuing this command it will display the network context.

1VV0301498 Rev. 2.0 447 2020-05-05

Page 448: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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 337), 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 427, page 449 describes the synchronous responses and remarks for the Restore Network Context command.

1VV0301498 Rev. 2.0 448 2020-05-05

Page 449: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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 427 Restore Network Context Synchronous Responses

Responses Remarks

OKSuccess

Reads the IP layer network connection parameters saved by “Store Network Context” and reestablishes the connection that existed before the transition to standby.

ERRORFailure

If the command is issued, prior to storing the network connection, or after storing the network connection but before a transition to Standby has occurred.

1VV0301498 Rev. 2.0 449 2020-05-05

Page 450: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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 428, page 451 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).

1VV0301498 Rev. 2.0 450 2020-05-05

Page 451: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

Synchronous Response

Table 429, page 451 describes the synchronous responses and remarks for Request Standby Mode command.

Table 428 Request Standby Mode Parameters

Parameter Optional/Mandatory Value Description

x Mandatoryx=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 429 Request Standby Mode Synchronous Responses

Responses Remarks

OK Success

ERROR:INVALID INPUT If parameters are not valid.

1VV0301498 Rev. 2.0 451 2020-05-05

Page 452: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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 430, page 452 describes the Enabling standby mode between beacons parameters.

Synchronous Response

Table 431, page 452 describes the synchronous responses and remarks for Request Standby Mode command.

Table 430 Enable Standby Mode Between Beacons Parameters

Parameter Optional/Mandatory Value Description

1 Mandatory

Value range: 1

Format: Decimal

Default value: N/A

It enables the GS node to transition to ultra low power standby mode between beacons.

Table 431 Enable Standby Mode Between Beacons Synchronous Responses

Responses Remarks

OK Success

ERROR:INVALID INPUT If parameters are not valid.

NOTE: Enable ARP cache to transfer HTTP Data/L4 Data after PS-Poll Standby.

1VV0301498 Rev. 2.0 452 2020-05-05

Page 453: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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 432, page 453 describes the Configuring standby mode between beacons parameters.

Table 432 Configure Standby Mode Between Beacons Parameters

Parameter Optional/Mandatory Conf ID Value Description

Conf ID, Value

Mandatory 0

Alarm 1 wakeup

Value range: 0, 1

Format: Decimal

Default 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 polarity

Value range: 0, 1

Format: Decimal

Default 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 wakeup

Value range: 0, 1

Format: Decimal

Default 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 polarity

Value range: 0, 1

Format: Decimal

Default 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

1VV0301498 Rev. 2.0 453 2020-05-05

Page 454: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

Synchronous Response

Table 433, page 456 describes the synchronous responses and remarks for Request Standby Mode command.

1VV0301498 Rev. 2.0 454 2020-05-05

Page 455: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

1VV0301498 Rev. 2.0 455 2020-05-05

Page 456: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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 434, page 457 describes the Enable/Disable GS node Deep Sleep parameters.

AT+PSDPSLEEP=[<timeout>,,<ALARM2 POL>]<CR>

Table 433 Configure Standby Mode Between Beacons Synchronous Responses

Responses Remarks

OK Success

ERROR: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).

1VV0301498 Rev. 2.0 456 2020-05-05

Page 457: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

Synchronous Response

Table 435, page 457 describes the synchronous responses and remarks for Enable/Disable module Deep Sleep command.

Table 434 Enable/Disable GS node Deep Sleep Parameters

Parameter Optional/Mandatory Value Description

Timeout OptionalInteger 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 low

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.

Table 435 Enable/Disable module Deep Sleep Synchronous Responses

Responses Remarks

OK Success

ERROR:INVALID INPUT If parameters are not valid.

1VV0301498 Rev. 2.0 457 2020-05-05

Page 458: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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 436, page 458 describes power save in Limited AP Mode parameters

Table 436 Deep Sleep in Limited AP Mode parameters

Parameter 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 0Always issue zero (0) for this parameter.

Receiver on-time after Transmission

Mandatory

0 to Beacon interval

Unit: 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 437, page 459.

1VV0301498 Rev. 2.0 458 2020-05-05

Page 459: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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 438, page 459 describes the synchronous responses and remarks for Deep Sleep in Limited AP mode command.

9.3.5 Hardware Cryptography

This 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 437 AP behavior based on Power-Save Control and Power-Save Configuration

Power-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.

1Exit 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 438 Deep Sleep in Limited AP Mode Synchronous Responses

Responses Remarks

OK Success

ERROR Failure

ERROR:INVALID INPUT If parameters are not valid.

1VV0301498 Rev. 2.0 459 2020-05-05

Page 460: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

Command Syntax AT+CRYPTOEN=n

Parameter Description

Table 439, page 460 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 439 Hardware Cryptography Parameters

Parameter Optional/Mandatory Value Description

n Mandatory1 It enables the hardware crypto block.

0 It disables the hardware crypto block.

1VV0301498 Rev. 2.0 460 2020-05-05

Page 461: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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 461

• PWM Commands, page 465

• GPIO Commands, page 469

• EMU Commands, page 470

10.1 I2C Commands

This section contains I2C specific commands.

10.1.1 I2C Configuration

This command is used to configure the I2C device.

Command Syntax AT+I2CCONF=<conf id>,<value>

Parameter Description

Table 440, page 461 describes the I2C Configuration parameters.

Table 440 I2C Configuration Parameters

Parameter Conf id Optional/Mandatory Value Description

Master/Slave 1 Mandatory

0 - Slave

1 - Master

Value 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 mode

1 - 10 bit mode

Value range: 0,1

Whether the slave address is 7 bit or 10 bit.

1VV0301498 Rev. 2.0 461 2020-05-05

Page 462: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

Synchronous Response

Table 441, page 462 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,10

This command configures the device as Slave when Slave device address is 0x20.

Clock Rate 4 Mandatory

Value range: 10 to 34000

Unit: KHz

Note:

• 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 address

1 - Random address

Whether memory access is in current mode or random mode.

SlaveLocAddr 6 Mandatory ValueIt is the address location when random mode is selected.

Memory Address Sel

8 Mandatory0 - Single byte

1 - 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 440 I2C Configuration Parameters (Continued)

Parameter Conf id Optional/Mandatory Value Description

Table 441 I2C Configuration Synchronous Responses

Responses Remarks

OK Success

ERROR INVALID INPUT If parameters are not valid.

1VV0301498 Rev. 2.0 462 2020-05-05

Page 463: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

10.1.2 I2C Start

This command is used to start I2C device.

Command Syntax AT+I2CSTART

Synchronous Response

Table 442, page 463 describes the synchronous responses and remarks for I2C Start command.

10.1.3 I2C Write

This command is used for write operation.

Command Syntax AT+I2CWRITE=<No. of bytes>,<bytes>

Parameter Description

Table 443, page 463 describes the I2C Write parameters.

Synchronous Response

Table 444, page 463 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 442 I2C Start Synchronous Responses

Responses Remarks

OK Success

ERROR If device open fails.

Table 443 I2C Write Parameters

Parameter Optional/Mandatory Value Description

No of bytes Mandatory 1-128It specifies the range in which the I2CWrite operation is done.

bytes Mandatory NA It is the actual data in bytes.

Table 444 I2C Write Synchronous Responses

Responses Remarks

OK Success

ERROR INVALID INPUT If parameters are not valid.

1VV0301498 Rev. 2.0 463 2020-05-05

Page 464: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

10.1.4 I2C Read

This command is used for read operation.

Command Syntax AT+I2CREAD=<No. of bytes>

Parameter Description

Table 445, page 464 describes the I2C Read parameters.

Synchronous Response

Table 446, page 464 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 Stop

This command is used to stop the I2C device.

Command Syntax AT+I2CSTOP

Synchronous Response

Table 447, page 465 describes the synchronous responses and remarks for I2C Stop command.

Table 445 I2C Read Parameters

Parameter Optional/Mandatory Value Description

No of bytes Mandatory 1 - 128It specifies the range in which the I2C Read operation is done.

Table 446 I2C Read Synchronous Responses

Responses Remarks

OK Success

ERROR INVALID INPUT If parameters are not valid.

1VV0301498 Rev. 2.0 464 2020-05-05

Page 465: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

10.2 PWM Commands

10.2.1 PWM Start

This 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 448, page 465 describes the PWM Start parameters.

Table 447 I2C Stop Synchronous Responses

Responses Remarks

OK Success

ERROR If device close fails.

Table 448 PWM Start Parameters

Parameter Optional/Mandatory Value Description

pwm_id Mandatory

1: pwm1

PWM identifier.2: pwm2

3: pwm3

4: 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

1VV0301498 Rev. 2.0 465 2020-05-05

Page 466: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

Synchronous Response

Table 449, page 466 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: 40MHzIt 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 448 PWM Start Parameters (Continued)

Parameter Optional/Mandatory Value Description

Table 449 PWM Start Synchronous Responses

Responses Remarks

OK Success

ERROR INVALID INPUT If parameters are not valid.

1VV0301498 Rev. 2.0 466 2020-05-05

Page 467: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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

1VV0301498 Rev. 2.0 467 2020-05-05

Page 468: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

10.2.2 PWM Stop

This command is used to stop the PWM that has started using the AT+PWMSTART command.

Command Syntax AT+PWMSTOP=<pwm_id>

Parameter Description

Table 450, page 468 describes the PWM Stop parameters.

Synchronous Response

Table 451, page 468 describes the synchronous responses and remarks for PWM Stop command.

10.2.3 PWM Control

This 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 452, page 468 describes the PWM Control parameters.

Table 450 PWM Stop Parameters

Parameter Optional/Mandatory Value Description

pwm_id Mandatory

1: pwm1

PWM identifier.2: pwm2

3: pwm3

4: 3 pwm’s at a time

Table 451 PWM Stop Synchronous Responses

Responses Remarks

OK Success

ERROR If parameters are not valid.

Table 452 PWM Control Parameters

Parameter Optional/Mandatory Value Description

pwm_id Mandatory

Value range: 1 to 4

1: PWM1

2: PWM2

3: PWM3

4: 3 PMWs at a time

It specifies the PMW identifier.

duty_cycle Mandatory 1 to 99 It specifies the duty cycle of the pulse.

1VV0301498 Rev. 2.0 468 2020-05-05

Page 469: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

Synchronous Response

Table 453, page 469 describes the synchronous responses and remarks for PWM Control command.

10.3 GPIO Commands

10.3.1 GPIO Out HIGH/LOW

This 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 454, page 469 describes the GPIO Out HIGH/LOW parameters.

Table 453 PWM Control Synchronous Responses

Responses Remarks

OK Success

ERROR 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 454 GPIO Out HIGH/LOW Parameters

Parameter Optional/Mandatory Value Description

GPIO30 Optional 30 General Purpose Input Output 30

GPIO31 Optional 31 General Purpose Input Output 31

1VV0301498 Rev. 2.0 469 2020-05-05

Page 470: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

10.4 EMU Commands

10.4.1 EMU Get Version

This command is used to return the EMU software version.

Command Syntax AT+EMUVER=?

Synchronous Response

Table 455, page 470 describes the synchronous responses and remarks for EMU Get Version command.

10.4.2 EMU Get Supported Module List

This command is used to return the supported module lists.

Command Syntax AT+EMUSUPMOD=?

Parameter Description

Table 456, page 470 describes the EMU supported module list parameters.

Synchronous Response

Table 457, page 470 describes the synchronous responses and remarks for EMU supported module list command.

Table 455 EMU Get Version Synchronous Responses

Responses Remarks

OK Success

ERROR INVALID INPUT If parameters are not valid.

Table 456 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 457 EMU Supported Module List Synchronous Responses

Responses Remarks

OK Success

ERROR INVALID INPUT If parameters are not valid.

1VV0301498 Rev. 2.0 470 2020-05-05

Page 471: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

10.4.3 EMU Start

This command is used to start the EMU.

Command Syntax AT+EMUSTART

Synchronous Response

Table 458, page 471 describes the synchronous responses and remarks for EMU Start command.

10.4.4 EMU Stop

This command is used to stop the EMU.

Command Syntax AT+EMUSTOP

Synchronous Response

Table 459, page 471 describes the synchronous responses and remarks for EMU Stop command.

Table 458 EMU Start Synchronous Responses

Responses Remarks

OK Success

ERROR INVALID INPUT If parameters are not valid.

Table 459 EMU Stop Synchronous Responses

Responses Remarks

OK Success

ERROR INVALID INPUT If parameters are not valid.

1VV0301498 Rev. 2.0 471 2020-05-05

Page 472: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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 460, page 472 describes the EMU mode configuration parameters.

Synchronous Response

Table 461, page 472 describes the synchronous responses and remarks for EMU Mode Configuration command.

Table 460 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 461 EMU Mode Configuration Synchronous Responses

Responses Remarks

OK Success

ERROR INVALID INPUT If parameters are not valid.

1VV0301498 Rev. 2.0 472 2020-05-05

Page 473: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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 462, page 473 describes the EMU channel configuration for a given gain value.

Synchronous Response

Table 463, page 473 describes the synchronous responses and remarks for EMU Channel Configuration command.

Table 462 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 463 EMU Channel Configuration Synchronous Responses

Responses Remarks

OK Success

ERROR INVALID INPUT If parameters are not valid.

1VV0301498 Rev. 2.0 473 2020-05-05

Page 474: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

10.4.6 EMU Get Configuration

This command is used to get the configuration values which have been set for the EMU.

Command Syntax AT+EMUGETCONF=<Param>

Parameter Description

Table 464, page 474 describes the configuration values which have been set for the EMU.

Synchronous Response

Table 465, page 474 describes the synchronous responses and remarks for EMU Get Configuration command.

Table 464 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 465 EMU Get Configuration Synchronous Responses

Responses Remarks

OK Success

ERROR INVALID INPUT If parameters are not valid.

1VV0301498 Rev. 2.0 474 2020-05-05

Page 475: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

10.4.7 EMU Get Values

This 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 466, page 475 describes the synchronous responses and remarks for EMU Get Values command.

10.4.8 EMU Load Control

This command is used to switch on or off the EMU load.

Command Syntax AT+EMULOADCTRL=<1/0>

Parameter DescriptionParameters

Table 467, page 475 describes the EMU load control parameters.

Synchronous Response

Table 468, page 475 describes the synchronous responses and remarks for EMU Load Control command.

Table 466 EMU Get Values Synchronous Responses

Responses Remarks

OK Success

ERROR INVALID INPUT If parameters are not valid.

Table 467 EMU Load Control Parameters

Parameter Description

1/0• 0 - is for switching OFF the load

• 1 - is for switching ON the load

Table 468 EMU Load Control Synchronous Responses

Responses Remarks

OK Success

ERROR INVALID INPUT If parameters are not valid.

1VV0301498 Rev. 2.0 475 2020-05-05

Page 476: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

10.4.9 EMU Reset Energy

This command is used to reset the Accumulated Energy.

Command Syntax AT+EMURESETENERGY

Synchronous Response

Table 469, page 476 describes the synchronous responses and remarks for EMU Reset Energy command.

10.4.10 EMU Get Status

This command is used to return the status of the EMU.

Command Syntax AT+EMUGETSTATUS

Parameter Description

Table 470, page 476 describes the EMU get status parameters.

Synchronous Response

Table 463, page 473 describes the synchronous responses and remarks for EMU Get Status command.

Table 469 EMU Reset Energy Synchronous Responses

Responses Remarks

OK Success

ERROR INVALID INPUT If parameters are not valid.

Table 470 EMU Get Status Parameters

Parameter Description

Running/Stopped• Running - this runs the EMU status

• Stopped - this stops the EMU status

Table 471 EMU Get Status Synchronous Responses

Responses Remarks

OK Success

ERROR INVALID INPUT If parameters are not valid.

1VV0301498 Rev. 2.0 476 2020-05-05

Page 477: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

10.4.11 EMU Get Load Status

This command is used to return the load status of the EMU.

Command Syntax AT+EMULOADSTATUS

Parameter Description

Table 472, page 477 describes the EMU load status parameters.

Synchronous Response

Table 473, page 477 describes the synchronous responses and remarks for EMU load status command.

Table 472 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 473 EMU Load Status Configuration Synchronous Responses

Responses Remarks

OK Success

ERROR INVALID INPUT If parameters are not valid.

1VV0301498 Rev. 2.0 477 2020-05-05

Page 478: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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 478

• Live Calibration, page 493

• Debug, page 498

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 474 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.

1VV0301498 Rev. 2.0 478 2020-05-05

Page 479: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

Dat ps

GC

Dat

GC

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 475, page 479 describes the Asynchronous Frame Transmission parameters.

Table 474 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 Mb

T 18 8 14 11 27 27 27 27 26 25

a Rate 48 Mbps 54 Mbps MCS0 MCS1 MCS2 MCS3 MCS4 MCS5 MCS6 MCS7

T 24 19 27 27 27 27 25 24 20 16

Table 475 Asynchronous Frame Transmission Parameters

Parameter Optional/Mandatory Value Description

Channel Mandatory 1-14The 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-65535The number of asynchronous frames to be sent (1-65535).

1VV0301498 Rev. 2.0 479 2020-05-05

Page 480: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

Table 476, page 481 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/AThe rate at which the data need to be sent. See Table 476, page 481.

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/AThe 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 disabled

1 High throughput enabled

GuardInterval Mandatory1 Short guard interval

0 Long guard interval

GreenField Mandatory0 11n disabled

1 11n only

PreambleType Mandatory0 short

1 long

QosEnable Mandatory 0 Enable QoS

AckPolicy (Debug parameter) Mandatory 4 N/A

Scrambler (Debug parameter) Mandatory0 OFF

1 ON

AifsnVal Mandatory N/A N/A

Antenna Mandatory N/A N/A

ccaBypass Mandatory N/A N/A

Table 475 Asynchronous Frame Transmission Parameters

Parameter Optional/Mandatory Value Description

1VV0301498 Rev. 2.0 480 2020-05-05

Page 481: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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 477, page 482 describes the Asynchronous Frame Reception Start parameters.

Table 476 Asynchronous Frame Transmission Data Rates

TxRate HtEnable Data Rate (Mbps)

1 0 1

2 0 2

5 0 5.5

11 0 11

6 0 6

9 0 9

12 0 12

18 0 18

24 0 24

36 0 36

48 0 48

54 0 54

0 1 MCS0

1 1 MCS1

2 1 MCS2

3 1 MCS3

4 1 MCS4

5 1 MCS5

6 1 MCS6

7 1 MCS7

NOTE: Check the wireless sniffer to see if the frames are on air.

1VV0301498 Rev. 2.0 481 2020-05-05

Page 482: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

Example Serial2WiFi APPAT+NMAC=?00:1d:c9:17:8d:b1OKAT+WRFTESTSTARTOKAT+WRXTEST=6, 0, 429493010, 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 477 Asynchronous Frame Reception Start Parameters

Parameter Optional/Mandatory Value Description

Channel Mandatory 1 to 14The 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/AThe 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

1VV0301498 Rev. 2.0 482 2020-05-05

Page 483: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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.

1VV0301498 Rev. 2.0 483 2020-05-05

Page 484: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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,429493010,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.

1VV0301498 Rev. 2.0 484 2020-05-05

Page 485: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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 478, page 485 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 478 Asynchronous Frame Transmission Parameters

Parameter Optional/Mandatory Value Description

Channel Mandatory 1 to 14The 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-65535The 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/AThe 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.

1VV0301498 Rev. 2.0 485 2020-05-05

Page 486: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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 478 Asynchronous Frame Transmission Parameters

Parameter Optional/Mandatory Value Description

1VV0301498 Rev. 2.0 486 2020-05-05

Page 487: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

Table 479, page 487 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 478 Asynchronous Frame Transmission Parameters

Parameter Optional/Mandatory Value Description

Table 479 ModeSelect, TxRate, PHY test transmit rates for corresponding Data rates (TX99 mode)

Data Rate (Mbps) ModeSelect Mode TxRate PhyTestTxRate

1 1

802.11b

0 0

2 1 0 1

5.5 1 0 2

11 1 0 3

6 0

802.11g

0 3

9 0 0 7

12 0 0 2

18 0 0 6

24 0 0 1

36 0 0 5

48 0 0 0

54 0 0 4

1VV0301498 Rev. 2.0 487 2020-05-05

Page 488: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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 480, page 488 table provides examples of Tx99 mode command for corresponding Data rates.

MCS0 2

802.11n

0 0

MCS1 2 1 1

MCS2 2 2 2

MCS3 2 3 3

MCS4 2 4 4

MCS5 2 5 5

MCS6 2 6 6

MCS7 2 7 7

Table 479 ModeSelect, TxRate, PHY test transmit rates for corresponding Data rates (TX99 mode)

Data Rate (Mbps) ModeSelect Mode TxRate PhyTestTxRate

Table 480 Examples for Asynchronous Frame Transmission (TX99 mode)

Data Rate (Mbps) Example

1AT+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

2AT+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.5AT+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

11AT+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

1VV0301498 Rev. 2.0 488 2020-05-05

Page 489: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

6AT+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

9AT+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

12AT+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

18AT+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

24AT+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

36AT+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

48AT+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

54AT+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

MCS0AT+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

MCS1AT+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

MCS2AT+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

MCS3AT+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

MCS4AT+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

MCS5AT+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

MCS6AT+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

MCS7AT+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 480 Examples for Asynchronous Frame Transmission (TX99 mode)

Data Rate (Mbps) Example

1VV0301498 Rev. 2.0 489 2020-05-05

Page 490: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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 481, page 490 describes the Asynchronous Frame Transmission (TX100 mode) parameters.

Table 481 Asynchronous Frame Transmission (TX100 mode)

Parameter Optional/Mandatory Value Description

Channel 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

1VV0301498 Rev. 2.0 490 2020-05-05

Page 491: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

Table 482, page 491 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 7The rate will differ depending on the ModeSelect (see Table 482, page 491).

ModeSelect Mandatory 0 to 2• 0 - 11g mode

• 1 - 11b mode

• 2 - 11n mode

Table 481 Asynchronous Frame Transmission (TX100 mode) (Continued)

Parameter Optional/Mandatory Value Description

Table 482 PHY Test Transmit Rates (TX100 mode)

Mode Select PhyTestTxRate Data Rate (Mbps)

1 0 1

1 1 2

1 2 5.5

1 3 11

0 3 6

0 7 9

0 2 12

0 6 18

0 1 24

0 5 36

0 0 48

0 4 54

2 0 MCS0

2 1 MCS1

2 2 MCS2

2 3 MCS3

2 4 MCS4

2 5 MCS5

2 6 MCS6

2 7 MCS7

NOTE: Special equipment may need to be setup in order to observe the signals.

1VV0301498 Rev. 2.0 491 2020-05-05

Page 492: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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 483, page 492 describes the Carrier Wave Transmission parameters.

Example AT+WCARWAVTEST=11,0,27,0,2

Table 483 Carrier Wave Transmission Parameters

Parameter Optional/Mandatory Value Description

Channel 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/AThe period in which the carrier wave is transmitted.

1VV0301498 Rev. 2.0 492 2020-05-05

Page 493: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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.

1VV0301498 Rev. 2.0 493 2020-05-05

Page 494: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

Parameter Description

Table 484, page 494 describes the Live Calibration parameters.

Synchronous Response

Table 485, page 494 describes the synchronous responses and remarks for the Live calibration command.

Example AT+WLCALEN=1OK

Table 484 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 485 Live Calibration Synchronous Responses

Responses Remarks

OK 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

1VV0301498 Rev. 2.0 494 2020-05-05

Page 495: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

11.2.2 Erase Live Calibration

This 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 486, page 495 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 486 Live Calibration Erase Synchronous Responses

Responses Remarks

OK 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.

1VV0301498 Rev. 2.0 495 2020-05-05

Page 496: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

11.2.3 Start Live Calibration

This 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 487, page 496 describes the Start Live Calibration parameters.

Synchronous Response

Table 488, page 497 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 487 Start Live Calibration Parameters

Parameter Optional/Mandatory Value Description

value Mandatory1

Default value - 1Runs live calibration

1VV0301498 Rev. 2.0 496 2020-05-05

Page 497: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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 488 Start Live Calibration Synchronous Responses

Responses Remarks

Calibration Info:

status = SUCCESS

Length = Length of Calibration data

Data: Calibration data

OK

Success

Calibration Info:

status = FAIL

Length = Length of Calibration data

Data: Calibration data

OK

Failure

1VV0301498 Rev. 2.0 497 2020-05-05

Page 498: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

11.2.4 For Complete Sequence of Live Calibration

After 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 Level

This 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 489, page 498 describes the Error Code parameters.

Synchronous Response

Table 490, page 499 describes the synchronous responses and remarks for the Error Code command.

Table 489 Error Code Parameters

Parameter Optional/Mandatory Value Description

level Mandatory

0 (Default)No error code or warning message along with the command response.

1Error 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.

1VV0301498 Rev. 2.0 498 2020-05-05

Page 499: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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 491, page 499 describes the Echo parameters.

Table 490 Error Code Synchronous Responses

Responses Remarks

OK Success

ERROR Failure

NOTE: This command is applicable for all the AT Commands, but not to their Responses.

Table 491 Echo Parameters

Parameter Value Description

n

0 Disabled

1 (default)Enabled

If 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=?\r

Do not send AT+CID=?\r\n

1VV0301498 Rev. 2.0 499 2020-05-05

Page 500: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

Synchronous Response

Table 492, page 500 describes the synchronous responses and remarks for the Echo command.

11.3.3 Verbose

This command is used to enable or disable verbose mode for synchronous and asynchronous responses.

Command Syntax ATVn

Parameter Description

Table 493, page 500 describes the Verbose parameters.

Synchronous Response

Table 494, page 500 describes the synchronous responses and remarks for the Verbose command.

Table 492 Echo Synchronous Responses

Synchronous Responses Remarks

OK Success

ERROR: INVALID INPUT If parameters are not valid.

Table 493 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)Enabled

Verbose responses are enabled. The status response is in the form of ASCII strings.

Table 494 Verbose Synchronous Responses

Responses Remarks

OK Success

ERROR: INVALID INPUTIf parameters are not valid.

(n other than 0 or 1)

1VV0301498 Rev. 2.0 500 2020-05-05

Page 501: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

11.3.4 RSSI

This command is used to get information regarding the received signal strength of the incoming packets in dBm. WLAN updates the RSSI value of only Management frame (Beacon).

Command Syntax AT+WRSSI=?

Synchronous Response

Table 495, page 501 describes the synchronous responses and remarks for the Get RSSI command.

Example AT+WRSSI=?-33OK

11.3.5 WLAN Status

This command is used to retrieve information about the current wireless status.

Command Syntax AT+WSTATUS

Synchronous Response

Table 496, page 501 describes the synchronous responses and remarks for the alternate Status command.

Table 495 Get RSSI Synchronous Responses

Responses Remarks

RSSI

OKSuccess

Table 496 Alternate Status Synchronous Responses

Responses Remarks

MODE:<mode> CHANNEL:<channel> SSID:<ssid>

BSSID:<bssid> SECURITY:<security>

OK

Success

The GS node reports the current network configuration to the serial host:

• Mode

• Channel

• SSID

• BSSID

• Security

NOT ASSOCIATED

OKIf module is not associated with an access point.

1VV0301498 Rev. 2.0 501 2020-05-05

Page 502: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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 Status

This command is used to retrieve information about the current network status.

Command Syntax AT+NSTAT=?

Synchronous Response

Table 497, page 503 describes the synchronous responses and remarks for the Status command.

1VV0301498 Rev. 2.0 502 2020-05-05

Page 503: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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 496, page 501 describes the synchronous responses and remarks for the alternate Status command.

Table 497 Status Synchronous Responses

Responses Remarks

MAC=00:1d:c9:d0:70:cc

WSTATE=CONNECTED MODE=AP

BSSID=c8:d7:19:75:74:fbSSID="GainSpanDemo" CHANNEL=11 SECURITY=NONE

RSSI=-32

IP addr=192.168.1.99 SubNet=255.255.255.0 Gateway=192.168.1.1

DNS1=0.0.0.0 DNS2=0.0.0.0

Rx Count=22 Tx Count=75090

OK

• 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

1VV0301498 Rev. 2.0 503 2020-05-05

Page 504: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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 Statistics

This 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

Command Note Before issuing this command, make sure that you enable the “Ping and Trace Route” option under the “Networking Services” tab while building the firmware in the SDK Builder.

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.

Table 498 Alternate Status Synchronous Responses

Responses Remarks

MODE:<mode> CHANNEL:<channel> SSID:<ssid>

BSSID:<bssid> SECURITY:<security>

OK

Success

The GS node reports the current network configuration to the serial host:

• Mode

• Channel

• SSID

• BSSID

• Security

NOT ASSOCIATED

OKIf module is not associated with an access point.

NOTE: This command is used for testing and debugging purpose only.

1VV0301498 Rev. 2.0 504 2020-05-05

Page 505: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

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 499, page 505 describes GS node WLAN TX Statistic counters.

Table 499 GS Node WLAN TX Statistic Counters

WLAN Statistic Counters Description

itxs TX Success

itxto TX Timeout

itxf TX Failed

wep40 WEP-40 encrypted

wep104 WEP-104 encrypted

tkip TKIP encrypted

ccmp CCMP encrypted

unencryp Not encrypted

ukencryp Unknown encryption

leg Legacy frames

ht20l HT-LongGl-20MHz

ht20s HT-Shrtl-20MHz

ht40l HT-LongGl-40MHz

ht40s HT-ShrtGl-40MHZ

mcs32s MCS-32 ShortGl

mcs32l MCS-32 LongGl

probersp Probe response

proberreq Probe request

mc_data Multicase data

uc_data Unicast data

qos_uc_data Unicast QoS data

qos_mc_data Multicast QoS data

amsdu_uc_data Unicast AMSDU data

amsdu_mc_data Multicast AMSDU data

ampdu_uc_data Unicast AMPDU data

ampdu_mc_data Multicast AMPDU data

oth_mgmt Other management

oth Other frames

ctrl Control frames

1VV0301498 Rev. 2.0 505 2020-05-05

Page 506: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

Table 500, page 506 describes GS node WLAN RX Statistic counters.

retries Retries

multiple_retries Multiple retries

fragments Fragments

Table 500 GS Node WLAN RX Statistic Counters

WLAN Statistic Counters Description

irx0 Invalid

irxf FCS Failure

irxs RX Successful

irxd Duplicate Detected

irxmf MIC Failed

irxkf Key Failed

irxicvf ICV Failed

irxtkipicvf ICV failed for TKIP

irxtkipmf MIC failed for TKIP

irxrf CCM Replay Failure

irxtkiprf TKIP Replay Failure

irxdip Defragmentation in Progress

irxdf Defragmentation Failure

irxex Exception - Reserved value

wep40 WEP-40 encrypted

wep104 WEP-104 encrypted

tkip TKIP encrypted

ccmp CCMP encrypted

unencryp Not encrypted

ukencryp Unknown encryption

leg Legacy

ht20l HT-LongGl-20MHZ

ht20s HT-ShrtGl-20MHz

ht40l HT-LongGl-40MHz

ht40s HT-ShrtGl-40MHz

mcs32s MCS-32 ShortGl

mcs32l MCS-32 LongGl

bcn Beacon

Table 499 GS Node WLAN TX Statistic Counters (Continued)

WLAN Statistic Counters Description

1VV0301498 Rev. 2.0 506 2020-05-05

Page 507: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

rts RTS

cts CTS

ack ACK

probersp Probe response

probereq Probe request

atim ATIM

cfend CF-End

back Block-Ack

bar Block-Ack Request

mc_data Multicast data

uc_data Unicast data

oth_data Other data

qos_uc_data Multicast QoS data

qos_mc_data Unicast QoS data

qos_oth_data Other QoS data

amsdu_uc_data Multicast AMSDU data

amsdu_mc_data Unicast AMSDU data

amsdu_oth_data Other AMSDU data

oth_mgmt Other Management frame

oth_ctrl Other Control frame

oth Other type

Table 500 GS Node WLAN RX Statistic Counters (Continued)

WLAN Statistic Counters Description

1VV0301498 Rev. 2.0 507 2020-05-05

Page 508: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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 508

• Asynchronous & Enhanced Asynchronous Messages, page 509

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 Messages

Table 501, page 508lists the response codes with all characters including: <CR> or <LF> that would be seen on the MCU interface.

Table 501 Response codes for Synchronous Messages

Events Synchronous Message RemarksVerbose mode Non Verbose mode

S2W_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\nInvalid Command or Option orParameter

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\nGS 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

1VV0301498 Rev. 2.0 508 2020-05-05

Page 509: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

A.2 Asynchronous & Enhanced Asynchronous Messages

Table 502, page 509 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 502 Response codes for Asynchronous and Enhanced Asynchronous Messages

Events Verbose mode Non Verbose ModeAsynchronous message Enhanced

asynchronous messageAsynchronous

messageEnhanced

asynchronous message

ERROR \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

1VV0301498 Rev. 2.0 509 2020-05-05

Page 510: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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\rn

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\rn

APP 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\rn

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\rn

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\rn

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 502 Response codes for Asynchronous and Enhanced Asynchronous Messages

Events Verbose mode Non Verbose ModeAsynchronous message Enhanced

asynchronous messageAsynchronous

messageEnhanced

asynchronous message

1VV0301498 Rev. 2.0 510 2020-05-05

Page 511: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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 of

StandBy-Pspoll\r\n\r\n

<ESC><A>ff0815Out of StandBy-Pspoll<CR><LF>

r\n50\r\n<ESC><A>ff080226<CR><LF>

Table 502 Response codes for Asynchronous and Enhanced Asynchronous Messages

Events Verbose mode Non Verbose ModeAsynchronous message Enhanced

asynchronous messageAsynchronous

messageEnhanced

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.

1VV0301498 Rev. 2.0 511 2020-05-05

Page 512: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

A.3.1 Exception Messages

The possible exception messages sent by the Adapter to the serial host are enumerated in Table 503, page 512.

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 503 Exception Messages

No. ASCII String Meaning

1 \r\n\n\rAPP Reset-Wlan SW Reset\r\n\r\nAdapter 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\nAdapter reset due to WLAN processor watchdog.

4 \r\n\n\rAPP Reset-App-Wd\r\n\r\nAdapter reset due to app processor watchdog.

5 \r\n\n\rAPP Reset-Wlan Except\r\n\r\nAdapter 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.

1VV0301498 Rev. 2.0 512 2020-05-05

Page 513: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

A.3.2 Boot Messages

The possible boot messages sent by the Adapter to the serial host are enumerated in Table 504, page 513.

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 504 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.

1VV0301498 Rev. 2.0 513 2020-05-05

Page 514: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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.

1VV0301498 Rev. 2.0 514 2020-05-05

Page 515: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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 515

• General Operations, page 516

• Wireless, page 518

• Network, page 527

• Data Transfer, page 528

• Advance Services, page 535

• Power Management - Radio and System, page 540

• Peripherals, page 543

• Production and Debug, page 545

• Default Return Messages, page 547

• Escape Sequence Commands, page 548

B.1 Host Interaction

Table 505, page 515 lists the Host Interaction AT commands.

Table 505 Host Interaction AT Supported Commands

Command Parameters Response / Effect

ATB<baudrate>[[,bitsperchar>][,<parity>][,<stopbits]]

UART parameters are immediately reset to values provided.

AT&Knn=0

n=1Enable 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”

1VV0301498 Rev. 2.0 515 2020-05-05

Page 516: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

B.2 General Operations

Table 506, page 516 lists the General Operation interface AT commands.

Table 506 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>,<Server

IP>,<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 NoneCurrent 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 NoneRestore profile to factory default values.

1VV0301498 Rev. 2.0 516 2020-05-05

Page 517: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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 Supported

Sets 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+ASYNCMSGFMT

n

• 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 506 General Operations AT Supported Commands

Command Parameters Response / Effect

1VV0301498 Rev. 2.0 517 2020-05-05

Page 518: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

B.3 Wireless

Table 507, page 518 lists the Wireless AT commands.

Table 507 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 mode

2 - limited AP

5 - ISOTX

Set 802.11 Station operating mode.

AT+WRETRY <n>1 to 255Sets 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 NonePrepares WLAN for graceful shutdown

1VV0301498 Rev. 2.0 518 2020-05-05

Page 519: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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 507 Wireless AT Supported Commands

Command Parameters Response / Effect

1VV0301498 Rev. 2.0 519 2020-05-05

Page 520: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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 NoneDisassociate 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 255Keep-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 507 Wireless AT Supported Commands

Command Parameters Response / Effect

1VV0301498 Rev. 2.0 520 2020-05-05

Page 521: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

AT+WWEP1=<key>

If setting Key 2, the command would be:

AT+WWEP2=<key>

1VV0301498 Rev. 2.0 521 2020-05-05

Page 522: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

Table 508, page 522 lists the Wi-Fi Direct AT commands.

Table 508 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 UUId

AT+P2PSETATTR <attribute ID><attribute value> Sets the P2P attributes

1VV0301498 Rev. 2.0 522 2020-05-05

Page 523: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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 NAStops the P2P find operation that is currently in progress

AT+P2PPROVOK <WPS-KEYPAD PIN><CR>Triggers the WPS- registrar functionality for GO.

Table 508 Wi-Fi Direct AT Supported Commands

Command Parameters Response / Effect

1VV0301498 Rev. 2.0 523 2020-05-05

Page 524: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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 508 Wi-Fi Direct AT Supported Commands

Command Parameters Response / Effect

1VV0301498 Rev. 2.0 524 2020-05-05

Page 525: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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 508 Wi-Fi Direct AT Supported Commands

Command Parameters Response / Effect

1VV0301498 Rev. 2.0 525 2020-05-05

Page 526: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

Table 509, page 526 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 508 Wi-Fi Direct AT Supported Commands

Command Parameters Response / Effect

Table 509 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.

1VV0301498 Rev. 2.0 526 2020-05-05

Page 527: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

B.4 Network

Table 510, page 527 lists the Network AT commands.

Table 510 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+NDHCPn[,<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+DNS

n,<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.

1VV0301498 Rev. 2.0 527 2020-05-05

Page 528: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

B.5 Data Transfer

Table 511, page 528 lists the Data Transfer AT commands.

Table 511 Data Transfer AT Supported Commands

Command Parameters Response / Effect

AT+BDATA• 1 - Enable

• 0 - DisableEnables 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

1VV0301498 Rev. 2.0 528 2020-05-05

Page 529: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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:25

The valid Inner authentication values are:

• EAP-MSChAP:26

• EAPGTC:6

• EAP-PAP: 253

For PEAP with Certificates, set the [Use CA Certificates] field to “1”.

AT+WEAP<Type>,<Format>,<Size>,<Location><CR>

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 511 Data Transfer AT Supported Commands

Command Parameters Response / Effect

1VV0301498 Rev. 2.0 529 2020-05-05

Page 530: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

Table 512, page 530 lists the Auto Mode AT commands.

Table 512 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 NoneStarts Auto Connect, including association.

ATA2 NoneInitiates 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 513 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 a

remote server with IPv4 address.

AT+NCTCPRESTORE <CID>Restores the connection parameters previously stored through

AT+NCTCPSTORE command.

1VV0301498 Rev. 2.0 530 2020-05-05

Page 531: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

Table 514, page 531 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 a

remote server with IPv4 address.

AT+DTLSRESTORE <CID>Restores the connection parameters previously stored through

AT+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 513 Data Transfer AT Supported Commands (Continued)

Command Parameters Response / Effect

Table 514 HTTP AT Supported Commands

Command Parameters Response / Effect

AT+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.

1VV0301498 Rev. 2.0 531 2020-05-05

Page 532: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

Table 515, page 532 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 to

a 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 514 HTTP AT Supported Commands (Continued)

Command Parameters Response / Effect

Table 515 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

1VV0301498 Rev. 2.0 532 2020-05-05

Page 533: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

Table 516, page 533 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 515 CoAP AT Supported Commands (Continued)

Command Parameters Response / Effect

Table 516 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=0

n=1If 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.

1VV0301498 Rev. 2.0 533 2020-05-05

Page 534: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

Table 517, page 534 lists the Multicast AT commands.

Table 517 Multicast AT Supported Commands

Command Parameters Response / Effect

AT+NIPMULTICASTJOIN <GroupIP> Joins the specified multicast group.

AT+NIPMULTICASTLEAVE <GroupIP> Leaves the specified multicast group.

AT+MCSTSETn=0

n=1If 1, enables Multicast and Broadcast reception

1VV0301498 Rev. 2.0 534 2020-05-05

Page 535: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

B.6 Advance Services

Table 518, page 535 lists the Advance Services AT commands.

Table 518 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/AStarts the mDNS module of the adapter.

AT+MDNSSTART ? Returns the current status of mDNS.

AT+MDNSV6START N/AStarts 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 caching

Enable: 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 NoneDeletes 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.

1VV0301498 Rev. 2.0 535 2020-05-05

Page 536: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

AT+NARPAUTO nEnables 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 518 Advance Services AT Supported Commands (Continued)

Command Parameters Response / Effect

1VV0301498 Rev. 2.0 536 2020-05-05

Page 537: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

Table 519, page 537 lists the Firmware Update AT commands.

Table 520, page 538 lists the HomeKit AT commands.

Table 519 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/AIt is used to rollback to the previous firmware version.

AT+FWINFOGET N/AGets the version numbers of available firmwares in flash.

AT+SOTHFWUPSTART<Image Type>,<Encoding format>,<Size>

Returns the standard command response to the serial host.

1VV0301498 Rev. 2.0 537 2020-05-05

Page 538: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

Table 521, page 538 lists the Provisioning AT commands.

Table 520 HomeKit AT Supported Commands

Command Parameters Response / Effect

AT+HKSETUP

[<Accessory category>,<Discovery

ID>,<Configuration number>,<Model name>,<Setup

code>,<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>,<Service

Type>,<Number of characteristics>]

Adds a service to an accessory

AT+HKACC

[<Acessory ID>,<Service ID>,<Characteristic

ID>,<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 521 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.

1VV0301498 Rev. 2.0 538 2020-05-05

Page 539: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

Table 522, page 539 lists the Advance Services AT commands.

Table 522 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=0

n=1If 1, enables all the credentials from AP to print during WPS procedure

AT+WACSTART

n

0,1

0: Stop

1: Start

Starts or stops Apple’s Wireless Accessory Configuration (WAC).

1VV0301498 Rev. 2.0 539 2020-05-05

Page 540: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

B.7 Power Management - Radio and System

Table 523, page 540 lists the Power Management - Radio & Systems AT commands.

Table 523 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 disable

n=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-0

LISTEN INTERVAL-1

CUSTOM-2

Wake 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.

1VV0301498 Rev. 2.0 540 2020-05-05

Page 541: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

Table 524, page 541 lists the Battery Check AT commands.

Table 525, page 541 lists the System Power Save AT commands.

Table 524 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/ARetrieve the most recent battery check value.

Table 525 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 connection

that 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 mode

between beacons

AT+PSSTBYBWBEACONCONF

<Conf ID>,<Value>

Configures GS node to support transitioning the ultra low power

standby mode between beacons.

1VV0301498 Rev. 2.0 541 2020-05-05

Page 542: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

Table 526, page 542 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 525 System Power Save AT Supported Commands

Command Parameters Response / Effect

Table 526 Hardware Cryptography AT Supported Commands

Command Parameters Response / Effect

AT+CRYPTOEN

n

• 1 - Enable

• 0 - Disable

Enables or disables hardware cryptography block.

1VV0301498 Rev. 2.0 542 2020-05-05

Page 543: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

B.8 Peripherals

Table 527, page 543 lists the I2C AT commands.

Table 528, page 543 lists the PWM AT commands.

Table 529, page 543 lists the GPIO AT commands.

Table 527 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 528 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 529 GPIO AT Supported Commands

Command Parameters Response / Effect

AT+DGPIO<GPIO-NO>,<SET/RESET0/1>

Sets or resets (high/low) a GPIO pin.

1VV0301498 Rev. 2.0 543 2020-05-05

Page 544: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

Table 530, page 544 lists the EMU AT commands.

Table 530 EMU AT Supported Commands

Command Parameters Response / Effect

AT+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/AThis command gets the status of the EMU.

AT+EMULOADSTATUS N/AThis command gets the load status of the EMU.

NOTE: Parameters in [ ] are optional. Values are expressed as ASCII text unless specified.

1VV0301498 Rev. 2.0 544 2020-05-05

Page 545: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

B.9 Production and Debug

Table 531, page 545 lists the RF Test AT commands.

Table 531 RF Test AT Supported Commands

Command Parameters Response / Effect

AT+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/AStops 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.

1VV0301498 Rev. 2.0 545 2020-05-05

Page 546: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

Table 532, page 546 lists the Live Calibration AT commands.

Table 533, page 546 lists the Debug AT commands.

Table 532 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/AErases live calibration LUT in flash.

AT+WLCALSTART <value> Runs Live Calibration

Table 533 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 (enableIF 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.

1VV0301498 Rev. 2.0 546 2020-05-05

Page 547: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

B.10 Default Return Messages

Table 534, page 547 lists the Default Return Messages.

Table 534 Default Return Messages

Status Message (Verbose Enabled) Message (Verbose Disabled)

Valid Input OK 0

Invalid Input ERROR: Invalid Input 2

NOTE: Other commands can return different ERROR messages.

1VV0301498 Rev. 2.0 547 2020-05-05

Page 548: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

B.11 Escape Sequence Commands

Table 535, page 548 lists the available Escape Sequence commands.

Table 535 Escape Sequence Commands

Escape Sequence Description

<ESC>S CID 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 UDP client (must be done before data can be received by that client).

Example: <ESC>S10123456789<Esc>E (where 1 is the UDP client CID and 012...9 is the data to be sent)

<ESC>U CIDremote address:remote port:

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 ASCII text encoding and terminated with a ':' character.

Example: <ESC>U4192.168.1.1:52:<data><Esc>E

<ESC>u CID<remote address><remote port>

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.

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

<ESC>E End-of-Data sequence, indicating end of a transmit frame, and start of transmission. The data received is sent on the network, and the interface returns to Command mode.

<ESC>C This sequence causes transmission of the data received, after which the currently selected connection is closed, and the interface returns to Command Mode. Any buffered data is sent before the connection is closed.

<ESC>xxx If an unknown character “xxx” is detected after an <ESC> character the <ESC> and the <xxx> characters are ignored.

<ESC>M<Chunk size in bytes><:><Image of mentioned chunk size>

This escape sequence is used to digital data or firmware from Host MCU to GS node.

<ESC>N<CID><Data of above Length>

This escape sequence is used to send MCU application message MQTT data from client to the server.

1VV0301498 Rev. 2.0 548 2020-05-05

Page 549: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

<ESC><N><CID><StartOfFrame><CurrentLength><Total Length Of Frame><TopicName><Space><DataOfLength Equal to CurrentLength>

This escape sequence is used to receive MQTT data sent by GS node.

<ESC>i<CID><Data of above Length>

This escape sequence is used to send the WebSocket client data to server connected.

<ESC>W <data of size mentioned in AT+WEAP>

This escape sequence is used to enable the GS node and receive the EAP certificates.

Table 535 Escape Sequence Commands (Continued)

Escape Sequence Description

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

1VV0301498 Rev. 2.0 549 2020-05-05

Page 550: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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

1VV0301498 Rev. 2.0 550 2020-05-05

Page 551: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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

1VV0301498 Rev. 2.0 551 2020-05-05

Page 552: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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

1VV0301498 Rev. 2.0 552 2020-05-05

Page 553: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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

1VV0301498 Rev. 2.0 553 2020-05-05

Page 554: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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

1VV0301498 Rev. 2.0 554 2020-05-05

Page 555: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

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

1VV0301498 Rev. 2.0 555 2020-05-05

Page 556: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

166.AT+WCARWAVTEST

167.AT+WD

168.AT+WEAP

169.AT+WEAPCONF

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+WPAPSK

184.AT+WPARAMSET

185.AT+WPHYMODE

186.AT+WPSK

187.AT+WRATE

188.AT+WREGDOMAIN

189.AT+WRETRY

190.AT+WRFTESTSTART

191.AT+WRFTESTSTOP

192.AT+WRSSI

193.AT+WRTS

194.AT+WRXACTIVE

195.AT+WRXPS

196.AT+WRXSTOP

197.AT+WRXTEST

1VV0301498 Rev. 2.0 556 2020-05-05

Page 557: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements

GS2101M S2W Adapter Command Reference Guide

198.AT+WS

199.AT+WSEC

200.AT+WST

201.AT+WSTATUS

202.AT+WSYNCINTRL

203.AT+WTEMPREAD

204.AT+WTX100TEST

205.AT+WTX99TEST

206.AT+WWEP N

207.AT+WWEPCONF

208.AT+WWPA

209.AT+WWPS

210.AT+XMLPARSE

211.AT+XMLSEND

1VV0301498 Rev. 2.0 557 2020-05-05

Page 558: GS2101M S2W Adapter Command Reference Guide · GS2101M S2W Adapter Command Reference Guide 1VV03014 98 Rev. 2.0 3 2020-05-05 USAGE AND DISCLOSURE RESTRICTIONS I. License Agreements