AT Command Reference and Applications User s Guide

Similar documents
AT Command Version 2.1 Application Note. This document provides information for controlling Ameba through external UART.

WizFi250 Quick Start Guide

Ameba RTL8195AM+ALC5680 Smart Voice 2-Mic Development Kit User Guide for Baidu DuerOS

Realtek Ameba-1 Power Modes

eztcp Configuration Software ezmanager Manual Version 1.9 Sollae Systems Co., Ltd.

User guide of Google Nest s cloud database

User Manual V1.1 Date: WiFi RS-232 Adapter. Red LED: IP Address Blue LED: TX/RX 5V Out (Pin 9)

Firmware Reprogramming Guide

RN-WIFLY-EVAL-UM. WiFly Evaluation Kit Roving Networks. All rights reserved. RN-WIFLY-EVAL-UM-1.0 Version /8/2011 USER MANUAL

Aport-213 One Port Serial-to-WiFi Gateway User s Guide

Programming User Guide Version 2.2

WS2118/WS2119 EVB AT CMD USER GUIDE. Version: A module/product solution provider. Center Supervisor Joshua Guo Louis Lee Austin Huang

G3P-WiFi User Manual Release 1.2

Programming User Guide Version 2.0

WiFi 16 Relay Board TCP ModBus Controlled - User Manual 21 Aug WiFi 16 Relay Board TCP ModBus Controlled

WIZ-SM10 Datasheet. ( Version 0.1 ) 2010 WIZnet Co., Ltd. All Rights Reserved. For more information, visit our website at

Wi-Fi 16 Relay Module User Manual 21 Aug Wi-Fi 16 Relay Module

WiFiBee MT7681 (Arduino WiFi Wireless Programming) SKU: TEL0107

WiFi to RS-232 adapter user manual

WIFI DEVICE. User Manual. Shanghai Shuncom Electronic Technology Co., Ltd. Shanghai Shuncom Electronic Technology Co.,Ltd.

WizFi250 Programmer's Guide

ezconfig User s Manual

BLUEGIGA WI-FI SOFTWARE

(1) Device Management tool: enables you to remotely manage AX220xx RS232-to-WiFi devices.

Web UI Guide. Overview 5-2 Activating Web UI 5-2 Status Screen 5-3 Main Menu 5-3

SSE232-LE Serial Server- User s Manual

BLUEGIGA WI-FI SOFTWARE

Industrial Serial Device Server

RN-171-EK Evaluation Board

WiFi to RS-422/485 adapter user manual

Session 4. Embedded Wireless LAN Module. (WizFi210/220) Ultra Low Power. WIZnet EU 2012 MARCH - 1 -

Embedded Modbus TCP Module GS11-MT. User Manual REV 1.1. SST Automation.

Wi-Fi Modules. Turnkey Solution for the Internet of Things

kcenergy User Guide Introduction Hardware

Getting Familiar with Wi-Fi Scanner

EGW1-IA3-MB User s Manual

Wifi Attachment Manual

User Manual V1.2 Date: WiFi RS-232 Adapter. Red LED: IP Address Blue LED: TX/RX 5V Out (Pin 9)

USR-TCP User Manual

HOME AUTOMATION, INC. Model 93A00-1. Serial Server. User s Manual

Ethernet to RS-422/485 adapter user manual

Appendix A - Configuring the WiFi Module Option

USR-TCP User Manual

WIFI232-RS232 quick start guide

BitPipe Cellular Dev- Kit

Settings Settings

UG160: Wizard Gecko BGTool User's Guide

WF121: b/g/n module. Product Presentation

Freescale Semiconductor Inc. TWRWIFIGS1500MLAB. TWR-WIFI-GS1500M Lab Guide Rev. 1

WizFi250 Programmer's Guide

WIFI232 series product is used for convert data from RS232 to WIFI TCPIP, Two-way transparent

User Manual. ESP8266 Wifi Shield

ETH to 232 (A) User Manual

LiteStation2 LiteStation5 User s Guide

Bluegiga Wi-Fi Software 9/19/2013 1

ICP DAS IOP760AM FAQ. FAQ Version ICP DAS Co., Ltd

WRE2206. User s Guide. Quick Start Guide. Wireless N300 Range Extender. Default Details. Version 1.00 Edition 1, 01/2015

HF-LPB300 Low Power WiFi Module User Maunal V 1.0

