WiFly GSX
www.rovingnetworks.com
WiFlyGSX-um 9/16/2010
809 University Avenue
•
Los Gatos, CA 95032
•
Tel (408) 395-6539
•
~ 43 ~
In the following example assume the network SSID and security have been set correctly and autojoin is set
to 1. This will also work in adhoc mode(autojoin 4), however there will be delay in connecting to the adhoc
network from the remote computer so set the sleep timer large enough to allow the network to get set up and
the autoconn establish a TCP connection.
When the module wakes up or is powered on the autoconn timer will cause the module to attempt a
connection to the stored remote IP address and port. While this connection is open the sleep timer will not
decrement. While data is flowing the idle timer will not decrement. Once data stops for 5 seconds the
connection will be closed. The sleep timer will the kick in and put the module in deep sleep. Finally the
wake timer will start the whole cycle again one minute later.
set ip host X.X.X.X
( set up the IP address of the remote machine )
set ip remote_port num
(set up the IP port of the remote machine )
set sys autoconn 1
(automatically connect out after READY )
set com idle 5
(disconnect after 5 seconds with no data activity )
set sys sleep 2
(sleep 2 seconds after connection is closed )
set sys wake 60
(wakeup after 1 minute of sleeping )
UART data TRIGGER mode.
(version 2.19) This mode will automatically make a TCP/HTTP
connection upon incoming UART data.
set uart mode 2
12.4.
Controlling Connections using PIO5 and PIO6
PIO5 can be used to control the TCP connection. Once configured with the set system IO command the
module will attempt to make a connection to the stored IP and PORT address when set high and will
disconnect when set low.
set sys io 0x20
(configures PIO5 to connect/disconnect )
You can monitor the connection status by reading PIO6. High indicates an open connection, low indicates
no connection. Use the command set system IO to enable PIO6.
set sys io 0x40
(configures PIO6 to represent the connection status )
12.5.
Using DNS settings
WiFly contains a built in DNS client. If the IP address of the host is not specified (i.e it is set to 0.0.0.0),
the DNS protocol will be used. WiFly will automatically attempt to resolve the host address
stored with the command:
set dns name <string>
sets the name of the host for TCP/IP connections.