Electronics123 UART2WF User Manual

Uart-wifi module wlan module with uart serial interface

Advertisement

Quick Links

www.linksprite.com
)PIGXVSRMGW
GSQ -RG
LS-UART-WiFi Module User Manual
May 2010
[[[ IPIGXVSRMGW
GSQ
1 / 50

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the UART2WF and is the answer not in the manual?

Questions and answers

Summary of Contents for Electronics123 UART2WF

  • Page 1 www.linksprite.com )PIGXVSRMGW GSQ -RG LS-UART-WiFi Module User Manual May 2010 [[[ IPIGXVSRMGW 1 / 50...
  • Page 2: Table Of Contents

    www.linksprite.com TABLE OF CONTENTS 1.OVERVIEW............................4 1.1. Main Function ........................4 1.1.1. Summary ......................4 1.1.2. Specifications ....................4 1.2. Typical Applications......................4 1.2.1. Wireless POS Machine..................5 1.2.2. Wirelsee Monitoring and Control System............5 2. FUNCITON DESCRIPTION ......................6 2.1.
  • Page 3 www.linksprite.com 4.3.12. Reset Order....................39 4.3.13. Message of Finished Initialization .............39 4.3.14. TCP Connection order................40 4.3.15. Message of TCP connection Status ............40 4.3.16. Message of TCP Failed Sending ...............40 4.4. Configuration parameters....................41 4.4.1. System parameters ..................41 4.4.2. Network parameters ..................41 4.5. Programming Guide ....................43 4.5.1.
  • Page 4: Overview

    www.linksprite.com 1. Overview 3YV 9%68 ;* MW E ;0%2 1SHYPI [MXL 9%68 WIVMEP MRXIVJEGI LS-UART-WiFi is a WLAN Module with UART serial interface by LinkSprite (www.linksprite.com). 1.1. Main Functions 1.1.1 Summary SOC chip based solution: cost-effective high quality and stable, built-in WiFi protocol stack and •...
  • Page 5: Wirelsee Monitoring And Control System

    www.linksprite.com 1.2.2. Wireless Monitoring and Control System Serial device networking through TCP/IP has been popular for industrial networking. However, with wired communication, deployment of new wires and the following construction often become a bottleneck. In contrast, WLAN can be embedded in the monitoring and control terminals, therefore, reduces the wire deployment and construction cost.
  • Page 6: Block Diagram

    www.linksprite.com Function Descriptions 2.1. Block Diagram 6 / 50...
  • Page 7 www.linksprite.com 7 / 50...
  • Page 8: Parameter Management

    www.linksprite.com Parameter management 2.2. WLAN module provides for user parameters reconfiguration. These parameters are used to control the module operation. Parameters are divided into two types: system parameters and network parameters. System Parameters These parameters are used to control the working mode of the module, it include: Networking Mode: WLAN module supports two modes: automatic networking and manual networking.
  • Page 9: Connection Model

    www.linksprite.com Connection Mode 2.3. WLAN module supports two connection modes: automatic mode and manual mode for users to choose from. It needs to be noted that in the 1.3 and older versions, when the WLAN module is set to TCP Link Layer format, the process of connection automatically includes the process of connection with the TCP server.
  • Page 10: Manual Connection

    www.linksprite.com In the automatic mode, all connection process is automatically completed by WAN module without any user intervention. This makes it very easy to use for users. To successfully connect the network, users only need to set at least one group of basic parameters in the first use. Then WLAN module will automatically scan the network after each power-on reset.
  • Page 11: Encryption

    www.linksprite.com In the manual connection mode, users need to control connection and disconnection of WLAN module through user command. Encryption 2.4. WLAN module supports three encryption modes: WEP, WPI, and CCMP, and the non encrypted OPEN mode. In the WEP encryption mode, user can set 4 sets of key, and choose one set as default key. The length of the key can be 64 bit or 128 bit.
  • Page 12: Udp Format

    www.linksprite.com 2.5.2. UDP format UDP (User Data Protocol) is a connectionless data transmission protocol in the TCP/IP protocol stack. UDP protocol supports unreliable data transmission, and does not guarantee the integrity of the data. But UDP uses little network source and processes data fast. Therefore, it is suitable for applications that require real-time but low-integrity data transmission, such as audio and video data transmission.
  • Page 13 www.linksprite.com Transparent Transmission Mode In UDP format, WLAN module also supports transparent transmission mode. Transparent transmission means that the WLAN module transmits “transparently” the data it receives from the serial user port to the network. The data transmission model is as following: The module must meet all the following conditions before it can work in the transparent transmission mode: 、...
  • Page 14: Tcp Format

    www.linksprite.com 、 UDP Link Layer data format is used; WLAN module is in successful connection status; 、 It must be noted that once the WLAN module enters the transparent transmission mode, it cannot receive user’s command from the UART serial port. (In testing or demonstration using the simulation environment, please turn off the WLAN module client software, and use general- purpose serial tools, such as Hyper Terminal, serial debugging assistant etc.
  • Page 15 www.linksprite.com Disable TCP Monitoring After associating with the AP, the WLAN module automatically connects to the server defined in the network parameters, and returns the message of successful connection to user. If the connection fails, it returns a failure message. The procedure of the WLAN module is the same as that in Version 1.3 and older versions which do not support the TCP Monitoring mode.
  • Page 16: Testing Guide

    www.linksprite.com 3. Testing Guide WLAN cannot work properly until it is embedded in a system. We support the following simulation environment for users to do the functional testing of the module. 3.1. Summary All the testing environments consist of the following devices: Tester 1 It is used to run the client software of WLAN module, and communicates with WLAN module through the computer serial port.
  • Page 17: Client Software

    www.linksprite.com It is used to run the server software of WLAN module. This computer must have network connection. The functions include: c onduct the data transmission testing with client software; 、 U se as server for online update of the WLAN module firmware. 、...
  • Page 18: Server Software

    www.linksprite.com Sending control command Control commands can be sent to WLAN module by clicking the buttons, the supported commands include scanning network, join network, leave network, parameter configuration, reset. Receiving control message It analyzes the control message it receives, and displays the result in the export window. Parameters configuration It analyzes and modifies the system parameters and the seven groups of network parameters of WLAN module.
  • Page 19: Parameter Management

    www.linksprite.com The server software runs on the computer with a WLAN connection. When the computer and the WLAN module both connect to a network defined by an AP, the server software can do the data transmission testing with the client software. UDP Testing First set up a UDP server and set the Link Layer data format of WLAN module to UDP.
  • Page 20: Parameter Explanation

    www.linksprite.com 、 Click the “parameter configuration” button (Please do not set the parameter during transmission). Choose parameter index 、 Check the box of encryption setting, and modify the encryption method. 、 Click the “Save” button. 、 Modification is finished. 、 3.4.2.
  • Page 21 www.linksprite.com Network parameters include the parameters needed to connect to AP and server. This module supports 7 groups of network parameters. These parameters are defined as follows. Parameter Index This is the group number of the network parameter. Channel 、 S SID 、...
  • Page 22 www.linksprite.com Transparent Transmission Mode This is the transmission format of the serial data. This transmission mode can be set to enabled or closed. It must be noted that the transparent transmission mode can only be supported when automatic connection mode is used and the server data format is UDP. Otherwise, this parameter can be ignored.
  • Page 23 www.linksprite.com In automatic mode, all process of connection is automatically completed by the WLAN module without user’s intervention. User only needs to set at least one group of network parameters before first use. Then the WLAN module will automatically scan network after power-on reset. If it finds a target network, it automatically connects and sends out an confirmation message of a successful connection, as shown here.
  • Page 24 www.linksprite.com 、 C lick the “Join” button; C hoose the group number of the network parameters, then click “OK”; 、 C onnect successfully 、 ; Disconnect the connection C lick “Leave” button; 、 D isconnect successfully; 、 Scan the network 24 / 50...
  • Page 25: Tcp Monitor Mode Test

    www.linksprite.com c lick “Scan” button; 、 、 r eturn the scan result; 3.7. TCP Monitor Mode Test A ccurately set the network parameters, and enable TCP monitor mode; 、 W LAN module gets in monitor status after a successful connection; 、...
  • Page 26 www.linksprite.com T ype in random character string in the input window of the client software, click “TXT send”, 、 then click the “TCP connection” button and choose “disconnect” to disconnect the TCP connection, as shown below. I n the Internet Explorer window, the character string that was typed in the client software is 、...
  • Page 27 www.linksprite.com 27 / 50...
  • Page 28 www.linksprite.com 3.9. Document Transmission Test The client and server software also support the document transmission. As an example, the process that the client sends a document to the server is shown below. 28 / 50...
  • Page 29 www.linksprite.com It is noted that when WLAN module uses UDP data format, document transmission is only supported from the client to the server. Due to uncertainty, document transmission may be incomplete. To ensure the transmission reliably, TCP format is suggested. 3.10.
  • Page 30 www.linksprite.com Scan network manually, be sure the target network can be found; Check if the wireless mode of AP is set to B mode or B/G mixed mode. 、 Network configuration parameters of the AP is not correct Check the configuration of WLAN module, ensure channel, BSSID, SSID, and encryption setting is the same as the setting of AP.
  • Page 31 www.linksprite.com Check if the encryption method and key setting in network parameters are consistent with the setting of AP; Check if IP address of device, IP address of server and service port in network parameters are set correctly; Check if the firewall of the computer which the server software runs in is turned off; Question: What is the relationship between the IP address of the network card of the computer which the client software runs in and the device IP address defined in the configuration parameters of the WLAN module?
  • Page 32: Serial Protocol

    www.linksprite.com 4. Serial Protocol 4.1. Summary Interface Data: The format and transmission mechanism of the data transmitted between a user terminal and a WALN module through UART serial is defined in the corresponding serial protocol. Serial data may include control data and user data. Control Data: The definition and transmission mechanism of control data between a user terminal and a WALN module is defined in the User Serial Control protocol.
  • Page 33 www.linksprite.com : Synchronized Field, it indicates the start of a data frame, the fixed value is ‘0xAA’. : Control Field, its meaning is as follow, TYPE F rame type, : : : : 000b indicates control data 001b indicates common data 010b indicates the ACK acknowledgement to the previous frame.
  • Page 34: Serial Configuration

    www.linksprite.com Send/response Mode The data frame whose A is set to ‘1’ uses this transmission mode. The sender needs to wait for ACK from the receiver after the sender has sent a frame of data. Then it starts to send the next frame as following: Continuous sending mode The data frame whose A is set to ‘0’...
  • Page 35: User Serial Control Protocol

    www.linksprite.com flow control n one : 4.3. User Serial Control Protocol 4.3.1. Data Format This protocol is used to define the format of the control data transmitted through UART user serial port. Control data includes the following two types, COMMAND and MESSAGE. COMMAND: The receiver must execute the command it receives.
  • Page 36: Message Of Scanning Network Result

    www.linksprite.com 000100b I nquire the parameters : 000101b R eset/ initialization : 000110b T CP connection : 000111b T CP failed transmission : Others : R eserved PARAMETERS : They are defined differently according to the TYPE and SUBTYPE. 4.3.2. Command to Scan Network 0 x00 :...
  • Page 37: Message Of Network Connected

    www.linksprite.com In versions newer than 1.53, this parameter is defined as signal strength, and is used to return the strength of signal of the target network. The range of its value is 0~255, ‘0’ indicates strongest signal, ‘255’ indicates weakest signal. C hannel number :...
  • Page 38: Message Of Network Disconnected

    www.linksprite.com SSID S SID of network : 4.3.6. Command to disconnect network 0 x02 : d isconnects normally : , Others d isconnect abnormally. , 4.3.7. Message of Network Disconnected 0 x42 : d isconnects normally : , Others d isconnect abnormally. ,...
  • Page 39 www.linksprite.com : 0 x03 G roup number of network parameter. The value range is 0xb1~0xb7 representing 1st~7th : group of parameters. Parameter PB is an optional field. It can be ignored when only setting system parameters. P arameter ID d efined in the following table. :...
  • Page 40 www.linksprite.com 0xa9 Transparent transmission mode 0xaa TCP monitor mode … Reserved (* the parameters set by the manufacturer can only be read by user) L ength of INFO field : INFO : P arameter content 4.3.9. Message of Setting Parameters 0 x43 :...
  • Page 41: Reset Order

    www.linksprite.com 0 x44 : G roup number of network parameter : P arameter ID. Its definition is same as setting parameter : L ength of INFO field : INFO P arameter content : 4.3.12. Reset Order 0 x05 : N ot defined :...
  • Page 42: Message Of Tcp Connection Status

    www.linksprite.com R eset type: 0 h ardware reset, 1 s oftware reset, others n ot defined. : - - - V ersion, value fixed to 0x76 : INFO C haracter strings of firmware version. : 4.3.14. Command to connect a TCP connection :...
  • Page 43: Configuration Parameters

    www.linksprite.com 0 x47 : N o defined : 4.4. Configuration parameters WLAN module’s configuration parameters are defined as follows. 4.4.1. System parameters Baud rate Its length is 1 byte. It defines the baud rate of the UART serial port in bps, 19200 3 8400 5 7600...
  • Page 44 www.linksprite.com SSID Its length is variable, but not longer than 32 bytes. It defines SSID of the target network. Privacy Type Its length is 1 byte. It defines the encryption method of WLAN module. Its definition is as following: Value Description Not encrypted CCMP...
  • Page 45: Programming Guide

    www.linksprite.com SubnetGate Its length is 4 bytes. It defines the subnet gate IP address of the network which the WLAN module is in, and its format is as above. It needs to note that, according to the specific SubnetMask value, the valid data filed length of SubnetGate is different and others are ignored.
  • Page 46 www.linksprite.com The explanation of content is, Example 2: Connect to the target network defined in the first group of parameters. Create the following command, where the highlighted blue part is to connect (01) to first group of parameters (01). The returned message of successful connection is The explanation content is, Connect successfully 46 / 50...
  • Page 47: The Example Of Parameters Setting

    www.linksprite.com Channel : BSSID 0 0-1a-70-35-b9-32 : SSID s tauart_wrv_wep128 : 4.5.2. Example of Parameters Setting Example 1: Set the first group of network parameters as following: BSSID 0 0-1a-70-35-b9-32 : Channel : SSID s tauart_wrv_wep128 : Encryption type W EP :...
  • Page 48: Crc-8 Algorithm Reference Implementation

    www.linksprite.com 4.5.4. CRC-8 Algorithm Reference Implementation INT8U __crc8_tbl[256]= 0x00,0x91,0xe3,0x72,0x07,0x96,0xe4,0x75, 0x0e,0x9f,0xed,0x7c,0x09,0x98,0xea,0x7b, 0x1c,0x8d,0xff,0x6e,0x1b,0x8a,0xf8,0x69, 0x12,0x83,0xf1,0x60,0x15,0x84,0xf6,0x67, 0x38,0xa9,0xdb,0x4a,0x3f,0xae,0xdc,0x4d, 0x36,0xa7,0xd5,0x44,0x31,0xa0,0xd2,0x43, 0x24,0xb5,0xc7,0x56,0x23,0xb2,0xc0,0x51, 0x2a,0xbb,0xc9,0x58,0x2d,0xbc,0xce,0x5f, 0x70,0xe1,0x93,0x02,0x77,0xe6,0x94,0x05, 0x7e,0xef,0x9d,0x0c,0x79,0xe8,0x9a,0x0b, 0x6c,0xfd,0x8f,0x1e,0x6b,0xfa,0x88,0x19, 0x62,0xf3,0x81,0x10,0x65,0xf4,0x86,0x17, 0x48,0xd9,0xab,0x3a,0x4f,0xde,0xac,0x3d, 0x46,0xd7,0xa5,0x34,0x41,0xd0,0xa2,0x33, 0x54,0xc5,0xb7,0x26,0x53,0xc2,0xb0,0x21, 0x5a,0xcb,0xb9,0x28,0x5d,0xcc,0xbe,0x2f, 0xe0,0x71,0x03,0x92,0xe7,0x76,0x04,0x95, 0xee,0x7f,0x0d,0x9c,0xe9,0x78,0x0a,0x9b, 0xfc,0x6d,0x1f,0x8e,0xfb,0x6a,0x18,0x89, 0xf2,0x63,0x11,0x80,0xf5,0x64,0x16,0x87, 0xd8,0x49,0x3b,0xaa,0xdf,0x4e,0x3c,0xad, 0xd6,0x47,0x35,0xa4,0xd1,0x40,0x32,0xa3, 0xc4,0x55,0x27,0xb6,0xc3,0x52,0x20,0xb1, 0xca,0x5b,0x29,0xb8,0xcd,0x5c,0x2e,0xbf, 0x90,0x01,0x73,0xe2,0x97,0x06,0x74,0xe5, 0x9e,0x0f,0x7d,0xec,0x99,0x08,0x7a,0xeb, 0x8c,0x1d,0x6f,0xfe,0x8b,0x1a,0x68,0xf9, 0x82,0x13,0x61,0xf0,0x85,0x14,0x66,0xf7, 0xa8,0x39,0x4b,0xda,0xaf,0x3e,0x4c,0xdd, 0xa6,0x37,0x45,0xd4,0xa1,0x30,0x42,0xd3, 0xb4,0x25,0x57,0xc6,0xb3,0x22,0x50,0xc1, 0xba,0x2b,0x59,0xc8,0xbd,0x2c,0x5e,0xcf INT32S ChkCrc8(INT8U *ptr, INT32U len) INT8U crc8,data;...
  • Page 49: Serial Protocol Modification Notes

    www.linksprite.com INT8U GetCrc8(INT8U *ptr, INT32U len) INT8U crc8,data; crc8=0; while(len--!=0) data = *ptr++; crc8=__crc8_tbl[crc8^data]; return crc8; 4.6. Serial Protocol Modification Notes Version 1.3 modification from Version 1.0 T he largest value of LENGTH field in data format definition of UART serial protocol is 、...
  • Page 50 www.linksprite.com )PIGXVSRMGW GSQ -RG LinkSprite Technologies, Inc. )EWX 4EVO %ZI 'SPYQFMERE 3, 1 410 Cannon Mountain Dr, Longmont, CO 80503 : 720-204-8599 : KIRIVEP$IPIGXVSRMGW Email s ales@linksprite.com : WYTTSVX$IPIGXVSRMGW Support s upport@linksprite.com : [[[ IPIGXVSRMGW w ww.linksprite.com : 50 / 50...

Table of Contents