User manual
WiFly GSX
www.rovingnetworks.com
WiFlyGSX-um 7/16/2010
809 University Avenue • Los Gatos, CA 95032 • Tel (408) 395-6539 • info@RovingNetworks.com
~ 30 ~
NOTE. Bits 0-3 are mutually exclusive with the bits 4-6. i.e. 0x77 is an illegal value.
If the LEDs are disabled using bits 0, 1, 2 above, you can then use the show i command to read these GPIO.
<2.21> show i will return
Port=30
For example, to use the alternate functions of the LEDs, the sequence of commands would be:
set sys mask 0x2070 // set mask for GPIO 6, 5 and 4
set sys iofunc 0x70 // enable alternate function for GPIO 6, 5 and 4
save // store configuration
reboot // reboot the module
You can also use the set sys output <value> <mask> to drive GPIO output pins to HIGH or LOW.
(mask is optional, default sets all the pins ).
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 using the alternate function for GPIO-5 and GPIO-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.20> set ip host <addr> // set the IP address of the remote host
<2.20> set ip remote <port> // set the IP port of the remote host
<2.20> set sys iofunc 0x60 // set alternate function for GPIO-5 and GPIO-6
<2. 20> save
<2. 20> reboot // the module must be rebooted for the alternate settings to take effect
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 drive low the connection will be closed. Be sure to not to drive the
GPIO with more that 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.