使用esp_iot_sdk_v1.4.0_15_09_18中IOT_DEMO例子
已经正确激活了Espressif Cloud
串口终端显示
ping success
user_esp_platform_sent_beacon 1758066291
user_esp_platform_sent_cb
user_esp_platform_recv_cb {"status": 200, "epoch": 1448369437, "message": "ping success", "identified": true, "datetime": "2015-11-24 20:50:37"}
ping success
测试使用的KEY ID:
user key: a12c5b4447bf7c0e6a82d37f904f0ec1d6128965
device key: 4c91f317b2011ff69af54abbfb7494f009a0e24c
owner key: da747d1b3801cba78834b43658174c816ca83226
问:查询和设置灯的状态步骤?
测试情景:
1.向Espressif Cloud 申请设备的控制权
使用user key and random token 返回owner key
curl -X POST -H "Authorization:token <user key>" -d"{\"token\": \"<random token>\"}" http://iot.espressif.cn/v1/key/authorize/
2.查询灯的状态
curl -X GET -H "Content-Type:application/json" -H "Authorization: token <owner key>" http://iot.espressif.cn/v1/datastreams/light/datapoint
执行此命令后,执行终端显示{"status": 403, "message": "can not find datastreamTmpl(product_id: 1910, stream_name: light)", "result": "failed"}
IotBucket控制台请求日志:
GET /v1/datastreams/light/datapoint 2015-11-24T21:09:19+08:00
{
"body": {},
"created": "2015-11-24T21:09:19+08:00",
"get": {},
"meta": {
"Authorization": "token da747d1b3801cba78834b43658174c816ca83226"
},
"path": "/v1/datastreams/light/datapoint",
"method": "GET"
}
3.设置为的状态
如何使用esp_iot_sdk中的iot_demo例程查询和设置灯的状态?
Who is online
Users browsing this forum: No registered users and 3 guests
Login
Newbies Start Here
Are you new to ESP8266?
Unsure what to do?
Dunno where to start?
Start right here!
Latest SDK
Documentation
Complete listing of the official ESP8266 related documentation release by ESPRESSIF!
Must read here!
- All times are UTC+08:00
- Top
- Delete all board cookies
About Us
Espressif Systems is a fabless semiconductor company providing cutting-edge low power WiFi SoCs and wireless solutions for wireless communications and Internet of Things applications. We are the manufacturer of ESP8266EX.