Roving Networks WiFly RN-131GSX Installation manual

RN-131G
rn-131-um.pdf 5/14/2009
W
I
F
LY
GSX
802.11 b/g wireless LAN Module
User Manual and Command Reference
Version 1.1
Copyright © 2009 Roving Networks, Inc. All Rights Reserved.
The contents of this doc ment can be changed by Roving networks witho t prior notice and do not
constit te any binding ndertakings from Roving networks. Roving Networks is not responsible nder
any circ mstances for direct, indirect, nexpected or conseq ent damage that is ca sed by this
doc ment.

RN-131G
rn-131-um.pdf 5/14/2009
www.rovingnetworks.com
s pport@rovingnetworks.com
Phone 408-395-6539
- 2 -
Contents
1
RN-131G Overview .......................................................................................................................... 3
2
Hardware Interface............................................................................................................................ 4
2.1
Power ......................................................................................................................................... 4
2.2
Reset .......................................................................................................................................... 4
2.3
UART ........................................................................................................................................ 4
2.4
LED Indictors............................................................................................................................. 5
3
Configuration.................................................................................................................................... 5
3.1
Entering Command Mode........................................................................................................... 5
4
WiFly Command Reference .............................................................................................................. 6
4.1
Command Syntax ....................................................................................................................... 6
4.2
Command Organization.............................................................................................................. 6
5
SET Commands ................................................................................................................................ 7
5.1
COMM Parameters..................................................................................................................... 7
5.2
DNS Parameters ......................................................................................................................... 8
5.3
FTP Parameters .......................................................................................................................... 8
5.4
IP Parameters ............................................................................................................................. 8
5.5
SYSTEM Parameters.................................................................................................................. 9
5.6
TIME Server Parameters .......................................................................................................... 10
5.7
UART Parameters .................................................................................................................... 10
5.8
WLAN Parameters ................................................................................................................... 10
6
GET Commands ............................................................................................................................. 11
7
STATUS Commands ...................................................................................................................... 11
8
ACTION Commands ...................................................................................................................... 12
8.1
FILE IO Commands ................................................................................................................. 13
8.2
System timers and other features .............................................................................................. 13
8.3
Wake on Sensor INPUTs .......................................................................................................... 14
8.4
Wake on UART........................................................................................................................ 14
8.5
Uart Receiver, RTS/CTS Hardware Flow Control..................................................................... 15
8.6
Setting PIO directions, Disabling LED drivers.......................................................................... 15
8.7
Alternate IO functions .............................................................................................................. 16
8.8
Setting Debug Print levels ........................................................................................................ 16
9
Joining Networks and Making Connections .................................................................................... 17
10
Firmware Upgrade over FTP........................................................................................................... 19
11
Setting Adhoc Mode and Restoring Configuration Settings............................................................. 20
12
Default Configuration Settings........................................................................................................ 21
13
Know issues and Errata................................................................................................................... 22

RN-131G
rn-131-um.pdf 5/14/2009
www.rovingnetworks.com
s pport@rovingnetworks.com
Phone 408-395-6539
- 3 -
1RN-131G Overview
The RN-131g “WiFly” radio mod le is a complete, stand alone, embedded wireless LAN access
device. The device has on board TCP/IP stack and applications. Req iring only 4 pins (POWER,
TX, RX, GND) to design in. Once initial config ration is set, the radio can a tomatically access
the WiFi network and send/receive serial data over UART.
•Q alified 2.4GHz IEEE 802.11b/g transceiver
•High thro ghp t, p to 4Mbps s stained data rate with TCP/IP and WPA2
•Ultra-low power (4 A sleep, 35mA Rx, 110-180mA Tx)
•Small, compact s rface mo nt mod le
•On board ceramic chip antenna and U.FL connector for external antenna
•8 Mbit flash memory and 128 KB RAM
•UART and SPI (f t re) data/control interfaces
•10 general p rpose digital I/O
•8 analog inp ts
•Real-time clock for wake p and time stamping
•Accepts 3.3V reg lated or 2-3V battery
•S pports Adhoc connections
•On board ECOS -OS, TCP/IP stacks
•Wi-Fi Alliance certified for WPA2-PSK
•FCC / CE/ ICS certified and RoHS compliant
Features
•Host Data Rate Up to 2.7 Mbps for UART
•Memory 128 KB RAM,2MB ROM, 2 KB battery-backed memory, 8 Mbit Flash.
•Intelligent, b ilt-in power management with programmable wake p
•Can be powered from reg lated 3.3-3.7V so rce or 2.0-3.0V batteries
•Real time clock for time stamping, a to-sleep and a to-wake p modes
•Config ration over UART or wireless interfaces sing simple ASCII commands
•Over the air firmware pgrade (FTP), and data file pload.
•Sec re WiFi a thentication WEP-128, WPA-PSK (TKIP), WPA2-PSK (AES).
•B ilt in networking applications DHCP, UDP, DNS, ARP, ICMP
•802.11 power save and roaming f nctions

