Presentation is loading. Please wait.

Presentation is loading. Please wait.

Wireless Products Division Wi-Fi™ Module Product Training April, 2012.

Similar presentations


Presentation on theme: "Wireless Products Division Wi-Fi™ Module Product Training April, 2012."— Presentation transcript:

1 Wireless Products Division Wi-Fi™ Module Product Training April, 2012

2 2 Wireless Products Division Wi-Fi™ Overview l Protocol l Built on the IEEE 802.11 standard l Conformance testing performed by the non-profit Wi-Fi Alliance (formed in 1999) l Consumer Wi-Fi Growth (2009 - 2010) l 158% growth in Wi-Fi enabled consumer electronics l 90% cell phones l 3 in 4 consumers considered buying a Wi-Fi enabled device l 34% laptops l 15% Wi-Fi connected 3-D TVs l Embedded Systems l Evangelizes on huge hotspot availability l Provides data with ultra-low cost transport

3 3 Wireless Products Division Wi-Fi™ Overview l Roving Networks’ Wi-Fi Solution l Industry’s lowest power, complete system-on-module solution l 4-uA sleep l 30-mA Rx l Tx variable depending on PA options l Compact surface mount design l Quick & simple to integrate l Complete TCP/IP solution: no external processor or drivers required l Feature Rich, Robust Firmware l Standard build: serial port profile l Extensions: WebScan™ & sensor

4 Wireless Products Division Firmware April, 2012

5 5 Wireless Products Division Roving Networks Firmware l Standard Firmware l Simplifies customer design l No register-level configurations l Manages standard TCP/IP service, e.g., HTTP, DHCP, FTP l Firmware Extensions l Builds on the robust, standard firmware l Provides application-specific extensions l Sensor l Remote provisioning l Automatic sensor data acquisitions l Data logging l WebScan™ l RTLS (Real-Time Location System)

6 6 Wireless Products Division Firmware Extensions l Sensor: Real-Time Monitoring l Uses Roving Networks silicon l Monitors I/O pin & ADC status l Data logger l If module disconnects from access point, it stores data until reconnect when data can be sent to server l Supports remote provisioning l Supports remote software upgrade

7 7 Wireless Products Division Firmware Extensions l WebScan: Real-Time Location System l Uses Roving Networks silicon l Uses I/O pins, ADCs, RFID & timers for wakeup & data generation l Measures RSSI levels for triangulation l Creates full data packet for server upload

8 8 Wireless Products Division Firmware Extensions l WebScan Example Application  Goods monitored by tag attached to pallet  Pallets arrive at docking bay A  Tag wakes by MAG exciter near docking bay door  Tag probes for access points & measures their RSSI level  Tag sends RSSI data to company’s server via Wi-Fi  Tag reports logged data Refrigeration truck temperatures Tag wake up reasons Battery life

9 Wireless Products Division Wi-Fi Lab: Introduction April, 2012

10 10 Wireless Products Division Lab Agenda l Introducing WiFly l Firmware l Hardware architecture l Capabilities l Hands-On Wi-Fi Labs l Association & UDP l TCP connections & embedded applications l Roaming & FTP l HTML client & sensors l Location tracking (optional) l Ad hoc & further FTP (optional) l Resources

11 11 Wireless Products Division Data & Command Modes  Data Mode (Default State) –WiFly module like data pipe –TCP/UDP header stripped or added, transparent to UART –Data written to UART is sent out over Wi-Fi –Data received over Wi-Fi is read from UART  Command Mode ($$$) –Special configuration mode entered using $$$ –Used to assign data, e.g., SSID, pass phrase, etc. AB

12 12 Wireless Products Division Command Mode: Configuration Settings l Performed Using ASCII Commands l User Guide l Configuration Settings Stored in Module’s Flash l Changes are persistent & reloaded after power cycling l Changes kept using save command l Many settings require reboot to take effect

