![Roving Networks RN-171 Скачать руководство пользователя страница 47](http://html1.mh-extra.com/html/roving-networks/rn-171/rn-171_user-manual-and-command-reference_1492508047.webp)
WiFly GSX
www.rovingnetworks.com
WiFlyRN171-um 2/23/2011
809 University Avenue
•
Los Gatos, CA 95032
•
Tel (408) 395-6539
~
47
~
Example:
setip proto 18
// turn on HTTP mode=0x10 + TCP mode = 0x2
setdns namewww.webserver.com
//name of your webserver
setip address 0
// so WiFly will use DNS
setip remote 80
// standard webserver port
set com remote GET$/userprog.php?DATA=
// sample server application
setuart mode 2
// automatically connect using data TRIGGER mode
Then when the serial UART data comes in, WiFly auto connects to the web server, and will automatically
send:
GET /userprog.php?DATA=<users serial data> \n\n
NOTE:
If you attempt to send data by physically typing characters on the keyboard or if your
microcontroller is not sending data fast enough, the WiFly module will send out small packets of data (It
will send out many packets of small MTU size). To avoid this, set the flush timer to a higher value. By
default, it is set to 10 milliseconds. You can extend the flush to a higher value (e.g.
set comm. time 5000
).
13.4.
Posting binary data:
Web servers expect ASCII data, so if the User data is binary, WiFly can convert binary data to ASCII
format before sending it to the web server.
Example: using the same settings as above but this timeuse the
setip proto 18
// turn on HTTP mode=0x10 + TCP mode = 0x2
setdns namewww.webserver.com
//name of your webserver
setip address 0
// so WiFly will use DNS
setip remote 80
// standard webserver port
set com remote GET$/userprog.php?DATA=
// sample server application
set option format 2
//Converts user binafy data in ASCII hex format
If incoming UART data = 6 bytes of binary data with hex values 0x01 0xAB 0x03 0xFF 0x05 0x06
WiFly will send this string to the webserver:
GET /userprog.php?DATA=01AB03FF0506 \n\n