User`s guide

RN-WIFLYCR-UG
www.rovingnetworks.com Version 1.2r 4/30/13 page 77
EXAMPLE 4-9: SET THE BACKUP DNS NAME
4.4 USING THE HTML CLIENT FEATURE
The module has a built-in HTML client. When enabled, the module can get or post data
to a web server. For example, you can use the HTML client to post serial and/or sensor
data to the host web server. This feature makes possible to provide Wi-Fi capabilities
to applications such as GPS units, remote sensors, weather stations, etc.
4.4.1 Retrieve Web Server Data
In this example, you want to retrieve data from the web server with the format:
http://www.webserver.com/ob.php?obvar=WEATHER
To perform this function, use the following settings:
set ip proto 18 // Enable the HTML client
set dns name www.webserver.com // Set the web server name
set ip address 0 // Turn on DNS
set ip remote 80 // Set the web server port, 80 is standard
set com remote 0 // Turn off the REMOTE string so that it
// does not interfere with the post
To make the connection, use the open command or you can use open www.web-
server.com 80. The user’s microprocessor writes the following string to the UART:
GET /ob.php?obvar=WEATHER \n\n
Where the \n is the linefeed character (decimal 10 or hex 0xa). Two linefeeds are
required for the web server to know the page is complete.
set dns backup <string> // Set the backup host name
Note: Some web servers require a carriage return and linefeed to indication the
page is complete. In this case, use \r\n at the end of the string instead of
\n\n.