Roving Networks reserves the right to make corrections, modifications,
and other changes to its products, documentation and services at any
time. Customers should obtain the latest relevant information before placing orders and should verify that such information is current and complete.
Roving Networks assumes no liability for applications assistance or customer’s product design. Customers are responsible for their products and
applications that use Roving Networks components. To minimize customer product risks, customers should provide adequate design and operating safeguards.
Roving Networks, Inc.
102 Cooper Court
Los Gatos, CA 95032
+1 (408) 395-5300
www.rovingnetworks.com
www.rovingnetworks.comVersion 1.2r 4/30/13page 2
Roving Networks products are not authorized for use in safety-critical
applications (such as life support) where a failure of the Roving Networks
product would reasonably be expected to cause severe personal injury or
death, unless officers of the parties have executed an agreement specifically governing such use.
Appendix B. Boot-Up Timing Values
Appendix C. Supported Access Points
Appendix D. Command Quick Reference Guide
Appendix E. Known Problems
Appendix F. Current Firmware Features & Fixes
F.1 VERSION 4.00.1 4/19/2013 ....................................................................... 111
F.2 VERSION 4.0 3/27/13 ................................................................................ 111
F.3 Version 2.36/2.45 9/14/2012 ...................................................................... 112
F.4 Version 2.30 10/26/2011 ............................................................................ 112
F.5 Version 2.27 09/08/11 ................................................................................ 113
F.6 Version 2.23 04/03/2011 ............................................................................ 113
F.7 Version 2.21 07/11/2010 ............................................................................ 114
F.8 Version 2.20 06/14/2010 ........................................................................... 114
RN-WIFLYCR-UG
Appendix G. Document Information
RN-WIFLYCR-UG
Chapter 1. Introduction
1.1OVERVIEW
The Roving Networks WiFly radio module is a complete, standalone embedded wireless LAN access device. The device has an on-board TCP/IP stack and applications,
and in the simplest hardware configuration requires only four pins (power, TX, RX, and
ground). Once you have performed the initial configuration, the device automatically
accesses a Wi-Fi network and sends/receives serial data.
This user manual is applicable to standalone RN131 and RN171 modules, as well as
Roving Networks products based on these modules. For example, the RN171XV
device incorporates the RN171 module; therefore, all RN171 hardware features apply
to the RN171XV. Although there are some differences, the RN131 and RN171 modules
support the same ASCII command set. Table 1-1 compares the RN131 and RN171
module features.
TABLE 1-1:COMPARING THE RN131 & RN171
FeatureRN131RN171
Output power (P
Lowest power18 dBm0 dBm (< 100 mA Tx current)
On-board antennaYesNo
Accurate sleep timer Yes (32 kHz)No (+/- 10% error)
GPIO pins available10, GPIO4 – 13 (GPIO1 – 3 are not available for use) 14, GPIO1 – 14
) 18 dBm (fixed)12 dBm (programmable)
MAX
Refer to the RN131 and the RN171 data sheets on the Roving Networks website at
http://www.rovingnetworks.com for more details on their hardware differences and for
- Real-time clock for wakeup and time stamping/data logging; auto-sleep and
auto-wakeup modes
• Network support:
- Supports Soft Access Point (AP), ad hoc, and infrastructure networking
modes
- Push-button WPS mode for easy network configuration
- On-board TCP/IP stack
- Over the air firmware upgrade (FTP)
- Secure Wi-Fi authentication via WEP, WPA-PSK (TKIP), and WPA2-PSK
(AES)
- Configuration over UART or wireless interfaces using simple ASCII commands
- Built in networking applications: DHCP client, DNS client, ARP, ICMP ping,
FTP client, TELNET, HTTP, UDP, and TCP
1.2CONFIGURATION
RN-WIFLYCR-UG
The WiFly module has two modes of operation: data mode and command mode. In
data mode, the module can accept incoming connections or initiate outgoing connections. To configure parameters and/or view the current configuration, you must put the
module into command mode (also called configuration mode).
1.2.1Entering Command Mode
By default, the module is in data mode after power up. Sending the escape sequence
$$$ causes the module to enter command mode. You must send $$$ together quickly
with no additional characters before or after. You must not send a carriage return (<cr>)
or line feed after the $$$ to enter command mode. The module replies with CMD to indicate it is in command mode. Once in command mode, you can configure the WiFly
device using simple ASCII commands; each command ends with a carriage return
<cr>. Most valid commands return AOK; invalid ones return an ERR description. To exit
command mode, send exit <cr>. The module responds with EXIT, indicating that it has
exited command mode and entered data mode.
Note:There is a 250-ms time buffer before and after the $$$ escape sequence.
If characters are sent before or after the escape sequence within this 250ms interval, the WiFly module treats them as data and passes them over
the TCP or UDP socket, and the module will not enter command mode.
You can view various parameters, such as the SSID, channel, IP address, serial port,
and other settings, and configure them in command mode. You send commands to the
module through the UART or via remotely via telnet. When using the UART interface,
the communications settings should match the WiFly module’s stored settings. The
www.rovingnetworks.comVersion 1.2r 4/30/13page 6
RN-WIFLYCR-UG
default is 9,600 baud, 8 bits, no parity, 1 stop bit, and hardware flow control disabled.
You can enter command mode locally over the UART interface at any time irrespective
of an active TCP connection.
Note:Roving Networks suggests using either the TeraTerm (Windows OS) or
CoolTerm (Mac OS-X) terminal emulator program.
When the WiFly module powers up, it attempts to auto-associate with the access point
stored in its configuration settings if the auto join feature is enabled. In firmware
version 4.0 and higher, the auto join feature is disabled by default. Enable it using the
ASCII command set wlan join 1.
You can disable the auto-associate feature (default behavior) using the set wlan join 0
command. This command prevents the WiFly module from attempting to associate with
a network that does not exist.
1.2.2Remote Configuration Using Ad Hoc Mode
NOTICE
Firmware version 4.0 and higher does not support ad hoc mode (these versio ns support soft AP mode). If ad hoc mode is required, use firmware version 2.38.3.
Using ad hoc mode to configure the device eliminates the need for the module to be
associated with a network access point. In ad hoc mode, the module creates it’s own
“on demand” network to which you can connect via your computer as you would with
any other network.
To enable ad hoc mode using hardware, set GPIO9 high (3.3 V) at power up. For the
RN134 board, GPIO9 is on pin 1 on the jumper block (J2). For the RN174 board,
GPIO9 is on the J6 connector. Upon power up with GPIO9 high, the WiFly module creates an ad hoc network with the following settings:
SSID:WiFly-GSX-XX, where XX is the final two bytes of the devices MAC
address
Channel:1
DHCP:Off
IP address:169.254.1.1
Netmask:255.255.0.0
With the ad hoc jumper in place, these settings override any saved configuration settings.
From your computer, connect to the WiFly-GSX-XX network. This open network does
not require a pass phrase or pass key. Currently the WiFly module only supports OPEN
mode for creating ad hoc networks.
www.rovingnetworks.comVersion 1.2r 4/30/13page 7
RN-WIFLYCR-UG
It may take a few minutes for Windows to assign an IP address and connect to the network. You can check your computer’s IP address by running the ipconfig command in
the Command Window. If connected, this command displays your computer’s IP
address and netmask.
Note:The automatically assigned IP address must be on the 169.254.x.y subnet,
otherwise the WiFly module will not be accessible. If your computer has
both wireless and wired interface hardware, you may need to disable the
wired LAN interface hardware before connecting to the ad hoc network. If
the wired LAN is enabled, the computer may assign an IP address that is
not on the same subnet as the WiFly module.
Once connected with an appropriate IP address, telnet into the WiFly module on port
2000 using the following command:
telnet 169.254.1.1 2000
The module issues the response *HELLO*. You can now enter command mode using
the escape sequence $$$ and configure the module.
In firmware versions 2.28 and higher, you can disable remote configuration, e.g., for
security. To disable remote configuration, use bit 4 in the TCP mode register by issuing
the command:
set ip tcp-mode 0x10
www.rovingnetworks.comVersion 1.2r 4/30/13page 8
Chapter 2. Command Reference
Roving Networks WiFly modules support a variety of commands for configuration. This
section describes these commands in detail and provides examples.
2.1COMMAND SYNTAX
To issue commands to the module, you send a keyword followed by optional parameters. Commands are case sensitive, and you cannot use spaces in parameters. Use a
$ to indicate a space, e.g., MY NETWORK should be written as MY$NETWORK. Hex
input data can be uppercase or lowercase. String text data, such as the SSID, is case
sensitive.
You can use shorthand for the parameters. For example, the following commands are
equivalent:
• set uart baudrate 115200
• set uart b 115200
• set u b 15200
Note:You cannot use shorthand for command keywords. For example, s uart
baudrate 115200 is illegal.
RN-WIFLYCR-UG
You can type numbers in decimal (e.g., 115200) or hexadecimal. To enter a number in
hex, use 0x<value>. For example, the hex value FF would be entered as 0xFF.
2.2COMMAND ORGANIZATION
There are five general command categories, as shown in Table 2-1.
TABLE 2-1:COMMAND TYPES
Command TypeDescription
Set commandsSet commands take effect immediately and are stored to memory when the save command
is issued.
Get commandsThese commands retrieve the stored information and display it.
Status commandsThese commands display the interface status, IP status, etc.
Action commandsUse these commands to perform actions such as scanning, connecting, disconnecting, etc.
File I/O commandsUse these commands to upgrade, load and save configuration, delete files, etc.
Note:You must save any changes you make using the save command or the
module will load the previous settings upon reboot or power up.
When the system boots, all configuration data is loaded into RAM variables from the
configuration file. The set commands only modify the RAM copy of the system variables. In general, the IP, WLAN, and UART settings require you to save and reboot
before they take effect because they operate upon power up. For example, you only
associate, set the channel, and obtain an IP address once at power up. Most of the
other commands, e.g., COMM settings and timers, take effect immediately, allowing
you to change parameters on the fly, minimizing power usage, and saving flash re-write
cycles.
www.rovingnetworks.comVersion 1.2r 4/30/13page 9
Once configuration is complete, you must save the settings to store the configuration
data, otherwise it will not take effect upon reboot or reset. You can store multiple con-
figurations using the save <filename> command, and you can load them using the load
<filename> command.
2.3SET COMMANDS
These commands begin with the set keyword and include the categories shown in
Ta bl e 2 -2 .
TABLE 2-2:SET COMMANDS
ParameterDescription
adhocControls the ad hoc parameters.
broadcastControls the broadcast hello/heartbeat UDP message.
commSets the communication and data transfer, timers, and matching charac-
dnsSets the DNS host and domain.
ftpSets the FTP host address and login information.
ipSpecifies the IP settings.
optionSupports optional and infrequently used parameters.
sysSets system settings such as sleep and wake timers.
timeSets the timer server settings.
uartSpecifies the serial port settings such as baud rate and parity.
wlanSets the wireless interface settings, such as SSID, channel, and security
RN-WIFLYCR-UG
ters.
options.
2.3.1set adhoc beacon <value>
This command sets the ad hoc beacon interval in milliseconds, where <value> is a dec-
imal number from 0 to 65,436.
Note:This command applies only to firmware versions supporting adhoc net-
working mode. WiFly firmware versions 4.0 and higher do not support
adhoc networking mode.
Default:102
Example: set adhoc beacon 120// Beacons are sent every 120 ms
2.3.2set adhoc probe <value>
This command sets the ad hoc probe timeout in seconds, where <value> is the number
of seconds. The probe timeout is the number of seconds the module waits for probe
responses before declaring, “ADHOC is lost,” and disabling the network interface.
Note:This command applies only to firmware versions supporting adhoc net-
working mode. WiFly firmware versions 4.0 and higher do not support
adhoc networking mode.
Default:5
Example: set adhoc probe 80// Sets the ad hoc probe timeout to 80 s
www.rovingnetworks.comVersion 1.2r 4/30/13page 10
RN-WIFLYCR-UG
2.3.3set adhoc reboot <value>
This command sets the reboot timer to reboot the module periodically every <value>
seconds.
Note 1:<value> must be greater than 60 secs. To enable the automatic reboot
feature, the reboot timer must be used in conjunction with the debug register (set system debug 0x80).
2:This command applies only to firmware versions supporting adhoc net-
working mode. WiFly firmware versions 4.0 and higher do not support
adhoc networking mode.
Default:0
Example: set adhoc reboot 600// Sets the reboot timer to 600 seconds
2.3.4set broadcast address <address>
This command sets the primary address to which the UDP hello/heartbeat message is
sent, where <address> is an IP address in the form <value>.<value>.<value>.<value>
with <value> being a number between 0 and 255.
Default:255.255.255.255
Example: set broadcast address 192.168.1.50
// Sets the broadcast address to
// 192.168.1.50
2.3.5set broadcast backup <address>
This command sets the secondary address to which the UDP hello/heartbeat message
is sent, where <address> is an IP address in the form
<value>.<value>.<value>.<value> with <value> being a number between 0 and 255.
The secondary broadcast is also a UDP packet sent after the primary broadcast and is
of 120 bytes. The secondary broadcast contains the primary broadcast (110 bytes) plus
the module’s MAC address (6 bytes) and IP address (4 bytes), for a total of 120 bytes.
Default:0.0.0.0
Example: set broadcast backup 192.168.1.5
// Sets the broadcast address to
// 192.168.1.5
2.3.6set broadcast interval <mask>
This command sets the interval at which the hello/heartbeat UDP message is sent and
is specified in seconds. The value is a mask that is ANDed with a free running seconds
counter; if the result is all 0s, a packet is sent. For example:
• If the interval is 0x1, the module sends one packet every 2 seconds.
• If the interval is 0x2. The module sends two packets every 4 seconds.
• If the interval is 0x3, the module sends one packet every 4 seconds.
• If the interval is 0x6, the module sends two packets every 8 seconds.
• If the interval is 0x7, the module sends one packet every 8 seconds.
www.rovingnetworks.comVersion 1.2r 4/30/13page 11
RN-WIFLYCR-UG
The minimum interval value is 1 (every 2 seconds) and the maximum value is 0xff
(every 256 seconds). Setting the interval value to zero disables UDP broadcast messages.
Default:7
Example: set broadcast interval 6// Sets the heartbeat UDP message
// interval to 6 seconds
2.3.7set broadcast port <value>
This commands sets the port to which the UDP hello/heartbeat message is sent, where
<value> represents the port number.
Default:55555
Example: set broadcast port 55555// Sets the port to which the UDP heart
// beat is sent to 55555
2.3.8set broadcast remote <value>
This commands sets the port to which the backup UDP hello/heartbeat message is
sent, where <value> represents the port number.
Default:0
Example: set broadcast port 4444// Sets the port to 44444
2.3.9set comm $ <char>
This command sets character used to enter command mode to <char>. You typically
use this setting when $$$ (the default string used to enter command mode) is a possi-
ble data string. You must carefully note the new character. After you save this setting,
upon every subsequent reboot the module ignores $$$ and looks for
<char><char><char> to enter command mode.
Default:$
Example: set comm $ w// Sets the string to enter command mode
// to www
2.3.10set comm close <string>
This command sets the ASCII string that is sent to the local UART when the TCP port
is closed, where <string> is one or more characters up to a maximum of 32 (32 bytes).
If you do not wish to use a string, use a zero (0) as the <string> parameter.
Default:*CLOS*
Example: set comm close *port closed*// Set the string to *port closed*
2.3.11set comm open <string>
This command sets the ASCII string that is sent to the local UART when the TCP port
is opened, where <string> is one or more characters up to a maximum of 32 (32 bytes).
If you do not wish to use a string, use a zero (0) as the <string> parameter.
Default:*OPEN*
Example: set comm open *port open*// Set the string to *port open*
www.rovingnetworks.comVersion 1.2r 4/30/13page 12
RN-WIFLYCR-UG
2.3.12set comm remote <string>
This command sets the ASCII string that is sent to the remote TCP client when the TCP
port is opened, where <string> is one or more characters up to a maximum of 32 (32
bytes). If you do not wish to use a string, use a zero (0) as the <string> parameter.
Default:*HELLO*
Example: set comm remote *welcome*// Set the string to *welcome*
2.3.13set comm idle <value>
This command sets the idle timer value, where <value> is a decimal number represent-
ing the number of seconds. The idle timer value is the number of seconds during which
no data is transmitted or received over TCP before the connection is closed automatically. Setting the timer to 0 (the default) means the module never disconnects when
idle.
Default:0
Example: set comm idle 25// Set the idle timer value to 25 s
2.3.14set comm match <value> | <hex>
This command sets the match character, where <value> is a decimal number from 0 to
127 or a hex number from 0 to 7F. When this configuration option is set, the module
sends an IP packet each time the match character appears in the data. You enter
<value> either as the decimal (e.g., 13) or hex (e.g., 0xd) equivalent of the of the ASCII
character. Setting the match character to 0 disables matching.
A match character is one of three available methods you can use to control TCP/IP
packet forwarding. The other methods are set comm size and set comm time. For
more information refer to ““UART Receiver & RTS/CTS Hardware Flow Control” on
page 60.
Default:0
Example: set comm match 1// Set the match character to a carriage
// return
2.3.15set comm size <value>
This commands sets the flush size in bytes, where <value> is a decimal number from
0 to 1,420 (at 9600 baud). When this configuration option is set, the module sends an
IP packet each time <value> bytes are received. Roving Networks recommends that
you set this value as large as possible to maximize TCP/IP performance.
Flush size is one of three available methods you use to control TCP/IP packet forwarding. The other methods are set comm match and set comm time. For more information refer to “UART Receiver & RTS/CTS Hardware Flow Control” on page 60.
Default:1420
Example: set comm size 1420// Set the flush size to 1,420 bytes
2.3.16set comm time <value>
This command sets the flush timer, where <value> is a decimal number representing
milliseconds. When this configuration option is set, the module sends an IP packet if no
additional bytes are received for <value> ms. Setting this value to 0 disables forwarding
based on the flush timer.
www.rovingnetworks.comVersion 1.2r 4/30/13page 13
RN-WIFLYCR-UG
The flush timer is one of three available methods you can use to control TCP/IP packet
forwarding. The others are set comm match and set comm size. For more information refer to “UART Receiver & RTS/CTS Hardware Flow Control” on page 60.
Default:5
Example: set comm time 20// Set the flush timer to 20 ms
2.3.17set dhcp lease <value>
This command sets the soft AP mode DHCP lease time to <value>, where <value> is
the number of seconds. The module uses this value when offering the DHCP lease to
each client associating with the module in soft AP mode.
Default:86400
Example: set dhcp lease 2000// Sets the DHCP lease to 2,000 seconds
2.3.18set dns address <address>
This command sets the IP address of the DNS sever, where <address> is an IP
address in the form <value>.<value>.<value>.<value> with <value> being a number
between 0 and 255. This address is automatically set when using DHCP; you must set
the DNS IP address for static IP or automatic IP modes.
Default:0.0.0.0
Example: set dns address 169.64.1.1// Set the DNS server address to
// 169.64.1.1
2.3.19set dns name <string>
This command sets the name of the host for TCP/IP connections to <string>, where
<string> is up to 32 characters (32 bytes).
Default:server1
Example: set dns name roving1// Set the DNS host name to roving1
2.3.20set dns backup <string>
This command sets the name of the backup host for TCP/IP connections to <string>,
where <string> is up to 32 characters (32 bytes). The FTP client uses the backup string
to download the firmware via the ft p update command.
Default:rn.microchip.com
Example: set dns backup roving2// Set the DNS host name to roving2
2.3.21set ftp addr <address>
This command sets the FTP server’s IP address of the FTP server, where <address>
is an IP address in the form <value>.<value>.<value>.<value> with <value> being a
number between 0 and 255.
Default:0.0.0.0
Example: set ftp addr 66.35.227.3// Set the FTP server to 66.35.227.3
www.rovingnetworks.comVersion 1.2r 4/30/13page 14
RN-WIFLYCR-UG
2.3.22set ftp dir <string>
This command sets the starting directory on the FTP server, where <string> is up to 32
characters. To read/write to subfolders, use the \ character. To indicate the root directory, use a period.
Default:public
Example: set ftp dir demo// Set FTP server starting directory to
// demo
set ftp dir demo\test// Set FTP server starting directory to
// demo\test
set ftp dir .// Set FTP server starting directory to the
// root directory
2.3.23set ftp filename <filename>
This command sets the name of the file that is transferred when issuing the ftp u com-
mand, where <filename> is the firmware image. If you specify any file other than the
firmware image, the WiFly module downloads the file and issues the UPDATE FAIL=3
error.
Example: set ftp filename my_data// Sets the firmware image to be retrieved
// via FTP as my_data
2.3.24set ftp mode <mask>
This command sets the ftp mode, where <mask> indicates active or passive mode.
Default: 0x0
Example: set ftp mode 0x1 // Enables active FTP mode
2.3.25set ftp remote <value>
This command sets the FTP server’s remote port number, where <value> is the port
number.
Default:21
Example: set ftp remote 25// Sets the FTP server’s remote port to 25
2.3.26set ftp time <value>
The command sets the FTP timeout value, where <value> is a decimal number that is
five times the number of seconds required. The module uses this timer to close the FTP
connection automatically after the specified time.
Default:200
Example: set ftp timer 40// Sets a 5-second timer
set ftp timer 80// Sets a 10-second timer
www.rovingnetworks.comVersion 1.2r 4/30/13page 15
RN-WIFLYCR-UG
2.3.27set ftp user <string>
This command sets the user name for accessing the FTP server, where <string> is up
to 16 characters (16 bytes).
Default:roving
Example: set ftp user my_username// Sets the user name to my_username
2.3.28set ftp pass <string>
This command sets the password for accessing the FTP server, where <string> is up
to 16 characters (16 bytes).
Default:Pass123
Example: set ftp user my_password// Sets the user name to my_password
2.3.29set ip address <address>
This command sets the WiFly module’s IP address, where <address> is an IP address
in the form <value>.<value>.<value>.<value> with <value> being a number between 0
and 255. If DHCP is turned on, the IP address is assigned and overwritten when the
module associates with an access point. IP addresses are “.” delimited.
Default:0.0.0.0
Example: set ip a 10.20.20.1// Sets the WiFly module’s IP address to
// 10.20.20.1
2.3.30set ip backup <address>
This command sets a secondary host IP address, where <address> is an IP address
in the form <value>.<value>.<value>.<value> with <value> being a number between 0
and 255. If the primary host IP is unreachable, the module attempts to reach the secondary IP address (if set).
Default:0.0.0.0
Example: set ip a 10.20.20.2// Sets the WiFly module’s secondary IP
// address to 10.20.20.2
2.3.31set ip dhcp <value>
This command enables/disables DHCP mode, where <value> is a decimal number
shown in Ta bl e 2 -3 . If you set this parameter, the module requests and sets the IP
address, gateway, netmask, and DNS server upon association with an access point.
Any previously set IP information is overwritten.
TABLE 2-3:DHCP MODES
ModeProtocol
0Turns DHCP off. The module uses its stored static IP address.
1Turns DHCP on. The module attempts to obtain an IP address and gateway from the
access point.
2Enables automatic IP, which is generally used with ad hoc networks.
3Turns on DHCP cache mode. The module uses a previously set IP address if the
lease is not expired (or the lease survives reboot).
4Enables DHCP server in soft AP mode.
www.rovingnetworks.comVersion 1.2r 4/30/13page 16
RN-WIFLYCR-UG
Using DHCP cache mode can reduce the time the module requires to wake from deep
sleep, which saves power. The module checks the lease time; if it is not expired, the
module uses the previous IP settings. If the lease has expired, the module attempts to
associate and uses DHCP to obtain the IP settings. The DHCP cached IP address does
not survive a power cycle or reset.
Default:1
Example: set ip dhcp 0// Turns DHCP off
2.3.32set ip flags <mask>
This commands sets the TCP/IP functions, where <mask> is a hex number referring to
a bit-mapped register. See Figure 2-1.
FIGURE 2-1:SET IP FLAGS COMMAND BIT-MAPPED REGISTER
12345670
TCP connection status. See Notes (1), (2).
Bypass Nagle algorithm and use TCP_NODELAY.
TCP retry enabled (for a total of 96 packet retries).
UDP RETRY (attempts retry if no ACK from UDP).
DNS host address caching enabled.
ARP table caching enabled.
UDP auto pairing enabled.
Add 8-byte timestamp to UDP or TCP packets.
Note 1:If the module loses the link to an associated access point while a TCP con-
nection is active, the TCP connection may hang or be in an inconsistent
state. In some cases, the TCP connection will not recover. In firmware version 2.20 and higher, if the module regains the link to the access point
within 60 seconds, the TCP connection will survive.
2:In firmware prior to version 2.20, bit 0 specified the TCP copy function.
If bit 0 is set (the default), TCP connections are kept open when the connection to the
access point is lost.
If bit 0 is cleared (e.g., by sending set ip flags 0x6), if the module loses the access
point connection while TCP is connected, the connection is closed.
Default:0x7
Example: set ip flags 0x6// Clear bit 0
2.3.33set ip gateway <address>
This command sets the gateway IP address, where <address> is an IP address in the
form <value>.<value>.<value>.<value> with <value> being a number between 0 and
255. If DHCP is turned on, the gateway IP address is assigned and overwritten when
the module associates with the access point.
Default:0.0.0.0
Example: set ip gateway 169.254.1.1// Sets the IP gateway to 169.254.1.1
www.rovingnetworks.comVersion 1.2r 4/30/13page 17
RN-WIFLYCR-UG
2.3.34set ip host <address>
This command sets the remote host’s IP address, where <address> is an IP address
in the form <value>.<value>.<value>.<value> with <value> being a number between 0
and 255. You use this command to make connections from the WiFly module to a TCP/
IP server with the IP address <address>.
Default:0.0.0.0
Example: set ip host 137.57.1.1// Sets the remote host’s IP address to
// 137.57.1.1
2.3.35set ip localport <value>
This command sets the local port number, where <value> is a decimal number repre-
senting the port.
Default:2000
Example: set ip localport 1025// Sets the local port to 1025
2.3.36set ip netmask <address>
This command sets the network mask, where <address> is an IP address in the form
<value>.<value>.<value>.<value> with <value> being a number between 0 and 255. If
DHCP is turned on, the netmask is assigned and overwritten when the module associates with the access point.
Default:255.255.255.0
Example: set ip netmask 255.255.0.0// Sets the netmask to 255.255.0.0
2.3.37set ip protocol <flag>
This command sets the IP protocol, where <flag> is a bit-mapped register as shown in
Figure 2-2. To be able to connect to the WiFly module over TCP/IP (for example using
telnet), you must set bit 2 of the IP protocol register. For the module to accept both TCP
and UDP set bits 1 and 2 (value = 3).
FIGURE 2-2:SET IP PROTOCOL COMMAND BIT-MAPPED REGISTER
12340
UDP.
TCP server and client (default).
Secure mode (only receive packets form an IP address that matches the stored host IP).
TCP client only.
HTTP client mode.
Default:2
Example: set ip protocol 18 // enables TCP and HTTP client mode
2.3.38set ip remote <value>
This command sets the remote host port number, where <value> is a decimal number
representing the port.
Default:2000
Example: set ip remote 1025// Sets the remote host port to 1025
www.rovingnetworks.comVersion 1.2r 4/30/13page 18
RN-WIFLYCR-UG
12340
Shorten the TCP connect timer (use with bit 1).
Shorten the TCP connect timer (use with bit 0).
Forces the module to use DNS rst to resolve the IP address, even if the host IP is set.
Reserved.
Disables remote conguration for security purposes.
2.3.39set ip tcp-mode <mask>
This command controls the TCP connect timers, DNS preferences, and remote config-
uration options. <mask> is a hex number referring to a bit-mapped register as shown
in Figure 2-3.
Note:The TCPMODE register is available in firmware version 2.27 and higher.
FIGURE 2-3:SET IP TCP-MODE COMMAND BIT-MAPPED REGISTER
Default:0x0
Example: set ip tcp-mode 0x4// Forces the module to use DNS
set ip tcp-mode 0x10 // Disables remote configuration
2.3.40set opt jointmr <value>
This command sets the join timer, which is the length of time (in ms) the join function
waits for the access point to complete the association process. <value> is a decimal
number representing the number of ms. This timer is also used as the timeout for the
WPA handshaking process.
Default:1000
Example set opt jointmr 1050// Sets the join timer to 1,050 ms
2.3.41set opt format <flag>
The command sets the HTTP client/web server information, where <flag> is a bit-
mapped register as shown in Figure 2-4. See “Using the HTML Client Feature” on
page 77 for more details.
FIGURE 2-4:SET OPT FORMAT COMMAND BIT-MAPPED REGISTER
12340
Automatically send an HTML header-based broadcast interval.
Send users binary data (converted to ASCII hex).
Sample the GPIO and ADC pins and format to ASCII hex.
Appends &id=<value>, where <value> is the device ID string that was set using set opt device <string>.
Appends the following key/value pairs to the HTTP message: &rtc=<time>, &mac=<address>,
&bss=<access point address>, &bat=<battery voltage>, &io=<GPIO in hex>, &wake=<wake reason>,
&seq=<sequence value>, where <time> is the realtime clock value in the message as a 32-bit hex value in
format aabbccddee and <sequence value> is a rolling counter of how many web posts have been sent.
Default:0x00
Example: set opt format 0x7// Module sends sensor values
www.rovingnetworks.comVersion 1.2r 4/30/13page 19
RN-WIFLYCR-UG
2.3.42set opt replace <value>
This command sets the replacement character used to indicate spaces in the SSID and
pass phrases string, where <value> is the ASCII value of the character. Each occur-
rence of the replacement character is changed into a space. Only the WiFly command
parser uses this replacement character.
For example, to change the replace character to %, use the set opt replace 0x25 command (the ASCII value of % is 0x25).
Default:0x24
Example: set opt replace 0x25// Sets the replacement character to %
2.3.43set opt deviceid <string>
This command sets the configurable device ID, where <string> is up to 32 bytes long.
You can use <string> for serial numbers, a product name, or to show other device infor-
mation. The module sends the device ID as part of the UDP broadcast hello packet.
You can view the device ID’s current value with the get option or show deviceid com-
mands.
Default:WiFly-GSX
Example: set opt deviceid my_wifly// Sets the device ID to my_wifly
2.3.44set opt password <string>
This command sets the TCP connection password, where <string> is up to 32 bytes
long. This setting provides minimal authentication by requiring any remote device that
connects to the module to send and match the challenge <string>. When a connection
is opened, the module sends the string PASS? to the remote host. The remote host
must reply with the exact characters that match the stored password in one TCP
packet; otherwise, the module closes the connection. To disable the password feature,
use 0 (the default).
Default:“” (no password required)
Example: set opt password my_password
// Sets the TCP connection password to
// my_password
2.3.45set opt average <value>
This command sets the number of RSSI samples used to calculate the running RSSI
average for the set opt signal command.
Default:5
Example: set opt average 10// Sets the average to 10 RSSI readings
2.3.46set opt signal <value>
This command allows you to configure the threshold level for the RSSI value in infra-
structure mode. If the signal strength (RSSI) falls below <value> dB, the module
declares AP is lost and deauthenticates itself from the network. Thereafter, the module
associates with the network based on the join policy.
This command is useful for applications in which the Wi-Fi module is in a mobile environment and frequently enters and leaves the AP’s range.
www.rovingnetworks.comVersion 1.2r 4/30/13page 20
RN-WIFLYCR-UG
The recommended range for <value> is between 50 and 80. As <value> is lowered, the
module more frequently deauthenticates itself from the AP.
Note:This command applies in infrastructure mode only. It is not applicable in soft
AP mode.
You must enable the link monitor for this feature to work.
Default:0
Example: set opt signal 70// Sets the RSSI threshold to -70 dBm. If
// the RSSI average falls below -70 dBm,
// the module deauthenticates itself.
2.3.47set q sensor <mask>
This command specifies which sensor pins to sample when sending data using the
UDP broadcast packet or the HTTP auto sample function, where <mask> is a bit-
mapped register.
Note:In versions of firmware prior to 2.23, this command is named set option
sensor.
Default:0
Example: set q sensor 0xff// Enables all sensor inputs
2.3.48set q power <value>
This register automatically turns on the sensor power, where <value> is shown in
Ta bl e 2 -4 . This parameter sets an 8-bit register with two 4-bit nibbles. If the top nibble
is set, power is applied upon power up and removed upon power down or sleep. If the
bottom nibble is set, power is applied when a sampling event occurs such as:
• UDP broadcast
• Automatic web posting of sensor data
• Power is removed immediately after sampling is complete
TABLE 2-4:SET Q POWER COMMAND SENSOR PIN VOLTAGE SETTINGS
ValueSensor Pin Voltage
0Turn off the sensor power.
1Ground the sensor pin.
21.2-V internal regulated reference.
3VBATT input pin.
43.3-V output of on board regulator.
Default:0
Example: set q power 0x20// Sets power to 1.2 V automatically
// upon power up
set q power 0x02// Sets power to 1.2 V when a
// sampling event occurs
set q power 0x40// Sets power to 3.3 V automatically
// upon power up
www.rovingnetworks.comVersion 1.2r 4/30/13page 21
RN-WIFLYCR-UG
set q power 0x04// Sets power to 3.3 V when a
// sampling event occurs
2.3.49set sys autoconn <value>
This command sets the auto-connect timer in TCP mode, where <value> is a decimal
number from 0 to 255 as shown in Table 2-5. Setting this parameter causes the module
to connect to the stored remote host periodically as specified by <value>.
Note:To use the auto-connect timer, you must store the remote host’s IP address
and port in the WiFly module using the set ip host <address> and set ip
remote <value> commands.
TABLE 2-5:AUTO-CONNECT TIMER SETTINGS
ValueDescription
0Disable the auto-connect timer (default).
1Connect to the stored remote host IMMEDIATELY upon power up or when waking
from sleep.
2 - 254Connect to a stored remote host every <value> seconds.
255Connect to a stored host IMMEDIATELY upon power up or when waking from
sleep and go back to sleep IMMEDIATELY as soon as the TCP connection closes.
Default:0
Example: set sys autoconn 5// Module connects to host every 5 sec.
2.3.50set sys iofunc <mask>
This command sets the I/O port alternate functions, where <mask> is a hex number
referring to a bit-mapped register. The I/O function <mask> is encoded as shown in
Ta bl e 2 -6 .
TABLE 2-6:GPIO PIN ALTERNATE FUNCTION BITMASK
BitSignal Name DirectionFunction
0GPIO4OutputDisable the LED function so the I/O can be used as a GPIO pin.
1GPIO5OutputDisable the LED function so the I/O can be used as a GPIO pin.
2GPIO6OutputDisable the LED function so the I/O can be used as a GPIO pin.
3Unused-4GPIO4OutputThis pin goes high after the module has associated/authenticated and has an IP
address.
5GPIO5InputSet this pin high to trigger a TCP connection and low to disconnect.
6GPIO6OutputThis pin goes high when the module is connected over TCP and low when discon-
nected.
Note:Bits 0 - 3 are mutually exclusive with bits 4 – 6, i.e., 0x77 is an illegal value.
For more details see “Setting the Alternate GPIO Functions with set sys iofunc” on
page 62.
Default:0x0
Example: set sys iofunc 0x7// Disables the WiFly board LEDs
www.rovingnetworks.comVersion 1.2r 4/30/13page 22
RN-WIFLYCR-UG
set sys launch_string <string>
This command sets the name of the application (indicated by <string>) that is launched
when GPIO9 toggles from high to low after power up (e.g., by pressing the FN button
on evaluation kits). You use this mechanism to invoke valid applications as shown in
Ta bl e 2 -7 .
TABLE 2-7:VALID APPLICATION STRINGS
<string>Description
web_appLaunches the configuration web server.
wps_appLaunches the WPS application.
Note:Do not set <string> to the configuration filename or the boot firmware
image. Otherwise, the module configuration may become corrupted and
the module will reboot.
Setting the <string> to an invalid string such as test results in the following error mes-
sage when GPIO9 is toggled:
*test not Found*
Note:Disable this error message by setting the print level to zero using the set
sys print 0 command.
Default:web_app
Example: set sys launch_string wps_app // Sets the launch application to WPS
2.3.51set sys mask <mask>
This command sets the I/O port direction, where <mask> is a hex number referring to
a bit-mapped register. Figure 2-5 shows the bits corresponding to the GPIO pins and
Ta bl e 2 -8 shows the GPIO pin usage, their default state, and functionality.
FIGURE 2-5:GPIO PIN BITMASK
14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
GPIO14
GPIO13 UART RTS
GPIO12 UART CTS
GPIO11 UART RX
GPIO10 UART TX
GPIO9
GPIO8
GPIO3
GPIO4
GPIO5
GPIO6
GPIO7
GPIO0
GPIO1
GPIO2
www.rovingnetworks.comVersion 1.2r 4/30/13page 23
RN-WIFLYCR-UG
TABLE 2-8:GPIO PIN USAGE, DEFAULT STATE & FUNCTIONALITY
Bit
Signal
Name
0GPIO0N/AN/A1GPIO1N/AInputUnused.
2GPIO2N/AInputUnused.
3GPIO3N/AInputUnused.
4GPIO4OutputOutputGreen LED.
5GPIO5OutputOutputYellow LED.
6GPIO6OutputOutputRed LED.
7GPIO7OutputOutputBlue LED.
8GPIO8InputOutputUnused.
9GPIO9InputInputAd hoc mode and factory reset.
10GPIO10OutputOutputUART TX.
11GPIO11InputInputUART RX.
12GPIO12InputInputThrottles the transmitter if hardware flow control is enabled.
13GPIO13OutputOutputThis pin goes high on power up and goes low when the system is
14GPIO14N/AInput-
RN-131
Default State
RN-171
Default State
Default Function
Driving this pin low enables transmitter; driving this pin high disables it.
ready. If hardware flow control is enabled, this pin toggles to high
to indicate the RX buffer is full.
Note:On the Wi-Fi serial adapter (RN-370) and the RN-174 evaluation board, the
blue LED is connected to GPIO7. The blue LED is NOT connected to
GPIO7 on the RN-134 board. It is not possible to power off the blue LED on
the RN-134 board because it is connected directly to power.
For more details see “Setting GPIO Direction, Alternate Functions & Disabling LEDs”
on page 60.
Note:To set the GPIO pins as inputs or outputs instantly, use the set sys mask
0xABCD 1 command, which does not require a reboot.
Default:0x20F0 (for RN131)
0x21F0 (for RN171)
Example: set sys mask 0x0// Sets all pins as inputs
www.rovingnetworks.comVersion 1.2r 4/30/13page 24
RN-WIFLYCR-UG
2.3.52set sys printlvl <value>
This command controls the debug print messages printed by the WiFly module on the
UART, where <value> is one of the values shown in Ta bl e 2 -9 . Refer to “Setting Debug
Print Levels” on page 64 for more information.
TABLE 2-9:DEBUG PRINT MESSAGE SETTINGS
ValueDescription
0Quiet mode. Messages are not printed when the module wakes up or powers up.
1Print all status messages.
2Print only critical network access point connection level status, e.g., Associated! or Disconnect from
<SSID>.
4Print the DHCP and IP address status information. After you have verified the module’s configuration,
you can turn off this option so that the messages do not interfere with the data.
0x4000Change the scan format output to an MCU friendly format.
0x10Enables the UART heartbeat message. See “UART Heartbeat Messages” on page 67 for more details.
Default:0x1
Example: set sys printlvl 2// Sets the debug print messages to only
// critical network connection status
2.3.53set sys output <mask> <mask>
This command sets the output GPIO pins high or low, where <mask> is a hex number
referring to a bit-mapped register. The optional <mask> sets a subset of the pins.
Default:None
Example: To toggle GPIO8, use the following commands:
set sys mask 0x21f0 // Set GPIO8 as output
set sys output 0x0100 0x0100// Drives GPIO8 high
set sys output 0x0000 0x0100// Drives GPIO8 low
2.3.54set sys sleep <value>
This command sets the sleep timer, where <value> is a decimal number. The sleep
timer is the time (in seconds) after which the module goes to sleep. This timer is disabled during an open TCP connection. When the TCP connection is closed, the module
counts down and puts the module to sleep after <value> seconds. Setting the value to
0 disables the sleep timer, and the module will not go to sleep based on this counter.
Note:Be sure to set the wake timer before issuing the sleep timer if you are not
using an external wake up signal; otherwise, the module will never wake up.
See “System & Auto-Connect Timers” on page 57 for more details on using system tim-
ers.
Default:0
Example: set sys sleep 5// Module sleeps 5 s after TCP
// connection closes
www.rovingnetworks.comVersion 1.2r 4/30/13page 25
RN-WIFLYCR-UG
2.3.55set sys trigger <flag> or <mask>
With this parameter setting, the module wakes from sleep state using the sensor input
0, 1, 2, and 3, where <flag> is a decimal number referring to a bit-mapped register as
shown in Ta bl e 2 -1 0 and <mask> is a hex number. You use either <flag> or <mask>
with this parameter setting. This command sets the sensor input(s) to wake on (0 to 3).
Setting <flag> to 0 disables wake on sensor inputs.
Setting the trigger value to 0x20 (i.e., using <mask>) puts the module to sleep when
GPIO8 is pulled high. To enable this feature, use the set sys trigger 0x20 command.
This command makes GPIO8 an interrupt pin and puts the module to sleep as soon as
it is pulled high, regardless of the module’s state; the module goes to sleep even if it is
associating with a network or has an open, active TCP connection.
This command is useful for when the module is failing to associate with network
because it is out of range (or for any other reason), or if the module must be put to sleep
quickly.
Note:GPIO8 must be low on power up and stay low until you want to put the mod-
ule to sleep.
Default:0x41
Example: set sys trigger 0x8// Enable wake on sensor input 3
2.3.56set sys value <mask>
This command sets the default value of the GPIO pins’ outputs upon power-up, where
<mask> is a hex number representing a bit-mapped register. The GPIO pins that are
configured as outputs can be driven high or low on power-up or when the module
wakes from sleep. The default power-up states can be set ONLY for the GPIO pins that
are set as outputs. Setting the value to 1 makes the default power-up state high; setting
the value to 0 makes the default power-up state low.
www.rovingnetworks.comVersion 1.2r 4/30/13page 26
RN-WIFLYCR-UG
To configure GPIO pins as outputs, use the set sys mask <value> command.
Note:GPIO pins 4, 5, and 6 are used by the firmware to blink the status LEDs. To
set the default power up states for these GPIO pins, you must first disable
their use by the firmware using the set sys iofunc 0x7 command.
Default:0x0
Example: To configure power-up states of GPIO8 (output by default):
set sys value 0x0100// Sets GPIO8 high upon power-up
set sys value 0x0000// Sets GPIO8 low upon power-up
2.3.57set sys wake <value>
This command sets the automatic wake timer, where <value> is a decimal number rep-
resenting the number of seconds after which the module wakes from sleep. Setting
<value> to 0 disables. See “System & Auto-Connect Timers” on page 57 for more
details.
Default:0
Example: set sys wake 5// The module wakes after 5 seconds
2.3.58set time address <address>
This command sets the time server address, where <address> is an IP address in the
form <value>.<value>.<value>.<value> with <value> being a number between 0 and
255. This command applies to SNTP servers.
Default:64.90.182.55
Example: set time address 208.109.78.52
// Sets the time server address as
// 208.109.78.52
2.3.59set time port <value>
This command sets the time server port number, where <value> is a decimal number.
123, the default, is typically the SNTP server port.
Default:123
Example: set time port 1052// Sets the time server port to 1052
2.3.60set time enable <value>
This parameter tells the module how often to fetch the time from the specified SNTP
time server, where <value> is a decimal number representing minutes. The default (0)
disables time fetching. If <value> is 1, the module fetches the time only once on power
up. If <value> is greater than 1, the modules fetches the time every <value> minutes.
Default:0
Example: set time enable 5// The module fetches the time every 5
// minutes
www.rovingnetworks.comVersion 1.2r 4/30/13page 27
RN-WIFLYCR-UG
2.3.61set time raw <value>
This parameter setting allows you to set the RTC raw value from the console, where
<value> is a decimal number in seconds. The RTC ticks at 32,768 Hz.
Default: None
Example: set time raw 1// Set to 1 second
2.3.62set uart baud <value>
This command sets the UART baud rate, where <value> is 2400, 4800, 9600, 19200,
Default:9600
Example: set uart baud 19200// Sets the baud rate to 19,200 baud
2.3.63set uart flow <value>
This command sets the flow control mode and parity, where <value> is a hex number.
The setting is in the upper nibble of the hardware flow control setting. The default is
flow control disabled with parity set to none/no parity. Figure 2-6 shows the bit-mapped
register.
FIGURE 2-6:SET UART FLOW BIT-MAPPED REGISTER
12345670
00
000
Parity:
00 = None
01 = Illegal
10 = Even
11 = Odd
Flow control:
0 = Disabled
1 = Enabled
Note:Once flow control is enabled, it is important to drive the CTS pin properly
(i.e., active-low enabled). If CTS is high, the module does NOT send data
through the UART and further configuration in command mode is problematic because no response is received.
Default:0
Example: set uart flow 0x21// Even parity with flow control
set uart flow 0x20// Even parity without flow
set uart flow 0x31// Odd parity with flow control
set uart flow 0x30// Odd parity without flow control
www.rovingnetworks.comVersion 1.2r 4/30/13page 28
RN-WIFLYCR-UG
Command echo:
0 = Enabled
1 = Disabled
Data trigger:
0 = Disabled
1 = Make TCP connection upon UART RX data
12345670
00
0
Sleep on RX break signal:
0 = Disabled
1 = Enabled
UART RX data buer:
0 = When TCP connection closes, buer is ushed
1 = When TCP connection closes, buer holds data until:
- If more data is received, buer is ushed
- If no data is received and a new connection is made,
buer is transmitted
Command prompt:
0 = Version string <x.xx>
1 = Replacement character
2.3.64set uart instant <value>
This command immediately changes the baud rate, where <value> is 2400, 4800,
9600, 19200, 38400, 57600, 115200, 230400, 460800, or 921600. This command is
useful when testing baud rate settings or when switching the baud rate “on the fly” while
connected over TCP via telnet. Using this command does not affect configuration. The
module returns the AOK response, and then the module exits command mode.
Note:In firmware version 2.22 and lower, the module does NOT return an AOK
over telnet before exiting command mode.
If used in local mode, the baud rate changes and the module sends AOK using the new
baud rate. If the host switches to the new baud rate immediately, the host may see the
AOK string at the new baud rate. Depending on the baud rate, it takes at least ten times
the bit rate for the module to issue the first character.
Default:Not applicable
Example: set uart instant 19200// Sets the baud rate to 19,200 baud
2.3.65set uart mode <mask>
This command sets the UART mode register, where <mask> is a hex number masking
Default:0
Example: set uart mode 0x10// Enable the UART data buffer
2.3.66set uart raw <value>
This command sets a raw UART value, where <value> is a decimal number represent-
ing the baud rate. You use this command to set non-standard baud rates. The lowest
possible baud rate is 2,400.
www.rovingnetworks.comVersion 1.2r 4/30/13page 29
RN-WIFLYCR-UG
Using non-standard raw baud rates with hardware flow control can be more useful at
speeds as the microcontroller interfaced to the module may be able to better match the
UART speed and get better results. Ta ble 2 -12 shows the supported raw baud rates:
Default:Not applicable
Example: set uart raw 7200 // Sets the baud rate to 7,200 baud
2.3.67set uart tx <value>
This command disables or enables the UART’s TX pin (GPIO10), where <value> is 1
or 0. Disabling the pin (<value> = 0) sets GPIO10 as an input with a weak pull down.
Note:Firmware version 2.36/2.45 and higher supports parity with the set uart
flow command
Default:Not Applicable
Example: set uart tx 1// Enable the UART’s TX pin
2.3.68set wlan auth <value>
This command sets the authentication mode, where <value> is shown in Ta b le 2 - 13 .
You only need to set this parameter if you are using automatic join mode 2, i.e., the set
wlan join 2 command.
Note:During association the module interrogates the access point and automat-
ically selects the authentication mode.
The firmware supports the following security modes:
• WEP-64 and WEP-128 (open mode only, NOT shared mode)
• WPA2-PSK (AES only)
• WPA1-PSK (TKIP only)
• WPA-PSK mixed mode (some access points, not all are supported)
www.rovingnetworks.comVersion 1.2r 4/30/13page 30
Loading...
+ 92 hidden pages
You need points to download manuals.
1 point = 1 manual.
You can buy points or you can get point for every manual you upload.