13 13 Wireless Products Division Command Mode: Syntax l Commands Use Keyword Followed by Additional Information l Command Rules l Case sensitive l Spaces not allowed, substitute $ “MY NETWORK” = “MY$NETWORK” l Can Use Shorthand l set uart baudrate 115200 valid l set uart b 115200 valid l set u b 115200 valid l s uart baudrate 115200 Invalid

14 14 Wireless Products Division Command Mode: Keywords l Set: Immediate Effect, Permanent If Saved to Configuration File l Get: Retrieve & Display Permanently Stored Information l Status: Current Interface Status, IP Address, etc. l Action: Perform Actions Such As Scan, Connect & Disconnect l File: Upgrade, Load & Save Configuration, Delete Files, etc.

15 15 Wireless Products Division Hardware Architecture: Key Features l 2.4-GHz IEEE 802.11b/g Tx/Rx l Ultra Low-Power Consumption 4-uA sleep 40-mA RX/connected 200-mA maximum TX l Sparc 32-Bit Micro Embedded TCP/UDP/IP stacks l Hardware Interfaces UART: 1-Mbps streaming SPI slave: 2.7-Mbps streaming l 10 GPIO Pins Status & control  8 Analog Sensor Inputs 14-bit, 35-us frequency 0 to 1.2 V  Security: Hardware Encryption Engine WEP128 WPA-PSK WPA2-PSK (TKIP & AES)  Real-Time Clock  1-MB Flash Memory for Data Logging  2-KB NV RAM  Battery Boost Regulator

16 16 Wireless Products Division Hardware Architecture: Silicon

17 17 Wireless Products Division Hardware Architecture: Development Environment

18 Wireless Products Division Wi-Fi Lab April, 2012

19 19 Wireless Products Division Lab Prerequisites l Hardware l RN-134-K or RN-174-K evaluation kit l Configured access point (AP) l Security: WEP-128, WPA-TKIP or WPA2-AES l FTP server to upload & store data l Utility Software l Available from http://www.rovingnetworks.com support pagehttp://www.rovingnetworks.com l Tera Term (terminal emulator) l PortPeeker (packet sniffer)

20 20 Wireless Products Division Lab 1: Association & UDP l Lab Overview l Infrastructure & ad hoc networks l Hardware setup l Configuration parameters & factory resets l Scan, join & authenticate l Broadcast UDP l Device name l Sensor mask l UDP auto-pair

21 21 Wireless Products Division Lab 1: Association & UDP l Supported Security Modes l WEP 64, WEP 128 OLD/NOT SECURE l WPA1 TKIP l WPA2 AES has not been compromised l Enterprise not currently supported l Finding Devices on Network Roving Networks Device 192.168.0.3 Access Point DHCP server Roving Networks Device 192.168.0.2 192.168.0.1 174.201.25.16 To Internet Infrastructure Networking Roving Networks Device 169.254.1.1 169.254.1.2 169.254.1.3 Ad Hoc Networking

22 22 Wireless Products Division Lab 1: Hardware Setup l Connect Evaluation Board l Connect board to your computer l Connect battery l Blue LED lights up (RN-134-K only) l Green LED blinks slowly l Use device manager to find the COM port

23 23 Wireless Products Division Lab 1: Configure Module via UART l Launch Command Mode l Run Tera Term l Open assigned COM port l Serial port settings: 9600 baud, 8 bits, No Parity, 1 stop bit l Type $$$ l Module responds with l Review & Reset Configuration l Check configuration & firmware version l get e l ver l Perform factory reset (starts module in known state) l factory R l reboot

24 24 Wireless Products Division Lab 1: Joining/Associating with Networks  Search for Networks –$$$ (enter command mode) –scan  Join a network –join # 1 (remember spaces) –leave –join (e.g., join RovingNET) –leave  Auto-Join Network with Persistent Configuration –set wlan ssid –set wlan pass –save –reboot TIP: If Network Is Secure, Set Pass Phrase with set wlan pass before Joining Network

25 25 Wireless Products Division Lab 1: Interim Summary  Configured Module via the UART in Command Mode  Next, Observe Wi-Fi Activity Using PortPeeker