RN-131G
rn-131-um.pdf 5/14/2009
www.rovingnetworks.com
s pport@rovingnetworks.com
Phone 408-395-6539
- 4 -
2Hardware Interface
See the RN-131 data sheet on the Roving Networks website for technical specifications and
layo t information. (Doc ment rn-131-ds.pdf
)
2.1 Power
There are two options for powering the RN-131G mod le directly.
1. 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.
2. BATTERY: Apply battery = 1.8 to 3.3VDc to VBATT (pin 20). V3.3IN pin 21 = floating.
Tie pin 17 to pin 18. (this enables the on board battery boost 3.3V switcher).
2.2 Reset
Reset is active LOW and is optional/does not need to be connected. The reset pin is 3.3V
tolerant and has an internal p ll p of 100K to the VBATT. There is also a b ilt in voltage
browno t monitor.
2.3 UART
•Connect a common gro nd when sing the external TX, RX inp ts.
•For a 3 wire DB-9 interface (tx, rx, gnd only) Factory defa lt is hardware flow control
disabled, CTS and RTS are not req ired.
•When sing a 5.0Vdc Inp t, PIO’s and UART pins req ire a 10K ohm series resistor. PIO’s
are 0-3.3Vdc not 5 volt tolerant.
Warning: Do NOT exceed the voltage ratings on the 3.3V pins, damage to the module will
result.
Important Notes:
#1: The Sensor inputs SENS0-7 are extremely sensitive to over voltage. Un er no
con itions shoul these pins be riven above 1.2VDC. Placing any voltage above
this will permanently amage the ra io mo ule an ren er it useless.
#2: Placing 5VDC or any voltage above 3.3V c into the VDD pins of the mo ule will
permanently amage the ra io mo ule.
#3: Placing 3.3V c into the PIO’s while they are set as outputs will permanently
amage the ra io mo ules. The failure mo e is a short across GND an VCC. Use a
10KΩ resistor in series or a 10KΩ pull up resistor for input an output PIO’s
respectively.

RN-131G
rn-131-um.pdf 5/14/2009
www.rovingnetworks.com
s pport@rovingnetworks.com
Phone 408-395-6539
- 5 -
2.4 tatus Indictors
PIO 4, 5 and 6 are active high and can be connected to external LEDs to provide status.
3Configuration
3.1 Entering Command Mode
Upon power p, the device will be in data mode. To enter command mode, exactly the three
characters $$$ m st be sent. The device will respond with CMD.
While in command mode, the device will accept ASCII bytes as commands.
To exit command mode, send exit<cr>. The device will respond with “EXIT”.
Parameters, s ch as the SSID, channel, IP address, Serial Port settings, and all other settings can
be viewed and config red in command mode.
ASCII characters can be sent thro gh a terminal em lator connected to the UART or via Telnet.
When sing the UART comm nications settings sho ld match the settings sed when RN-131g
connects, for example: the defa lt is 9600 ba drate, 8 bits, No Parity, 1 stop bit, and hardware
flow control disabled.
R n yo r favorite terminal em lator, Roving Networks provides a free one, Teraterm, at
http://www.rovingnetworks.com/s pport/teraterm.zip.
Type $$$ on yo r em lator. Yo sho ld see “CMD” ret rned to yo . This will verify that yo r
cable and comm. settings are correct. Most valid commands will ret rn an “AOK”, response,
and invalid ones will ret rn an ERR description.
To exit command mode, type “exit“<cr>.
NOTE: Yo can enter command mode locally over the serial port at any time when not
connected, and also when connected if the appropriate settings are enabled.
Over the air, Remote configuration
Once the mod le has associated and if TCP SERVER is enabled (the defa lt) the device will be
listening for connections on port 2000.
Using Windows XP or Lin x or any other TCP command line client or program, yo can access
remote config ration.
Example: (windows command line) telnet 10.10.10.149 2000
Response “*HELLO*”
Yo can now enter command mode and config re the mod le.
Condition PIO6=Red LED PIO5=Yellow LED PIO4=Green LED
ON solid Not Associated Connected over TCP
Fast blink Rx/Tx data transfer No IP address
Slow blink Associated, No Internet IP address OK
OFF Associated, Internet OK