USR-W600 User Manual. File Version: V Jinan USR IOT Technology Limited 1

UART Interface Wlan Adapter Application Note

kcenergy User Guide DRAFT EDITION Introduction Serial Data Communications Hardware Supported Bluetooth Profiles

SN8000 EVK User Guide

Appendix A - Configuring the WiFi Module Option

Pmod ESP32 Reference Manual

EH-MC-10. Command Interface User Guide. Ver 1.3

PowerStation2 LiteStation2 LiteStation5 User s Guide

Wireless-Tag WT51822-S4AT

Wireless LAN Device Series CPE2615. User Manual. v

MDNET-5W. Wi-Fi/Ethernet/RS485 Converter Operation Manual. Version /03/24

ArduCAM CC3200 UNO board

Wireless LAN Device Series CPE2615. User Manual. v

WiFi to RS-232 adapter user manual

WIZ140SR/WIZ145SR Datasheet

USR-LG220-L User Manual

Added released version binaries for TR-CPQ, TR-SL2, TR-SL5, TR-SL9, TR-6, TR-5a, TR- FDD, TR-4.9, TR-Multi, and TR-90X

Overview. Introduction. Key Features

Communication adapter RS232 over the Wi-Fi ELO E231. User manual

ECOV-110 User s Manual

Content 1. General Description Features System Block Diagram Module Hardware Description Module photo Packag

GreenEye Monitor. GEM Communication Setup Manual. For GEM model: GEM-W. (Wifi Only Option)

CONFIGURATION MANUAL. English version

MRD-310 MRD G Cellular Modem / Router Web configuration reference guide. Web configuration reference guide

PePWave Mesh Connector User Manual

WiFi A/V Module. (Model: WM-CAM)

USR-TCP Serial Device Server

UART data s integrity UART frame control Agenda Power save management TCP maintenance settings Multiple AP roaming and dual mode Firmware update mode,

AplombTech Smart Router Manual

Grandstream Networks, Inc. GWN76xx Wi-Fi Access Points Master/Slave Architecture Guide

Reference Manual. mxchipwnet TM -DTU firmware. UART <> Wi-Fi Firmware. 4.0 Date: Reference manual. Overview

WIFLY SERIAL ADAPTER RN-370 & RN-374

Security SSID Selection: Broadcast SSID:

CC3100 SimpleLink Wi-Fi Network Processor and Internet-of-Things Solution for MCU Applications

RN-174. WiSnap M2 Super Module. Features. Description. Applications. ~ page 1 ~ rn-174-ds v1.1 6/1/2011

XT200 Intelligent Network Router

DWR G Integrated Access Device. User Manual

DEMO XTR-8LR100 DEMO XTR-8LR10 User Manual

DFRobot BLE4.1 Module SKU: TEL0120

BLE Command Line Interface Document

USR-W610 User Manual. File Version: V Jinan USR IOT Technology Limited 1

RN-111B-EVAL IGRN111B-EVAL 3/10/2009. WiFly evaluation Kit. Features. Description. Getting Started

Transcription:

A module/product solution provider AT Command Reference and Applications User s Guide V 0.1.3 For Ameba firmware V 1.02 SW Engineer SW Supervisor Center Supervisor Nathan Kuo Austin Huang Austin Huang ~ 1 ~

Table of Contents Table of Contents... 2 Manual History... 4 1. Introduction... 5 1.1. Architecture... 5 1.2. Module Features... 6 1.3. GPIO pins... 7 1.3.1. Pin Out Definition... 7 1.3.2. Introduction to GPIO pins... 8 1.4. UART Port for User... 9 1.4.1. Features... 9 2. Command Reference... 10 2.1. Command Syntax... 10 2.1.1. The format to send an AT command is as follows:... 10 2.1.2. The received response is show in followings.... 10 2.2. Returning system and error codes... 11 2.3. Command List... 12 3. AT Commands for Wi-Fi Setting... 13 3.1. Introduction... 13 3.2. Client Mode... 14 3.3. AP Mode... 15 3.4. Web Server... 16 3.4.1. AP Mode... 16 3.4.2. Client Mode... 17 4. AT Commands for Networking... 18 4.1. ATWZ (Read MAC message):... 18 4.2. ATWD(Disconnect from a network):... 18 4.3. ATWI (Ping Test):... 18 4.4. ATWP (Power on/off):... 19 4.5. ATWS (Scan for Network):... 19 4.6. ATWR (Scan for Network):... 20 4.7. ATW? (Show network information):... 20 4.8. ASDS (Set DNS Server IP):... 21 4.9. AGDS (Get DNS Server IP):... 21 4.10. AMDS (Set and Start MDNS ):... 21 4.11. TCP Client Socket... 22 ~ 2 ~