26 26 Wireless Products Division Lab 1: Configure & Capture UDP with PortPeeker  Associate PC with Same AP as Module –Enter command mode & retrieve module’s IP address –Ensure PC is on same subnet  Launch & Configure PortPeeker –Click configure –Set port number to 55555 (default) –Set protocol to UDP –Click OK  Start UDP Packet Capture –Click Start –If PC & module are on same subnet, broadcast packets shown –If multiple nodes on network, look for YOUR IP address

27 27 Wireless Products Division Lab 1: UDP Broadcast l Module Sends UDP Broadcast at Specified Intervals l UDP Broadcast Contains Information that Identifies Module on Network l Set UDP Broadcast Interval l Enter command mode l get broadcast (observe current interval) l set b i 3 (b=broadcast, i=interval) l save & reboot l Review UDP messages in PortPeeker l Enable Sensor Data in UDP Broadcast l Enter command mode l set q s 0xff (set sensor mask) l save to make persistent l Reboot not required l Review UDP messages in PortPeeker l Sensor data highlighted

28 28 Wireless Products Division Lab 1: Setting Device Name l Device Names Can Identify Products on Network l Can Append Device ID to UDP Broadcast l Set Device ID l Enter command mode l get option l set o d RockAndRollWiFi(o=optional, d=deviceID) l save & reboot l Review UDP messages in PortPeeker l Set Broadcast UDP Port l Enter command mode l get broadcast l set b p 50000(b=broadcast, p=port) l Save & reboot not required l Reconfigure PortPeeker to listen for UDP packets on port 50000 l Review UDP messages in PortPeeker TIP: UDP Broadcast on by Default Set Interval to 0 to Turn It Off

29 29 Wireless Products Division Lab 1: Sending UDP Packets l UDP Mode Not Enabled by Default l Enable UDP by Setting Remote Host, Port & Protocol l Enter command mode l factory R l Associate with AP l set ip host l set ip remote 50000 l set ip proto 1 (IP protocol bitmask; 1 = UDP) l set comm timer 1000 (try 10, see the change) l get ip l save & reboot l Type characters; they appear in PortPeeker TIP: IP Protocol Value Is a Bit Mask You Can Enable Both TCP & UDP Messages

30 30 Wireless Products Division Lab 1: UDP Auto Pairing Mode (Optional Slide) l Similar to Bluetooth Pairing, Module Can Store IP Addresses for Fast UDP Message Setup l Example Requires 2 Modules l Module 1: Clear Host IP & Port & Set Auto Pair Mode l $$$ (enter command mode) l set ip host 0.0.0.0 l set ip remote 2000 l set ip local 2000 l set ip flag 0x40 l save & reboot l Module 2: Set Module 1 Host IP & Port l $$$ (enter command mode) l set ip host l set ip remote 2000 l set comm timer 1000 l save & reboot l Test System l Type characters in module 2’s terminal; they appear in module 1’s terminal window l Type characters in module 1’s terminal; they appear in module 2’s terminal window

31 31 Wireless Products Division Lab 1: Conclusion l RN-134-K or RN-174-K with T erminal Emulator & Serial Cable Provides Simple, Effective D evelopment Environment l Joining N etworks Is Easy l Use B roadcast UDP to F ind M odules on N etwork Using Device Names & MAC Addresses l Module S ends UART D ata as UDP Packets when Associated with N etwork in UDP Mode

32 32 Wireless Products Division Lab 2: TCP l Objective l Connect from module to remote host using TCP l Connect to module from remote host using TCP l TCP modes l Auto-connect features l Alternative GPIO functions l Event-based TCP packet forwarding l Prerequisites l RN-134-K set up as in Lab 1 l Module associated to access point (AP) l Computer associated to same AP l Telnet client (Tera Term) l PortPeeker application