RN-131G
rn-131-um.pdf 5/14/2009
www.rovingnetworks.com
s pport@rovingnetworks.com
Phone 408-395-6539
- 6 -
4WiFly Command Reference
4.1 Command yntax
Commands begin with a keyword, and have optional additional parameters, generally space
delimited. Commands and options are case sensitive. Hex inp t data can be pper or lower
case. String text data, s ch as SSID is also case sensitive.
The first command is f lly decoded and m st be complete. Other command parameters can be
shorted by sing only the first character.
For example,
set uart baudrate 115200 is valid,
set uart b 115200 is also valid,
set u b 115200 is also valid, however,
s uart baudrate 115200 is NOT valid.
N mbers can be entered as either decimal, (like 115200 above) or HEX. To enter HEX, se
0x<value>. For example, the HEX val e FF wo ld be entered as 0xFF.
4.2 Command Organization
Commands fall into 5 general categories:
•ET COMMAND -Take effect immediately, permanently (save command iss ed).
•GET COMMAND -Retrieve the permanently stored information for display to ser.
•TATU COMMAND -See what is going on with the interface, IP stat s, etc.
•ACTION COMMAND - Perform action s ch as scan, connect, disconnect, etc.
•FILE IO COMMAND - Upgrade, load and save config ration, delete files, etc.
NOTE: Yo m st save the config ration or the mod le will load the previo s settings pon reboot
or power p.
When the system boots, all config ration data is loaded into RAM variables from the file called
“config”. The set commands act ally only modify the RAM copy of variables in the system.
This allows temporary change of parameters “on the fly” to test feat res, minimizes power sage
and saves on flash re-write cycles.
Once all config ration is complete, the ser m st save the settings sing the save command to
store the config ration data, otherwise it will not take effect pon reboot or reset. M ltiple
config rations can be stored by sing the save <filename> command, and these
config rations can be loaded sing the load <filename> command. These files can be pload
to remote FTP site, s ch that once a desired config ration is created, it can q ickly be copied into
additional devices (cloning).

RN-131G
rn-131-um.pdf 5/14/2009
www.rovingnetworks.com
s pport@rovingnetworks.com
Phone 408-395-6539
- 7 -
5ET Commands
These commands begin with “set”. There are 6 major categories.
•COMM - comm nication and data transfer, timers, matching characters
•DN - DNS host and domain
•FTP - FTP host address and login information
•
IP - IP settings
•
Y - system settings s ch as sleep and wake timers
•
TIME - timer server settings
•
UART - serial port settings s ch as ba drate and parity
•
WLAN - wireless interface settings, s ch as ssid, chan, and sec rity options
5.1 COMM Parameters
set comm close <string> sets the ASCI string that is sent to the local UART when the TCP
port is closed. If no string is desired, se the command with no
<string> parameter. Max string length is 32 characters.
set comm open <string> sets the string that is sent to the local UART when the TCP port is
opened. If no string is desired, se the command with no
<string> parameter. Max string length is 32 characters.
set comm remote <string> sets the string that is sent to the remote TCP client when the TCP
port is opened. If no string is desired, se the command with no
<string> parameter. Max string length is 32 characters.
set comm idle <secs> sets the Idle Timer Val e. This is the n mber of seconds with no
transmit or receive data before the connection is closed
a tomatically. Defa lt is 0, never disconnect on idle.
set comm match <value> sets matching character initiate forwarding data across the TCP/IP
connection. The val e is entered as the decimal val e of the of
the ASCII character. Defa lt is 0, disabled. For more information
see section 8.5
set comm size <value> sets the Fl sh Size val e. This is the n mber of bytes to receive
on the UART before forwarding, 0 or 1 forwards immediately. .
Defa lt is 16 bytes. Maxim m val e = 1024 bytes
set comm time <num> sets the Fl sh Timer. This is the n mber of 10 millisecond
intervals after a byte is received before the data is sent over
TCP/IP, 1 is the minim m val e. Defa lt is 2 (20 milliseconds)

RN-131G
rn-131-um.pdf 5/14/2009
www.rovingnetworks.com
s pport@rovingnetworks.com
Phone 408-395-6539
- 8 -
5.2 DN Parameters
set dns address <addr> sets the IP address of the DNS sever. This is auto-set when using
DHCP, so only used used in STATIC IP mode.
set dns name <string> sets the name of the DNS server
set dns backup <string> sets the name of the backup DNS server
set dns domain <string> sets the name of the DNS domain
5.3 FTP Parameters
set ftp filename <file> sets the name of the file transferred when iss ing the ftp get
command. If the file is not fo nd on server the connection will
time o t.
set ftp addr <addr> sets the ftp server IP address.
set ftp user <name> sets the ftp ser name for accessing the FTP server.
set ftp pass <pass> sets the ftp password for accessing the FTP server.
5.4 IP Parameters
set ip address <addr> sets the IP address of the WiFly GSX mod le. If DHCP is t rned
on, the IP address is assigned and overwritten d ring association
with the access point. IP addresses are “.” delimited. Note this is
different from the RN-111b mod le which is space delimited!
Example: “set ip a 0.20.20. ”
set ip dchp <0,1> enable or disable DHCP client. If DHCP is t rned on, the IP,
gateway and net mask are assigned and overwritten d ring
association with the access point.
set ip gateway <addr> sets the gateway IP address, If DHCP is t rned on, the gateway IP
address is assign and overwritten d ring association with the
access point.
set ip host <addr> sets the remote host IP address. This command is sed for
making connections from the WiFly mod le to a TCP/IP server at
the IP address <addr>.
set ip backup <addr> sets a secondary host IP address.
set ip localport <num> sets the local port n mber.

