RN-WIFLY-SRL-UM
WiFly Serial Adapter
© 2011 Roving Networks. All rights reserved.
RN-WIFLY-SRL-UM-1.0 Version 1.0 11/11/2011
USER MANUAL
RN -W IFLY-SR L-U M- 1.0
OVERVIEW
The Roving Networks Wi-Fi serial adapters supply a serial-to-Wi-Fi bridge, providing wireless connectivity to any legacy
system that supports serial communication. Connected to a remote host, the adapters transfer data read or written to the
serial interface to a remote application such as an iPhone app, data logger, or PC control console. The adapters support
Wi-Fi infrastructures or ad hoc networking, which allows you to use existing, low-cost wireless connectivity while remotely
connecting to any WiFly serial adapter in the world.
Because Apple iOS devices require an additional Bluetooth authorization co-processor for any and all devices connecting
to the iPhone, using the Wi-Fi serial adapter in ad hoc mode is a simple, cost-effective way to connect to iPhone apps. The
WiFly serial adapters are more than a cable replacement solution: by allowing TCP/IP sockets, applications can control and
monitor hundreds of Wi-Fi serial adapters remotely distributed across a building LAN or campus WAN.
The adapters also support other usage modes. For example, when configured in auto-connect mode, the WiFly serial
adapter connects to a pre-stored IP address whenever data is written to the serial port. The adapter can also be
programmed to sleep automatically when idle and wake up based on a time delay, UART RX data, or CTS signal state
change.
POWERING THE WIFLY SERIAL ADAPTER
The RN-340 and RN-370 serial adapters have different powering capabilities: the RN-340 uses a DC power source, while
the RN-370 uses either batteries or a DC power source.
Powering the RN-340 Adapter
The RN-340 adapter has a built-in voltage regulator and can be powered from a 4 to 12 V DC power source. You can also
power the RN-340 adapter using pin 9 of a DB9 connector.
Powering the RN-370 Adapter
You can power the RN-370 adapter using rechargeable batteries or the external power connector. The adapter has a red
button on it’s top, which is a soft on/off switch.
WARNING:
Do NOT use alkaline batteries when connecting the external power connector to the adapter; otherwise, the
alkaline batteries will leak and damage the serial adapter.
Turning the Adapter On & Off
To turn the adapter on, press the red button for 1 second and then release it. The green, yellow, red, and blue LEDs flash
in succession. After a moment, the blue and yellow LEDs go off and the red and green LEDs remain flashing.
To turn the adapter off, press the red button for 1 second and then release it. The green, yellow, red, and blue LEDs flash
in succession several times. Then all LEDs turn off and the device is in sleep mode.
By default, the adapter automatically shuts off if it is not connected for more than 3 minutes (i.e., 180 seconds). You can
control the sleep timer duration using the
set system sleep
<seconds> command. Use the
get sys
command to display the
sleep timer’s current settings.
www.rovingnetworks.com
2
RN -W IFLY-SR L-U M- 1.0
Batteries & Charging
If you wish to power the module using AC power, insert rechargeable NiMH batteries into the device. When using the
external power connector to charge the batteries, ensure that:
•
You install rechargeable batteries before using the charger. Do not operate the adapter using the charger without
batteries or the adapter will be permanently damaged.
You only use the charger with NiMH batteries (NOT alkaline). Attempting to charge alkaline batteries causes
battery acid to leak and destroys the adapter (and surrounding environment).
The charge rate is low enough (< 100 ma) such that the batteries can be charged indefinitely without harm.
The charger is a slow charger; it typically takes 10 hours to re-charge batteries fully from low battery.
•
•
•
You can apply external power from either the 5-V DC plug or pin 9 on the DB9 connector. The power plug is center pin
positive, outer cylinder ground. The input MUST be 5-V DC for proper battery charging. Higher voltages can permanently
damage the charger and battery.
You can view the current battery voltage in configuration mode using the
show bat
command. Note that with rechargeable
NiMh batteries the voltage remains relatively unchanged just until they go dead.
STATUS LEDS
The adapters have green, red, and blue status LEDs (see Table 1). The blue LED blinks when data is sent or received on
the serial interface; it does not indicate that the data was sent over the WiFi connection. If the blue LED is not flashing and
your device is sending data to the serial port, you likely have a connection, incorrect baud rate, or hardware flow control
(RTS/CTS) problem.
When using switch 1 to enable ad hoc mode, after power up all LEDs blink in succession from green to blue. This blinking
does not occur when you set up ad hoc mode through software.
There is an additional red LED near the power connector that indicates external power is present at either the power plug
or the DB9 connector.
Table 1. LED Indicators
State
On solid
Fast blink
Slow blink
Off
Green LED
Connected over TCP
No IP address or configuration mode
IP address OK
Not associated
Associated, no Internet
Associated, Internet OK
Rx/Tx data transfer
Red LED
Blue LED
www.rovingnetworks.com
3
RN -W IFLY-SR L-U M- 1.0
CONFIGURATION SWITCHES
The adapters have small configuration switches on the top. You need a paper clip or small screwdriver to flip them.
Holding the adapter with the DB9 connector facing to the right, refer to Figure 1 for the switch numbering and on/off
positions.
Figure 1. Switches
RN-370
On
4
3
2
1
O
O
On
RN-340
4 3 2 1
Switch 1 is used for ad hoc mode and for restoring factory defaults. With this switch turned on, the device powers up in ad
hoc mode. The ad hoc network’s SSID is Wifly-GSX-NN where
NN
is the last two digits of the adapter’s MAC address.
To restore factory defaults, power on the device with switch 1 turned on, then toggle the switch five (5) times. If the
adapter’s file system has a configuration file named
user,
the adapter reads the data in this file as the default instead of
using hardcoded defaults. If no user configuration file is present, the adapter uses the hardcoded factory defaults.
NOTE:
You create the
user
configuration file with the
save user
command, which saves the current configuration settings.
Even if a user configuration file exists, you can override it’s settings and restore the WiFly module to the factory hardcoded
defaults by arming and toggling switch 1 seven (7) times. This bypass mechanism allows you to restore the adapter to its
original settings if incorrect configuration is saved into the user file.
Switches 2 (sensor pin 2), 3 (sensor pin 3), and 4 (sensor pin 7) are currently unused.
www.rovingnetworks.com
4
RN -W IFLY-SR L-U M- 1.0
CONFIGURATION
The WiFly module operates in two modes: data mode (default) and command mode. While in data mode, the WiFly
module is essentially a data pipe. When the module receives data over a Wi-Fi, it strips the TCP/IP headers and trailers and
passes the user data to the UART. When data is written to the UART, the module constructs the TCP/IP packet and sends
it out over Wi-Fi. Thus, the entire process of sending/receiving data to the host is transparent to the end microprocessor.
See Figure 2.
Figure 2. Data & Command Modes
Host
User Data
A
B
UART
$$$
Wi-Fi
Wi-Fi
F
WiFly
Module
Wi-Fi Interface
$$$
Command
Mode
A
B
By default, the module is in data mode. Sending the escape sequence
$$$
causes the module to enter command mode.
Once in command mode, you can configure the WiFly device using simple ASCII commands. To exit command mode and
return to data mode, type
exit
<cr>.
Basic configuration only requires the wireless network access point’s name (SSID) and authentication password. The WiFly
module can only associate with one network at a time. Roving Networks recommends that you begin your evaluation by
configuring the WiFly module using an open access point to simplify the setup.
There are two ways to configure the WiFly module:
•
•
Over the UART, which is connected to a computer or microprocessor
Via Wi-Fi using ad hoc networking
You need a terminal emulator to complete the setup.
NOTE:
Roving Networks suggests using either the TeraTerm (Windows OS) or CoolTerm (Mac OS-X) terminal emulator
program.
Configuration Using the RS-232 Serial Interface
You can configure the WiFly serial adapter by using a USB-to-serial cable or by plugging it directly into your computer’s
serial port. The following instructions describe how to use a terminal emulator to go into configuration mode, send
commands to find networks, associate with an access point, and save your configuration.
www.rovingnetworks.com
5