WiSnap User Manual 2.21 04112011-JF
Page
48
of
66
Example:
set ip proto 18
// turn on HTTP mode=0x10 + TCP mode = 0x2
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 GET$/userprog.php?DATA=
// sample server application
set option format 2
//Converts user binary data in ASCII hex format
If incoming UART data = 6 bytes of binary data with hex values 0x01 0xAB 0x03 0xFF 0x05 0x06
WiSnap will send this string to the web server:
GET /userprog.php?DATA=01AB03FF0506 \n\n
13.5
Auto posting sensor data:
WiSnap module can send the value of the GPIO and sensor pins:
The data will come as 18 bytes of ASCII HEX: <2 bytes GPIO><channel 0 thru 7 sensor data>
set ip proto 18
// turn on HTTP mode=0x10 + TCP mode =
0x2
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 GET$/userprog.php?DATA=
// sample server application
set q sensor 0xff
// sets WiSnap to sample all 8 sensor channels
set sys auto 30
// automatically make the connection every 30
seconds
set option format 7
// send the header plus the sampled binary data
converted to ASCII format
The Resulting string sent to the server will be
GET /userprog.php?DATA=0F3000001111222233334444555566667777\n\n
In the above example, the data format is
2 Bytes
GPIO
Channel
0
Channel
1
Channel
2
Channel
3
Channel
4
Channel
5
Channel
6
Channel
7
0F30
0000
1111
2222
3333
4444
5555
6666
7777
13.6
Examples using the HTML client
Example#1: Auto posting sensor data:
In this example, we will connect to the web server at
www.rovingnetworks.com/mike.php?ID
= and
send data “ID=1234” every 60 seconds. We will also append the sensor data to the “ID=1234”.
Set the network connections as described above. The other parameters that we need to set are
described below.
Set dns name www.rovingnetworks.com //set up the URL of the server
Set ip host 0
//instructs RN-370 to use DNS address of host server
Set ip remote 80
//standard web server port