RN-131G
rn-131-um.pdf 5/14/2009
www.rovingnetworks.com
s pport@rovingnetworks.com
Phone 408-395-6539
- 9 -
set ip netmask <value> sets the network mask. If DHCP is t rned on, the net mask is
assign and overwritten d ring association with the access point.
set ip protocol <value> sets the IP protocol. This is a bit mapped setting. To connect to
the WiFly GSX mod le over TCP/IP s ch as Telnet the device m st
have the se the TCP Server protocol. ( this is the defa lt setting )
Bit Value Protocol
0 UDP (receive from ANY IP)
1 TCP Server +Client
2 UDP (only receive from Host IP)
3 HTTP (f t re se)
set ip remote <value> sets the remote host port n mber.
5.5 Y TEM Parameters
set sys autoconn <secs> TCP mode: sets the a to connect timer. The a to connect timer
will attempt to connect to the stored remote host IP every <secs>
seconds. If set to once the mod le will only make one attempt to
a to connect. This command can be sed to have the mod le
periodically connect to the host. 0 is the defa lt and disables a to
connect.
set sys autosleep <num *10ms> UDP mode: sets the a to-sleep timer. 0 disables.
set sys iofunc <value> sets the IO port alternate f nctions. Bit-mapped val e. For more
details see section 8.7
set sys mask <mask> sets the IO port direction mask. Bit-mapped val e. For more
information see section 8.6
set sys printlvl <value> sets n mero s print f nctions. 0 = q iet 1 = connect
information Defa lt is 1.
set sys output <value> <mask> sets o tp t PIO pins to HIGH or LOW. Bit-mapped val e.
Optional mask only sets a s bset of pins.
set sys sleep <secs> sets the sleep timer. 0 disables.
NOTE: If not sing Sensor pins to wake the mod le, be s re to set
the wake timer before iss ing the sleep timer or the mod le will
not wake p.
See section 8.2 for more details on sing system timers
set sys trigger <value> sets the sensor inp t(s) to wake on (1-4). Bit-mapped val e. 0
disables.
set sys wake <secs> sets the a to wake timer. 0 disables. See section 8.2 for more
details on sing system timers

RN-131G
rn-131-um.pdf 5/14/2009
www.rovingnetworks.com
s pport@rovingnetworks.com
Phone 408-395-6539
- 10 -
5.6 TIME erver Parameters
set time address <addr> sets the time server address.
set time port <num> sets the time server port n mber.
set time enable <value> Enable or disable time server. 1= get time once on power p.
Or, get time contin o sly every <val e> min tes.
5.7 UART Parameters
set uart parity <n,e,o> sets the UART parity.
Example : “set u p e” sets even parity
set uart baud <rate> set the UART ba d rate. Valid settings are {1200, 2400, 4800,
9600, 19200, 38400, 57600, 115200, 230400, 460800, 921600}.
Example : “set b 9600” sets the ba d rate to 9600 ba d.
set uart raw <rate> sets a RAW UART val e. Used to set non-standard rates.
Example : “set r 760” sets the ba d rate to 7200 ba d.
set uart flow <0,1> sets the flow control mode. 0=off, 1= hardware RTS/CTS.
set uart tx <0, 1> Disables or enables the TX pin= PIO0 of the UART. Disable will
set PIO0 to an INPUT with weak p lldown.
5.8 WLAN Parameters
set wlan antenna <0, 1> determines which antenna is active, se 0 for chip antenna, 1 for
UF.L connector.
set wlan channel <value> sets the wlan channel, 1-13 is the valid range for a fixed channel.
If 0 is set, then scan is performed, sing the ssid, for all the
channels set in the channel mask.
set wlan key <num> <value> sets the WEP key. key m st be EXACTLY 13 bytes (26 ASCII
chars). Data is expected in HEX format, “0x” sho ld NOT be sed
here.
Example : “set w k 112233445566778899AABBCCDD”
Hex digits > 9 can be either pper or lower case.
set wlan mask <value> sets the wlan channel mask, bit-mapped val e. Bit 0 = ch 1.
set wlan num <value> sets the defa lt WEP key to se. 1-4 is the valid range.
Example : “set w n 2” sets the defa lt key to 2.

