CX-WIFI-2NET module user manual
Shenzhen Coolmay Technology Co.,Ltd
www.coolmay.com
Page
12
,Total 93 Pages
Second byte: reserved
Target port
:
Little endian format, low byte first, such as port 23, here the order is 17 00
Target address
:
If it is IP, it is 4 bytes, for example, 192.168.0.7 is represented as 07 00 A8 C0; if it
is a domain name, the address length is not fixed, ending with '\0'
Data
:
Variable length, up to 1000 bytes
Calibration
:
From the beginning of the function word, before the check byte, add the checksum.
The following are specific application examples:
Send data: 55 aa 00 0a 00 00 00 21 00 85 00 A8 C0 01 0f
Length byte 00 0a: length is n+m+5, here is 10
Function word 00: UDP mode
Target ip address 85 00 A8 C0:192.168.0.133
Data area 00: length is 1
Check
calculation:
0x00+0x00+0x00+0x21+0x00+0x85+0x00+0xA8+0xC0+0x01=0x0f
2.2.3 HTTPD Client mode
This mode is used to request data from an HTTP server or to submit data to a
server.
After the user sets the specific content of the HTTP protocol header with the AT
command or the web page. Each time data is sent, the module automatically
encapsulates the sent data into HTTP protocol data and sends it to the specified HTTP
server. It is convenient for users to read or submit data directly from the HTTP server. In
this mode, the user can send the data to the specified http server, and the module will
automatically add the http protocol header in front of the sent data. The content of the
specific protocol header can be set by the AT command or the web page.
The following are specific application examples:
First set the HTTP related parameters with the AT command.
AT+HTTPURL=192.168.1.1,80 Set the server's address and port
AT+HTTPTP=POST
Set the HTTP type, GET, PUT,
or POST
AT+HTTPPH=/set Set the path in the protocol
header, up to 50 bytes
AT+HTTPCN=keep-alive
Set Connection in the protocol
header, up to 20 bytes
AT+HTTPUA=lwip13.2 Set the User-Agent in the protocol
header, up to 20 bytes.
If the data sent is 1234.
Then on the 192.168.1.1 port 80 will receive the following data
POST/set HTTP/1.1
Connection:keep-alive
User-Agent:lwip1.3.2
Content-Length:4
Host:192.168.1.1:80
Содержание CX-WIFI-2NET
Страница 30: ...Shenzhen Coolmay Technology Co Ltd CX WIFI 2NET module user manual Page 30 Total 93 pages www coolmay com ...
Страница 73: ...Shenzhen Coolmay Technology Co Ltd CX WIFI 2NET module user manual www coolmay com Page 73 Total 93 pages ...
Страница 75: ...Shenzhen Coolmay Technology Co Ltd CX WIFI 2NET module user manual www coolmay com Page 75 Total 93 pages ...
Страница 84: ...Shenzhen Coolmay Technology Co Ltd CX WIFI 2NET module user manual www coolmay com Page 84 Total 93 pages ...
Страница 86: ...Shenzhen Coolmay Technology Co Ltd CX WIFI 2NET module user manual www coolmay com Page 86 Total 93 pages ...