33 33 Wireless Products Division Lab 2: TCP Connections WiFly Module Opens TCP Connection  Sensing applications  Sending data to web server  Data acquisition systems  Fleet management RN-134-K 192.168.1.50 Listen on Port 2000 Access Point DHCP server Remote Host 192.168.1.200 Listen on Port 5000 Remote Host Opens TCP Connection  Industrial controls  Home automation  Universal remotes open 192.168.1.200 5000open 192.168.1.50 2000 TCP Connections Are Point to Point Provide Reliable, Guaranteed, In Order Data Delivery Also Known As Sockets

34 34 Wireless Products Division Lab 2: Setup PortPeeker l Associate Computer with AP l Launch PortPeeker l Configure PortPeeker l Click Configure (Note PC’s IP address in Interface box) l Set port to 5000 (port number matches remote port of WiFly module) l Set protocol to TCP l Click Start to Capture TCP Packets

35 35 Wireless Products Division Lab 2: Open TCP Connection from Module l With Module Connected to PC over USB-Serial Cable, Open Tera Term on Serial COM Port l Restore Module to Factory Defaults l Enter command mode l factory R l Associate with AP l save & reboot l Open TCP connection l open 5000 l *OPEN* shown on serial port (Tera Term window) & packet with *HELLO* on PortPeeker l Close TCP Connection l Enter command mode l close l Close string *CLOS* displayed in Tera Term

36 36 Wireless Products Division Lab 2: Connecting from Remote Host to WiFly module l In Command Mode, Obtain Module’s IP Address l get ip l Open Telnet Connection from PC Using Tera Term (Use Existing Instance) l Click File > New connection l Select TCP/IP l Select Telnet l In Host field, type module’s IP address l TCP port# is 2000 (default listening port) l Click OK l *HELLO* Message Shown in Telnet Window Indicating Successful TCP Connection l Type in Telnet Window; Data Appears on Serial Port Window & Vice Versa l Can Configure Module Remotely over Telnet by Entering Command Mode *HELLO*

37 37 Wireless Products Division Lab 2: TCP modes l Module Supports Three TCP Modes l TCP client & server mode l Default mode initiates & accepts TCP connections l Currently supports one active connection at a time l Concurrent TCP connections supported in future l TCP client ONLY mode l ONLY initiates TCP connections; cannot accept incoming connections l Secure mode l ONLY receives packets from host that matches stored host IP address TIP: Refer to User Manual for More Details on TCP Modes

38 38 Wireless Products Division Lab 2: TCP Client Mode l Set Up Module in TCP Client Mode l set ip proto 8 l save & reboot l Open New Telnet Connection to Module from Tera Term l Second Connection Is Refused Indicating TCP_Client Mode Works Correctly

39 39 Wireless Products Division Lab 2: Auto-Connect Feature l Module Can Automatically Open TCP Connection to Remote Host on Power Up or Waking from Sleep l Auto-Connect Controlled by autoconn Setting l set sys auto 1// Attempts to open TCP connection immediately once only l set sys auto // Attempts to open TCP connection every seconds l set sys auto 255// Attempts to open TCP connection once & go back to sleep immediately // when connection is closed l Auto-Connect Requires Module to Store Remote Host’s IP Address & Port # l set ip host l set ip remote l Once TCP Connection Is Opened, It Can Be Closed in Several Ways l close command l Idle timer l Remote host l Idle Timer Closes TCP Connection after Preset # of Seconds of No Activity (No Tx or Rx) on the TCP Link l set com idle //Closes the TCP connection after seconds of inactivity

40 40 Wireless Products Division Lab 2: Auto Connect Feature (Timers) l Module Attempts a TCP Connection Every 10 seconds, Drops Connection after 3 seconds Inactivity l set ip host l set ip remote 5000 l set sys auto 10 l set comm idle 3 l save l reboot l PortPeeker: Connection Opens & Closes l Tera Term: Open & Close Strings Shown when Each Connection Opens & Closes *OPEN**CLOS* …