4.11.1. Sequence to create a Socket to connect to a dedicate IP:... 22 4.11.2. Close Client Socket:... 23 4.12. TCP Server Socket... 23 4.12.1. Sequence to a Socket to accept connections:... 23 4.12.2. Close Server Socket:... 23 4.13. UDP Client Socket... 24 4.13.1. Sequence to create a Socket to connect to a dedicate IP:... 24 4.13.2. Close UDP Socket:... 24 4.14. UDP Server Socket... 24 4.14.1. Sequence to a Socket to accept connections:... 24 4.14.2. Close UDP Socket:... 25 4.15. TCP and UDP Socket application... 25 4.15.1. Introduction:... 25 4.15.2. Create a connection to a TCP server:... 25 4.15.3. Accept a connection for a TCP client:... 26 4.15.4. Connection to UDP server:... 27 4.15.5. Accept connection for UDP client:... 28 4.16. Setting up a Secure (SSL)Connection... 29 5. AT Commands for System Setting... 30 5.1. ASLP (Deep Sleep):... 30 5.2. AVRR (Get Version Firmware& Hardware):... 30 5.3. ARST(Reset System):... 31 5.4. ACLR(Erase AP or Clien Wi-Fi information):... 31 5.5. ABUD(Set and query baud rate of the UART in user mode):... 31 6. Over-the-air (OTA) Update... 33 6.1. ATWO (For firmware update)... 33 7. Appendix A - UART Utility... 35 7.1. Screenshot... 35 7.2. Configuration... 35 7.3. Send AT Command... 35 7.4. Transmit Data... 36 7.5. Receive Data... 36 8. Appendix B - Reference... 36 ~ 3 ~

Manual History Date Releases Features 2016/10/04 V0.1.0 Initial Release 2017/01/03 V0.1.1 Updated AT command and FW OTA function for Ameba firmware V 1.0.0 2017/06/15 V0.1.2 Updated AT command and FW OTA function for Ameba firmware V 1.0.2 Section 4.1.16 SSL command and usage changed. 2017/07/15 V0.1.3 Updated ACLC and ACLA to ACLR command and Figure2 and 3. ~ 4 ~

WG6611 AT command User s Guide 1. Introduction 1.1. Architecture Jorjin Low Power Wi-Fi WG6611 Module is able to be used as a standalone system with Wi-Fi internet capability or a Wi-Fi interface connecting to an existing MCU. The architectures of these two types are shown as follows: AT AT WG6611 WG6611 MCU Command Command (1) (2) Figure 1. Architectures of (1) standalone system and (2) Wi-Fi interface with an existing MCU. The details of how to use USB-URAT dongle to connect to WG6611 Module is shown in Figure 2. By using the dongle, one can send commands WG6611 modules and receives the responses from it. Figure 2. Using USB-URAT dongle to connect to WG6611 Module. ~ 5 ~

WG6611 AT command User s Guide 1.2. Module Features Figure 3. Connections of a WG6611 module and an MCU. 1. IC: RTL8711AM 2. Package: QFN56 3. External flash:2m bytes 4. I/O: GPIO pin 6 Reset/Default pin 1 UART command/data mode pin 1 UART PORT 1 JTAG PORT 1 5. AT command FW with UART baud rate default is 9600. ~ 6 ~

1.3. GPIO pins WG6611 AT command User s Guide 1.3.1. Pin Out Definition The definitions of the GPIO pins of Jorjin WG6611 WiFi modules are listed in the following tables. Figure 4. Map for Jorjin WG6611 Module. ~ 7 ~

