WiFly GSX WiFlyGSX-um.pdf 12/14/2009 WIFLY GSX 802.11 b/g wireless LAN Modules User Manual and Command Reference RN-131G, RN-131C, RN-134, RN-121, RN-123 & RN-125 Version 2.15 Dec 1st, 2009 Copyright © 2009 Roving Networks, Inc. All Rights Reserved. The contents of this document can be changed by Roving networks without prior notice and do not constitute any binding undertakings from Roving networks.
WiFly GSX WiFlyGSX-um.pdf 12/14/2009 1 2 Overview.......................................................................................................................... 3 Hardware Interface ........................................................................................................... 4 2.1 Power ....................................................................................................................... 4 2.2 Reset...................................................................
WiFly GSX WiFlyGSX-um.pdf 12/14/2009 1 Overview The “WiFly” radio module is a complete stand alone embedded wireless LAN access device. The device has on board TCP/IP stack and applications. Requiring only 4 pins (POWER, TX, RX, GND) to design in. Once initial configuration is set, the radio can automatically access the WiFi network and send/receive serial data over UART. • • • • • • • • • • • • • • • Fully Qualified and Wifi Certified 2.4GHz IEEE 802.
WiFly GSX WiFlyGSX-um.pdf 12/14/2009 2 Hardware Interface See the RN-131 or RN-134 data sheets on the Roving Networks website for technical specifications and layout information of these modules. 2.1 Power There are two options for powering the RN-131G module directly. DC SUPPLY: Apply 3.3 VDC power to VBATT (pin 20), and V3.3IN (pin 21). Tie 3.3VREG-IN (pin 18) to GROUND. 3.3V-REG-OUT (Pin 17) leave floating. BATTERY: Apply battery = 2.0 to 3.3VDC to VBATT (pin 20). V3.3IN pin 21 = floating.
WiFly GSX WiFlyGSX-um.pdf 12/14/2009 2.4 Status Indictors PIO 4, 5 and 6 are active high and can be connected to external LEDs to provide network, connection and data status. Condition ON solid PIO6=Red LED Not Associated Fast blink Slow blink OFF 3 3.1 PIO5=Yellow LED PIO4=Green LED Connected over TCP Rx/Tx data transfer Associated, No Internet Associated, Internet OK No IP address IP address OK Configuration Entering Command Mode Upon power up, the device will be in data mode.
WiFly GSX WiFlyGSX-um.pdf 12/14/2009 Channel: DHCP: IP address: Netmask: 1 OFF 169.254.1.1 255.255.0.0 With the adhoc jumper in place the above settings override the current saved configuration settings. From your computer, connect to the WiFly-GSX-XX network. This is an open network which does not require a pass phrase or pass key. Note: currently the WiFly only supports OPEN mode for creating adhoc networks.
WiFly GSX WiFlyGSX-um.pdf 12/14/2009 4 4.1 WiFly Command Reference Command Syntax Commands begin with a keyword, and have optional additional parameters, generally space delimited. Commands and options are case sensitive. Hex input data can be upper or lower case. String text data, such as SSID is also case sensitive. The first command is fully decoded and must be complete. Other command parameters can be shorted by using only the first character.
WiFly GSX WiFlyGSX-um.pdf 12/14/2009 5 SET Commands These commands begin with “set”. There are 6 major categories. ADHOC BROADCAST COMM DNS FTP IP OPTION SYS TIME UART WLAN 5.
WiFly GSX WiFlyGSX-um.pdf 12/14/2009 set comm open sets the string that is sent to the local UART when the TCP port is opened. If no string is desired, use 0 as the parameter. Max string length is 32 characters. Default is *OPEN* set comm remote sets the string that is sent to the remote TCP client when the TCP port is opened. If no string is desired, use 0 as the parameter. Max string length is 32 characters.
WiFly GSX WiFlyGSX-um.pdf 12/14/2009 set ftp filename sets the name of the file transferred when issuing the “ftp u” or “ftp g” commands. set ftp addr sets the ftp server IP address. set ftp remote sets the ftp server remote port number (default is 21). set ftp user sets the ftp user name for accessing the FTP server. set ftp pass sets the ftp password for accessing the FTP server. 5.
WiFly GSX WiFlyGSX-um.pdf 12/14/2009 7-31 Reserved set ip gateway sets the gateway IP address, If DHCP is turned on, the gateway IP address is assign and overwritten during association with the access point. set ip host sets the remote host IP address. This command is used for making connections from the WiFly module to a TCP/IP server at the IP address . set ip localport sets the local port number. set ip netmask sets the network mask.
WiFly GSX WiFlyGSX-um.pdf 12/14/2009 challenge . When set, all newly opened connections must first send the exact characters that match the stored password otherwise the WiFly module will close the connection. When the password is set the WiFly module sends the string “PASS?” to the remote host. All characters in the string must be sent in one TCP packet. Max string size is 32 bytes. To disable the password feature use string=0 which is the default. 5.
WiFly GSX WiFlyGSX-um.pdf 12/14/2009 set time port sets the time server port number. Defaults to 123 which is almost always the sNTP server port. set time enable Enable or disable fetching time from the specified sNTP time server. Default=0= disabled. A value or 1 gets time only once on power up. Any value > 1 gets time continuously every minutes. 5.10 UART Parameters set uart baud set the UART baud rate.
WiFly GSX WiFlyGSX-um.pdf 12/14/2009 set wlan auth Sets the authentication mode. Not needed unless using auto join mode 2. i.e. set wlan join 2 Note: During association the WiFly module interrogates the Access Point and automatically selects the authentication mode.
WiFly GSX WiFlyGSX-um.pdf 12/14/2009 set wlan hide <0, 1> Hides the WEP key and WPA passphrase. When set, displaying the wlan settings shows ****** for these fields. To unhide the passphrase or passkey, re-enter the key or passphrase using the set wlan key or set wlan passphrase command. Default = 0, don’t hide. set wlan key sets the 128 bit WEP key. If you are using WPA or WPA2 you should enter a pass phrase with the set wlan passphase command. Key must be EXACTLY 13 bytes (26 ASCII chars).
WiFly GSX WiFlyGSX-um.pdf 12/14/2009 “my$pass$word”. The replacement character can be changed using the optional command set opt replace . Example : “set w p password” sets the phrase. set wlan rate sets the wireless data rate. Lowering the rate increases the effective range of the WiFly-GSX module. The value entered is mapped according to the following table Value Wireless Data Rate 1 Mbit/sec 2 Mbit/sec 5.
WiFly GSX WiFlyGSX-um.pdf 12/14/2009 get dns display DNS settings. get ftp display FTP settings. get ip display IP address and port number settings. get mac display the device MAC address. get optional display the optional settings like device ID get sys display system settings, sleep, wake timers, etc. get time display the time server UDP address and port number. get wlan display the ssid, chan, and other wlan settings. get uart display the UART settings.
WiFly GSX WiFlyGSX-um.pdf 12/14/2009 show time Displays number of seconds since last powerup or reboot show q <0-7> Display the value of the an analog interface pin from 0 to 7. The value returned will be in the format 8xxxxx where xxxxx is voltage in microvolts sampled on the channel you request with the 8 in front as a start marker. show q 0x1 Displays multiple analog interface values at once.
WiFly GSX WiFlyGSX-um.pdf 12/14/2009 8 ACTION Commands $$$ enter command mode Characters are PASSED until this exact sequence is seen. If any bytes are seen before these chars, or after these chars, in a 250ms window, command mode will not be entered and these bytes will be passed on to other side. close disconnect a TCP connection. exit exit command mode. Exit command mode. “EXIT” will be displayed. factory RESET Loads factory defaults into the RAM configuration.
WiFly GSX WiFlyGSX-um.pdf 12/14/2009 scan
WiFly GSX WiFlyGSX-um.pdf 12/14/2009 10 10.1 Advanced Features and Settings System Timers and Auto Connect Timers There are 2 timers that can be used to put the module to sleep, and perform a wake up. If the sleep timer is enabled, the module will automatically go into deep sleep, low power mode once the timer counts down to 0. The sleep timer is disabled if the module has an IP connection, or the module is in COMMAND mode. The timer is reset when characters are received on the UART.
WiFly GSX WiFlyGSX-um.pdf 12/14/2009 10.2 Wake on Sensor Input SENSE 0 to 3 inputs are available to wake the module from sleep. SENSE 0 to 3 pins have a small current source that is activated in sleep mode. This source is approximately 100nA, and will cause the input to float up to about 1.2VDC. If SENSE1 for example, is enabled, pulling the SENSE1 pin to GROUND will wake the device. To enable these inputs to wake the module, use the command set sys trigger . The value is a bit-mapped setting.
WiFly GSX WiFlyGSX-um.pdf 12/14/2009 increase the UART baudrate, set the flush size to 1460 and flush timer to a large value so full IP packets are sent. You can control the packet forwarding 3 ways: set comm match sets the value of the packet terminator. Each time the match character is seen an IP packet will be sent. "set comm match 0xd" for example forwards once a 0xd hex character is seen.. set comm size sets the flush size, the size is the number of bytes received before forwarding.
WiFly GSX WiFlyGSX-um.pdf 12/14/2009 The get sys command will show the setting of the GPIO mask. <2.09> get sys SleepTmr=0 WakeTmr=0 Trigger=0x1 Autoconn=0 IoFunc=0x0 IoMask=0x21f0 PrintLvl=0x1 The table below shows the usage of the GPIO pins with their default state and functionality.
WiFly GSX WiFlyGSX-um.pdf 12/14/2009 Bit 0 1 2 3 4 5 6 IO GPIO-4 GPIO-5 GPIO-6 Not Used GPIO-4 GPIO-5 GPIO-6 DIRECTION output output output Function Disable LED function so IO can be used as GPIO Disable LED function so IO can be used as GPIO Disable LED function so IO can be used as GPIO output input output HIGH once associated/authenticated and have IP address. Set HIGH to trigger TCP connection, LOW to disconnect. HIGH when connected over TCP, LOW when disconnected. NOTE.
WiFly GSX WiFlyGSX-um.pdf 12/14/2009 set sys printlvl sets additional print functions. Bit-mapped value. Bit 1 Function Print start-up messages showing progress of association, dhcp, etc. Once the configuration has been checked, this can then be turned off so that these messages do not interfere with the data. 10.
WiFly GSX WiFlyGSX-um.pdf 12/14/2009 ADDR=129.6.15.28:123 ZONE=7 To view a complete listing of the time variable use the command <2.09> show t t Time=09:02:10 UpTime=653 s Powerup=1792 s RTC=7753271426558 ms timera=66885 10.8 Using the UDP Broadcast function The WiFly module can be setup to automatically generate UDP broadcast packets. This is useful for a number of reasons: - Some Access Points will disconnect devices that sit idle and don’t send any packets after a time.
WiFly GSX WiFlyGSX-um.pdf 12/14/2009 11 Joining Networks and Making Connections Configuring the module to make connections is a two set process. First you need to associate with a network access point and second you need to open a connection. To configure the module over the WiFi link is a chicken and egg problem. The module must be associated to a network to connect to it and program the network settings.
WiFly GSX WiFlyGSX-um.pdf 12/14/2009 You could also have specified the roving1 access point by using the command join # 1 If the access point is security enabled you will need to set the pass phrase prior to issuing the join command. The RN-131G module will attempt to inquire and determine the security protocol of the access point so you do not have to set the authentication mode. To set the pass phrase for WPA use the command set wlan phrase .
WiFly GSX WiFlyGSX-um.pdf 12/14/2009 seconds the connection will be closed. The sleep timer will the kick in and put the module in deep sleep. Finally the wake timer will start the whole cycle again one minute later. set ip host X.X.X.
WiFly GSX WiFlyGSX-um.pdf 12/14/2009 12 Firmware Upgrade over FTP WiFly module has a file system for storing firmware, web pages and config files. Use the ls command to view files. File size is displayed in sectors and the active boot image is identified in the final message. FL# 11 29 SIZ 18 1 FLAGS 3 10 WiFly_GSX-2.05 config 190 Free, Boot=11, Backup=0 Multiple firmware images and config files can be stored on the module file system.
WiFly GSX WiFlyGSX-um.pdf 12/14/2009 <2.10> boot image 11 Set Boot Image 11, =OK To upload your own firmware or config file to the module, change the stored FTP settings: See section 5.5 for more details on the FTP commands. To upload your file w following command: ftp get 13 13.1 Retrieves remote file with name Adhoc Networking Mode Infrastructure and adhoc comparison There are two types of networks.
WiFly GSX WiFlyGSX-um.pdf 12/14/2009 To enable adhoc mode from software: From command mode, the module is configured for adhoc mode using the join command. You will also need to set the ssid and channel. set wlan join 4 set wlan ssid my_adhoc_network set wlan chan 1 Turn off DHCP and set the IP address and netmask so other devices know where to connect to the adhoc WiFly GSX. Since auto IP fixes the first two bytes of the IP address you want to use the netmask of 255.255.0.
WiFly GSX WiFlyGSX-um.pdf 12/14/2009 Alternatively you can statically set the IP address by disabling the DHCP service and explicitly assigning the IP address. set ip set ip address dhcp 169.254.1.2 0 You can confirm the device has properly connected to the adhoc network using the ping command. ping 169.254.1.
WiFly GSX WiFlyGSX-um.pdf 12/14/2009 You can also sample multiple channels by using a bit mask: show q 0x1 where mask is a bit mask of the channels. For example, to read channels 0,1, and 7, send: show q 0x183 The return values are the format: 8, 8, 8\r\n www.rovingnetworks.com support@rovingnetworks.
WiFly GSX WiFlyGSX-um.pdf 12/14/2009 15 Default Configuration Settings ADHOC PARAMETERS Beacon Probe 100 (milliseconds) 5 (retries before declaring adhoc is lost ) BROADCAST PARAMETERS IP address 255.255.255.255 Port 55555 Interval 7 (seconds) COMM PARAMETERS Close string Open string Remote string Flush size Match byte Flush timer Idle timer Cmd char *OPEN* *CLOS* *HELLO* 64 0 10 (milliseconds ) 0 $ DNS PARAMETERS IP address Name Backup 0.0.0.
WiFly GSX WiFlyGSX-um.pdf 12/14/2009 IOfunc IOmask Print level 0 (no alternate functions ) 0x21F0 1 (prints enabled) TIME SERVER PARAMETERS Enable 0 (disabled) Server address 129.6.15.
WiFly GSX WiFlyGSX-um.pdf 12/14/2009 16 Boot-up Timing Values Function Power up Initialization Ready Description Powerup Time from Reset HIGH or power good to boot code loaded.
WiFly GSX WiFlyGSX-um.pdf 12/14/2009 18 Release Notes 18.1 • • 18.2 Known problems The UART does not support odd or even parity, only no parity is supported. Flow control: RTS may fail to properly de-assert when RX buffer (2048 bytes) is exceeded. For high speed transfers, it is best to limit RX data to the maximum Ethernet frame (1460 bytes) and have a protocol to acknowledge data is received by the remote host. Current Firmware features and fixes As of Version 2.
WiFly GSX WiFlyGSX-um.pdf 12/14/2009 most useful in battery systems, when using the sleep mode. Upon waking from sleep, as long as the DHCP lease time is valid and the WiFly is associated to the same AP, DNS caching does not survive a power cycle or usage of the hardware reset pin. • UART break detect enables sleep. The command set uart mode 8 enables break detection on the UART RX pin.
WiFly GSX WiFlyGSX-um.pdf 12/14/2009 User specified default configuration - You can now specified a USER configuration as the factory reset settings. The function of PIO9 has been changed slightly. See section 15.1 Configurable Device ID – There is now an additional user programmable device ID that can be used for storing serial numbers, product name, device type or other information. The device ID is part of the broadcast “hello” UDP message that the module sends out to identify itself.
WiFly GSX WiFlyGSX-um.pdf 12/14/2009 • Set ip proto is now a bitmask. It is possible to have both UDP and TCP bits set. If TCP enabled, UART RX data will be forwarded via TCP if a connection exists. Otherwise, data will forward over UDP (if UDP bit is set ). As of firmware version 2.07 6/04/2009 Command changes • set wlan antenna < 0 or 1 >command has been changed to set wlan extant <0 or 1 >. • set wlan auth command has been added • set wlan hide will hide the WEP key or WPA passkey.