41 41 Wireless Products Division Lab 2: Alternative GPIO Functions l Firmware Uses GPIO 4, 5 & 6 to Blink Evaluation Board’s Status LEDs (See Section 2.4 in User Manual for Standard LED Function) l Microcontroller Opens or Closes TCP Connection to Stored Remote Host by Driving GPIO5 High or Low l This setup requires a hardware configuration that is not part of this lab l Microcontroller Can Monitor TCP Connection Status by Reading GPIO6 l High = Connected l Low = Not Connected GPIOFunctionDescription 4 (GRN)OutputHigh once associated, authenticated & has IP address. 5 (RED)InputSet high to trigger TCP connection, low to disconnect. 6 (YLW)OutputHigh when connected over TCP, low when disconnected.

42 42 Wireless Products Division Lab 2: Alternative GPIO Functions l Enable Alternative Functions l set wlan ssid l set sys iofunc 0x70 l save l reboot l Evaluation board LEDs do not turn on l After Module Associates with AP l Associate with AP l save & reboot l Green LED goes on (GPIO4) l Connect/Disconnect TCP Connection l Enter command mode ($$$) l open l Red LED blinks & connection closed because RN-134-K board’s GPIO5 pulled to GND l Enter command mode ($$$) l leave// disassociate from AP l Green LED goes OFF

43 43 Wireless Products Division Lab 2: Setting Comm Strings l Microcontroller Can Look for UART comm Strings as Indication of TCP Connection Status l Factory reset l reboot l Associate with AP l set ip host l set ip remote 5000 l set comm open HAPPY l set comm close HOLIDAYS l set comm remote HAPPY_NEW_YEAR l save & reboot l Enter command mode l open l See open string in Tera Term l See remote string in PortPeeker l Enter command mode l close l See close string in Tera Term Tip: Microcontroller Can Read UART Open & Close Strings to Determine TCP Connection Status

44 44 Wireless Products Division Lab 2: Forwarding TCP packets l When Data Is Written to Module’s UART, TCP Packets Forwarded Based On l Flush timer l Flush size l Match character l TCP Packet Sent When Any of These Events Occur l Parameters Logically ORed to Determine when TCP Packet Is Sent l When Configured Correctly, Module Can Be Optimized for Low Latency or High Throughput l Low latency: use lower flush timer value & flush size l High throughput: use higher flush timer value & flush size Tip: Module Tries to Optimize Automatically for Bandwidth by Increasing Default Flush Size with Higher Baud Rates

45 45 Wireless Products Division Lab 2: Forwarding TCP packets l Forwarding Packets Based on Flush Timer l set comm timer 1000 l save l open l Type text after TCP connection opens l After you stop typing, TCP packet is sent 1 second later l Forward Packets Based on Match Character l set c t 0 (why do we send this command ?) l set comm match 65 l This parameter expects ASCII decimal character or HEX value of the match character (e.g., 65= Capital A) l save l open l Type 12345678A l TCP packet sent out after you type A character l Observe packet in PortPeeker l What Do You Learn from Using ‘get c’ Command?

46 46 Wireless Products Division Lab 2: Conclusion l Module Can Open TCP Connection to Remote Host & Accept Incoming Connections from Remote Host l Auto-Connect Automatically Opens TCP Connection l Idle Timer Can Automatically Close TCP Connection l Alternative GPIO Functions Allow Microcontroller to Control & Monitor TCP Connections l comm open, close & remote Strings Can Indicate TCP Connection Status l TCP Packets Forwarded Based On l Packet size l Match character l Flush timer

47 47 Wireless Products Division Lab 3: Association/Roaming & FTP l Objective l Wake & sleep timers l Auto join l Roaming configuration ( Linkmon/IP flags) l FTP l Prerequisites l User has completed Labs 1 & 2 l Evaluation board & computer set up as described in Lab 1

48 48 Wireless Products Division Lab 3: Where in the World Wide Web are you? l Module Associates with AP Based on SSID l Password required depending on security l Multiple security modes l Multiple AP with same SSID and/or password l Each Wi-Fi Device Must Have Unique IP Address l Provided by DHCP server l Gateway bridges multiple networks, typically Internet with Intranet  Dynamic Name Service (DNS) l Maps URL (www.google.com) to an IP Address 74.125.19.103www.google.com Access Point SSID RovingNet1 Bridge Roving Networks Device To internet Intranet Local Network Access Point SSID RovingNet DHCP server 192.168.0.1 Roving Networks Device 192.168.0.2 101.11.2.15 Router DHCP server Gateway 10.10.10.1 Internet Worldwide Web 10.10.10.2 10.10.10.3 10.10.10.4 DNS server www.google.com 135.201.25.15 74.125.19.103