WG6611 AT command User s Guide PIN name PIN defined State Note GPIOA_3 UART_RTS Input PH GPIOA_5 UART_CTS Output PH GPIOA_6 UART_RX Input PH User UART GPIOA_7 UART_TX Output HI GPIOB_0 LOG_TX Output HI GPIOB_1 LOG_RX Input PH Debug UART GPIOB_2 IO Output PL GPIOB_3 IO Output PL GPIOC_0 IO Output PL GPIOC_1 IO Output PL GPIO GPIOC_2 IO Output PL GPIOC_3 IO Output PL GPIOC_4 GPIO INT Input PH GPIO GPIOC_5 GPIO INT Input PL GPIO GPIOE_0 JTAG_TRST Input PH GPIOE_1 JTAG_TDI Input PH GPIOE_2 JTAG_TDO Output PH JTAG GPIOE_3 JTAG_TMS/SWDIO Input PH GPIOE_4 JTAG_CLK/SWCLK Input PH Note : PH = Pull-High, PL=Pull-Low, HI = High-impedance Table 1. GPIO pin definition of Jorjin WG6611 Module. 1.3.2. Introduction to GPIO pins In the following, the GPIO pins with specified will introduced. Please refer [1] to see the details of those are not addressed. 1.3.2.1. GPIOC_4: GPIOC_4 can be used to reset the system and to clean the Wi-Fi setting (AP and Client Mode) by pulling GPIOC_4 from high to low keep over 100 ms to reset system. When pulling GPIOC_4 from high to low and keep over 5 seconds, the system will clean Wi-Fi setting. Notice that, only the Wi-Fi setting of the current Wi-Fi mode will be cleaned and the Wi-Fi mode will not change by the reset action. 1.3.2.2. GPIOC_5: GPIOC_5 is used for User UART Port. When it is pulled Hi, the port will be in Command Mode, in which AT Commands can be used. On the contrary, the port will be in Transparent Mode. ~ 8 ~

1.4. UART Port for User WG6611 AT command User s Guide 1.4.1. Features UART port can be used to send AT commands or transfer data based on the pull-up/down of GPIOC_5(pull-up for Command Mode and pull-down for Transparent Mode, respectively). An AT command is only sent in the Command Mode and composed of ASCII Code. The interval between two characters of a command is 1ms and the interval between two AT Commands is 10ms. As for Transparent Mode, only the data is forwarded. For instance, when a TCP connection is constructed, a user can use UART port to send/receive the data to/from the peer via Wi-Fi, as indicated in Figure 5. The setting of the UART port is listed as follows: Default baud rate: 9600bps. 1. UART TX Pin = GPIOA_7 2. UARTRX Pin = GPIOA_6. Notice that when the data size is over 1.4 KB or no data is received during 50us, all data in buff will be sent out directly. Figure 5. Transparent Transmission via UART port. ~ 9 ~

WG6611 AT command User s Guide 2. Command Reference 2.1. Command Syntax 2.1.1. The format to send an AT command is as follows: ATW0=SSID \r \n Data to send out: 0x41,0x54,0x57,0x30,0x3D,0x53,0x53,0x49,0x44,0x0D,0x0A 2.1.2. The received response is show in followings. 2.1.2.1. Command send success OK\r \n Data to send out: 0x4F,0x4B,0x0D,0x0A 2.1.2.2. Command send success and return messages OK:-70\r \n Data to send out: 0x4F,0x4B, 0x3A, 0x2D,0x37, 0x31,0x0D,0x0A 2.1.2.3. Command send fail and return error messages ERR:0\r \n Data to send out: 0x45,0x52,0x52,0x3A,0x30,0x0D,0x0A ~ 10 ~

2.2. Returning system and error codes WG6611 AT command User s Guide Responding Status Code ASCII System Code 0 WIFI status disconnect 1 WIFI status connect 2 WIFI connect fail* 3 WIFI connect timeout* 4 AP mode start 5 AP mode stop 6 web mode start 7 web mode stop 8 WIFI auto connect* 9 socket open* 10 socket close* 11 OTA success 12 OTA fail ASCII Error Code 0 error parameter 1 error format 2 SSID empty 3 IP and port empty 4 WIFI start fail 5 AP start fail 6 WIFI connect fail 7 WIFI disconnect fail 8 WIFI scan fail 9 Ping timeout 10 socket initial fail 11 socket not exist 12 DNS timeout 13 Show network information fail 14 MDNS Initial Failed 15 Unknown Host ~ 11 ~

