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
~ 58 ~
13.2. Automatically connect to web server
WiFly module can be setup to automatically post data to a webserver. The auto connect feature is enabled
by the set sys auto <seconds> command. For example, the WiFly module can be configured to connect to
the web server every 10 seconds by using the set sys auto 10.
The example below illustrates the commands to configure WiFly for connecting to the web server every 30
seconds.
set com remote GET$/ob.php?obvar=WEATHER // setup the string
set sys auto 30 // auto connect every 30 seconds.
set option format 1 // auto send the header once connection is open
set ip proto 18 // turn on HTTP mode=0x10 + TCP mode = 0x2
NOTE1: when HTTP mode is set, the WiFly automatically appends the \n\n to the end of the packet.
NOTE2: if the html header contains spaces, the $ is required when entering the string. Space is the
command delimiter. When WiFly command parser sees $ it will convert this to a SPACE character.
13.3. Automatically connect to web server on uart data
WiFly GSX supports a mode in which it can connect to the web server when it receives uart data. In this
mode, connection to the web server will be triggered on uart data.
Example:
set ip proto 18 // turn on HTTP mode=0x10 + TCP mode = 0x2
set dns name www.webserver.com //name of your webserver
set ip host 0 // so WiFly will use DNS
set ip remote 80 // standard webserver port
set com remote GET$/userprog.php?DATA= // sample server application
set uart mode 2 // automatically connect using data TRIGGER mode
Then when the serial UART data comes in, WiFly auto connects to the web server, and will automatically
send:
GET /userprog.php?DATA=<users serial data> \n\n
NOTE: If you attempt to send data by physically typing characters on the keyboard or if your
microcontroller is not sending data fast enough, the WiFly module will send out small packets of data (It
will send out many packets of small MTU size). To avoid this, set the flush timer to a higher value. By
default, it is set to 10 milliseconds. You can extend the flush to a higher value (e.g. set comm. time 5000).