Gpio Mode; Httpd Client Mode - Jinan USR IOT Technology USR-WIFI232-A2 User Manual

Table of Contents

Advertisement

Sum 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-A2 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.
Below is the specific application, for example:
The first set HTTP parameters using AT instructions.
AT+HTTPURL=192.168.1.1,80
AT+HTTPTP=POST
AT+HTTPPH=/set
AT+HTTPCN=keep-alive
AT+HTTPUA=lwip13.2
Jinan USR IOT Technology Limited
USR-WIFI232-A2 User Manual
The serveraddress and portsettings
Set the HTTP type, GET, PUT or POST
Set the path,the mostis50 bytes
Set the Connection,maximum length of 20bytes
Set the User-Agent,maximum length of 20bytes
Page 22 of 76
http://www.usriot.com
tec@usr.cn

Advertisement

Table of Contents
loading

Table of Contents