Note: message can show on data mode if marked as*. 2.3. Command List Wi-Fi Setting Commands Client Mode ATW0 Network Set SSID ATW1 Network Set Passphrase ATW2 Network Set Key ID ATWC Join a Network AP Mode ATW3 Set Access Point SSID ATW4 Set Access Point Security Key ATW5 Set Access Point Channel ATWA Activate Access Point ATWE Start Web Server Network Setting and Connecting Commands TCP & UDP Socket ATCP Set IP and Port to Start/Stop TCP Server or Client Mode AUDP Set IP and Port to Start/Stop UDP Server or Client Mode SSL Client ATCP Set IP and Port to connect SSL Server Network ATWZ MAC Address Read and Write ATWD Disconnect From a Network ATWI Ping Test ATWS Scan for Network Access Point ATWR Get RSSI of Associated Network Access Point ATW? Show Network Information ASDS Set DNS Server IP address AGDS Get DNS Server IP address AMDS Set Name and service to start MDNS System Commands ATWP Power On/Off Wi-Fi Module ASLP Deep Sleep AVRR Read Version Firmware & Hardware ARST Reset System WG6611 AT command User s Guide ~ 12 ~

ACLR ABUD ATWO Erase AP or Client Wi-Fi Information Set and query baud rate of the UART in user mode Over-the-air (OTA) Update WG6611 AT command User s Guide 3. AT Commands for Wi-Fi Setting 3.1. Introduction Jorjin WG6611 module has two modes, including AP mode and Client Mode. A device with WG6611 module in AP mode can be connected by the other devices WG6611 modules. Notice that, when in AP mode, the device is unable to connect to internet. Normally, AP mode is used by user to setup the device with WG6611 module so that the device can connect to an existing AP. The scenario of a WG6611 device in AP mode is shown in Figure 6. Figure 6. Scenario for WG6611 Module in AP Mode. WG6611 device in client mode can connect to an existing AP with Internet capability so that the device can send data to the Internet, as shown in Figure 7. ~ 13 ~

WG6611 AT command User s Guide Figure 7. Scenario for 8711AM Module in Client Mode. 3.2. Client Mode When trying to connect to an existing AP, you have to set the SSID and the passphrase of the AP first and then use command ATWC to connect to the AP. When connect to the existing AP, WG6611 module will receive a DHCP IP automatically. The commands are listed as follows: ATW0=SSID<CR> ATW1=passphrase<CR> ATW2=key id (key id range is 0~3, only needed for WEP mode) ATWC<CR> ATW0=JORJIN ATW1=123456789 ATWC The received response messages are as follows: Example (WEP mode): ATW0=JORJIN ATW1=123456789 ATW2=1 ATWC ~ 14 ~

The received response messages are as follows: WG6611 AT command User s Guide 3.3. AP Mode When acting as an AP, you have to set the SSID, passphrase, and the channel to use. Finally, use command ATWA to activate the setting. Users can connect to the AP by using the setting SSID and passphrase. ATW3=SSID(SSID length can't exceed 30 byte) ATW4=passphrase (passphrase length can't exceed 60 byte) ATW5=Channel (Channel range is 0~11) ATWA<CR> Example : ATW3=JORJIN ATW4=123456789 ATW5=5 ATWA If trying to set up the AP, you need to start the web server by using command ATWE after finishing the above setting. ATWE<CR> ATWE ~ 15 ~

3.4. Web Server WG6611 AT command User s Guide Web server of WG6611 Module works only on AP mode. After associating with the AP, as shown in Figure 88, and get right IP address, a client can open web browser and visit the web site by entering http://192.168.1.1 in the browser to get/set AP and Client settings. Figure 8. Connect to Ameba WG6611 WiFi Module. 3.4.1. AP Mode In the interface of SoftAP configuration, you can modify the SSID, Security Type, AP Password and Channel of the module. After submitting, the module will reboot to adapt the setting. Figure 9. Interface to setup Ameba 8711AM module for AP mode. Figure 10. Response after pressing submit button in AP mode ~ 16 ~

WG6611 AT command User s Guide 3.4.2. Client Mode In the interface of SoftAP configuration, you can modify the STA SSID, and STA Password of upper tier AP that the module tries to connect. After submitting, the module will reboot to adapt the setting. Figure 11. Interface to setup Ameba 8711AM module Client mode. Figure 12. Response after pressing submit button in Client Mode. ~ 17 ~

WG6611 AT command User s Guide 4. AT Commands for Networking 4.1. ATWZ (Read MAC message): ATWZ=read_mac 4.2. ATWD(Disconnect from a network): ATWD 4.3. ATWI (Ping Test): ATWI=IP address[y] Comment: y = number of ECHO REQUEST packets. Ping an unused IP, e.g., ATWI=124.108.105.150[5]. Message (Ping Success): Message (Ping fail): ~ 18 ~

