Home
M03 AT Command - User Manual
Contents
1. Network mode Infra Network mode is Infrastructure Create ADHOC when network does not exist BG mode B G Wireless mode is BG fixed Maximum rate 36M The Maximum sending rate is 36M Auto Forbid to fix the BSSID address of wireless BSSID network Auto Detect the operating channel of wireless Channel network automatically Auto retry 255 Retry for ever automatically Wireless roam Disable Forbid to do the wireless roam Channel list OxSfff 1 14 channels Baud rate 115200 The data format of serial is set to Data bits 8 bits Baud rate is 115200bps Stop bits 1 bit 8 bits of data bits Parity bit None 1 bit a ele No parity of parity bit Auto framing 512 The length is 512 bytes length Auto framing 500ms The period is 500ms period Escape 0x2B The character is 0x2B that is in ASCII character 45 Page ThaiEasyElec comlll On line Electronics Shop for Embedded System Escape time 2000ms The period is 2000ms System setting System 000000 Login password of system is 000000 password WEB server Enable Enable WEB server port is 80 Command AT The system command is AT Instruction mode set GPIO1 mode System The setting of GPIO1is system function 4 5 Typical application examples 4 5 1 The networking of active serial device 4 5 1 1 Application scene background server TCP server y wireless AP router SQ SI SI s s wireless POS dev
2. 95 1Page Thaitasyelec comill s Shop for 6 2 4 13 AT WARC Function Set or query the function of auto retry after the wireless network is disconnected or networking is failed This parameter is only effective in the auto work mode Format AT WARC count lt CR gt OK count lt CR gt lt LF gt lt CR gt lt LF gt Parameter count means retry times Table 6 24 retry times 0 No retry 1 254 1 254 times of retry 255 Retry for ever 6 2 4 14 AT WBGR Function Set or query BG mode of the wireless network and the maximum sending rate Format AT WBGR bg mode max rate lt CR gt OK bg mode max rateJ lt CR gt lt LF gt lt CR gt lt LF gt Parameter bg mode mean BG mode Table 6 25 BG mode 0 B G fixed 1 B max rate means the maximum sending rate in B mode only 0 to 3 is effective Table 6 26 The maximum sending rate 0 1 Mbps 1 2 Mbps 96 1Page Enable Your Design ThaiEasyElec com ill nics Shop for Em 5 5 Mbps 11 Mbps 6 Mbps 9 Mbps 12 Mbps 18 Mbps 24 Mbps 36 Mbps 48 Mbps 54 Mbps O OI IN OD oO amp OW PP sch oO 6 2 4 15 AT UART Function Set or query data format of UART serial Format AT UART baud rate data bit stop bit parityJ lt CR gt OK baud rate data bit stop bit parity CR gt lt LF gt lt CR gt lt LF gt Parameter baud rate means baud
3. SSID encryption mode key and so on refer to the setting of wireless AP or router Network setting gt gt gt gt IP address 192 168 0 X Subnet Mask 255 255 255 0 Gateway address 192 168 0 1 DNS address 192 168 0 1 Work mode setting gt WV WW WV Enable auto work mode Protocol type UDP C S mode unicast Port number 6000 Connection timeout 0 51lPage ThaiEasyElec comill On line Electronics Shop for Embedded System 4 5 4 Wireless virtual serial 4 5 4 1 Application scene device 1 device 2 device 1 device 2 TCP server TCP client figure4 9 Wireless virtual serial 4 5 4 2 Reference setting Wireless setting gt Network mode ADHOC and enable Create ADHOC when network does not exist gt SSID my_ADHOC gt Encryption mode open gt Others is default Network setting gt IP address 192 168 0 1 gt Subnet Mask 255 255 255 0 gt Gateway address 192 168 0 1 gt DNS address 192 168 0 1 Work mode setting gt Enable auto work mode gt Protocol type TCP gt C S mode server gt Port number 6000 52lPage gt Connection timeout 0 ThaiEasyElec comilll On line Electronics Shop for Embedded System Wireless setting gt gt gt gt Network mode ADHOC SSID my_ADHOC Encryption mode open Others is default Network setting gt gt gt gt IP address 192 168 0 2 Subnet Mask 255 255 255 0 Gateway address 192
4. TCP client TCP client TCP client Figure4 7 The networking of passive serial device The networking of passive serial device means all devices in the system are passive to wait for a connecting only the background server sponsors the networking and does request or data download Typical applications are such as some wireless sensor network each sensor terminals always are doing the real time data collection and the data collected does not immediately upload but temporarily stores in the devices The background servers periodically connect devices actively and request to upload or download data At this time background server works as a TCP Client while the device works as a TCP Server 4 5 2 2 Reference setting Wireless setting gt SSID encryption mode key and so on refer to the setting of wireless AP or router lt gt Network setting gt IP address 192 168 0 X 48 Pacge ThaiEasyElec comlilil On line Electronics Shop for Embedded System gt Subnet mask 255 255 255 0 gt Gateway address 192 168 0 1 gt DNS address 192 168 0 1 Work mode setting gt Enable auto work mode Protocol type TCP C S mode server Port number 6000 Connection timeout 120s VV V WV 4 5 3 The networking with broadcast method of serial device 4 5 3 1 Application scene 49 Page ThaiEasyElec comlll On line Electronics Shop for Embedded System system control terminal based on serial device 1 device devicen
5. ThaiEasyElec comlll On line Electronics Shop for Embedded System notebook computer server S eds IN d N ae en wireless iR ze AP PDA m DEREN KS 4 N user device ES user device user device figure2 6 Infrastructure topology wireless network based on ad hoc network ADHOC ADHOC it s also called independent basic service set and it s built by two or more STAs without AP this type of network is a loose structure all the STAs in the network can communicate directly noteboot computer user device figure2 7 ad hoc network topology M03 works as a STA and supports the two types of wireless networks above 2 3 1 2 Security The module supports multiple wireless encryption mechanisms and enables to protect the security of user s data transmission the mechanisms include 14 Page ThaiEasyElec comlilil On line Electronics Shop for Embedded System WEP64 WEP128 WPA PSK TKIP WPA PSK CCMP WPA2 PSK TKIP WPA2 PSK CCMP gt gt gt gt gt 2 3 1 3 Quick networking The module supports quick networking by specifying channel number In the usual course of wireless networking devices would first scan automatically on the current channel in order to search for the network or Ad hoc built by the target AP This module provides working channel configuration when the channel of the target network is known users can specify the working channel directly the networking time will be
6. 19 Page Enable Your Design ThaiEasyElec com ill On line Electronics Shop for Embedded System 2 3 7 Firmware upgrade online The module supports firmware upgrade online there are two methods to upgrade the firmware onthe basis of serial connection using the configuration management program lt on the basis of network connection using the IE browser program 20lPage ThaiEasyElec comill On line Electronics Shop for Embedded System 3 Quick Start Wizard 3 1 Preparation m Hardware lt M03 module serial adapter board serial cable m Software UART WIFI configuration management program Serial debugging software such as serial debugging assistant serial master 3 apa exe Realtern and soon for TCP UDP debugging software such as TCP UDP test tool BW exe and so on 3 2 Setting parameters 1 Run the UART WIFI configuration management program 2 Connect M03 module with Serial adapter board and then turn the power on after the serial cable has been connected as shown below 21lPage Enable Your Design ThaiEasyElec com ill On line Electronics Shop for Embedded System Figure 3 1 connection between with serial adapter board and UART WIFI module 3 click search modules as shown below UART WIFI Configuration Port Connect Configuration FuncTest UpdateFw SystemInfo Port Auto v Set Close CH Wireless Setting SSID IER Modify All Encry
7. 37 1Page Thaitasyelec comill s Shop for user can modify this parameter to reduce the sending rate in order to improve the reliability of wireless transmission 4 3 4 5 BSSID Table 4 21 BSSID AT BSSID AP BSSID Used to specify the BSSID address of WIFI network options include Auto Fixed it needs to input BSSID address The default setting of system is Auto ordinarily user doesn t need to modify this parameter When join to WIFI network module can detect BSSID address of the network according with SSID and join in When several networks APs create with the same SSID is existed in order to enhance network security user can fix the target AP by modifying this parameter to fix BSSID address Once the parameter is fixed the module will never connect to the network without suited BSSID 4 3 4 6 Channel Table 4 22 Channel AT CHL Channel Number Channel Used to specify the channel of WIFI network options include Auto Channel 1 14 The default setting of system is Auto ordinarily user doesn t need to modify this parameter When join to WIFI network the module will automatically scan all channels to detect the target network The time module needs to scan each channel is 150ms and the completion of all channel scan takes about 2s In order to reduce the scanning time and improve networking speed user can specify channel number through modifying this paramet
8. ate S cover Ji Wireless Setting SSID apds Wireless Connect cH Close iM No Port Device ID 1 COM OO1FA4FD2ADD Encry Mode OPEN EN Key Ten Key Index Key L Forever Network Setting Roaming close PlEnsbled DHCP meist EI Be Ein Ela Ds De Or IP Adar le Ms Bu lu Miz Mis Di i Serial Setting Subnet Mask i g BaudRate 115200 w Payat none Gateway Addr 9 Data Bt 8 v Stop Bk P DNS Server Transparent mode Setting i Framing Cyst 3 4 Workmode Setting Framing Length Auto Workmo Escape Time J ProtocolType TCP C S Mode Escape Character OX 2B Others ServerAddr 192 168 1 100 Port a kien Westen SE TCPConTime s 10000000 0 Order Mode AT Cind Mode mo GPIOI Made System Function i Password 1000000 figure5 4 configure parameters 5 1 3 1 Refresh parameter User can refresh the configuration parameter from wireless module and show in the display interface through clicking the refresh parameter button 5 1 3 2 Submit modification User can click submit modification button after modifying configuration parameter including parameter in advanced setting in the display interface to save the parameters into wireless module New parameters will become effective until wireless module has been reset
9. cs host_timeout port lt CR gt OK protocol cs host port lt CR gt lt LF gt lt CR gt lt LF gt Parameter protocol means protocol type Table 6 13 protocol type Value Mean 0 TCP 1 UDP cs means C S mode Table 6 14 CS mode 901Page ThaiEasyElec comillll On line Electronics Shop for Embedded System 0 Client 1 Server host_timeout means that shown as follow Table 6 15 host_timeout x destination server name you can input oO domain name or IP address for example 192 168 1 100 or www sina com cn TCP connection timeout period the clients that connect with the server send noting in this effective period will be kicked out effective value range is 1 10000000 its Unit is second 0 means never default setting is 120 seconds 1 1 No meanings port means port number 6 2 4 4 AT SSID Function Set or query wireless network name namely SSID Format AT SSID ssid lt CR gt OK ssid amp lt CR gt lt LF gt lt CR gt lt LF gt Parameter ssid means wireless network name it s formed with 1 32 characters and embedded in double quotation marks 6 2 4 5 AT ENCRY Function Set or query wireless network encryption mode What should are noted is that every encryption modes need to set correct key to cooperate with AT KEY command except OPEN mode Format AT ENCRY encry mode lt CR gt 91lPage OK encry modekCR gt lt LF gt lt CR
10. 6 1 1 2 Format Examples Example 1 responding success message Example 2 responding failed message Example 3 Using input parameter Example 4 Using the symbol lt gt Example 5 Using the symbol lt gt 78lPage AT ATPT OK 500 6 1 1 3 Error Code Thaigasy lec comMll s Shop for Table 6 1 Error Code Ineffective Command Format Non supported Ineffective Operation Symbol Ineffective Parameter Not Permitted Memory Lack FLASH Error Join Failed 11 No Available socket 12 Ineffective Socket 13 Socket Connect Failed 100 Undefined 6 2 Instruction Set 6 2 1 Instruction List Table 6 2 AT lInstruction list null Null ATLT Set or query data length of automatic framing ATM Set or query work mode of module ATPT Set or query period of automatic framing ATRM Set or query connection message of socket module creates automatically in auto work mode BSSID Set or query BSSID address of target AP CHL Set or query target wireless channel number 79 Page for Embedded Syster Enable Your Design ThaiEasyElec com ill u Ins Elsctrenies Shes CHLL Set or query wireless channel list CMDM Set or query default command mode of system E Switch serial character to show back ENCRY
11. Q14 In some environment the module used why is the quality of wireless connection always bad and how to improve the wireless transmission A The reasons which cause bad quality of wireless connection are multiple such as those the placement of AP is not reasonable the distance between AP and module is too far there are some obvious screens or shelter between AP and module in the environment module works there are some disturbance of 2 4G band and so on Some environmental problems can t be resolved fundamentally it can be only reduced for adverse effects with some methods user can try to do the changes as follow 1 Lay AP in open and no obvious shelter environment as much as possible in particular to avoid large areas of metal and the corners of wall 2 Modify the setting of AP change the channel far from the current channel such as those change the channel from 1 to 6 or from 6 to 13 and so on 3 Modify the maximum rate of advanced wireless parameters reduce it to 11Mbps or even lower 124 Page ThaiEasyElec comillll On line Electronics Shop for Embedded System Appendix B Revision History of the document 1 00 Original Version by ThaiEasyElec com Dec 5 2012 1 01 Added 2 2 4 1 USB to Serial optional Dec 6 2012 125 Page
12. GHz Impedance 50 Q VSWR Sg 12 Page Enable Your Design ThaiEasyElec com ill On line Electronics Shop for Embedded System 2 2 4 4 Wireless adapter optional WII MAC 001EE3EFD3B2 Figure 2 5 3 Wireless adapter Wireless adapter can be used to configure parameters of the product through the wireless connection which is more useful when the products can t connect to serial port In addition parameter configuration of a group of products can be achieved by using the wireless adapter The method for use is shown in Section 3 2 2 3 Main features 2 3 1 Wireless Network Connection 2 3 1 1 Network Topology WIFI wireless network includes two types of topology basic network Infrastructure and ADHOC networks ADHOC to explain the wireless network topology two basic concepts are needed to be understood first AP that is the wireless access point the founder of a wireless network and the center of the network nodes The wireless router we use at home or in office may be an AP STA short for station each terminal connects to a wireless network such as laptops PDA and other networking devices can be called with a STA devices Basic wireless network based on AP Infrastructure Infrastructure it s also called basic network Its built by AP and many STAs which join in The characters of network of this type is that AP is the center and all communication is transmitted through the AP 13 Page
13. System What should be noted is that when BSSID address is blinded wireless roaming is not effective anymore 2 3 1 6 Region Setting The module supports wireless region setting Users can set the wireless channel list to determine the channels of scanning range 2 3 2 Plug and Play Serial The module supports serial transparent transmission and auto work mode it really achieves the serial plug and play and it does the greatest degree to reduce the use complexity In this mode users only need to pre set the required network parameters as follow The paraments of wireless network include network name SSID security mode Key if it s need default TCP UDP paraments include protocol type connection type server address port number Since then after its power is on module can automatically connect to the default wireless network and server each time As in the auto mode the module s serial always work in the transparent transfer state so users only need to think of the module as a virtual serial cable and send or receive data as using a simple serial In other words the serial cable of users original serial devices is directly replaced with the module user equipments can be easy for wireless data transmission without any changes In this mode the module supports the trigger length and trigger time of auto forming a frame Trigger length means that the module receives from the serial a specified length of data then
14. connect acquire and acquire when the networking is failed or network is disconnected Users can also set a limited number of retries value in this case once the retry number is over the limit the system will not try to reconnect any more except resetting the system 2 Socket connection here especially means TCP connection is a virtual connection in the case of non normal disconnection of the wireless network the original socket connection will not be deleted and restored when the wireless network connection is resumed 4 2 2 2 Auto framing system In transparent transmission mode all data in the serial transfers in the form of byte stream and in the network the data transfer at a fixed frame format therefore the data between the serial and network need a conversion process between a stream and a frame For the data transmission in the direction from the network to the serial data conversion from a frame into a stream is very easy but in the contrary direction that is data is converted from the stream to frame format it needs certain rules to restrain The module uses two parameters to specify the conversion rules Auto framing length When the data length the module received reach the length of auto framing the module will trigger the framing operation and send the data frame to the network Auto framing period In certain cases such as the data sent is little and cause the data in buffer can fill up a data block then t
15. connect the module to the serial of the PC and then run the Windows HyperTerminal program and do the paraments configuration with AT Instruction set this approach is the most flexible but it needs users are familiar with AT Instruction set on the basis of network connection using IE browser program This approach requires the module has connected to a wireless network On the PC connected to the same wireless network use IE browser to connect the WEB server of the module This approach has the advantages of simple operation and intuitive interface 2 3 6 Multi functional GPIO This module provides two multi functional pins which can be multiplexed Table 2 8 GPIO Multi functions Output RTS signal in auto work mode it as the RTS nRTS signal of this side can directly connect with the CTS signal of the other side Output In command mode it indicates the state of nREADY wireless network connection of the module law level is connected high is disconnected Input CTS signal in auto work mode it as the CTS nCTS signal of this side can be directly connected to the RTS signal of the other side Input it means the startup mode selection of the module In the start up phase power on reset within MODE 300ms low level means common work mode high level means configuration mode refered in Section 4 2 1 e Input output it can works as general input or output pin according to user configuration
16. control terminal of user devices based on serial UDP broadcast wireless AP Ei 4 mm 7 O O Geet O device 1 device devicen UDP Unicast UDP Unicast UDP Unicast figure4 8 The networking with broadcast method of serial device The networking with broadcast type of serial device is a networking mode based on UDP protocol In the network the host works in UDP broadcast mode all devices works in UDP unicast mode This method creates a passive network essentially The most typical application is upgrading the wireless network for the traditional network based on the connection of RS422 485 bus If user would use this connection mode all the devices and their system control terminals in the original system needn t to get any changes of software user directly replaces the original hardware connection of RS422 485 with this module and it can be truly plug and play 50IlPage ThaiEasyElec comlll On line Electronics Shop for Embedded System 4 5 3 2 Reference setting Wireless setting gt SSID encryption mode key and so on refer to the setting of wireless AP or router Network setting gt gt gt gt IP address 192 168 0 Y Subnet mask 255 255 255 0 Gateway address 192 168 0 1 DNS address 192 168 0 1 Work mode setting gt VV WM WV Enable auto work mode Protocol type UDP C S mode broadcast Port number 6000 Connection timeout 0 Wireless setting gt
17. escape characters This parameter is used for serial to exit the transparent transmission mode Format AT ESPC f escape lt CR gt OK escape lt CR gt lt LF gt lt CR gt lt LF gt Parameter escape means escape characters its format is two ASCII characters expressed in hexadecimal such as ASCII character should be expressed as 2B 6 2 4 19 AT ESPT Function Set or query escape time This parameter is used for serial to exit the transparent transmission mode Format AT ESPT time lt CR gt OK timekCR gt lt LF gt lt CR gt lt LF gt Parameter time means escape time its range is 100 10000ms its unit is millisecond the smallest step is 100ms 6 2 4 20 AT WEBS Function Set or query whether to enable the internal WEB server Format 99 Page Enable Your Design ThaiEasyElec com ill n line Electronics Shop for Embedded System AT WEBS enable port lt CR gt OK enable port lt CR gt lt LF gt lt CR gt lt LF gt Parameter enable means the symbol of enabling Table 6 31 symbol of enabling 0 disabled 1 enabled port means server port number the default setting is 80 6 2 4 21 AT PASS Function Set or query the system password Format AT PASS pass lt CR gt OK pass CR gt lt LF gt lt CR gt lt LF gt Parameter pass means system password it s formed with 6 ASCII characters 6 2 4 22 AT IOM Function Set or query GPIO1 mode Format AT I
18. forms a wireless data frame and immediately start the network sending process Trigger time means when the data received from the serial is less than the specified length the module will force to form a frame with the current data and start to send after the specified time 16 Page ThaiEasyElec comlilil On line Electronics Shop for Embedded System In this mode the module serial supports hardware flow control provides normal RTS CTS signals it s strongly recommended when doing large amounts of data hardware flow control should be enabled so as to fully ensure reliable data transmission In the applications which doesn t need flow control users can simply leave RTS CTS pin vacant 2 3 3 Command Mode of Serial Module also provides the command mode based on serial control which is different from auto work mode this mode provides the user with sufficient flexibility and meet users specific needs of different applications In this mode the module works according to user command through the serial user can control the module completely with the command including modifying parameters controlling networking controlling TCP IP connection and data transmission This is a high level use and also the most flexible to use Users can discretionarily control the connection and disconnection of the wireless network with command also can create several different types of TCP IP connections at the same time and keep them transferr
19. gt lt LF gt Parameter encry mode means encryption mode Table 6 16 encryption mode Enable Your Design Elec c ThaiEasy nics Shog Value Meanings OPEN WEP64 WEP128 WPA PSK TKIP WPA PSK CCMP AES WPA2 PSK TKIP 9 0 P oOI ND WPA2 PSK CCMP AES 6 2 4 6 AT KEY Function for m om Set or query network key What should are noted is that before using this command to set network key user must set the encryption mode with the command AT ENCRY Format AT KEY format index key lt CR gt OK format index key kCR gt lt LF gt lt CR gt lt LF gt Parameter format means key format Table 6 17 key format Value Meanings HEX ASCII index means key index 1 4 is used in WEP key in other encryption modes it s set 0 key means key string its embedded in double quotation marks according with different encryption modes key size and key format is defined as follows Table 6 18 key 921Page 3 oysTe m Thaitasyelec comill nics Shop for Er 10 hexadecimal WEP64 ween BASCH characters Note 2 characters 26 hexadecimal WEP128 13 ASCII characters characters 64 hexadecimal WPA PSK TKIP 8 63 ASCII characters characters 64 hexadecimal WPA PSK CCMP AES 8 63 ASCII characters characters 64 hexadecimal WPA2 PSK TKIP 8 63 ASCII characters characters 64 hexadecim
20. hof 2 Overview 2 1 Technical Specification Table2 1 Technical Specifications Wireless standard IEEE802 11b g Frequency range 2 412 2 484 GHz Receiver 802 11b 86 dBm 11Mbps typical sensitivity 802 119 71 dBm 54Mbps typical Transfer rate 802 11b 1 2 5 5 11 Mbps 802 119 6 9 12 18 24 36 48 54 Mbps Modulation DSSS OFDM DBPSK DQPSK CCK QAM16 64 Output power 802 11b 18 2 dBm typical 802 11g 15 1 dBm typical Antenna Interface IPX WLAN Chip Set TLG10UA03 from www hed com cn China Serial type UART LVTTL Low Voltage TTL Serial rate 1200 115200 bps Operating voltage 3 3 0 3 V Operating current 300mA typical Storage A0 85 C temperature Operating 0 75 C temperature Dimensions 55 2x25 4x11 5 mm Environmental RoHS certification 7lPage ThaiEasyElec comill On line Electronics Shop for Embedded System Network type Infr ADHOC WEP WPA PSK WPA2 PSK Security WEP64 WEP128 TKIP CCMP AES Work mode auto command Serial command AT Instruction set Network protocol TCP UDP ARP ICMP DHCP DNS HTTP Most sockets to connect 15 TCP connection the most connection 8 the most Client 8 the most Server 3 4 the most client to connect to server built in this module 4 UDP connection the most connection5 6 The maximum sending rate 11Kbytes s TCP 2 2 Hardware i
21. is in the state of detecting escape character and the data receives is three and only three consecutive escape characters it will exit the transparent transmission mode The default setting of system is 0x2B that is characters in ASCII 4 3 6 4 Escape time Table 4 33 Escape time Escape Trigger Period Escape time AT ESPT When serial is in transparent transmission mode the time received no data is more than this parameter specifies it will automatically detect the escape characters Optional range is 100 10000ms the minimum accuracy is 100ms 42 Page Enable Your Design ThaiEasyElec com s Shop for In addition the setting must be greater than the setting of auto framing period The default setting of system is 2000ms 4 3 7 System parameters 4 3 7 1 System password Table 4 34 System password System password AT PASS Login Password The login password for accessing the module through WEB server or wireless configuration The default setting of system is 000000 4 3 7 2 WEB server Table 4 35 WEB server WEB Server AT WEBS Used to specify whether to enable the WEB server or not and the server port The default setting of system is enabled the default port is 80 4 3 7 3 Command Mode Table 4 36 Command Mode Command Mode AT CMDM Command Mode Used to specify the control protocol of the
22. kk 56 5 1 3 Configuring parameter 1 eeeeecccececenececnseeceeneececeeecaaeeseaeececececeaeeesaaesseaeeceaeecsansesaaesseneeteeeeessinenenes 58 0 1 4 FURCIOR EE 61 5 15 System information EE 70 5 1 6 Firmware Upgrade tesa u Er ann EEEE REEE EE EEEE re 70 5 2 CONFIGURATION THROUGH WEB SERVER cssccccccccecsessseceeecececeeseaaeseceeececeessaaececeesceesessaaeseseeseessessnaeees 71 5 2 1 Query set configuration parametef esseesseeseeeeeeeeee renerne reen reen reer neerneernerrnerrnerrn neer neeneeernee ene 72 522 Firmware upgrade on NE oscsnsnesiinriiiiiri ianea i EEE EEE E 73 5 3 CONFIGURATION THROUGH HYPER TERMINAL PROGRAM 73 6 AT INSTRUCTION CONTROL PROTOCOL uursuussasnnnnnannnnnnnnnnnnnnnnnnnnnnnnnnnnnnnannnnnnnnnnnnnnnnannnnnnnnnnnann 76 621 SYNTAX INTRODUC TION ae 3er e E 76 E E SYNIaX EE 76 6 2 INSTRUCTION SEW WE 79 6 2 1 E eidele EE 79 6 2 2 Network Control Type ei Dies 81 62 3 System Control type u ine 86 6 2 4 Parameter Setting Type ccsccccccceceeccessseesencecsenceceaeesanaecscacecesaeessaesseaeecseneessassaeaeeseeaeessnnsteneans 89 E WIR ee TEEN 101 ThaiEasyElec comlilil On line Electronics Shop for Embedded System 6 3 1 Description of sample code 101 6 3 2 Operation flow of WIFI module in command mode 101 6 3 3 main data framework of sample Code 102 6 3 4 Operation of serial data 103 6 3 5 The function used to parse the return parameters Of AT metruchon 108 6 3 6
23. module in command mode options include AT Instruction Compatible Protocol The default setting of system is AT Instruction mode ordinarily user doesn t need to modify this parameter The command mode of compatible protocol is used to be compatible with the control protocol of TLGO9UA01 02 43 Page Enable Your Design ThaiEasyElec com ul gt hof products If user wants to use this mode please call for the Technical Support for more help 4 3 7 4 GPIO1 mode Table 4 37 GPIO1 mode GPIO1 mode AT IOM GPIO Mode Used to specify the work mode of GPIO1 options include System function Input Output The default setting of system is system function 4 4 Default setting Table 4 38 default setting SSID default The SSID of wireless network is default Encryption mode OPEN The encryption mode of wireless network is Key format open Key Index Key Network setting S O DHCP Enable Enable DHCP protocol to dynamically IP address obtain IP address Subnet Mask Gateway address DNS server 44 Page ThaiEasyElec com ill On line Electronics Shop for Embedded System timeout Auto work mode Enable Enable the auto work mode Protocol type TCP Default connection CS mode Server When it s set to TCP server the default Server address timeout is 120second TCP connection 120
24. number 6 2 2 10 AT SKSDF Function Set the default sending socket of system If user needs to enter transparent transmission mode in command mode using this command can send the transparent data from serial port to the destination Format AT SKSDF lt socket gt lt CR gt OK lt CR gt lt LF gt lt CR gt lt LF gt Parameter socket means socket number 6 2 3 System control type 6 2 3 1 AT Function Null command Format AT lt CR gt OK lt CR gt lt LF gt lt CR gt lt LF gt Parameter None 6 2 3 2 AT Z Function Reset system Format AT Z lt CR gt OK lt CR gt lt LF gt lt CR gt lt LF gt Parameter 861Page ThaiEasyElec comlilil On line Electronics Shop for Embedded System None 6 2 3 3 AT E Function Switch serial command to return Format AT E lt CR gt OK lt CR gt lt LF gt lt CR gt lt LF gt Parameter None 6 2 3 4 AT ENTS Function Enable system to enter to sleeping mode System will be awaked automatically after receiving any AT Instruction in sleeping state Format AT ENTS lt CR gt OK lt CR gt lt LF gt lt CR gt lt LF gt Parameter None 6 2 3 5 AT ENTM Function Enable the serial to enter to transparent transmission mode System exit this mode when it has received escape character according with escape term in transparent transmission mode Format AT ENTM lt CR gt OK lt CR gt lt LF gt lt CR gt lt LF gt Parameter None 6 2 3 6 AT RSTF Function 87IPage En
25. of setting key is as follow 114 Page Enable Your Design ThaiEasyElec com ul Sri void WIFI_SetKey unsigned char NeedFlash WIFIKey KeySet WIFIKey KeyResult TATCP_CMD ATWIFlJoin unsigned char ErrorCode 0 char arg NULL INT argc 0 char WiretFlash int argpoint 0 INT err 0 char argv ATCP_MAXARGS char AlGmd KEY char Atbuf 128 memset WIFIKey 0 sizeof WIFIKey memset AT ReceBuffer 0 gcAT ReceData 0 sizeof WIFlRecBuffer memset Atbuf 0 128 strcpy WIFIKey PSK 12345678 WIFIKey KeyLength 8 WIFIKey KeyIndex 1 WIFIKey KeyFormat 1 if NeedFlash WiretFlash else WiretFlash NULL sprintf Atbuf s c d d s n ATCmd WiretFlash WIFIKey KeyFormat WIFIKey KeyIndex WIFIKey PSK ATWIFIJoin Flag 1 ATWIFlJoin Cmdbuf Atbuf ATWIFlJoin Cmdbuflen strlen Atbuf 115 Page Enable Your Design ThaiEasyElec com ll gt hof AtCmdSend ATWIFIJoin if AtRespState 1 arg strchr ATReceBuffer 0 gcAT ReceData ATC_CH_SET if arg argc parse_line arg argv if argc lt 0 printf Recive Error parm n return if argc 3 printf recvie parm number error n else if strtodec amp KeyResult KeyFormat argv 0 lt 0 return if strtodec amp KeyResult Keylndex argv 1 lt 0 return strcpy char KeyResult Psk argv 2 else ErrorCode arg 2 116 Page ThaitasyElec comllll s Sh
26. rate effective range is from 1200 to 115200 Table 6 27 baud rate 115200 115200 bps 57600 57600 bps 38400 38400 bps 19200 19200 bps 9600 9600 bps 4800 4800 bps 2400 2400 bps 1200 1200 bps data bitmeans data bits Table 6 28 data bits 97 Page Thaitasyelec comill s Shop for 0 8 bits 1 7 bits stop bit means stop bits Table 6 29 stop bits 0 1 bit 1 Not supported 2 2 bits parity means parity bit Table 6 30 Even parity 0 No parity 1 Odd parity 2 Even parity 6 2 4 16 AT ATPT Function Set or query the auto framing period of data Data is automatically set frame period This parameter is only effective when serial is in transparent transmission mode Format AT ATPT J period lt CR gt OK period lt CR gt lt LF gt lt CR gt lt LF gt Parameter period means auto framing period its range is 100 10000ms and its units is millisecond the smallest step is 100ms 6 2 4 17 AT ATLT Function 98 1Page ThaiEasyElec comlilil On line Electronics Shop for Embedded System Set or query the data auto framing length of data This parameter is only effective when serial is in transparent transmission mode Format AT ATLT J length lt CR gt OK length lt CR gt lt LF gt lt CR gt lt LF gt Parameter length means auto framing length its range is 64 1024 bytes 6 2 4 18 AT ESPC Function Set or query
27. reduced from 2 seconds to about 300 milliseconds then quick networking is achieved 2 3 1 4 Address binding This module supports the feature of binding the BSSID address of target network According to the provisions of 802 11 protocol different wireless networks can have a same network name i e SSID ESSID but must correspond to a unique BSSID address Illegal intruders can create a wireless network with the same SSID ESSID it will make STAs in the network to join to the illegal AP thereby and then network leakage happens Users can prevent STA from joining to illegal network by binding the BSSID address to improve wireless network security 2 3 1 5 Wireless Roam This module supports 802 11 wireless roam Wireless Roam is that in order to expand the coverage of a wireless network multi AP co found the wireless network with a same SSID ESSID each AP is used to cover different area STA joined in the network can choose a proximate AP namely signal is the strongest to access according to different location and mobile STA will switch among the different APs When wireless roam is enabled the module will automatically initiate a scan in every 100 seconds and according to the current scan result module selects a recent AP to access During the wireless roaming the network may be a brief interruption therefore it is recommended to close as no need of roam 15 Page ThaiEasyElec comlilil On line Electronics Shop for Embedded
28. this parameter Another use of this parameter is reducing the time of scanning and networking by modifying the channel range For example we have known the AP may be connected to is in 1 6 11 channels the channel list can be set only 1 6 11 so that the module will only scan these three channels in the process of networking thus the purpose of shortening the networking time is reached Another should be noted is that parameter of channel has higher priority than the parameter of channel list that is when the parameter of channel is set to the specified channel even if this channel is not included by the channel list networking will still succeed 4 3 5 Port parameters 4 3 5 1 Baud Rate Table 4 26 Baud Rate Baud Rate AT UART Baud Rate Baud rate setting of serial options include 1200 115200bps The default setting of system is 115200bps 4 3 5 2 Data Bits Table 4 27 Data Bits Data Bits Data Bits AT UART Length setting of serial data bits options include 8 bits 7 bits The default setting of system is 8 bits 401Page Enable Your Design ThaltasyElec com s Shop for 4 3 5 3 Stop Bits Table 4 28 Stop Bits Stop Bits Stop Bits AT UART Length setting of serial stop bits options include 1bit 2bits The default setting of system is 1 bit 4 3 5 4 Parity Bit Table 4 29 Parity Bit Parity Bit AT UART Parity Bit setti
29. 0102 AT Instruction protocol uses the form of command response most of instructions need a response message after the receiver has processed the instruction if the receiver receive a new command acquire in the process of processing the previous command it will throw the command away stealthily without any response message the process is shown as following figure AT instruction 1 l deal with instruction 1 response 1 AT instruction 2 j ATrinstuction3 J desl with instruction 2 discard instruction 3 response 2 Figure6 1 Process flow of AT Instruction Some special commands such as AT SKSND and AT SKRCV need to transmit binary data behind command or response at this moment data receiver becomes into diaphanous transmission status provisionally and begins to receive binary numbers flow 77 Page Enable Your Design jil ThaiEasyElec com On line Electronics Shop for Embedded System until it has received the data of which length is prescribed in the lt SIZE gt field of command or message or waits for timeout then it exits transparent transmission mode the flow is shown as follow enter transparent receiving mode and exit the mode after completion return the AT SKRCV return the AT SKSND lt size gt response OK lt size gt data aen O ___ Saat stream gt enter transparent receiving mode and exit the mode after completion figure6 2 AT Instruction special process flow
30. 1 Syntax Format m Format Description lt gt means the parts must be included means the optional part m Command Message AT lt CMD gt op parat para2 para3 parad lt CR gt AT means the leader of Command message CMD means command string op means the symbol of Command operator when the command requires parameters it can specify the operation type of parameters it includes means the leader symbol of parameters or returns means to synchronize the modified parameter to flash in the command of parameters setting type means to query the current setting in the command of parameters setting type lt CR gt means enter it s 0x0d in ASCII m Response message means the leader of response message RSP means response string OK means success 76 Page 6 1 ERR means fail lt CR gt means enter it s 0x0d in ASCII lt LF gt means newline it s 0x0a in ASCII 1 1 Process Flow Enable Your Design ThaiEasyElec com ill On line Electronics Shop for Embedded System gt gt String is enveloped with double quotation marks but its content does not include the quotation mark such as this is a string gt gt Dec means number in decimals such as 10 gt gt Hex means number in hexadecimal such as a gt gt IP means IP address string such as 192 168 0 1 gt gt MAC means MAC address it s formed with 12 hexadecimal numbers such as 001EE3A8
31. 168 0 1 DNS address 192 168 0 1 Setting of work mode gt VV V WV Enable auto work mode Protocol type TCP C S mode client Port number 6000 Server address 192 168 0 1 4 5 5 Multi network connection mode 4 5 5 1 Application scene 53lPage g Enable Your Design ThaiEasyElec com ill On line Electronics Shop for Embedded System AT instruction control terminal of user N devices based on serial je TCP server wie control based on i SOCKET 4 TCP Client SOCKET I 2 gek ET3 eeeeee amp TCP Server TCP Client TCP Server J wireless AP router N gt N m fu 7 be device 1 device 2 device 3 device 4 TCP client TCP client TCP client TCP client figure4 10 Multi network connection mode As shown above it s the network topology diagram of multi network connection based on this modules this system does not be used for a particular application it is not practical but only be used to descript the function of this module as an analog system In the system above the module of device control terminal works in command mode user inputs to the AT Instruction to control it create four TCP connections including 2 Clients and 2 Servers There is a number of clients access to each server Control terminal can communicate with all devices and server in the above figure through different socket connection 4 5 5 2 Reference setting Wireless setti
32. 4 using 3 unsigned char cBuf if RI receive data RI 0 cBuf SBUF ProcessUARTData cBuf else if TI Wee if iSendCounter lt IUARTSendLen SBUF cpSendBufPtr iSendCounter Description ProcessUART Data cBuf is used to deal with the data the serial receives 2 The function of data processing main data structure is described is as follow define WIFIBUFLEN 1024 typedef struct WIFIRecBuffer unsigned char gcATReceData WIFIBUFLEN unsigned int gcATReceCount data length WIFIRecBuffer struct WIFIRecBuffer xdata ATReceBuffer 1 external ram of 51 3 Macro definition of AT instruction return status the definition is mainly used to control the flow of serial receive the return of AT instruction define WIFI_WAIT_SYN 0X00 serial initialization define WIFI_WAIT_ RESP 0x01 serial waits for Corresponding character define WIFI RECEDATA 0x02 l wait for data 105 Page 7 Enable Your Design ThaiEasyElec com ill nof define WIFI_WAIT_ OVER 0x03 wait for end define WIFI_WAIT_ERRCODE 0x04 wait for error define WIFI_SYN 0X2B receive the character 4 The function of parsing the return ProcessUART Data cBuf void ProcessUARTData IN unsigned char UARTData int i 0 switch gcWIFlICommunState case WIFI_WAIT_SYN wait to receive if UARTData WIFI_SYN gcWIFICommunState WIFI_WAIT_RESP break case WIFI_WAIT_RESP AtResp AtResplen UART Data if s
33. CH FOR THE TARGET MODULEN neee 123 Q10 TO MODIFY THE PARAMETERS WITH CONFIGURATION PROGRAM WHY DOES IT SHOW THE ERROR USED PROHIBITIVE OPERATING SYMBOL NA 123 Q11 WHY CANNOT WEB PAGES OF THE WEB SERVER OPEN 123 Q12 WHEN USER SETS THE SERIAL TO THE BAUD RATE IT DOES NOT SUPPORT THE MODULE CANT BE CONNECTED TO THEN ee ee el 123 Q13 IN WIRELESS CONNECTION STATE WHY CAN NOT THE SPECIFIED MODULE BE SEARCHED FORT 124 Q14 IN SOME ENVIRONMENT THE MODULE USED WHY IS THE QUALITY OF WIRELESS CONNECTION ALWAYS BAD AND HOW TO IMPROVE THE WIRELESS TRANSMISSION eenesenneennnsnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn nennen 124 APPENDIX B REVISION HISTORY OF THE DOCUMENT nuusneeanernnnnnnnnnnnnnnnnnnnnnnnnnunnnnnnnnnnnnnnnnnn nennen 125 4 Page ThaiEasyElec comlilil On line Electronics Shop for Embedded System 1 Introduction MO3 is the new third generation embedded UART WIFI modules studied by Venus Supply Co Ltd www ThaiEasyElec com UART WIFI is an embedded module based on the UART serial according with the WIFI wireless WLAN standards It accords with IEEE802 11 protocol stack and TCP IP protocol stack and it enables the data conversion between the user serial and the wireless network module Through the UART WIFI module the traditional serial devices can easily access to the wireless network M03 does a comprehensive hardware and software upgrades based on the products of the first two generations now i
34. MO3 LVTTL UART to Wi Fi IEEE 802 11 b g AT Command and User Manual Enable Your Design ThaiEasyElec com ill On line Electronics Shop for Embedded System ThaiEasyElec comlilil On line Electronics Shop for Embedded System Y Table of Contents 1 INTRODUCTION 2 4 22 Aa a E E E E E 5 2 e LE H 2 1 TECHNICAL SPECIFICATION eege eege eg Dee eege 7 2 2 HARDWARE INERODDIEETION 2 sde geed 8 221 Mechanical Re e een 8 22 2 TER IMT aC E eege eege ENEE 9 272 3 BIN EE 10 224 Optional sass tease te ead sa asa eh edel ee eee eee tee Maelo 11 2 3 MAIN FEATURES aaa han ke ee ea 13 2 3 1 Wireless Network Conmechon nenn nenn neen 13 2 3 2 Plug and NEU 16 2 3 3 Command Mode of Geral 1 ssccccscccceececeeeesenseceeececeeeeeseeceeneeceeeeesaeesensecseeeessaesseneesenseessesesaes 17 2 3 4 TCP IP Protocol stack 17 2 3 5 Flexible Parameter Configuration 2s ccccsccccssceceesceceeecseneececeeecaeessaaecseneecseneeseaseseneeseneeecsanseeaes 18 2 3 6 Multi functional GP 19 2 3 7 Firmware upgrade online ose eeeeescceceenneeececeneeeeceeaceeeceeaaeeeceeaaeeeceeaaeeeseeaaeeeseeaaeeeseeaaeeesseneeessenneees 20 3 QUICK START WIZARD 2 055226 co c5 cco caret aan a Eai ea aaae aa aae daea aa aaia anaien iaaiaee aiea 21 3 1 PREPARATION ink i a a aaia a E aa 21 3 2 SEMTING PARAMETERS fs3 lt scdensec ccevensniidebondxecdassdcidancadadecaayadadebotdnecves dh aeaa eiaa aa aaaea EE 21 3 0 TESTING lan aa anna En are d aE aa
35. Mode OPEN N Key Type HEX Key Index 1 Ho Port Device ID vi COM OO1FA4FDZADD Key Network Setting M Enabled DHCP IP Addr Subnet Mask Gateway Addr DHS Server search successfully Horkmode Setting VJ Auto Horkmode ProtocolType TCP F C S Mode Client x Server ddr 192 168 1 100 Port 60010 TCPConTime 5 s 0 10000000 0 means forever Figure 3 2 Search modules successfully 4 According to the wireless router AP that you connect to you can modify the parameters of wireless settings including network name encryption keys and the IP address of network settings 22 Page Enable Your Design ThaiEasyElec com ill On line Electronics Shop for Embedded System 5 Modify the working mode settings select the enable auto work mode option and set the parameters according to what you want 6 After modifying parameters as shown below click submit and select manually reset later in the pop up dialog box UART FIFEI Configuration 2 2 Se aca em Configuration FuncTest UpdateFw SystemInfo Port Connect SE Port Auto v Set e y Wireless Setting SSID apds Modify All Encry Mode OPEN Key Index No Fort Device ID Key vi COMI OOLFA4FDZADD Network Setting Enabled DHCP IP Addr Subnet Mask Gateway Addr DNS Server Workmode Setting
36. O the pin sends data to the serial 8 GND ground 101Page Enable Your Design ThaiEasyElec com ill On line Electronics Shop for Embedded System 2 2 4 Optional 2 2 4 1 USB to Serial optional MO3 is UART to Wifi Module LVTTL Low Voltage TTL To connect with your PC Notebook which is RS232 Level please use TTL to RS232 In the present most of PC Notebook not have DB9 to provide RS232 interface but have only USB interface USB to Serial is the module that can provide physical USB but give serial TTL data for connect the TTL UART device to PC Notebook easily PC Notebook will find the interface as COM port and you can use serial communication program to connect as the same DB9 interface For suggestion such as ETEEOO2 Serial UART to USB mini B Converter V4 RX Pin GND Pin15 GND Pin4 Figure 2 4 U FL to SMA Interface Cable 2 2 4 2 Antenna interface optional This product provides one antenna interface IPX U FL Connector but not include cable Please order as an option 11lPage ThaiEasyElec com ill On line Electronics Shop for Embedded System Figure 2 5 1 U FL to SMA Interface Cable 2 2 4 3 Antenna optional w Figure 2 5 2 Antenna 2 4 Ghz in many type dBi difference This product must be connected with the 2 4Ghz antenna according to IEEE 802 11g 802 11b standards the parameters are required as follows Table 2 3 antenna parameters Frequency range 2 4 2 4825
37. OM mode lt CR gt OK mode lt CR gt lt LF gt lt CR gt lt LF gt Parameter mode means work mode Table 6 32 work mode 0 System function 1 Input 1001Page Enable Your Design ThaiEasyElec com ill In line Electronics Shop for Embedded Syster 2 Output 6 2 4 23 AT CMDM Function Set or query default command mode of the system Format AT CMDM mode lt CR gt OK modekCR gt lt LF gt lt CR gt lt LF gt Parameter mode means the type of command mode Table 6 33 Command Mode 0 AT Instruction 1 Compatible protocol 6 3 Sample code This section chiefly gives the sample codes of the PC for the control of WIFI module in command mode Ifthe module works in auto work mode it will be not need to refer to this section 6 3 1 Description of sample code The sample code is based on Language C and it can be explanted to other systems It s mainly gives an demonstration of process for the operation of WIFI module while explanting appropriate modification is needed according with own system situation 6 3 2 Operation flow of WIFI module in command mode Usually the operation flow of WIFI module in command mode is shown as the following figure While module is in use user can decide whether to do the operation of the command line according with the state of system 1011Page Enable Your Design i ThaiEasyElec com On line Electronics Shop for Embedded Syst
38. Set or query security mode of wireless network ENTM Set module into transparent transmission mode ENTS Enter sleeping mode ESPC Set or query escape character ESPI Set or query escape time IOC GPIO Control IOM Set or query GPIO mode KEY Set or query key of wireless network LKSTT_ Query network connection state NIP Set or query local IP address PASS Set or query system password PMTF Update parameters in memory to Flash QMAC Query physical address QVER Query version RSIE Return to manufacturer setting SKCLS Close socket connection SKCT Create socket connection SKRCV Receive data through socket connection SKSDF Set default sending socket connection SKSND send data through socket connection SKSTT query socket connection state SSID Set or query SSID UART Set or Query serial data format WARC Set or query automatic retry times in auto work mode WARM Set or query wireless roam WATC Set or query whether to create ADHOC network automatically 801Page Enable Your Design ThaiEasyElec comllll ne Elec mics Shop for Emt WBGR_ Set or query wireless BG mode and maximum send rate WEBS Set or query web service WJOIN Join in or create network WLEAV Disconnect network WPRT Set or query wireless mode WSCA Scan for network Z Z Reset 6 2 2 Network Control Type 6 2 2 1 AT WJOIN Function Join Create a wireless network If the type of curr
39. The function of operating character string ssessssnessnnnesnnnnesnnnnnsnnnnnnnnnnnnnnnnnnnnnnnnnnnnennnnnenna 110 6 3 7 The parsing sample of several AT instructions sendmg 111 APPENDIX A FREQUENT QUESTIONS AND ANSWERS uuunssnusnannnnnunnunnnnunnnnnnnunnunnnnnnnnannnnnnnnnannnnnannnnnnn 120 Q1 WHY CAN NOT THE MODULE SEARCH FOR THE SPECIFIED NETWORK 0 2e ccceeeeeseeeeeeeeceeeeeseaeeesaaeeeeneeees 120 Q2 WHY CAN NOT THE MODULE JOIN IN THE NETWORK 121 Q3 WHY DOES THE MODULE NEED ABOUT 10 SECONDS TO RESPONSE THE COMMAND OR CONNECT TO NETWORK AUTOMATICALLY WHEN ENCRYPTION MODE IS SET TO WPA WPA2 cccccccsscessseceseeecsaeeecseeceeeecsaeeeesaeeeseeeees 121 Q4 THE MODULE HAS CONNECTED TO THE NETWORK SUCCESSFULLY WHY IT CAN T SHOW DESTINATION HOST UNREACHABLE OR REQUEST TIMED OUT AFTER DOING THE OPERATION PING BETWEEN THE MODULE AND PC 121 Q5 IN AUTO WORK MODE THE ICMP CONNECTION SOMETIMES CONNECTS AND SOMETIMES DISCONNECTS AFTER THE MODULE HAS JOINED IN THE NETWORK WHY 122 Q6 IN AUTO WORK MODE WHY DOES THE MODULE NOT CONNECT TO THE NETWORK AUTOMATICALLY AFTER DESEN 122 Q7 IN AUTO WORK MODE DATA SENT TO THE MODULE THROUGH SERIAL WILL DELAY SOMETIME TO SEND TO THE NETWORK WHY EN 122 Q8 IN AUTO WORK MODE WHY DOES THE MODULE NOT EXIT THE TRANSMISSION STATE AFTER INPUTTING THE ESCAPE GHARAGTER Peine einen delet aada deus deedecessibdveuel ai aaaeei 122 Q9 WHY CAN NOT THE CONFIGURATION PROGRAM SEAR
40. Type be w C S Mode Client ServerAddr 1192 168 1 100 Port so TCPConTime s 0 10000000 0 means forever figure5 6 sketch map of restoring to factory setting 5 1 3 4 Import export parameters User can save all configuration parameters in display interface to the specified configuration file through clicking the export parameters button and apply all parameter which are saved in configuration file through clicking import parameter button What should be noted is that using import parameter function only imports parameters to the display interface the imported parameters can be wrote in wireless module actually until clicking the submit modification 601Page UARI FIFI Configuration Fort Connect Port Auto v Wireless Connect CH Close v Device ID OO1FA4FDZADD Ho Port v com Enable Your Design ThaiEasyElec comillll On line Electronics Shop for Embedded System p C onfiguration FuncTest UpdateFw SystemInfo Wireless Setting SSID apds Encry Mode OPEN A Key Type Key Index Key Network Setting V Enabled DHCP IP Addr Subnet Mask Gateway Addr DNS Server Workmode Setting M Auto Horkmode ProtocolType TCP EI C S Mode Client ServerAddr 192 168 1 100 Port 160010 TCPConTime s Q 10000000 0 means forever figure5 7 sketch map of Importing parameters 5 1 3 5 Group mo
41. able Your Design _ThaiEasyElec coll mics Shop for Embedded S ys Return to manufacturer settings in flash Systems need to restart and then the settings become effective Format AT RSTF lt CR gt OK lt CR gt lt LF gt lt CR gt lt LF gt Parameter None 6 2 3 7 AT PMTF Function Parameters which are saved in the memory are updated to the flash Format AT PMTF lt CR gt OK lt CR gt lt LF gt lt CR gt lt LF gt Parameter None 6 2 3 8 AT lOC Function GPIO input or output control IO status is allowed to read when GPIO1 is set to input mode the mode of AT IOM is 1 IO status is allowed to write when GPIO1 is set to output mode the mode of AT IOM is 2 Format AT lOC status lt CR gt OK status lt CR gt lt LF gt lt CR gt lt LF gt Parameter status means IO Status Table 6 10 IO Status Value Mea 0 High level 1 Low level 6 2 3 9 AT QMAC Function 881Page Enable Your Design ThaiEasyElec com ill i line Electronics Shop for Embedded System Acquire physical address of the module Format AT QMAC lt CR gt OK lt mac address gt lt CR gt lt LF gt lt CR gt lt LF gt Parameter mac address is twelve hexadecimal Numbers format is 001EE3A34455 6 2 3 10 AT QVER Function Acquire version of system the version message includes hardware version and firmware version Format AT QVER lt CR gt OK lt hard firm gt lt CR gt lt LF gt lt CR gt lt LF gt Parameter har
42. acter that user input cannot be display in the super terminal interface Thus user can use super terminal program to test the most of AT instruction set for example the command of network scan can be instead of inputting AT WSCAN its shown as the following sketch map 74 Page Enable Your Design ThaiEasyElec com ill On line Electronics Shop for Embedded System Swis Track TCP Connection Hyper Terminal File Edit Yiew Call Transfer Help Dae o S 25 ee 0K 0K AT WSCAN 0K 88b00c55d5e8 H Ip tendad9 33 021f33c3dc91 0 3 0 dd wrt_vap 66 FT_wep64 70 021f33c3dc90 dd wrt_vap 66 0024017b1550 noos3 oO 002586325e06 noos2 52 0924013891a3 testbig 46 001f c6ce8de8 noos 0001613dfeb0 uaQ3_wlan 9 G AT QVER OK H1 00 01 1029 F1 00 00 14 30 35 Sep 6 2010 AT WJOIN 0K 001f c6ce8de8 H UH noos 20 Connected 0 00 19 Auto detect TCP IP SCROLL CAPS num Capture Print echo figure5 23 instruction test 75lPage Enable Your Design ThaiEasyElec com ill i line Elec ics Shop for Embedded System 6 AT Instruction Control Protocol User can ignore this chapter if only using auto work mode 6 1 Syntax Introduction This module uses AT Instruction protocol as user control protocol AT Instruction protocol is based on the instruction of ASCII command style The description of syntax format and management process is as follow 6 1
43. ake sure 3 Click search module if the connection port is selected to auto and the computer has more than one serial it maybe expend a long time for searching The following sketch map will show after search completed UARI FIFI Configuration Fort Connect Port com Set Wireless Connect Ho Port Device ID DRECHEN po _ Configuration FuncTest UpdateFw SystemInfo Wireless Setting SSID lapds Encry Mode OPEN Key Type Key Index Key Network Setting V Enabled DHCP IP Addr D Subnet Mask Gateway Addr E DNS Server Workmode Setting M Auto Yorkmode ProtocolType TCP sl C S Mode Client ServerAddr 1192 168 1 100 Port 60010 7 TCPConTime s 0 10000000 0 means forever figure5 1 serial connection sketch map 5 1 2 2 Management through wireless connection Note Using this function needs to choose correct wireless adapter and install wireless driver correctly 1 Plug the wireless adapter in computer it s shown as the figure 2 5 2 Install wireless driver the successful result is shown as the following sketch map 56lPage Enable Your Design ThaiEasyElec com ill On line Electronics Shop for Embedded System gd Broad dapter for YMnet1 B VMware Virtual Ethernet Adapter for YMnet amp ES Commiiew Atheros ARSO0SG Wireless Network Adapter H Figure5 2 Install wireless driver Open the UART WIFI configur
44. al WPA2 PSK CCMP AES 8 63 ASCII characters characters Note1 hexadecimal characters means 0 9 and a f no division of majuscule and lowercase for example 11223344dd Note2 ASCII character means the numbers 0 9 and characters a z and A Z in ASCII character set which is specified by ISO for example 14u6E 6 2 4 7 AT BSSID Function Set or query BSSID address of the target AP The configuration is only effective in infrastructure network Format AT BSSID mode bssid lt CR gt OK mode bssid amp lt CR gt lt LF gt lt CR gt lt LF gt Parameter mode means BSSID Mode Table 6 19 BSSID Mode 0 auto 1 specified bssid means Network BSSID its size is twelve hexadecimal numbers format is such as 001EE3A34455 93 Page Enable Your Design ThaiEasyElec com ill In line Electronics Shop for Embedded Syster 6 2 4 8 AT CHL Function Set or query the specified wireless channel Format AT CHL mode channelkCR gt OK mode channel lt CR gt lt LF gt lt CR gt lt LF gt Parameter mode means channel mode Table 6 20 channel mode 0 auto 1 specified channel means wireless channel number effective range is 1 14 6 2 4 9 AT CHLL Function Set or query wireless channel list Wireless channel list is used to prescribe work channel range of module the channel not included in the channel list will be not scanned reasonably using this parameter can expedite the speed o
45. asy lec comMlll s Shop for Used to specify static IP address of the local network address of the client it s only effective in the case of exiting DHCP 4 3 2 3 Subnet Mask Table 4 8 Subnet Mask Subnet Mask AT NIP Subnet Mask Used to specify the subnet mask of the local network address it s only effective in the case of exiting DHCP 4 3 2 4 Gateway address Table4 9 Gateway address Gateway Address Gateway address AT NIP Used to specify the gateway address of the local network address it s only effective in the case of exiting DHCP 4 3 2 5 DNS Server Table 4 10 DNS Server DNS Server DNS Address AT NIP Used to specify the DNS server address of the local network address it s only effective in the case of exiting DHCP 4 3 3 Parameters of work mode 4 3 3 1 Auto work mode Table 4 11 Auto work mode Auto Mode Enable AT ATM Used to specify whether auto work mode of the module is enabled or not 341Page Thaigasy lec com lll s Shop for 4 3 3 2 Protocol Type Table 4 12 Protocol Type Protocol Type AT ATRM Used to specify the protocol type of the default connection module creates in the auto work mode options include TCP UDP 4 3 3 3 CS mode Table 4 13 CS mode CS mode AT ATRM CS Mode Used to specify the CS mode of the default connection module creates in th
46. asyElec com II Shor WIFlJoin Flag RespParm WIFlJoin Cmdbufl ATCmd WIFlJoin Cmdbuflen strlen AT Cmd AtCmdSend WIFlJoin if AtRespState 1 arg strchr AT ReceBuffer 0 gcAT ReceData ATC_CH_SET if arg argc parse_line arg argv if argc lt 0 printf Recive Error parm n return if argc 6 printf recvie parm number error n else if strtohexarray Jionr BSSID 6 argv 0 lt 0 printf Error Bssid n return if strtodec amp Jionr Type argv 1 lt 0 return if strtodec amp Jionr channel argv 2 lt 0 return 113 Page Enable Your Design ThaiEasyElec com ill nics Shop for Em if strtodec amp Jionr encry argv 3 lt 0 return strcpy char Jionr Ssid argv 4 if strtodec amp Jionr rssi argv 5 lt O return else ErrorCode arg 2 printf reciver error At cmd resp ERROR Code d ErrorCode 6 3 7 2 The sending sample of the instruction of parameter setting type The instruction of parameter setting type is mainly used to set the parameters of WIFI module for PC AT Instruction set includes many command which is used to set parameters 1 Take the key setting as an example What used in key setting is mainly data structure typedef struct _WIFIKeyf unsigned char PSK 64 unsigned char KeyLength unsigned char Keylndex unsigned char KeyFormat WIFIKey 2 The main function
47. ation hypervisor if the driver is installed successfully setting frame of wireless connection will be in activation status Click setting button input system password only the module of which the system password match with the setting can be scanned Select scan channel from channel list It will scan all channels from 1 to 14 if auto is selected Click search module if channel is selected to auto it will expend a long time to search the completed result is shown as the following sketch map UARI VIFI Configuration Wireless Setting SSID RER lMedi y A11 Encry Mode OPEN i w Key Type HEX m Key Index Ho Port Device ID r Sg Key v i CHLI OO1EE3C3BE21 2 CHLI OO1EE3E20067 Network Setting Enabled DHCP IP Addr 192 Subnet Mask 5 Gateway Addr 192 DNS Server 192 Workmode Setting M Auto Yorkmode ProtocolType TCP wl C S Mode Client v ServerAddr 192 168 1 100 Port 60010 j TCPConTime u s 0 10000000 0 means forever Figure5 3 sketch map of wireless connection 57 Page Enable Your Design ThaiEasyElec com ill On line Electronics Shop for Embedded System 5 1 3 Configuring parameter This section offers the function of fast querying modifying configuration parameter of module for user UART WIFI Configuration pn M SE Configuration FuncTest UpdateFw SystemInfo Port Connect pert
48. before upgrading otherwise failure will make the module destroyed 70lPage Enable Your Design ThaiEasyElec com ill On line Electronics Shop for Embedded System UART IFI Configuration Configuration FuncTest UpdateFw SystemInfo Port Connect a a a E une Notes i The module connector must use phisical 2 The baud rate of the module serial port must be set Wireless Connect at 115200bps 8 data bits 1 start bit 1 stop bit no z parity no flow control 3 Never disconnect the serial cable or stop during the updating process it may break the module 4 Once the update complete please powered off and re up electricity and check the version No Port Device ID vi COM1 OO1FA4FD2ADD Please selet the update file IE pr ogram tes thTLGLOUAOS ver sion fi BS ar ev Update Mode COTTE figure5 19 firmware upgrade 5 2 Configuration through WEB server WEB server has been embedded in this product it can support the function of parameters configuration with IE browser the method is as follow Notices 1 Make sure the module has connected to the network successfully before using web page configuration 2 The default port number of the WEB server is 80 so it only needs to input address in address column of browser if user has modified the web server port user must input port number otherwise the net cannot be opened for example when the port number is set to 8080 the access address o
49. d means hardware version its format is string such as H1 00 00 1029 firm means firmware version its format is string such as F0 02 02 18 25 25 Jul 28 2010 6 2 4 Parameter Setting Type 6 2 4 1 AT NIP Function Set or query local IP address The dynamic IP address cannot be queried if address type is set to DHCP AT LKSTT command can be used to query Format AT NIP type ip netmask gateway dns lt CR gt OK type jo netmask gateway dns lt CR gt lt LF gt lt CR gt lt LF gt Parameter type means address type Table 6 11 address type q Use DHCP to assign IP address dynamically 1 assign static IP address 891Page Enable Your Design ThaiEasyElec com ill On line Electronics Shop for Embedded System ip means IP address data format is such as 192 168 1 22 not including quotation marks netmask means subnet mask data format is the same as IP address gateway means Gateway address Data format is the same as IP address dns means DNS address Data format is the same as IP address 6 2 4 2 AT ATM Function Set or query work mode of module Format AT ATM mode lt CR gt OK mode lt CR gt lt LF gt lt CR gt lt LF gt Parameter mode means work mode Table 6 12 work mode 0 Auto work mode 1 Command mode 6 2 4 3 AT ATRM Function Set or query the message of the connection the module creates automatically in auto work mode Format AT ATRMS protocol
50. der Input Output Box AT Qver Connect create network Connect create network complete NetMode Encry BSSID Infra No OO23CDS4DCEA 1 Disconnect network Disconnect network complete Channel SSID sea Late apds User can click the state button to query network connection status as following sketch map the result will show in the following display frame 64lPage Enable Your Design ThaiEasyElec com ill On line Electronics Shop for Embedded System UART WIFLI Configuration Port Connect Port Auto Ka Wireless Connect CH Close Ka No Port Device ID v COM OO1FA4FDZADD REES oS Configuration FuncTest UpdateFw SystemInfo Wireless Network Ordered Socket order Input Output Box Ine Query the connect property Query result is Already connected IP Addr 192 168 1 101 SubnetMask 255 255 255 0 Gateway 192 168 1 1 DnsServer 192 168 1 1 figure5 11 query network status 5 1 4 4 Create socket User can click create button to create socket as the following sketch map Click the Yes button after configured each parameter It will return a socket number after creating successfully Socket Setting Protocol Type TCP CiS Mode Client Server Addr 9 0 0 0 Port Connect Overtime s O 10000000 0 means forever Cancel 0 65 Page Enable You
51. dification Group modification will be activated when configuration hypervisor has searched for more than one wireless module If user selects the function the modified parameters will be applied to all of the wireless modules automatically through clicking modify all This function can predigest operation steps and enhance work efficiency when a lot of modules need to be restored to the default configuration 5 1 4 Function test This section offers the function of fast testing AT instruction for user the user can jump over this section when using auto work mode Additionally this function cannot work while the module is configured through wireless connection User can send command through shortcut button of usual instruction or inputting AT 61lPage Enable Your Design ThaiEasyElec com ill On line Electronics Shop for Embedded System instruction directly it is shown as the following sketch map UARI FIFI Configuration re S Configuration FuncTest UpdateFw SystemInfo Co Reese UST LEERE Port auto wl Wireless Network Ordered Wireless Connect 5 ocket order CH Close Vv Je 5 ge eceive Input Output Box AltQver No Fort Device ID vi COM OO1FA4FDZADD ATt Qver OK H0 00 00 0000 F1 01 00 09 19 06 Sep 19 2010 figure5 8 function test page 5 1 4 1 Network scanning User can click scan button to scan network as the follo
52. e auto work mode options include Client Server 4 3 3 4 Server Address Table 4 14 Server Address Server Address Server Address AT ATRM In the auto work mode when CS mode of the default connection module creates is Client it s used to specify the server module connects to its input format may be IP address or domain name 35lPage Thaigasy lec comMlll s Shop for 4 3 3 5 TCP connection timeout Table 4 15 TCP connection timeout TCP connection timeout Tcp Link TimeOut AT ATRM In the auto work mode when CS mode of the default connection module creates is TCP server it s used to specify the maximum connection time of the client which joined in the server in the condition of no data transfer if the no transfer connection is more than this time the client will be kicked out automatically 4 3 3 6 Port number Table 4 16 Port number AT ATRM Port Number Used to specify the port number of the default connection module creates in the auto work mode 4 3 4 Advanced wireless parameters 4 3 4 1 Network mode Table 4 17 Network mode AT WPRT Network Mode Network mode Used to specify the network mode of the WIFI network options include Infrastructure Adhoc The default setting is Infrastructure In most cases if what we want to join to is wireless network AP creates using the default setting is just conten
53. e function used to parse the return parameters of AT instruction This function is used to parse the return parameters of AT instruction and split the return parameters The sample is as follow INT parse_line char line char argv INT nargs 0 while nargs lt ATCP_MAXARGS skip any white space while line line t line if line 0 end of line no more args argv nargs NULL return nargs if line argument such as xxxx line skip 1st lt gt argv nargs line begin of argument string find end of string while line amp amp line line if line 0 end of line but 2nd lt gt is not found argv nargs NULL return 1 line 0 terminate current arg 108 Page ThaitasyElec comilll s Shop for skip any white space while line line t line if line line skip lt gt else if line 0 end of line no more args argv nargs NULL return nargs else unexpected char argv nargs NULL return 1 else argv nargs line begin of argument string find end of string while line amp amp line line if line 0 end of line no more args argv nargs NULL return nargs line 0 terminate c
54. ee da Ban ann d aE enei iena 23 d PRODUCT DESIGN GUIDE 4a AA ae ra a aE aaaea a aaa 25 4 1 HARDWARE CONNECTION 25 4 2 WORK MODE annaikninaeiga nal ia 25 4 2 1 Start up mode selechon nenene neneen nenene 25 4 2 2 Aulo W rk TIT TEE 26 4 2 3 Command work mode 31 4 3 PARAMETER DETAILS en 31 4 3 1 Wireless Parameter nenne en De ee i 31 4 3 2 Network Paramelars nnnneennsnrrnnnnsnernnnnne nes ran ern snnn ernennen rennen rn 33 4 3 3 Parameters of work mode 34 ThaiEasyElec comlilil On line Electronics Shop for Embedded System Y 4 3 4 Advanced wireless Darameierg 36 4 3 9 Fon EE 40 4 3 6 Parameters of transparent mode 41 43 7 System EE 43 4A DEFAULT SETTING ae en ea a 44 4 5 TYPIGAL APPLICATION EXAMPLES near deed dese 46 4 5 1 The networking of active serial device esseeeseseeeeseneeeirreerirreerrnneerrnrerrinrerrnnnerrrnnernneerenneent 46 4 5 2 The networking of passive serial device 00 0 eeeseececeeeceeeeeeneeeeeeeeneeesesaaeeetesaaeeesenaaeeesnesaeerennaaeeetnes 48 4 5 3 The networking with broadcast method of serial dewice 49 4 5 4 Wireless virtual serial 52 4 5 5 Multi network connection mode 53 5 CONFIGURATION MANAGEMENT MANUAL nuunsussssnnnnnnnnnnnnnnnnnnnnnnnnnnannnnnnnnnannnnnannnnnnnnnnannnnnannnnnnn 55 5 1 CONFIGURATION THROUGH CONFIGURATION MANAGEMENT SOFTWARE nnnnnunssnnnnnnnnnnnnennnnnnnnnnnnnnnnnnnnn nn 55 9 1 1 ee ee EE 55 5 1 2 Module menagement
55. em parameters needs to Set the parameters of the module Initiate networking ery whether networking is successful no Create user socket Start data transmission figure6 3 the operation of WIFI module 6 3 3 main data framework of sample code 6 3 3 1 At command structure Description CmdName means code name of the command of AT instruction Flag means whether the command has return symbol Cmdbuf means the content the command includes Cmdbuiflen means the length of the command 102 Page Enable Your Design ThaiEasyElec com ill In line Electronics Shop for Embedded Syster typedef struct _TATCP_COMMAND char CmdName INT Flag char Cmdbuf INT Cmdbuflen TATCP_CMD 6 3 3 2 The sending symbol of serial s AT instruction unsigned char AtCmdSending Description The symbol means an AT instruction is being sent or waiting for return The module can t continue to send down another instruction If user s system is based on operation system programming it can be achieve with the mechanism of signal quantum 6 3 3 3 The symbol for serial waiting return of AT instruction unsigned char ReciveAtCmdrep Description the symbol means the serial is waiting for the return of an AT instruction if operation system is used it can be used 6 3 4 Operation of serial data After the serial has sent a CMD it needs to wait for return of the command If there is no r
56. ent network is ADHOC and the module cannot search for the same SSID network then it automatically creates a new network or it has been connected then return the message of network connection Format AT WJOIN lt CR gt OK lt bssid gt lt type gt lt channel gt lt b_encry gt lt Ssid gt lt rssi gt lt CR gt lt LF gt lt CR gt lt LF gt Parameter bssid means network BSSID it is formed with twelve hexadecimal Numbers and the format is 001EE3A34455 type means Network Type Table 6 3 Network Type Value meanings 0 Infra network 1 ADHOC network channel means Channel Number b_encry means Encryption Mode Table 6 4 Encryption Mode 0 Open Encryption ssid means Wireless network name it s formed with 1 32 Character and embedded by 811Page ThaiEasyElec comlilil On line Electronics Shop for Embedded System double quotation marks rssi means Network Signal Strength it does not include minus its unit is dBm For example 50 means that the strength is 50 dBm 6 2 2 2 AT WLEAV Function Disconnect the current network Format AT WLEAV lt CR gt OK lt CR gt lt LF gt lt CR gt lt LF gt Parameter None 6 2 2 3 AT WSCAN Function Scan and return after finishing Format AT WSCAN lt CR gt OK lt bssid gt lt type gt lt channel gt lt b_encry gt lt ssid gt lt rssi gt lt CR gt lt LF gt lt bssid gt lt type gt lt channel gt lt b_encry gt lt ssid gt lt rssi g
57. er What should be noted Once user set it to fixed channels the module scans only the specified 381Page Thaigasy lec comMlll s Shop for channels if the target AP has changed the channel number module will never connect to the network successfully 4 3 4 7 Auto Retry Table 4 23 Auto Retry Auto Retry AT CHL Auto Retry Count This parameter is only effective in auto work mode it s used to specify the auto retry number when networking is failed or network disconnects unnaturally options include Never Ever 1 254 The default setting of system is Ever 4 3 4 8 Wireless roam Table 4 24 wireless roam Wireless Roam Wireless roam AT WARM Used to specify whether to enable the function of wireless roam or not The default setting of system is disabled What should be noted when the parameter of BSSID is set to fixed wireless roam will become no effect 4 3 4 9 Channel List Table 4 25 Channel List Channel List AT CHLL Channel List Used to specify the wireless region settings the ranges of the 2 4G frequency bands different countries and regions open is different such as the United States is 1 11 channels Europe is 1 to 13 channels and Japan is 1 to 14 channels 391Page Thaitasyelec comill re Elec mics Shop for The system default setting is 1 14 channels ordinarily user doesn t need to modify
58. erying Description 1 As shown above the querying results return from two sockets are different Because the second socket type is TCP server which is in monitor state after creating successfully its result does not only contain itself state but also includes the connection information of Clients which are connecting to the server these sockets are created by system automatically as socket3 and socket4 shown in sketch map 5 1 4 7 Socket sending User can send data through socket by clicking send button and inputting socket number the socket of TCP server can t be used to send or receive data directly what is 67 Page e Cell n line Electronics Shop for Embedded Syster input should be the socket number of the connection between clients and the server and data that need to send the sending accomplishment information will return in the display frame after clicking yes button Socket Send Socket No hello hello hello hello C Hexadecimal figure5 15 send data through socket 5 1 4 8 Socket receiving User can receive data through socket by clicking receive button and inputting socket number the socket of TCP server can t be used to send or receive data directly what is input should be the socket number of the connection between clients and the server and data size that expected to receive in pop up dialog box the data will show in the receive frame after clicking receive button s
59. eturn for this command timeout is needed the system will force to exit the command after time out It must be sure that in the process of sending AT instruction there is one AT instruction in serial which is waiting for return 6 3 4 1 The sample of serial sending instruction int AtCmdSend TATCP_CMD AtCmd 103 Page Thaitasyelec comlll s Shop for er unsigned char AtCmdbuf 51 2 int ret 0 I AtCmd_Check AtCmdCheck I strepy AtCmdbuf AT strcat AtCmdbuf AtCmd gt Cmdbuf ReciveAtCmdrep 0 ComSendstr AtCmdbuf AtcmdTimerld StartTimer MSG_CMD_TIMEOUT_CFM TIMER_ATCMD_ TIMEOUT while ReciveAtCmdrep 1 if Atcmdtimeout 1 ret 1 break StopTimer AtcmdTimerld return ret Description It needs the system supports added function of timeout processing in this sample code The system will start the timer after serial sends a command and set Atcmatimeout to 1 in the specified time in order to achieve the process after the module is time out 6 3 4 2 The sample of serial receiving the return of AT instruction It is used to receive the response message of AT instruction after hashing sent a AT instruction the PC needs to wait for the response or timeout more than 500 ms at least of WIFI module This sample is illustrated with the serial interrupt of 51 structure 1 The function of serial receiving interrupt 104 1Page Thaitasyelec comill s Shop for void COMM_INT interrupt
60. f des INT8U tmp return str 070 1 6 3 7 The parsing sample of several AT instructions sending 6 3 7 1 The sending sample of simple instruction of control type This command is only used to control the operation of the module it does not need to schlep a lot of parameters data in AT instruction and receiving the response means 111lPage em Thaigasy lec comMlll s Shop for it has been operated correctly 1 Take the operation of controlling the WIFI module networking as a example The data structure used in the operation of WIFI module networking is as follow define RespParm 1 define NoRespParm 0 define ATC_CH_SET define ATC_CH_SAVE d define ATC CH OUER GE typedef struct _JionResult unsigned char BSSID 12 unsigned char Type A0 infra 1 ADHOC unsigned char channel unsigned char encry char ssid 32 int rssi TJION_RESULT 2 The main function used to control the networking of WIFI module is shown as follow while using this function the system will hang out until networking is time out or the module has received the response of the command void WIFI_Jion void TATCP_CMD WIFlJoin TJION_ RESULT Jionr unsigned char ErrorCode 0 char arg NULL INT argc 0 int argpoint 0 INT err 0 char argv ATCP_MAXARGS char ATCmd WJOIN n memset WIFIJoin 0 sizeof TATCP_CMD memset ATReceBuffer 0 gcATReceData 0 sizeof WIFIRecBuffer 112 Page Enable Your Design ThaiE
61. f scanning and networking of module Format AT CHLL channel list lt CR gt OK channel listl lt C R gt lt LF gt lt CR gt lt LF gt Parameter channel list means wireless channel list it uses hexadecimal format it begins from the lowest bit each bit means a channel the default setting is 3fff that means all of 1 14 channels 6 2 4 10 AT WPRT Function Set or query wireless network type Format AT WPRT type lt CR gt OK typekCR gt lt LF gt lt CR gt lt LF gt Parameter 941Page Enable Your Design ThaiEasyElec comllll type means network type Table 6 21 network type 0 Infrastructure network 1 ADHOC network 6 2 4 11 AT WATC Function s Shop for Set or query whether to enable to create ADHOC network automatically This parameter is only effective when wireless network type is set to ADHOC it means whether to create a ADHOC network with the same SSID when networking is failed Format AT WATC fenablekCR gt OK enablekCR gt lt LF gt lt CR gt lt LF gt Parameter enable means the symbol of enabling Table 6 22 symbol of enabling Value Mea 0 disabled 1 enabled 6 2 4 12 AT WARM Function Set or query whether to enable the wireless roam Format AT WARMS fenable amp CR gt OK enable lt CR gt lt LF gt lt CR gt lt LF gt Parameter enable means the symbol of enabling Table 6 23 enable symbol 0 disabled 1 enabled
62. f the web server is http 192 168 1 20 8080 3 Please use Windows IE browser to access the server as well as you can 71 Page Enable Your Design ThaiEasyElec com ill On line Electronics Shop for Embedded System 5 2 1 Query set configuration parameter Open IE browser connect after inputting IP address and the port number sometimes of wireless module in address column the login interface will appear input user name admin and login password of module default password is 000000 The configuration web page is shown as the following sketch map if user want to modify configuration parameters of wireless module you need to click Save button to submit the modification Basic Advanced System e Wireless Settings wireless settings is the basic step for you to use the wifi module The encryption can guarantee the security of your data e Network Settings Proper Network Settings can ensure that your network is properly connected e Auto Mode Settings If the auto mode is enabled your wifi module will transmit the data transparently SSID Encryption Key Format Key Index Encryption Key Fixed IP Address Subnet Mask Gateway Address DNS Address Protocol C S Mode Server Address Tep Link TimeOut Port Number noos Disable x aSCII 19626384 I DHCP Enable VW Auto Mode Enable rl SERVER d 60s range lt 0 10000000 gt bom figure5 20 web pa
63. ge of parameter modification 3 After completing the submission the wireless module will restart automatically the web page will be also refreshed in ten seconds 72lPage ThaiEasyElec comilll On line Electronics Shop for Embedded System 5 2 2 Firmware upgrade on line The product supports firmware upgrade online through web page it s shown as following sketch map System er System Infomation S Advanced System Mac Address 00 11 22 33 44 04 Hardware Version fi 00 01 1029 irmware Version 2 System infomation Firmware Version 1 00 00 Mac address hardware Release Time 14 30 35 Sep 6 2010 version firmware SE Firmware Upgrade S Firmware Upgrade ui Sadler Firmware File EAFirmware_1 00 00 img WR and click the upgrade button then you can upgrade SES your firmware figure5 21 online upgrade of firmware 5 3 Configuration through Hyper terminal program User can ignore the section if only using the wireless module in auto work mode For the user who hopes to test the function of AT Instruction Windows Hyper Terminal which is embedded in Windows operation system can be used to input AT instruction directly for parameter configuration of wireless module and function test What should be described is that the serial debugging software serial genius serial master etc that referred in preamble all can be used for AT Instruction test this section just takes hyper terminal program as an e
64. he data in buffer is not normally sent At this time timeout mechanism is needed to ensure the small amount of data can be sent the timeout is auto framing period Two parameters above together form the two trigger terms of auto framing The longer the length of auto framing the higher the transmission performance of the system the shorter the auto framing period the higher real time transmission of the system so in practice the two parameters can be adjusted according to the needs to obtain the best effect of transmission 29 Page Enable Your Design all L ThaiEasyElec com On line Electronics Shop for Embedded System 4 2 2 3 Hardware Flow Control Mechanism Module supports hardware flow control mechanism in transparent transmission mode RTS it indicates the enable signal of module receiver and it s effective when it s low if the following conditions are met simultaneously RTS signal is effective Wireless network is connected The length of data in UART receiver buffer is no longer than 3 4 of full CTS it indicates the enable signal of host receiver and it s effective when it s low once the module detects the ineffective CTS signal it will immediately stop sending data to the serial until CTS becomes effective 4 2 2 4 Exit transparent transmission In auto work mode with default configuration the module s serial is in transparent transmission state At this time all data through the serial receiving are for
65. hown as figure5 18 Before receiving data please use query command to confirm whether the socket receiver buffer has saved data in it at first 68 Page ThaiEasyElec comilll On line Electronics Shop for Embedded System UARTI FIFI Configuration Configuration Functest Updater 5 Wireless Network Ordered Wireless Connect se Si R Socket serias er Addr Port Data Length 192 168 1 100 60010 figure5 16 query the receiver buffer Socket Receive figure5 17 socket receiving 69 Page Enable Your Design ThaiEasyElec com ill On line Electronics Shop for Embedded System 5 1 5 System information User can query MAC address hardware version information and firmware version information of the module in this section the following sketch map is the show UART FIFI Configuration we Famenne um Configuration FuncTest UpdateFw SystemInfo Fort Connect Port Auto Y MAC Address Dora Hardware Version noom amp Firmware Version kono SoS All Release Time a 19 06 Sep 19 2010 No Port Device ID el com OO1FA4FDZADD Wireless Connect CH Close v figure5 18 system information 5 1 6 Firmware upgrade This function will be activate when the module has connected to the wireless network User can acquire the function of module firmware upgrade in this section as the following sketch map shows what should be noted is that please read the notice carefully
66. ice wireless POS device 2 wireless POS device TCP client TCP client TCP client Figure 4 6 The networking of active serial device The networking of active serial device means the device sponsors the networking and data exchange with background server upload or download Typical active type equipment is such as wireless POS machine after each credit card transaction and then 46 Page ThaiEasyElec comillll On line Electronics Shop for Embedded System begins to connect background server and upload the transaction data The topology of the networking of active serial device is as shown above There into the background server works as a TCP Server the device connects to the network through wireless AP or router and works as a TCP Client 4 5 1 2 Reference Setting Wireless setting gt SSID encryption mode key and so on refer to the setting of wireless AP or router Network setting gt Enable DHCP Work mode setting gt Enable auto work mode Protocol type TCP C S mode client Server address IP address of background server such as 192 168 0 100 Port number port number of background server such as 6000 VV V WV 47 Page ThaiEasyElec comilll On line Electronics Shop for Embedded System 4 5 2 The networking of passive serial device 4 5 2 1 Application scene _ a background server ae TCP server wireless AP router ea SS i Ss gt BH u wireless senor wireless senor 2 wireless senorn
67. ing However this model also requires the user has full understanding of control protocol of the module s AT Instruction set and have a basic use knowledge of wireless network and TCP IP network This module beds a set of AT Instruction used for system control and parameter configuration command see Article VI all instructions are based on ASCII code using Windows Super Terminal program can directly control module with command it s convenient for debugging and using 2 3 4 TCP IP Protocol stack This module contains a complete TCP IP protocol stack and it supports the TCP UDP ICMP ARP DHCP DNS HTTP protocol in addition it also supports programming interfaces of socket based on AT Instruction set supports 8 TCP client connections at most supports 3 TCP server connections at most and the most number of clients which can join in one server is 4 supports 5 6 UDP connections at most 17 Page ThaiEasyElec comillll On line Electronics Shop for Embedded System supports UDP broadcasting supports 8 TCP connections at most supports DHCP Client supports DNS Resolver supports HTTP built in WEB server supports programming interfaces of socket gt gt gt gt 2 3 5 Flexible Parameter Configuration This module commonly works based on the default parameters configured parameters are saved in the flash memory parameters can be saved when power is down the user can use a variety of methods to modify the configuratio
68. kel Auto Horkmode ProtocolType TCP v C S Mode Client ServerAddr 192 168 1 100 Port TCPConTime s 0 10000000 0 means forever Figure3 3 Modify parameters of UART WIFI module 3 3 Testing 1 Run TCP UDP debugging software create a TCP Server whose detecting port is 60000 2 Run serial debugging software such as RealTerm exe in this case Modify parameters 23 Page Enable Your Design ThaiEasyElec com II gt hof RealTerm Serial Capture Program 2 0 0 57 Display Port Capture Pins Send EchoPort DC 12C 2 12CMise Misc n Clear Freeze _ Status Baud 115200 EI Port fi EI Dpen Spy Lo change Connected Parit F Software Flow Control _ RxD 2 se G d C d Receive xon Char 17 TXD 3 CTS 8 on IC ro I Transmit Xoff Char 19 Ser b Mark 2 i 9 None 8 IDSR 6 C Space C DTR DSA C RS485 ts Ring 9 BREAK Error Char Count 0000000 CPS 0 Fort Closed Figure3 5 modify the parameters of ComMaster 3 Repower the serial adapter plate or press the reset button and the M03 module will reset and automatically connect to the network and TCP server Then you can begin your transmission test between ComMaster and the TCP UDP test tools 24 Page Enable Your Design ThaiEasyElec com ill On line Electronics Shop for Embedded System 4 Product Design Guide 4 1 Hardware Connection CPU or RS232 chip connect to rese
69. n auto work mode data sent to the module through serial will delay sometime to send to the network why A In auto work mode framing and sending data has two trigger qualification trigger time and trigger length if the length of data doesn t reach the trigger length and it will wait to be framed and sent coercively after trigger time the specific is referred in Section 4 2 2 2 Q8 In auto work mode why does the module not exit the transmission state after inputting the escape character A To exit transparent transmission has strict limits the specific is referred in Section 4 2 2 4 122 Page ThaiEasyElec comlilil In line Electronics Shop for Embedded System Q9 Why can not the configuration program search for the target module A The serial setting of configuration program is not consistent with the serial setting of the module The module is in auto work mode please reset it be sure LED1 and LED2 is illumed and then retry the search Q10 To modify the parameters with configuration program why does it show the error used prohibitive operating symbol A Please disconnect the network connection first and then refer the modified parameters Q11 Why cannot web pages of the WEB server open A The reasons maybe include Whether the WEB server is forbidden Whether the server port is set correctly or not if the port is set to the number except 80 then it s needed to input the port number in
70. n parameters they include on the basis of wireless connection using the configuration management program recommended Use the dedicated wireless adapter and connect it with the module through wireless connection and then run the configuration management application we provide you can search and configure the parameters of the module the method of operation and interface are the same with those when serial connection is used Advantages of this approach are the first is anytime that means module doesn t need to connect to any wireless network as long as the module is power on parameters can be modified the second is anywhere without any physical cable connection even if the module has been integrated into the user equipment parameters can also be modified the third is group configuration it means a group of modules can be uniformly modified once which is more useful to do a unified factory configuration to devices for users it can greatly improve operation efficiency on the basis of serial connection using the configuration management program It needs an adapter plate to connect the module to the serial of the PC and then run the configuration management application this approach has the advantage of intuitive interface and easy operation 18 Page ThaiEasyElec comill On line Electronics Shop for Embedded System on the basis of serial connection using Windows HyperTerminal program It needs an adapter plate to
71. ng gt SSID encryption mode key and so on refer to the setting of wireless AP or router lt gt Network setting 54 Page VV Vv gt Enable Your Design ThaiEasyElec com ill In line Electronics Shop for Embedded Syster IP address 192 168 0 X Subnet Mask 255 255 255 0 Gateway address 192 168 0 1 DNS address 192 168 0 1 Work mode setting gt Disable auto work mode 5 Configuration management manual 5 1 Configuration through configuration management software 5 1 1 Introduction We offer a configuration hypervisor that can manage M03 module expediently for configuration querying config function test etc Its main function includes lt module management management through serial management through wireless connection lt parameter configuration modify query module parameters import export parameters modify parameters for a group of modules resume to default setting function test wireless network command test socket command test AT instruction test firmware upgrade system information query 55lPage Enable Your Design ThaiEasyElec com ill On line Electronics Shop for Embedded System 5 1 2 Module management 5 1 2 1 Management through serial connection 1 Connect the MO3 module to the serial adapter then turn it power on 2 Open the UART WIFI configuration hypervisor select the port number of connection from port list you can select auto unless you m
72. ng of serial options include no parity odd parity even parity The default setting of system is no parity 4 3 6 Parameters of transparent mode 4 3 6 1 Auto framing length Table 4 30 Auto framing length Auto framing length AT ATLT Data Trigger Length When serial is in transparent transmission mode and the data received reaches the length this parameter specifies module will force to frame a network frame and trigger the sending process the optional range is 64 1024 bytes The default setting of system is 512 bytes 41 Page en Thaigasy lec comMlll s Shop for 4 3 6 2 Auto framing period Table 4 31 Auto framing period Auto framing period Data Trigger Timeout AT ATPT When serial is in transparent transmission mode the data received is less than the length of framing if waiting time is more than this parameter specifies module will force to frame a network frame and trigger the sending process The timeout period of auto framing has a optional range of 100 10000ms the minimum accuracy is 100ms In addition this setting must be less than the setting of escape time The default setting of system is 500ms 4 3 6 3 Escape Character Table 4 32 Escape Character AT ESPC Escape Character Escape Character This parameter is specified the escape character used to exit the transparent transmission mode for serial such as when system
73. ntroduction 2 2 1 Mechanical Dimension The mechanical dimension of M03 is shown as follow there into figure 2 1 is the top view of module and side view of the module 8IPage g Enable Your Design ThaiEasyElec com ill On line Electronics Shop for Embedded System se HEALD 98 Bi 95 iif S 25 4 2 544 WLAN 9 d 54 i i BB MAC 53 2 2 1 KA 2 2 RAMA figure 2 1 is the top view of module 2 2 2 External Interface The following figure is the external interface diagram of MO3 product gt a nm PZ Figure 2 2 interface diagram Top View 9 Page g Enable Your Design ThaiEasyElec com ill On line Electronics Shop for Embedded System Figure 2 3 2 2 3 Pin Interfaces interface diagram Rear View The product supports 8 pin dual in line as Figure 2 2 they are defined as follows Table 2 2 Pin Interfaces No function direction description 1 nRTS nREADY Optional features pin detailed definition O see Section 2 3 6 and it s connected to LED1 2 nCTS MODE GPI Optional features pin detailed definition O UO see Section 2 3 6 and it s connected to LED1 3 Link Optional features pin It s the designation O of wireless transmission and it s connected to LED3 4 nRESET Optional features pin It s a reset signal and effective when it s low 5 VDD The pin of 3 3V input 6 RXD the pin receives data from the serial 7 TXD
74. oing the operation ping between the module and PC A Please check the network setting check whether the IP address and so on is correct or not Check whether the encryption mode is consistent with the AP sets or not because in certain encryption mode such as WEP encryption with open authentication even if the key is not correct module will join in the AP but they can t communicate Maybe certain operating program or Windows Firewall prevents from the operation ping 121 1Page Enable Your Design ThaiEasyElec com ill In line Electronics Shop for Embedded Syster Q5 In auto work mode the ICMP connection sometimes connects and sometimes disconnects after the module has joined in the network why A The module will create a default network connection after hashing joined in network if the TCP server which is the default target of the network connection is configured unsuccessfully or not opened the module will disconnect the wireless connection after failed TCP connection and retry to connect in 10 seconds And then it appears that ICMP connection sometimes connects and sometimes disconnects To settle this question is correct configuration of TCP server and opening it Q6 In auto work mode why does the module not connect to the network automatically after resetting A The module forces to go into the configuration mode according the state of MODE pin after start up the specific is referred in Section 4 3 1 5 Q7 I
75. on used to scan is as follow void WIFIScan void TATCP_CMD WIFIScan unsigned char ErrorCode 0 char arggroup NULL char arg NULL INT arggroupc 0 INT argc 0 int argpoint 0 INT err 0 int i 0 char argv ATCP_MAXARGS char arggroupv ATCP_MAXARGS char ATCmd WSCAN n memset WIFlJoin O sizeof TATCP_CMD memset AT ReceBuffer 0 gcAT ReceData 0 sizeof WIFlRecBuffer WIFIScan Flag RespParm WIFIScan Cmdbuf ATCmd 118 Page Enable Your Design ThaiEasyElec com ul gt hof WIFIScan Cmdbuflens strlen ATCmd AtCmdSend WIFIScan if AtRespState 1 arggroups strehr ATReceBuffer 0 gcATReceData ATC CH GEI arg strchr AT ReceBuffer 0 gcAT ReceData ATC CH GEI if arggroup arggroupc parse_line_group arggroup arggroupv if argc lt 0 printf Recive Error parm n return for i 0 i lt arggroupc i argc parse_line amp arggroupv arggroupc argv if argc lt 0 printf Recive Error parm n return else if strtohexarray Scanresult arggroupc BSSID 6 argv 0 lt printf Error Bssid n return if strtodec amp Scanresult arggroupc Type argv 1 lt 0 return 119 Page Thaigasy lec com lll s Shop for if strtodec amp Scanresult arggroupc channel argv 2 lt 0 return if strtodec amp Scanresult arggroupc encry argv 3 lt 0 return strcpy char Scanresul
76. op for er printf reciver error At cmd resp ERROR Code d ErrorCode 6 3 7 3 The sample of complicated AT Instruction with return parameters AT Instruction as this type has a response with more parameters network scan is a typical example 1 The function of detaching the group of parameters It is used to devide the long parameters in AT Instruction response into groups INT parse_line_group char line char argv_group INT nargs 0 while nargs lt ATCP_MAXARGS skip any white space while line line t line if line 0 end of line no more args argv_group nargs NULL return nargs line argv_group nargs line begin of argument group find end of string while line r amp amp line 1 n line if line 0 end of line but 2nd lt gt is not found argv_group nargs NULL return nargs line 0 terminate current arg group 117 Page ThaitasyElec comill s Shop for line MIT if line r amp amp line 1 n line 0 terminate current arg group line 0 return nargs return 1 Sample of module sending the scan command After sending the scan command WIFI module will return a very long parameters section The longest section can reach as much as 2Kbytes Therefore we use this part as a example the AT Instructi
77. r Design ThaiEasyElec com ill On line Electronics Shop for Embedded System figure5 12 interface of creating socket UART FIFI Configuration Fort Connect Port Auto v Wireless Network Ordered Wireless Connect a CD Socket order CH Close Y e Input Output Box No Fort Device ID AT Hver vi COM OO1FA4FDZADD Create a socket Create succeed The socket number is 1 figure5 13 interface of the result of creating socket 5 1 4 5 close socket User can delete the socket connection through clicking close button and inputting the socket number which is expected to close 5 1 4 6 query socket status User can query socket status through clicking query button and inputting the socket number which is wanted the state of socket will return in the display frame after clicking yes button 66 Page Enable Your Design ThaiEasyElec com ill On line Electronics Shop for Embedded System UARI FIFI Configuration Fort Connect Dirt Auto vl Wireless Network Ordered Wireless Connect Close W at Socket order CH Input Output Box No Port Device ID AT ver vi COM OO1FA4FDZADD Get the socket information Get socket succeed SocketNo Status Peer Addr Port Data Length Connect 192 168 1 100 60010 Port Data Length TCP server socket Monitor 255 255 255 255 60000 1 used to deteer figure5 14 socket status qu
78. r Embedded System 192 168 1 100 or Www sina com cn TCP connection timeout period it means client will be automatically kicked out from server if it 1 0 send nothing in effective period Effective value range is 1 10000000 Unit second 0 means never default setting is 120 seconds 1 1 No Meanings port means Port number socket means socket number 6 2 2 6 AT SKSND Function Send data through the specified socket and return when it is over This command send binary data User should send original data after receiving the response OK of module Module automatically exits transmission after receiving the data of specified length and send data to the network the redundant date will be rejected Otherwise module will be forced to constrainedly exit transmission mode and send the data has been received to the network when the module has waiting for timeout period 1 second Format AT SKSND lt socket gt lt size gt lt CR gt OK lt actualsize gt lt CR gt lt LF gt lt CR gt lt LF gt data steam Parameter socket means socket number size means the size of the data which prepare to be send its unit is type actualsize means the size of the data which actually is send its unit is type data steam means original data 6 2 2 7 AT SKRCV Function Read data form RX buffer of the target socket and return after hashing finished After receiving this command and sending the response OK is over mod
79. t s more functional and more convenient to use its main features include Interface 2 4 pins of Interface 2 54 Pitch The range of baud rate 1200 115200bps RTS CTS Hardware flow control single 3 3V power supply Wireless support IEEE802 11b g wireless standards support the range of frequency 2 412 2 484 GHz lt support two types of wireless networks Ad hoc and Infrastructure support multiple security authentication mechanisms WEP64 WEP128 TKIP CCMP AES WEP WPA PSK WPA2 PSK support quick networking lt gt support wireless roam Others lt support multiple network protocols TCP UDP ICMP DHCP DNS HTTP lt support two types of work modes 5lPage Enable Your Design ThaiEasyElec com ill On line Electronics Shop for Embedded System auto and command Support the transparent transmission mode support AT instruction set support a variety of parameters configuration methods serial WEB server wireless configuration Application I gt lt gt lt gt intelligent bus network such as wireless credit card machine small financial payment network such as wireless POS machine industrial equipment networking such as wireless sensor Things Gr iae AEI AAI ODAIA mn MAC 001FA4DABED7 Es IS 4 Za cs er 3 Und ud x T L ST ER CH Mra LLEURE AAA MAM M AA 6lPage Enable Your Design ThaiEasyElec com ul gt
80. t s no sense in other encryption mode 4 3 1 5 Key Table 4 5 Key Encryption Key AT KEY 32lPage Enable Your Design ThaiEasyElec com s Shop for Key string of WIFI network the keys of different encryption modes and key formats have different length provisions WEP64 HEX 10 characters WEP64 ASCII 5 characters WEP128 HEX 26 characters WEP128 ASCII 13 characters WPA WPA2 PSK HEX 64 characters WPA WPA2 PSK ASCII 8 63 characters gt gt gt gt In WPA WPA2 PSK TKIP CCMP encryption mode as the key format is ASCII the module must first do the conversion to the key of ASCII format when its power on this process increases about 10 seconds to the starting time And When using WPA WPA2 encryption directly using PMK of hexadecimal format can eliminate this delay However some APs does not provide PMK which can be directly input of hexadecimal format in WPA WPA2 mode in this case you can use the WPA key conversion tool GH sl to convert WPA Key Converter exe PSK to PMK and set to the module 4 3 2 Network Parameters 4 3 2 1 DHCP Table 4 6 DHCP AT NIP DHCP Enable Used to indicate the network address type of the client if this parameter is enabled the module will dynamically obtain the network address of the client according to the DHCP protocol 4 3 2 2 IP address Table 4 7 IP address IP address Fixed IP Address AT NIP 33 Page Thaig
81. t lt CR gt lt LF gt lt CR gt lt LF gt Parameter Same as AT WJOIN 6 2 2 4 AT LKSTT Function Query the network connection status Format AT LKSTT lt CR gt OK status jp netmask gateway dns lt CR gt lt LF gt lt CR gt lt LF gt Parameter 821Page Thaigasyelec comlllll ne Elec mics Shop for Status means Connection Status Table 6 5 Connection Status 0 Disconnect connect ip means IP address its format is 192 168 1 22 it does not include quotation marks netmask means Subnet Mask Its format is same as IP address gateway means Gateway address its format is same as IP address dns means DNS address its format is same as IP address 6 2 2 5 AT SKCT Function Create a socket connection In client mode module wait for connection is over success or failure to return and in server mode it return after creating a network Format AT SKCT protocoll cs host_timeout lt port gt lt CR gt OK lt socket gt lt CR gt lt LF gt lt CR gt lt LF gt Parameter protocol Protocol Type Table 6 6 Protocol Type Vale Meanings 0 TCP UDP cs C S mode Table 6 7 C S mode 0 Client 1 Server the meanings of host_timeout is shown as follows according to protocol and C S mode Table 6 8 host_timeout Name of target server it can be filled with domain name or ip address For example 831Page ThaiEasyElec comlilil In line Electronics Shop fo
82. t arcuit MO 3 connect to indicator light GND GNDS 4nRESET UART RX TXD7 e 3LINK UART TX RXD6 amp 2nCTS MODE GPIO VOUS Sy VDD5 I nkTS READY ART RTE Sen UART_CTS figure4 1 Hardware Connection MO3 module provides 8 pin dual in line the lateral row pins 5 8 must be connected as shown above Inside row pins 1 4 are optional feature pins connection as shown above If they are not used you can leave the corresponding pins vacant 4 2 Work mode 4 2 1 Start up mode selection Multi functional pins nCTS MODE GPIO pin 2 is used to select start up mode at the power on and reset phase timing is shown below 25lPage Enable Your Design ThaiEasyElec com ill On line Electronics Shop for Embedded System Normal startup mode nRESET nCTSIMODE GPIO IL m IMa f gt 300ms figure4 2 Normal startup mode What is noted is that nCTS MODE GPIO pin of the module do a internal pull down when it s disconnected module accesses to the normal startup mode automatically In the normal startup mode the system runs according to the default work mode auto or command in the parameters launching configuration mode nRESET 2 nCTS MODE GPIO t gt 300ms figure4 3 launching configuration mode In launching configuration mode the system ignores the default work mode parameters and force to operate in the AT Instruction mode this mode is commonly
83. t arggroupc Ssid argv 4 if strtodec amp Scanresult arggroupc rssi argv 5 lt O return else ErrorCode arg 2 printf reciver error At cmd resp ERROR Code d ErrorCode Appendix A Frequent Questions and Answers Q1 Why can not the module search for the specified network A The channel list user set doesn t contain the channel which the specified networks work in 1201Page Enable Your Design ThaiEasyElec com ill In line Electronics Shop for Embedded Syster Q2 Why can not the module join in the network A Please go through the following reasons Whether the parameters SSID Key Channel and so on are consistent with the AP sets or not Whether the module is specified BSSID and the BSSID is not consistent with the AP sets Q3 Why does the module need about 10 seconds to response the command or connect to network automatically when encryption mode is set to WPA WPA2 A When encryption mode is set to WPA WPA2 as the key format is ASCII the module must first do the conversion to the key of ASCII format when it s power on this process increases about 10 seconds to the starting time And when using WPA WPA2 encryption directly using PMK of hexadecimal format can eliminate this delay The specific method is referred in Section 4 3 1 5 Q4 The module has connected to the network successfully why it can t show Destination host unreachable or Request timed out after d
84. ted Only when user needs to join ADHOC the parameter may be modified to ADHOC 361Page Enable Your Design ThaiEasyElec com s Shop for 4 3 4 2 Creating ADHOC when network does not exist Table 4 18 Create ADHOC when network does not exist Create ADHOC When network does not exist Used to specify whether to automatically create network or not if the network does AT WATC Create ADHOC When network does not exist not exist when WIFI network type is ADHOC The default setting of system is disabled This parameter is only effective if the network type is set to ADHOC if users need to create an ADHOC network set this parameter to Enable 4 3 4 3 BG mode Table 4 19 BG mode AT WBGR Wireless Standard BG mode Used to specify the BG mode of the WIFI network options include B G fixed mode B mode The default setting of system is B G fixed mode ordinarily user doesn t need to modify this parameter 4 3 4 4 The maximum rate Table 4 20 The maximum rate AT WBGR Data Rate The maximum rate The maximum wireless sending rate options include 1M 2M 5 5M 11M 6M 9M 12M 18M 24M 36M 48M 54M When BG mode is chose to be B mode options include only the first 4 items The default setting of system is 36M ordinarily user doesn t need to modify this parameter when the use environment is harsh and wireless signal is worse
85. the address bar while using a browser such as http 192 168 1 100 2000 Q12 When user sets the serial to the baud rate it does not support the module can t be connected to then how to correct it A Resume it to the manufacturer setting the approaches is as follow 1 Open the serial debugging software such as serial master set the serial parameters to 115200bps 8 bits of data bits 1 bit of stop bits no parity of parity bit no flow control 2 Input at no contain quotation marks and contain enter in the sending column of the software choose periodic sending the period is set to 50ms 3 Reset the module if it return OK then stop the periodic sending 4 Send the command AT QVER to look over the return message if the message includes B1 xx field then it joins in bootloader mode successfully otherwise it s not in retry from the 2th approach 123 Page Enable Your Design ThaiEasyElec com ill In line Electronics Shop for Embedded Syster 5 Send the command AT QVER no return 6 Wait for 1 second and reset the module then it can be resume to the manufacturer state Q13 In Wireless connection state why can not the specified module be searched for A The reasons includes The signal between the netcard and the specified module is weak System password of wireless connection setting is not consistent with the specified module MAC address in wireless connection setting is specified
86. tremp AtResp OK 0 AtRespState 1 response ok gcWIFICommunState WIFILRECEDATA AtResplen 0 else if stremp AtResp ERR AtRespState 0 response ERR gcWIFICommunState WIFI_WAIT_ERRCODE AtResplen 0 else printf Recive unknown words n AtRespState 0 response ERR 106 Page Enable Your Design ThaiEasyElec com ill orn gcWIFICommunState WIFI_WAIT_SYN AtResplen 0 break case WIFI _RECEDATA case WIFI_WAIT_OVER case WIFI_WAIT_ERRCODE ATReceBuffer 0 gcAT ReceData AT ReceBuffer 0 gcAT ReceCount UART Data ATReceBuffer 0 gcAT ReceCount if strstr AT ReceBuffer 0 gcAT ReceData inn NULL ReciveAtCmdrep 1 gcWIFICommunState WIFI_WAIT_SYN ATReceBuffer 0 gcAT ReceCount 0 else if AT ReceBuffer 0 gcAT ReceCount WIFIBUFLEN printf At cmd recive error n gcWIFICommunState WIFI_WAIT_SYN else printf Wiat next byte n break default gcWIFICommunState WIFI_WAIT_SYN break Description This function is used to deal with the data which is received by the serial it should be used to judge and deal with when the serial has received a byte of data The function will 107 Page Thaitasyelec comlll s Shop for er set the bit of ReciveAtCmdrep when it has received the return of the AT instruction at this time the bit will be judged in AT instruction sending frame and then the function will parse the different returns of AT instructions 6 3 5 Th
87. twork by order also can create several different types of TCP IP connection at the same time and keep them transmitting To use this mode please refer to Chapter 6 AT Instruction control protocol 4 3 Parameter Details 4 3 1 Wireless parameters 4 3 1 1 SSID Table 4 1 SSID SSID SSID AT SSID network identity of WIFI network the length is 1 to 32 ASCII characters 4 3 1 2 Encryption mode Table 4 2 Encryption mode AT ENCRY Encryption Encryption mode encryption types of WIFI network options include OPEN WEP64 WEP128 WPA PSK TKIP WPA PSK CCMP gt gt 311Page err Enable Your Design mil H ThaiEasyElec com s Shop for WPA2 PSK TKIP WPA2 PSK TKIP WAPI not supported 4 3 1 3 Key Format Table 4 3 Key Format AT KEY Key Format Key format of WIFI network options include HEX format ASCII format For WEP encryption the difference between HEX and ASCII formats is the display format of key such as WEP64 encryption its key can be 5 ASCII characters such as 12345 or 10 hexadecimal numbers such as 3132333435 For WPA WPA2 PSK encryption HEX and ASCII formats indicate different meanings HEX format PMK ASCII format PSK 4 3 1 4 Key Index Table 4 4 Key Index Key Index AT KEY key index number of WIFI network this parameter is only effective in WEP encryption mode optional range is 1 to 4 i
88. ule will transmit the data of specified size in binary format Format AT SKRCV lt socket gt lt maxsize gt lt CR gt 841Page Tt n line Electronics Shop for Embedded Syster OK lt size gt lt CR gt lt LF gt lt CR gt lt LF gt data stream Parameter socket means socket number maxsize means maximal data size allows to receive size means actually size of the receiving data data steam means original data 6 2 2 8 AT SKSTT Function Acquire the state of the specified socket the first line of return value means the state of the message of the socket if the socket mode is TCP server then beginning from the first line each line shows a socket state of a client which is joined in the server Format AT SKSTT lt socket gt lt CR gt OK lt socket gt lt status gt host port rx_dataJ lt CR gt lt LF gt socket status host port rx_dataJ lt CR gt lt LF gt lt CR gt lt LF gt Parameter socket means socket number status means socket state Table 6 9 Socket status 0 Disconnected 1 Detecting 2 Connected host means IP address of the opposite terminal port means port number of the opposite terminal rx_data means data size in RX buffer 6 2 2 9 AT SKCLS Function Close the specified socket 851Page ThaiEasyElec comlilil In line Electronics Shop for Embedded System Format AT SKCLS lt socket gt lt CR gt OK lt CR gt lt LF gt lt CR gt lt LF gt Parameter socket means socket
89. urrent arg return 1 Description char line points to the data received bg the serial char argv points to the finger used to save the return parameters they are used the following parameters parsing 109 Page ThaitasyElec comllll s Shop for er 6 3 6 The function of operating character string The following functions is mainly used to parse the parameters of character string type in the return of AT instruction and convert the parameters to hexadecimal or decimal which CPU display INT atodec char Ch INT dec 1 if Ch gt 0 amp amp Ch lt 9 dec Ch 0 return dec INT strtodec INT dec char str INTi 1 INT dd 0 sign 1 if str Str sign 1 while str i atodec str if i lt 0 return 1 dd dd 10 i dec dd sign return i lt 0 1 0 INT atohex char Ch INT hex 1 if Ch gt 0 amp amp Ch lt 9 hex Ch 0 else if Ch gt a amp amp Ch lt f 110 Page Enable Your Design ThaiEasyElec com s Shop for hex Ch a Oxa else if Ch gt ASA Ch lt EI hex Ch A Oxa return hex INT strtohexarray INT8U array INT cnt char et INT hex INT8U tmp des des array while cnt gt 0 hex atohex str if hex lt 0 return 1 else tmp hex lt lt 4 amp 0xf0 hex atohex str if hex lt 0 return 1 else tmp tmp hex amp OxO
90. used to modify the parameters with the configuration management program and to do the function tests 4 2 2 Auto work mode The module supports auto work mode and it really achieves a plug and play serial and it reduces user complexity furthest In this mode user should only configure the necessary parameters After power is on each time module can automatically connect to 26 1Page Enable Your Design ThaiEasyElec com ill On line Electronics Shop for Embedded System the default wireless network and server As in the automatic mode the module s serial always work in the transparent transmission mode so users only need to think of it as a virtual serial cable and send and receive data as using a simple serial In other words the serial cable of users original serial devices is directly replaced with the module user equipments can be easy for wireless data transmission without any changes 4 2 2 1 Automatic retry mechanism In auto work mode the connection of the system runs completely and automatically and its working process is shown below 27 Page Enable Your Design ThaiEasyElec com ill On line Electronics Shop for Embedded System Enter auto work N mode Wail and circulate i figure4 4 Automatic retry mechanism Note 28lPage ThaiEasyElec comillll On line Electronics Shop for Embedded System 1 The default Automatic retry time of the system is set to forever that is the system will retry to
91. user can select to reset at once or manually reset later in pop up dialog box after modifying it s shown as the following sketch map 58lPage g Enable Your Design ThaiEasyElec com ill On line Electronics Shop for Embedded System BART WIFI Configuration Port Connect Port Auto v Wireless Connect Modify All Encry Mode Key Index No Port Device vi COM OO1FA4FD Modify parameter completed it will valid after reset DNS Server Workmode Setting Auto Workmode ProtocolType TCP v C S Mode Client K ServerAddr 192 168 1 100 Port 60010 TCPConTime s 0 10000000 0 means forever figure5 5 sketch map of submitting modification 5 1 3 3 Restore to factory setting User clicks button to restore the configuration parameters of the wireless module into factory status After restoring the factory setting becomes effect until the module has been reset 59 1Page 2 Enable Your Design ThaiEasyElec com ill On line Electronics Shop for Embedded System k UART IFI Configuration Fort Connect Port Auto Ke Set Er EN cH Close IWW Wireless Setting SSID lapds Enery Mode OPEN Port Device COM1 OO1FA4FD Sure you determine the recovery Factory setting Cancel em one Gateway Addr DNS Server Horkmode Setting F Auto Workmode Protocol
92. warded to the network and similarly data received from the network the module also sent to serial This is a simple data transfer state at this time if user wants to do the transmission in command through the serial firstly needs to exit the transparent transmission status Meanwhile the module also exit auto work mode The conditions of Module exiting transparent transmission status is shown as following figure ESPC x 3 eg IL UU ALLA DI t gt Tapi geen gt Tatpt t lt Tap figure4 5 Sketch map of exiting transparent transmission status There into ESPC escape character T espt Escape time T atp Auto framing period After having detected the existing condition as shown above the module puts out OK and confirms the serial exiting transparent transmission and switching to the AT Instruction state 301Page Enable Your Design ThaiEasyElec com s Shop for 4 2 3 Command work mode The module also provides a command mode based on serial control to use for different applications of users specific requirements In this mode the module works according to user commands issued through the serial user can completely control the module with command including parameters configuration networking control TCP IP connection control and data transmission This is an advanced usage and also the most flexible for users use Users can discretionarily control the connection and disconnection of the wireless ne
93. wing sketch map Scan result will show in the following display frame such as network type encryption network MAC channel signal strength etc 62 Page UARI FIFI Configuration Enable Your Design i ThaiEasyElec com On line Electronics Shop for Embedded System Configuration FuncTest UpdateFw SystemIn o Port Connect LEE ee Port Auto Wireless Network Ordered Wireless Connect Socket order CH Close Set Input Output Box Ho Port Device ID ATHOver vi COM1 OO1FA4FD2ADD Scanning Scan complete Infra Yes 002127635264 1 Infra No OO023CDS4DCEA 1 Yes OO2ZS867CF9C4 6 No OOBOOCSSDSES 6 No OB9TEOQITSBES 10 84 1 74 12 T6 8 80 1 82 1 NetMode Encry BSSID Channel Signal SSID tp_zhang figure5 9 network scanning 5 1 4 2 Join Disconnect network User can click the button to join or disconnect the wireless network as the following sketch map the result will show in the following display frame 63 Page UART IFI Configuration Port Connect Port Auto v Wireless Connect Close v No Port v 1 0 com CH Device ID OO1FA4FDZADD figure5 10 join disconnect network 5 1 4 3 Query network status Enable Your Design ThaiEasyElec comillll On line Electronics Shop for Embedded System Configuration FuncTest UpdateFw SystemInfo Wireless Network Ordered Socket or
94. xample 1 Open hyper terminal program Windows gt gt start gt gt program gt gt accessories gt gt Communication gt gt Hyper terminal input connection name and icon select serial number and parameters the same as the wireless module what should be described is that the option of flow control must be set to none in command mode the setting is shown as following sketch map 73 Page 2 Enable Your Design ThaiEasyElec com ill On line Electronics Shop for Embedded System at New Connection HyperTerminal Bits per second 115200 Data bits 8 Parity None Stop bits D Restore Defaults figure5 22 the configuration of super terminal Auto detect If the wireless module has started configuration mode see the 4 2 1 section or the work mode is set to command mode please jump to step 5 directly otherwise it needs to make the module exiting the transparent transmission mode according to following approaches at first refer to section 4 2 2 4 Open a notepad to edit escape character string the default escape character is and save Wait for the time specified by the parameter of escape time its default setting is 2 second select send text file in the transmit menu send escape character string file the module return OK information if success Input AT E instruction to open input return display before it the char
Download Pdf Manuals
Related Search
Related Contents
"取扱説明書" TECNICA 720 - kleer レーザーハンズオンセミナー レーザーハンズオンセミナー Highpoint Rocket 622 "取扱説明書" Lennox Hearth S1300 User's Manual User Manual Mode d'emploi Samsung M1933 User Manual MBT1DISP Manual Mode d`emploi Gebrauchsanweisung Copyright © All rights reserved.
Failed to retrieve file