RN-131G
rn-131-um.pdf 5/14/2009
www.rovingnetworks.com
s pport@rovingnetworks.com
Phone 408-395-6539
- 11 -
set wlan phrase <string> sets the passphrase for WPA and WPA2 sec rity modes. 1-64
chars. The passphrase can be alpha and n meric, and is sed
along with the ssid to generate a niq e 32 byte Pre-shared key
(PSK), which is then hashed into a 256 bit n mber.
However, if exactly 64 chars are entered, it is ass med that this
entry is already an ASCII HEX representation of the 32 byte PSK
and no s ch processing is done.
Example : “set w p password” sets the phrase.
set wlan ssid <string> sets the wlan ssid to associate with. 1-32 chars.
set wlan rate <value> sets the preferred wlan data rate. Defa lt = 1. Valid settings are:
1 = 1MBit, 2 = 2Mbit, 4=5Mbit, 8 = 11Mbit. Note that the
effective range will be red ced as the data rate is increased.
set wlan window <value> sets the IP max. b ffer size. Defa lt is 1460 bytes.
6GET Commands
These commands begin with “get”. They display the c rrent val es.
get com display comm. settings.
get dns display DNS settings.
get ftp display FTP settings.
get ip display IP address and port n mber settings.
get mac display the device MAC address.
get port ret rn c rrent val e of the PIO pins in hex format.
get sys display system settings, sleep, wake timers, etc.
get time display the time server UDP address and port n mber.
get wlan display the ssid, chan, and other wlan settings.
get uart display the UART settings.
ver ret rn the software release version
7TATU Commands
These commands begin with “show”, and they ret rn the c rrent val es of variables in the system.
In some cases, for example IP addresses, the c rrent val es are received from the network, and
may not match the stored val es.

RN-131G
rn-131-um.pdf 5/14/2009
www.rovingnetworks.com
s pport@rovingnetworks.com
Phone 408-395-6539
- 12 -
show net Displays c rrent network stat s, association, a thentication, etc.
show rssi Displays c rrent last received signal strength.
show stats Displays c rrent statistics, packet rx/tx co nters, etc.
show time Displays n mber of seconds since last power p or reboot
show i Displays IO pin levels stat s in this HEX format: 8ABC
Example: show I ret rns 8103 indicates pins 0, 1 and 9 high
level.
show c Displays connection stat s in this HEX format: 8XYZ
Bit loc 13-16 9-12 7 6 5 4 0-3
f nction fixed channel DNS fo nd DNS server A then Assoc TCP stat s
val e 8 1-13 1=resolved 1=
contacted
1= OK 1=OK 0= Idle,
1=Connected
3= NOIP
4= Connecting
8 ACTION Commands
$$$ enter command mode Characters are PASSED ntil this exact
seq ence is seen. If any bytes are seen before these chars, or
after these chars, in a 1 second 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.
join <ssid> joins the network <ssid>. If network is sec rity enabled yo
m st set the pass phrase with the set wlan phrase command
prior to iss ing the join command
join # <num> join a network from the scan list. <n m> is the entry n mber in
the scan list that is ret rned from the scan command. If network
is sec rity enabled yo m st set the pass phrase with the set
wlan phrase command prior to iss ing the join command
open <addr> <port> opens a TCP connection to the given IP port and address. If no
arg ments are provided the device will attempt to connect to the
stored remote IP address and remote port n mber.
Ping <g/addr> <num> ping remote host. Defa lt sends 1 packet. Optional <n m> sends
<n m> pings at 10 per second.
ping 0 - terminates a ping command
Ping 10.20.20.12 10 – pings IP address 10 times
ping g - pings the gateway