WG6611 AT command User s Guide 4.4. ATWP (Power on/off): ATWP=1 Comment: 1 for Power on ATWP=1 ATWP=0 Comment: 0 for Power off ATWP=0 4.5. ATWS (Scan for Network): ATWS ATWS ATWS:SSID,MAC, SECURITY (report format) ~ 19 ~

WG6611 AT command User s Guide Table 2: Wi-Fi security algorithms mapping table. 4.6. ATWR (Scan for Network): ATWR ATWR 4.7. ATW? (Show network information): ATW? ATW? CODE:MODE,SSID,CHANNEL,SECURITY,PASSWORD,MAC,IP,GW,DNS Note: CL=client mode, AP= AP Mode, UN : unknow ~ 20 ~

4.8. ASDS (Set DNS Server IP): ASDS=n,IP Comment: n = Choose DNS server(1 or 2). IP = DNS server IP. ASDS=1,8.8.8.8 WG6611 AT command User s Guide ASDS=2,8.8.4.4 4.9. AGDS (Get DNS Server IP): AGDS=n Comment: n = Choose DNS server(1 or 2). AGDS=1 AGDS=2 4.10. AMDS (Set and Start MDNS ): ~ 21 ~

AMDS=name,services ; services=_ services._tcp Comment: n = Choose DNS server(1 or 2). AGDS=user_name,_http._tcp WG6611 AT command User s Guide 4.11. TCP Client Socket 4.11.1. Sequence to create a Socket to connect to a dedicate IP: ATCP=c,<IP>:<port><CR> /c:client; IP=IP or Domain Name; port=port Number/ ATCP=l,<IP><CR> /l:ssl Link; IP=IP or Domainame/ ATCP=c,10.132.20.32:5001 AHML=GET / ATCP=c, www.google.com.tw:80 ~ 22 ~

WG6611 AT command User s Guide 4.11.2. Close Client Socket: ATCP=close<CR> /close:close TCP Socket/ 4.12. TCP Server Socket 4.12.1. Sequence to a Socket to accept connections: ATCP=s:<port><CR> /s:server; port=port Number/ ATCP=s:5001 4.12.2. Close Server Socket: ATCP=close ~ 23 ~

WG6611 AT command User s Guide 4.13. UDP Client Socket 4.13.1. Sequence to create a Socket to connect to a dedicate IP: AUDP=c,<IP>:<port><CR> /c:client; IP=IP or Domain Name; port=port Number/ AUDP=c,10.132.20.32:5001 4.13.2. Close UDP Socket: AUDP=close AUDP=close 4.14. UDP Server Socket 4.14.1. Sequence to a Socket to accept connections: AUDP=s:<port><CR> /s:server; port=port Number/ ~ 24 ~

AUDP=s:5001 WG6611 AT command User s Guide 4.14.2. Close UDP Socket: AUDP=close<CR> /close:close UDP Socket/ AUDP=close 4.15. TCP and UDP Socket application 4.15.1. Introduction: GPIOA_6 GPIOA_7 GPIOC_5 UART_RX UART_TX Command_Mode MCU Command_Mode(GPIOC_5) Hight Level Low Level Command Data Figure 13. Hardware setting of the application scenario. 4.15.2. Create a connection to a TCP server: Step 1. Switch user UART (reference GPIO pin definition) to Command mode (GPIOC_5 Hi level). Step 2. Connection TCP server (refer to 4.11). ~ 25 ~

WG6611 AT command User s Guide Step 3. Switch user UART to Data mode (GPIOC_5 Low level). Step 4. Start to transfer data transfer by using any networking tool. Figure 14. TCP/UDP tools to receive TCP packets from a 8711AM module. 4.15.3. Accept a connection for a TCP client: Step 1. Switch user UART (reference GPIO pin definition) to command mode(gpioc_5 Hi level). Step 2. Create a TCP socket with a given port to accept TCP connections (refer to 4.12). Step 3. Switch user UART to data mode (GPIOC_5 Low level). Step 4. Start to transfer data. ~ 26 ~

WG6611 AT command User s Guide Figure 15. TCP/UDP tools to send TCP packets to a 8711AM module. 4.15.4. Connection to UDP server: Step 1. Switch user UART (reference GPIO pin definition) to command mode(gpioc_5 Hi level). Step 2. Give the IP and PORT, then connect to a UDP server(refer to 4.13). Step 3. Switch user UART to data mode (GPIOC_5 Low level). Step 4. Start to Transfer data. ~ 27 ~