49 49 Wireless Products Division Lab 3: Wake & Sleep Timers l Several Options to Wake Module l FORCE WAKE Signal l Sensors l Internal Timers l Restore Factory Default Parameters & Training AP l Enter command mode l factory R l Associate module with AP l save & reboot l Set Wake Timer: # Seconds in Deep Sleep before Wake Up l set sys wake 10 l Set Sleep Timer: # Seconds before Entering Deep Sleep l set sys sleep 5 l save & reboot l LEDs cycle on & off (except blue), l Observe module reboot on wake up in Tera Term TIP: Do Not Set Sleep Timer to Less than 2 Seconds or It Is Hard to Go into Command Mode & Reconfigure Module before It Sleeps Again

50 50 Wireless Products Division Lab 3: Join Modes l Useful for Module to Associate with Network Automatically l Association Controlled with join Command or join Parameter Setting l Turn Off Auto-Join & Join Manually l Enter command mode l factory R & reboot l Associate module with AP l set wlan join 0 l save & reboot l Enter command mode l Join l Modules associates with AP l Auto-Associate with Any Open-Security AP l set wlan ssid l set wlan join 2 l set wlan auth 0 l save & reboot l Module attempts to join any open network (no security) TIP: If Network is Secure, Set Pass Phrase with “set wlan pass ” before Joining Network ValuePolicy 0Manual. Do not join automatically. 1Attempt to join the AP that matches the stored SSID, pass phrase & channel. Channel can be set to 0 for scanning. (Default) 2Join any AP with security matching the stored authentication mode. This setting ignores the stored SSID and searches for the AP with the strongest signal. The channels searched can be limited by setting the channel mas. 3Reserved. Do not use. 4Create an ad hoc network using the stored SSID, IP address & netmask. You must set the channel.

51 51 Wireless Products Division Lab 3: Roaming (Optional Slide) l Module Wakes, Searches for Aps, Connects, Off Loads Data & Returns to Sleep l Used for Asset Tracking, Fleet Management & Remote Sensor Applications l Combine Broadcast UDP, Wake Timers & Auto Join l Enter command mode l factory R & reboot l set broad interval 3 l set opt device l set wlan join 2 l set wlan auth 0 l set sys sleep 15 l set sys wake 5 l save & reboot l Open PortPeeker to Receive UDP Broadcast Messages (Lab 1) l Confirm Module’s UDP Broadcast Message l Move Module Near AP_SSID1 AP l Move Module Near AP_SSID2 AP l PortPeeker shows AP MAC address in broadcast UDP message change

52 52 Wireless Products Division Lab 3: FTP Update (REQUIRES Internet Access) l Use Module’s FTP Client to Update Firmware & Put/Get Data l Default Username/Password Set to Roving Networks’ FTP Server l Associate to Internet-Connected Network & Use “ftp update” Command l Use Local FTP Server l Enter command mode l factory R l Associate module with AP l save & reboot l Update Firmware l Enter command mode l ftp update l ver l reboot l Enter command mode l Ver TIP: After Downloading New Firmware, Restore Module to Factory Defaults Before Using It

53 53 Wireless Products Division Lab 3: Setting Firmware Boot Image l Firmware Stored in Embedded Flash Memory l Boot Image is Firmware Version Module Is Currently Running l After Successful Update, Boot Image Changes to New Firmware File l Change Boot Image l Enter command mode l View Files in Flash l Enter command mode l ls l Change Boot Image l Enter command mode l boot image l reboot

