User`s guide
RN-WIFLYCR-UG
www.rovingnetworks.com Version 1.2r 4/30/13 page 75
4.3 MAKING CONNECTIONS
To connect to the module, open an IP socket and connect to the module’s IP address.
You can use telnet to test the connection; type open <address> <port> in a telnet win-
dow. After the connection is open, you can type characters into the UART window and
see them on the telnet window or vise versa.
EXAMPLE 4-4: OPEN A CONNECTION
To make a connection from the module you need your server application’s IP address
and port number. A COM port redirector is a simple program you can use to test this
functionality. This software opens an IP port and transfers all data it receives to a spec-
ified COM port on your machine. A free COM port redirector program for Windows is
available from Pira at http://www.pira.cz/eng/piracom.htm.
In your COM port redirector program, note your computer’s IP address, e.g., by typing
the ipconfig command in the Microsoft Command Window. Go to your terminal emu-
lator and put the module into command mode. Type the open <address> <port> com-
mand. The server reports that the connection is open and you can type characters into
the UART window and see them on the server window or vice versa.
4.3.1 Setting Up Automatic Connections
Some applications require the module to connect to a remote server, send data, and
then disconnect automatically upon power up (or wakeup). You can configure the mod-
ule to perform this functionality automatically.
Set the network SSID and security, and set autojoin to 1. When the module wakes up
or is powered on, the auto-connect timer causes the module to attempt a connection to
the stored remote IP address and port. The sleep timer does not decrement while this
connection is open and the idle timer does not decrement while data is flowing. When
data stops for 5 seconds the connection is closed; the sleep timer puts the module in
deep sleep. The wake timer begins the cycle again one minute later.
open 10.20.20.62 2000 // Open host shown in Figure 4-4
Note: You can also use ad hoc mode (autojoin 4); however, there will be a delay
connecting to the ad hoc network from the remote computer. Therefore,
make the sleep timer large enough to allow the network to get set up and
the auto-connect to establish a TCP connection.