WG6611 AT command User s Guide Figure 16. UDP tools to receive UDP packets from a 8711AM module. 4.15.5. Accept connection for UDP client: Step 1. Switch user UART (reference GPIO pin definition) to command mode(gpioc_5 Hi level). Step 2. Start an UDP socket and wait for connections (Refer to 4.14). Step 3. Switch user UART to data mode (GPIOC_5 Low level). Step 4. Use UART to transfer data. ~ 28 ~

WG6611 AT command User s Guide Figure 17. UDP tools to send UDP packets to a 8711AM module. 4.16. Setting up a Secure (SSL)Connection ATCP = l,host NAME Comment: 1. Connect to a SSL server. 2. l is L lower case. 3. Use Uartutility tool v4.0. ATCP=I,www.github.com Switch to Data Mode GET / HTTP/1.1 then click Enter twice. Then press button Send block ~ 29 ~

5. AT Commands for System Setting 5.1. ASLP (Deep Sleep): WG6611 AT command User s Guide ASLP=sec Comment: sec is seconds for the module to be in the deep sleep mode. It can be set form 0 to 3600.sec=0 indicates that the module will be in the deep sleep mode forever and only CHIP_EN pin can be used to wake up the system. ASLP=0 ASLP=10 5.2. AVRR (Get Version Firmware& Hardware): AVRR = [F, H] Comment: F:Firmwareversion, H: Hardware version. AVRR =F AVRR:SDK + firmware Version(report format) AVRR =H ~ 30 ~

WG6611 AT command User s Guide *No version information is set in the system. 5.3. ARST(Reset System): ARST ARST 5.4. ACLR(Erase AP or Clien Wi-Fi information): ACLR=[AP, CL] ACLR=AP ACLR=CL Erase AP connection Erase Client connection 5.5. ABUD(Set and query baud rate of the UART in user mode): Set baud rate of the UART in user mode. ABUD=baud rate(9600 bps ~115200 bps) Comment: Default baud rate is 9600 bps. ABUD=115200 ~ 31 ~

Query the current baud rate of the UART in user mode. WG6611 AT command User s Guide ABUD=? ABUD=? ~ 32 ~

WG6611 AT command User s Guide 6. Over-the-air (OTA) Update 6.1. ATWO (For firmware update) 1. Put the firmware image file in the folder where the Download Server locates. 2. Edit batch file start.bat to indicate the port and the firmware image file. For the example in the following figure, the port is set to 8082 and the image file is ota.bin, as show in the following figure. Figure 18. Files used for OTA update. Figure 19. The modification of start.bat for OTA update. 3. After executing start.bat, a server is up and waiting for client s request. Figure 20. OTA server waiting for client s request 4. Connect to AP and make sure that the Ameba module and the computer that have the OTA server connect to the same AP 5. Enter command to perform OTA update: ATWO=IP[PORT]. ~ 33 ~

WG6611 AT command User s Guide 6. Starting update.after finishing downloading image, device will be auto-rebooted and the boot loader will load new image if it exist. If the update finishes, you can see the progress in OTA server side, as shown in Figure 21. The result of the OTA update will be indicated in the UART console, as indicated in UART log: Update success: Figure 21. OTA update progress shown in OTA server side. Update fail: ~ 34 ~

7. Appendix A - UART Utility WG6611 AT command User s Guide 7.1. Screenshot 7.2. Configuration User has to ensure the port number and baud rate in area 1 are correct for the COM port, before clicking Connect button. RTS status shows the state of MODE pin. 7.3. Send AT Command User can send AT command in area 2. Please be noted that the line feed is needed for each command for this application, therefore, please tick Add Line Feed The. utility will automatically changes the state of MODE pin, when clicking Send CMD button. ~ 35 ~

7.4. Transmit Data WG6611 AT command User s Guide The data, e.g. HTTP command, could be sent in area 3. If the same data needs to be transmitted periodically, user can tick Auto option of Active Type and set the time interval. 7.5. Receive Data The command response, system information and control signal etc. will be shown in area 4. Hex code is displayed in the left hand side, whereas the ASCII is shown in the right hand side. 8. Appendix B - Reference [1] AT Command Application Note, Realtek, August 25, 2015. ~ 36 ~