设备登录报文
| POST | $sys/{pid}/{device-name}/login |
| HOST | {Acc-ip} |
| Port | 5683 |
| Code | POST |
| Type | Con |
| Content-Format | application/json |
| payload | {“lt”:86400, “st”:“xxxxxx”} |
设备登录报文参数说明
| 参数 | 说明 |
|---|---|
| pid | 产品ID |
| device-name | 产品名称 |
| HOST | 接入地址,取值:183.230.102.116 |
| Port | 端口,取值为:5683 |
| Content-Format | 设备发送给物联网平台的上行数据编码格式,支持application/json方式 |
| payload | 设备登录信息内容,JSON数据格式 |
返回结果
| Resp-success | 2.01Created Payload:{token} |
| Resp-failed | 4.00 Bad Request/4.03 Forbidden |
设备保活报文:
| POST | $sys/{pid}/{device-name}/keep_alive |
| HOST | {Acc-ip} |
| Port | 5683 |
| Code | POST |
| Type | Con |
| Content-Format | application/json |
| payload | {“lt”:86400, “st”:“xxxxxx”} |
返回结果
| Resp-success | 2.04 Changed |
| Resp-failed | 4.00 Bad Request/4.04 Not Found |
1、属性上报:$sys/{pid}/{device-name}/thing/property/post
2、属性期望获取:$sys/{pid}/{device-name}/thing/property/desired/get
3、属性期望删除:$sys/{pid}/{device-name}/thing/property/desired/delete
1、事件上报:$sys/{pid}/{device-name}/thing/event/post
| POST | 使用物模型定义的上行topic |
| HOST | {Acc-ip} |
| Port | 5683 |
| Code | POST |
| Type | Con/Non |
| Accept | application/json |
| Content-Format | application/json |
| payload | 物模型数据 |
1、属性设置:$sys/{pid}/{device-name}/thing/property/set
2、属性获取:$sys/{pid}/{device-name}/thing/property/get
1、服务调用:$sys/{pid}/{device-name}/thing/service/{identifier}/invoke
| POST | 使用物模型定义的下行topic |
| HOST | 设备ip |
| Port | 设备连接端口 |
| Code | POST |
| Type | Con |
| Accept | application/json |
| Content-Format | application/json |
| payload | 设置属性的物模型数据 |
物模型下行命令响应报文:
| Code | 2.05 content |
| HOST | {Acc-ip} |
| Port | 5683 |
| Type | Ack |
| Accept | application/json |
| Content-Format | application/json |
| payload | 物模型响应数据 |
设备登出报文:
| POST | $sys/{pid}/{device-name}/logout |
| HOST | {Acc-ip} |
| Port | 5683 |
| Code | POST |
| Type | Con |
| Content-Format | application/json |
| payload | { “st”:“xxxxxx”} |
| Resp-success | 2.02Deleted |
| Resp-failed | 4.00 Bad Request/4.03 Forbidden |
| 通信协议 | 地址 | 端口 | 说明 |
|---|---|---|---|
| CoAP | studio-coap.heclouds.com | 5683 | 非加密端口 |