已经正确激活了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.设置为的状态Statistics: Posted by mrhw — Tue Nov 24, 2015 9:18 pm
]]>