USR-WIFI232-A/B/C User Manual
http://www.usriot.com
Jinan USR IOT Technology Limited
Page 28 of 93
Destination
Destination
Destination
Destination port
port
port
port::::
Little endian, low byte in the former,such as port 23, here are 0x17 0x00
Target
Target
Target
Target address:
address:
address:
address:
If it is IP, is 4 bytes, for example, 192.168.0.7 said 0x07 0x00 0xA8 0xC0; if it is a domain
name, then the address of indefinite length,ending with the’\0'.
Data:
Data:
Data:
Data:
Variable length,the maximum not exceeding 1000bytes.
Sum
Sum
Sum
Sum check:
check:
check:
check:
From the function word to check byte (does not contain a check byte), add Sum check.
The following is an example of a specific application:
send data:0x55 0xaa 0x00 0x0a 0x00 0x00 0x00 0x21 0x00 0x85 0x00 0xA8 0xC0 0x01 0x0f
Length:0x00 0x0a
Function byte:0x00 (UDP;Short connection;IP;cut protocol)
Destination port:0x21 0x00(33)
Target address:0x85 0x00 0xA8 0xC0 (192.168.0.133)
Data:0x01(data length :1)
Sum check:0x0f (0x00+0x00+0x00+0x21+0x00+0x85+0x00+0xA8+0xC0+0x01=0x0f)
4.2.3
GPIO mode
USR-WIFI232-A/B/C module support GPIO mode:At GPIO,UART (TXD/ RXD/CTS/RTS) defined
as GPIO and others (Ready/Link/) also defined as GPIO pin.
When module works at GPIO mode, PC and other equipments can setup connection (TCP/UDP)
through WiFi, then read/write GPIO information through command.
�
GPIO n IN,
Set GPIOn as input, Response GPIO OK or GPIO NOK;
�
GPIO n OUT 0, Set GPIOn as output and output
‘
0
’
, Response GPIO OK or GPIO NOK;
�
GPIO n OUT 1, Set GPIOn as output and output
‘
1
’
, Response GPIO OK or GPIO NOK;
�
GPIO n SW,
Set GPIOn as output and switch the output status, Response GPIO OK or
GPIO NOK;
�
GPIO n PWM m1 m2, Set GPIOn output a wave: m1 is
‘
high
’
duration and m2 is
’
low
’
duration (Time unit is
‘
ms
’
and minimal is 10ms), Response GPIO OK or GPIO NOK;
�
GPIO n GET, Read GPIOn status, Response I0,I1,O0,O1, means
”
input low
”
,
”
input
high
”
,
”
output low
”
,
”
output high
”
Notes: n can be 3, 4, 5, 6, 8, 9 corresponding module pin. GPIO 4 can only defined as input and
GPIO 3 can only defined as output.
GPIO READ returns all current IO status, and GPIO n GET said method. Such as, I1I1I0I0I0I0O1,
I said input, O output. 0 low, 1 express high.4 pin is negated. Read the 1 actual 0 actual 1, read
the 0.
4.2.4
HTTPD Client mode
This mode is used to send data to the HTTP server.
After setting the HTTP header format by webpage or AT command, the data sent each time by
UART will add the HTTP header automatically.Convenient for the user directly submit data or
read data from the HTTP server.