RN-131G
rn-131-um.pdf 5/14/2009
www.rovingnetworks.com
s pport@rovingnetworks.com
Phone 408-395-6539
- 13 -
reboot forces a reboot of the device (similar to power cycle)
scan Performs an active probe scan of access points on all 13 channels,
and prints o t MAC address, receive signal strength, and SSID
name.
NOTE: Unlike the RN-111B, this command can scan for access
point and remain associated .
time Sends a UDP time server req est packet o t.
8.1 FILE IO Commands
del <name> <num> Deletes a file. Optional <n m> will override the name and se
the sector n mber shown in the “ls” command.
load <name> Reads in a new config file.
ls Displays the files in the system
save Saves the config ration to “config” (the defa lt file).
save <name> Saves the config ration data to a new file name
boot image <num> Makes file <n m> the new boot image.
factory Reset Loads factory defa lts into the RAM config ration. Note that the
RESET m st be capitalized. After this command the new settings
m st be save to the config file sing the save command and the
mod le rebooted for them to take effect.
ftp get <name> Retrieves a file from the remote FTP server. If <name> not
specified, the stored ftp filename is sed.
ftp update <name> Deletes the back p image, retrieves new image and pdates the
boot image.
8.2 ystem timers and other features
There are 2 timers that can be sed to p t the mod le to sleep, and perform a wake p.
If the sleep timer is enabled, the mod le will a tomatically go into low power mode after the
timer co nts down to 0. The co ntdown is disabled if the mod le has an IP connection, or the
mod le is in COMMAND mode. The timer is reset when characters are received on the UART.
The sleep timer is set with : set sys sleep <time> time=decimal in seconds.
The wake timer is set with: set sys wake <time> time=decimal in seconds.
UDP sleep, and Connection timers
There is another timer than can be sed to p t the device to sleep.
In UDP protocol mode, the a to-conn timer is re-defined as an a to-sleep timer.

RN-131G
rn-131-um.pdf 5/14/2009
www.rovingnetworks.com
s pport@rovingnetworks.com
Phone 408-395-6539
- 14 -
Upon the start of transmission of the first UDP data packet this timer will co nt down.
set sys autosleep <value> UDP mode: sets the a to-sleep timer. 0 disables
the timer is decremented every 10 milliseconds. Beca se the timer is asynchrono s, the
act al val e can vary by 10ms. Using a minim m val e of 2 is recommended to ens re
that the UDP packet gets transmitted. For larger packets the val e sho ld be increased.
In TCP-Client mode, the a to-conn timer is sed as a connect o t timer. If set, the device will
a tomatically attempt a connection when the timer expires.
set sys autoconn <secs>
In TCP-Client AND TCP-Server mode, there is also a disconnect timer.
set comm idle <secs> sets the idle disconnect timer. This ca ses a disconnect if no transmit
or receive data is seen.
8.3 Wake on ensor INPUTs
There are 4 inp ts available to wake the mod le from sleep, SENS0-3..
To enable 1 of these inp ts, se: set sys trigger <value>. 0 disables. This is a bit-
mapped setting. To wake on sensor pin 2, yo wo ld se set sys trig 4, for example.
Unlike the RN-111b, The EN E inp ts do NOT have a resistor divider to allows pins to
tolerate 3V logic. So a minim m of 24K in series with 10K to gro nd as a divider network
from the UART RX or CTS pin sho ld be sed.
WARNING: Un er no con itions shoul the voltage on any SENS0-7 input excee
1.2VDC. Permanent amage to the mo ule will result.
The SENS0-3 inp ts have a small c rrent so rce that is activated in sleep mode. This so rce
is approximately 100nA, and will ca se the inp t to float p to abo t 1.2VDC. IF SENSE1 for
example, is enabled, p lling the SENS1 pin to GROUND will wake the device. An open drain
FET is a good device to tie to the pin. The threshold is abo t 500mV. Additional p ll p to
1.2VDC may need be sed if the circ it has an impedance (d e to leakage c rrent) of less
than 5Mohms ( 500mv / 100nA ). SENS1-4 pins that are not sed sho ld be left
nconnected.
8.4 Wake on UART
When the mod le is in Sleep mode, the UART itself is disabled. However, wake on UART can
be accomplished by connecting the SENS1 pin to the RX data pin. ( sing appropriate divider
resistors mentioned above) The S RFboard for example, has b ilt in resistor dividers to
allow wake from RXD or CTS pins.
To enable wake on RXD , se set sys trig 1.
It sho ld be noted that the first (or possibly m ltiple) byte sent into the mod le will likely be
lost, so the designer sho ld take care to send a preamble byte to wake p the mod le before
sending valid data bytes. A better way to do this is to se the CTS inp t to wake the
mod le, and wait ntil it is ready to accept data. To enable this, se set sys trig 2.