54 54 Wireless Products Division Lab 3: FTP put & get l FTP Client Can Stream Files to/from FTP Server l Useful in data logger applications l FTP Servers Can Accept Multiple Clients Concurrently l Configure FTP Setup l Enter command mode l factory R & reboot l Associate module with AP l set ftp address (e.g., ftp svr addr) l set ftp user (e.g., roving) l set ftp pass (e.g., Pass123) l set ftp dir (e.g., public) l set ftp timer 20 l save & reboot l Create & Read File on Server l Enter command mode l ftp put l Type characters, wait until *CLOS* shown l ftp get

55 55 Wireless Products Division Lab 3: Conclusion l Sleep & Wake Timers Allow Module to Deep Sleep to Save Power & Periodically Connect to Network l Roaming Allows Module to Connect to AP with Strongest Signal that Matches SSID or Authentication Mode l Use FTP to Update Firmware l Use FTP put & get Commands to Transfer Files l FTP put Combined with Sleep/Wake/Roaming Useful for Data Logging Applications

56 56 Wireless Products Division Lab 4: HTTP Client l Objective l Post data to web server l Uses built-in feature l Does not require external processor l Configure HTTP client mode l Periodically send sensor data web server l Wake on UART data l Prerequisites l Hardware same as in previous labs l Module associated to Access Point (AP) with Internet connectivity l Tera Term running on PC l Web server configured to accept HTTP messages (Roving Networks Website)

57 57 Wireless Products Division Lab 4: Solutions Architecture

58 58 Wireless Products Division Lab 4: Enabling HTTP Client Mode l HTTP Client Mode Disabled by Default l To enable use set ip proto 18 command l Module Connects to Web Server Using the IP Address or URL l Web Server Listens on Port 80 (Default) for Incoming Connections l For Each Request l Web server responds with 200 OK l Closes the connection

59 59 Wireless Products Division Lab 4: Auto-Posting Sensor Data l In HTTP Client Mode, Module Sends Request Message l GET /server.php?value=0F3000001111222233334444555566667777\n\n l Request message includes comm remote string & sensor readings l Configure HTTP Client Mode & Request Message l Go into command mode l Associate the module with AP l set ip proto 18// Enable HTTP & TCP protocols l set ip host 0// Set IP address if known l set dns name www.rovingnetworks.com// Set DNS name if notwww.rovingnetworks.com l set ip remote 80// Standard web server port l set comm remote GET$/server3.php?value=// $ is replaced by space character l set q sensor 0xff// Sample all sensors inputs l set option format 7// Send header & sample sensor data l save & reboot l Enter command mode l open Format 2 Bytes GPIO Chan 0 Chan 1Chan 2Chan 3Chan 4Chan 5Chan 6Chan 7 0F3000001111222233334444555566667777

60 60 Wireless Products Division *OPEN*HTTP/1.1 200 OK Date: Fri, 19 Nov 2010 19:24:07 GMT Server: Apache X-Powered-By: PHP/5.2.13 Connection: close Content-Type: text/html Server accepted values ID: 0 VALUE: 0D16CF2907ED3EB640AB07E607F4321C3219 RTC: 0 *CLOS*GPIO values Sensor Data Lab 4: Web Server l Open Web Browser l The PC must be associated with your AP connected to the internet l In Address Bar, Type www.rovingnetworks.com/result.htm l Scroll to bottom of log to see data l All module data looks the same

61 61 Wireless Products Division Lab 4: Add Device Name & RTC to Sensor Data l Append Device ID & RTC Value to Sensor Data so Server Can Identify It l Device String: Appends &id=, where is device ID string set with set opt device command l Real-Time Clock: Appends &rtc=, where is real-time clock value in message as 32-bit HEX value in format aabbccddeeff l Turn Off Auto Connect l Go into command mode l Set sys auto 0 l Save & reboot l Append Device Name & RTC l Go into command mode l set option device l time// Get network time l set option format 31 l save & reboot l Post Data l Go into command mode l open Tera Term Output *OPEN*SEND-WEBPOST HTTP/1.1 200 OK Date: Mon, 06 Dec 2010 17:56:28 GMT Server: Apache X-Powered-By: PHP/5.2.13 Connection: close Content-Type: text/html Server accepted values Device ID ID: servertest VALUE: 0D16CF2908043E854020080108043236323A RTC: 3ad82 *CLOS* Real Time Clock

