User`s guide

RN-WIFLYCR-UG
www.rovingnetworks.com Version 1.2r 4/30/13 page 78
4.4.2 Built-In HTML Client Modes
You can set up the module to post data to and get data from a web server automatically
without an external host CPU. You enable these advanced web features using the set
opt format <flag> command, where <flag> represents a bit-mapped register. Refer to
“set opt format <flag>” on page 19 for the bit function descriptions. Tabl e 4-1 describes
the wake reason values.
EXAMPLE 4-10: HTML CLIENT MODES
4.4.3 Connect to a Web Server Automatically
You can configure the module to post data to a webserver automatically using the set
sys auto <value> command, where <value> is a decimal number representing sec-
onds. For example, you can configure the module to connect to the web server every
10 seconds with the set sys auto 10 command.
When HTTP mode is set, the module automatically appends two linefeeds (\n\n) to the
end of the packet.
TABLE 4-1: WAKE REASON VALUES
Value Wake Reason
0 Undefined.
1 Power on or hardware reset (battery install or power up).
2 Sleep (wake when the sleep timer is expired).
3Sensor.
4 Undefined.
5 Button (RN370 serial adapter only).
6 Software reboot.
7 Watchdog.
set option format 1 // Automatically send HTML data
// header
set option format 7 // Append sensor data in ASCII hex
// format
set option format 11 // Append all key value pairs to the
// sensor data
Note: If the HTML header contains spaces, you must use the $ character to indi-
cate spaces in the string. (A space is the command delimiter.) When the
module’s command parser sees the $, it converts it to a space character.