WiSnap User Manual 2.21 04112011-JF
Page
46
of
66
13
Using HTML Client Feature
The WiSnap module has a built in HTML client. When enabled, the WiSnap module is capable of
getting or posting data to a web server. Using the HTML client, it is now possible to post serial and/or
sensor data to the host web server. This feature make is possible to provide Wi-Fi capabilities to
applications such as GPS units, remote sensors, weather station, etc.
Example:
User wants to retrieve data from web server with this format:
http://www.webserver.com/ob.php?obvar=WEATHER
Settings:
set ip proto 18
// enable html client
set dns name www.webserver.com
// name of your web server
set ip address 0
// so WiSnap will use DNS
set ip remote 80
// standard web server port
set com remote 0
// turn off the REMOTE string so it does not
interfere with the post
To make the connection the command would be:
open
or inline you can send
open www.webserver.com 80
The user’s microprocessor should write 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 so the
web server knows the page is complete.
13.1
Built-in HTML Client Modes
WiSnap can be setup to automatically post data to and get data from a web server without any
external HOST CPU. The advanced web features are enabled using the “set option format <mask>”
command. This is a bit mapped register. The functions of the bits are described in the table below:
set option format <value>
Bitmapped value.
Example:
To automatically send HTML data header, the command is
set option format 1
Bit of Format reg
Function
0
Automatically send HTML data header based on broadcast interval.
1
Send users BINARY data (converted to ASCII hex )
2
Sample the GPIO and AtoD pins and format to ASCII hex
3
Appends
&id= < value>
, where
value
is the device ID string set
with
set opt device <string>
4
Appends
&rtc=<time>
, where
time
is real time clock value in
message as 32 bit HEX value in format aabbccddeeff