62 62 Wireless Products Division Lab 4: Auto-Posting UART Data l Module Can Wake on Receiving UART Data, Associate with AP & Send Request Message Containing the UART Data l factory R & reboot l Associate module to AP l set ip proto 18// set HTTP client mode l set ip host 0// IP address of web server l set dns name www.rovingnetworks.com// OR DNS name l set ip remote 80// Web server port l set comm remote GET$/server3.php?value= // Set request message header l set uart mode 2// Automatically connect using trigger mode l set sys trigger 1// Wake up on uart RX data l set sys sleep 10// Put WiFly module to sleep after 10 seconds l set option format 1// Sends out HTTP header l set comm timer 2500// Allows multiple keystrokes per request l save & reboot l In Tera Term, Type Characters to Wake Module, Associate to AP & Send Data as HTTP Message to Web Server NOTE: You Cannot Send both Sensor & UART Data in Same Request Message

63 63 Wireless Products Division Lab 4: Auto-Posting Serial Data OPEN*SEND-WEBPOST HTTP/1.1 200 OK Date: Mon, 06 Dec 2010 18:25:36 GMT Server: Apache X-Powered-By: PHP/5.2.13 Connection: close Content-Type: text/html Server accepted values ID: 0 VALUE: ovingData with first byte missing RTC: 0 *CLOS* Company Confidential  When Serial UART Data Arrives, Module Auto-Connects to Web Server & Sends GET /server3.php?value= \n\n NOTE: First Data Byte Dropped because Module Must Initialize before Sending Data over Wireless Interface To Avoid This Issue, Module Should Wake on CTS Signal Using set sys trigger 2 or Send First Byte Twice

64 64 Wireless Products Division Lab 4: Conclusion l Module Supports HTTP Client Mode Natively l When Configured, Module Can Append l GPIO values l Sensor data l Real-time clock l Device name l UART data l Module Can Wake Up on UART Data l May result in dropping first byte l W aking up on CTS is better option Company Confidential

65 65 Wireless Products Division Lab 5: Access Point Mode l Advantages l Enables Android devices to talk to modules without infrastructure l Runs DHCP server l Supports up to 10 clients l Supports routing between clients l Supports WPA2-AES personal security

66 66 Wireless Products Division Lab 5: Creating a Default AP Network l Download Firmware Supporting AP Mode via FTP l RN-131: ftp update wifly-241.img l RN-171: ftp update wifly7-241.img l RN-370: ftp update wiflyA-241.img l Install Jumper at J6 to Enable AP Mode in Hardware l SSID: WiFlyAP-XX, where XX is last two bytes of MAC address l Channel: 1 l DHCP server: Enabled l IP address: 1.2.3.4 l Netmask: 255.25.5255.0 l Gateway: 1.2.3.4

67 67 Wireless Products Division Lab 5: Create Custom AP Network in Software l Create Custom AP Network with User-Defined Settings l set wlan join 7 // Create AP mode network l set wlan channel // Specify channel to create // network l set wlan ssid // Set up network SSID l set ip dhcp 4 // Enable DHCP server l set ip address // Specify IP address l set ip net // Specify subnetmask l set ip gateway // Spcify gateway l save // Store settings l reboot // Reboot module in AP mode

68 68 Wireless Products Division Lab 5: Connect to AP Network Created by Module l From PC/Mobile Phone/Tablet, Connect to Module-Created Network l Module Displays Client’s Device Name

69 69 Wireless Products Division Lab 5: View Associated Devices & Lease Times l View Device Lease Times l show lease l View List of Connected Devices l show associated

70 70 Wireless Products Division Wi-Fi Training Session Questions


Download ppt "Wireless Products Division Wi-Fi™ Module Product Training April, 2012."

Similar presentations


Ads by Google