RN-131G
rn-131-um.pdf 5/14/2009
www.rovingnetworks.com
s pport@rovingnetworks.com
Phone 408-395-6539
- 15 -
8.5 Uart Receiver, RT /CT Hardware Flow Control
The UART receive b ffer is approx. 1024 bytes, and at lower ba drates (9600, 19200) the
system can process data into the device witho t need for flow control.
If constant streaming of data into RX on the device is req ired, care sho ld be taken to set the
comm parameters to optimize the performance. If data has a termination char, this can be
sed. Also, if data has a partic lar frame size, this can be sed.
set comm match <value> sets the val e of the packet terminator.
set comm size <value> sets the n mber of bytes to receive before forwarding
0-1 forwards immediately. maxim m val e = 255 bytes.
The comm size is a tomatically set whenever the ba drate is set, b t sho ld be modified if
needed.
Even at higher ba drates (115K and higher ) it is possible to operate witho t flow control if
packets are niform and a protocol is sed to ens re that data is delivered on the remote side
before the next packet is sent.
However, given the ncertainty of packet delays in a TCP/IP network and the affects of loss
and retries inherent in wireless networks, flow control is s ally req ired to g arantee no data
is lost.
GPIO 12 and 13 implement UART hardware flow control if enabled.
By defa lt flow control is disabled. To enable hardware flow contol, se set uart flow 1.
8.6 etting PIO directions, Disabling LED drivers
The table below shows the sage of the PIO pins and their defa lt val es:
Use the command: s
et sys mask <hex val>
to enable or disable certain pins as o tp ts.
For example, set sys mask 0 will defa lt all pins to INPUT.
PIO
tate DE CRIPTION
9 inp t Used for factory reset
8
o tp t
Spare GPIO
7 o tp t Spare GPIO, BLUE LED on WiFly Serial Adapter
6 o tp t RED LED- (Associated, internet OK/ TCP conn )
5 o tp t YELLOW LED – (wifi RX or RSSI )
4 o tp t GREEN LED - (system stat s /ASSOC-AUTH)
13 o tp t UART RTS – goes HIGH on POWERUP, LOW once system is READY.
If HW Flow control enabled, toggles HIGH to indicate RX b ffer f ll.
12 inp t UART CTS – throttles transmitter if HW flow control enabled.
LOW enables transmitter, HIGH will disable.
1 inp t UART RX
0 o tp t UART TX

RN-131G
rn-131-um.pdf 5/14/2009
www.rovingnetworks.com
s pport@rovingnetworks.com
Phone 408-395-6539
- 16 -
8.7 Alternate IO functions
There are a n mber of alternate IO f nctions that can be enabled. These f nctions override
the defa lt IO f nction given in section 4.4, and described in the LED table of section 2.3.
If no bits are set for a partic lar PIO pin, that pin is available to be sed as general p rpose
inp t or o tp t, based on the IOMASK setting.
set sys iofunc <value> sets n mero s alternate f nctions. Bit-mapped val e.
Bit F nction
4PIO4 - O tp t. HIGH once associated/a thenticated and have IP address.
5PIO5 - Inp t. Set HIGH to trigger TCP connection, LOW to disconnect.
6PIO6 - O tp t. HIGH when connected over TCP, LOW when disconnected.
8.8 etting Debug Print levels
There are a n mber of print f nctions that can be enabled to assist in deb gging the operation
and stat s of the mod le. The following command is sed to control these printo ts.
set sys printlvl <value> sets additional print f nctions. Bit-mapped val e.
Bit F nction
1 Print start p messages showing progress of association, dhcp, etc.
Once the config ration has been checked, this can then be t rned off so that these messages
do not interfere with the datastream.

RN-131G
rn-131-um.pdf 5/14/2009
www.rovingnetworks.com
s pport@rovingnetworks.com
Phone 408-395-6539
- 17 -
9Joining Networks and Making Connections
Config ring the mod le to make connections is a two set process. First yo need to associate
with a network access point and second yo need to open a connection.
To config re the mod le over the WiFi link is a chicken and egg problem. The mod le m st be
associated to a network to connect to it and program the network settings. This problem can
be solved by config ring the mod le from the UART or over the air sing adhoc mode.
If config ring the mod le sing adhoc mode, see section 11. Once in adhoc mode open p a
telnet window on IP address 169.254.1.1 port 2000
If config ring the mod le sing the UART mode either sing the RS232 or development board,
open a terminal em lator on the COM port associated with that deveice. The defa lt ba d rate
is 9600, 8 bits no parity.
Associate with a network access point
From within the terminal window, p t the WiFly GSX mod le into command mode by typing
$$$ in the terminal window. Yo sho ld get CMD back confirming yo are in command mode.
Type show net to display the c rrent network settings.
Now finding all available networks with the scan command
If
the
network yo ’re connecting to is open, yo can simply se the join command to associate with
the access point. From the scan list above yo can see that roving1 is an open network access
point.
Type join roving1 to associate with an access point.

