User`s guide

RN-WIFLYCR-UG
www.rovingnetworks.com Version 1.2r 4/30/13 page 79
EXAMPLE 4-11: CONNECT TO WEB SERVER EVERY 30 SECONDS
4.4.4 Connect to a Web Server Automatically when UART Data Is
Received
The module supports a mode in which it can connect to the web server when it receives
UART data.
EXAMPLE 4-12: CONNECT TO WEB SERVER WHEN UART DATA IS
RECEIVED
Use the following commands to configure the module to connect to a web server
every 30 seconds:
set com remote GET$/ob.php?obvar=WEATHER
// Setup the HTML string
set sys auto 30 // Auto-connect every 30 seconds.
set option format 1 // Send header automatically when
// connection is open
set ip proto 18 // Turn on HTTP mode = 0x10 + TCP
// mode = 0x2
Note: If you attempt to send data by typing characters on the keyboard or if your
microcontroller is not sending data fast enough, the module sends out small
packets of data (it sends out many packets of small MTU size). To avoid this
issue, set the flush timer to a higher value, e.g., set comm time 5000. By
default, it is set to 10 ms.
set ip proto 18 // Turn on HTTP mode = 0x10 and
// TCP mode = 0x2
set dns name www.webserver.com // Set the web server name
set ip host 0 // Turn on DNS
set ip remote 80 // Set the web server port, 80 is
// standard
set com remote GET$/userprog.php?DATA=
// Sample server application
set uart mode 2 // Automatically connect using data
// trigger mode
When the serial UART data comes in, the module automatically connects to the web
server, and sends:
GET /userprog.php?DATA= <users serial data> \n\n