http协议设备接入
1、创建产品
2、配置设备接入方式

点击新增
选择http接入
3、配置网络组件
新增网络组件
点击新增->上传协议
4、上传消息协议
5、填写网关信息
6、配置http认证信息
产品详情->设备接入->HTTP认证配置,填写Token, 本文使用的token为admin。
点击启用产品
7、配置物模型
配置一个物模型属性temperature和事件reportWet
temperature配置方式跟第三篇文章一样
reportWet事件:
输出参数:
8、创建设备
9、使用apiPost模拟设备接入
9.1、设备上线

目前是离线状态
URL:http://{host:port}/{productId}/{deviceId}/online
post请求
请求头:Authorization:Bearer admin
请求体:{}

返回成功。页面显示设备也上线
9.2、设备上报属性
URL:http://{host:port}/{productId}/{deviceId}}/properties/report
post请求
方向:设备->平台
消息体:
{
"deviceId": "1840037431304814592",
"properties": {
"temperature": 12.4
}
}
9.3、设备事件上报
URL:http://{host:port}/{productId}/{deviceId}/event/{eventId}
#eventId指的事件id:
方向:设备->平台
消息体:
{
"messageId": "1621330658213723945",
"data": {
"wet": 23.2
}
}

平台也上报成功了