WIFI232-B2 User Manual
24
/
102
Target address: 0x85 0x00 0xA8 0xC0 (192.168.0.0133)
Data: 0x01 (data length: 1)
Sum check: 0x0f
(0x00+0x00+0x00+0x21+0x00+0x85+0x00+0xA8+0xC0+0x01=0x0f)
4.2.3
GPIO Mode
WIFI232 module support GPIO mode. In GPIO mode, UART (TXD/RXD/CTS/RTS)
defined as GPIO and others (nReady/nLink) 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
;
G
PIO n OUT 1, Set GPIOn as output and output ‘1’, Response
GPIO OK
or
GPIO NOK
;
GPIO n SW: Set GPIOn as output 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 10 ms). Response
GPIO OK
or
GPIO
NOK
;
G
PIO n GET, Read GPIOn status. Response I0, I1, O0, O1 means “input low”,
“input high”, “output
low” and “output high” separately.
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 stand for input, and O for output. 0 means low and 1 means high.
Pin 4 is negated. So if you read 1, it actual 0 and if you read 0, it actual 1.
4.2.4
HTTPD Client Mode
This mode is used to send data to the HTTP server or request data from 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.