RN-131G
rn-131-um.pdf 5/14/2009
www.rovingnetworks.com
s pport@rovingnetworks.com
Phone 408-395-6539
- 18 -
Yo co ld also have specified the roving1 access point by sing the command join # 1
If the access point is sec rity enabled yo will need to set the pass phrase prior to iss ing the
join command. The RN-131G mod le will attempt to inq ire and determine the sec rity
protocol of the access point so yo do not have to set the a thentication mode. To set the
pass phrase for WPA se the command set wlan phrase <string>. For WEP set the key sing
the set wlan key <num> command.
Once yo have s ccessf lly associated to the network the access point SSID is stored. This
along with the pass phrase can be saved to the config file so the mod le can associate with the
network each time it is booted p.
Open a connection
To make a connection into the mod le simply open a IP socket and connect to the IP address of
the mod le. Telnet is a simple way to test this connection. From in Telnet type open <addr>
<port>. In the example above the telnet command yo look like open 10.20.20.62 2000.
Once open yo can type characters into the UART window and see them on the Telnet window
or visa versa.
To make a connection from the mod le yo will need IP address and port n mber of yo r a
server application. A simple program to test this f nctionality is a COM port redirector. This
software opens an IP port and transfers all data it receives to a specified COM port on yo r
machine. A free com port redirector program is available from Pira at
http://www.pira.cz/eng/piracom.htm
After installing and starting this program, note the IP address of the machine it is r nning on.
This can be fo nd by r nning ipconfig in the Microsoft command window.
With the WiFly-GSX mod le in command mode type open <a r> <port>. The server will
report the connection is open and yo can type characters into the UART window and see them
on the server window or visa versa.

RN-131G
rn-131-um.pdf 5/14/2009
www.rovingnetworks.com
s pport@rovingnetworks.com
Phone 408-395-6539
- 19 -
10 Firmware Upgrade over FTP
WiFly mod le 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 identifyied.
FL# IZ FLAG
11 18 3 WiFly_G X-2.05
29 1 10 config
190 Free, Boot=11, Backup=0
M ltiple firmware images and config files can be stored in the mod le filesystem.
FTP Upload and Upgrade
WiFly contains a b ilt in FTP client for getting files and pdating the firmware. The client ses
passive mode FTP, which allows operation thr firewalls and the Internet.
To pload the latest released firmware from Roving Networks the following setting are req ired:
FTP sername = roving
FTP password = Pass123
FTP filename = wifly-G X.img
FTP directory = ./public (this parameter can not be modified)
To se FTP to pgrade the firmware, enter the following command:
ftp uploa <string> (string is an optional filename, se to bypass the stored FTP filename)
The ftp pload command will retrieve the file and switch the boot image to the new file. The
previo s firmware will become the back p image. Here is an example of what yo sho ld see
after a s ccessf l pdate:
FL# IZ FLAG
11 18 3 WiFly_G X-2.05
29 1 10 config
30 18 3 WiFly_G X-2.06
208 Free, Boot=30, Backup=11
Note the mod le m st be rebooted or power cycled to se the new firmware. To boot a different
firmware se the following command:
Boot image <num> sets the c rrent boot image <n m>
To pload yo r own firmware or config file to the mod le, change the stored FTP settings: See
section 5.3 for more details on these commands and get yo r file by entering the following
command:
ftp get <string> Retrieves remote file with name <string>

RN-131G
rn-131-um.pdf 5/14/2009
www.rovingnetworks.com
s pport@rovingnetworks.com
Phone 408-395-6539
- 20 -
11 etting Adhoc Mode and Restoring Configuration ettings
Adhoc mode
PIO(9) is sed to p t the mod le into adhoc mode and reset the config ration setting to the original
factory defa lts.
For adhoc mode PIO9 sho ld be set high (3.3V) at power p time. On the RN-134 PIO9 is on the
j mper block. When the mod le powers p in adhoc mode the WiFly mod le creates an adhoc
network with the following
SSID: WiFly-GSX
IP address: 169.254.1.1
Associate with the WiFly-GSX network by going into the “Control Panel / Networking and Sharing /
Networking and Sharing Center” dialog in Vista or “Control Panel / Network Connections” dialog in
Windows XP. From here, view available networks and select the WiFly-GSX network.
Note: Once associatd with the WiFly-GSX network, Vista a to IP may take a co ple min tes to
allocate an IP address for yo r comp ter To work aro nd this yo can assign a static IP address.
To check the stat s of the adhoc network, ping the WiFly mod le at IP address 169.254.1.1 or open
a telnet window sing port 2000. From telnet yo can send data to the WiFly or enter command
mode and config re the mod le. For example, it is sef l to se adhoc mode to set p the SSID and
sec rity key for enterprise networking.
Note: The mod le does not s pport adhoc and enterprise network modes sim ltaneo sly.
Restoring Factory Defaults
PIO9 is also sed to restore the config ration settings to the factory defa lts. If PIO9 is set high
(3.3V) at power p time and then toggled five (5) times while the mod le remains powered on all
the config ration settings will be set back to their factory val es.
The factory defa lts are saved to the config file and the mod le m st be rebooted or power cycled
for these to take effect.
This manual suits for next models
1
Table of contents
Other Roving Networks Wireless Router manuals