发布时间:2022-09-05 08:30
设置STA模式
AT+CWMODE=1
链接WIFI
AT+CWJAP="xxx","xxx"
通过TCP链接ONE NET 平台
AT+CIPSTART="TCP","183.230.40.33",80
进入透传模式
AT+CIPMODE=1
AT+CIPSEND
发送数据
POST /devices/xxxxx(你的device id)/datapoints?type=5 HTTP/1.1
api-key:xxxxxx(你的api key)
Host:api.heclouds.com
Content-Length:10(注意这里的长度是下面body的长度)
(注意两个\r\n)
,;data,25
收到回复的数据
[14:17:17.434]收←◆HTTP/1.1 200 OK
Date: Sat, 07 M
[14:17:17.466]收←◆ay 2022 06:17:16 GMT
Content-Ty
[14:17:17.497]收←◆pe: application/json
Content-Le
[14:17:17.535]收←◆ngth: 26
Connection: keep-alive
[14:17:17.566]收←◆
Server: Apache-Coyote/1.1
Pra
[14:17:17.598]收←◆gma: no-cache
{"errno":0,"error":"succ"}