User manual

WiFly GSX/EZX
www.rovingnetworks.com WiFly-RN-UM 11/9/2011
809 University Avenue Los Gatos, CA 95032 Tel (408) 395-6539 info@RovingNetworks.com
~ 43 ~
10.5.2. Controlling connections with GPIO
In embedded applications it is useful to monitor and control the status of the TCP/IP connection. This can
be done by enabling the alternate function of GPIO 4, 5 and 6.
With the alternate function for these GPIO set, the module will connect to the stored remote host IP address
and port when GPIO-5 is driven high and disconnect when driven low.
The TCP/IP connection status can be monitored by reading GPIO-6, high = connected, low = not connected.
Here is how to set the WiFly module to connect using GPIO-5 and GPIO-6
<2.21> set ip host <addr> // set the IP address of the remote host
<2.21> set ip remote <port> // set the IP port of the remote host
<2.21> set sys iofunc 0x70 // set alternate function for GPIO 4, 5 and 6
<2. 21> save // save settings in config file
<2. 21> reboot // reboot the module
On the remote host run your application or other software that opens and listens on the <port>.
Connect GPIO-5 to your embedded processor or other control signal. When GPIO-5 is driven high a
connection will be attempted. When GPI0-5 is driven low the connection will be closed.
NOTE: Do not to drive the GPIO with more than 3.3 VDC or permanent damage to the module will
occur.
If the connection to the remote host is successful GPIO-6 will go high. If the COMM OPEN and REMOTE
strings are set you should see the *OPEN* messages on the UART and the *HELLO* at the remote host.