# 系统消息
数据上行: fogcloud/{productKey}/{deviceName}/thing/up/sys
method | 说明 |
ping_reply | 设备响应 MQTT 是否在线 |
bind | 设备上报 wifi 配网 random |
meshkey.request | 网关向服务器申请 mesh 的 netkey&appkey&devkey |
meshaddr.request | 网关向服务器申请子设备的 mesh 地址 |
productconfig.request | 设备向服务器获取产品自定义配置 |
数据下行: fogcloud/{productKey}/{deviceName}/thing/down/sys
具体数据类型根据 json 数据的 method 字段进行区分:
method | 说明 |
ping | 云端探测 MQTT 是否在线 |
unbind | 云端通知设备被 App 解绑 |
sub.add.start | 云端请求网关设备开始子设备配网 |
sub.add.stop | 云端请求网关设备停止子设备配网 |
meshkey.response | 服务器向网关响应 mesh 的 netkey&appkey&devkey |
meshaddr.response | 服务器向网关响应子设备的 mesh 地址 |
productconfig.response | 服务器向设备响应产品自定义配置 |
# ping_reply
{
"id": 123,
"version": "1.0",
"method": "ping_reply",
"params":
{
"cloud_time": "xxxxx" //云端时间戳,单位毫秒
}
} # bind
{
"id": 123,
"version": "1.0",
"method": "bind",
"params":
{
"random": "xxxxx" //配网时业务服务器生成的随机数
}
} # meshkey.request
{
"id": 123,
"version": "1.0",
"method": "meshkey.request"
} # meshaddr.request
{
"id": 123,
"version": "1.0",
"method": "meshaddr.request",
"params":
{
"node_uuid":"00010203040506070809"
}
} # productconfig.request
{
"id": 123,
"version": "1.0",
"method": "productconfig.request",
"params":
{
"product_key":"xxxxx"
}
} # ping
{
"id": 123,
"version": "1.0",
"method": "ping",
"params":
{
"cloud_time": "xxxxx" //云端时间戳,单位毫秒
}
} # unbind
{
"id": 123,
"version": "1.0",
"method": "unbind"
} # sub.add.start
{
"id": 123,
"version": "1.0",
"method": "sub.add.start",
"timestamp": xxxxx, //时间戳,单位秒
"params": {
"session_id": "xxxx", //唯一id,子设备添加成功后由设备返回
"timeout": 30, //配网超时时间,单位秒
"product_keys": ["xx", "xx", "xx"] //网关匹配的子设备类型
}
} # sub.add.stop
{
"id": 123,
"version": "1.0",
"method": "sub.add.stop",
"timestamp": xxxxx, //时间戳,单位秒
"params": {
"session_id": "xxxx", //唯一id,子设备添加成功后由设备返回
}
} # meshkey.response
{
"id": 123,
"version": "1.0",
"method": "meshkey.response",
"timestamp": xxxxx, //时间戳,单位秒
"params": {
"netkey": "000102030405060708090A0B0C0D0E0F",
"appkey": "000102030405060708090A0B0C0D0E0F",
"devkey": "000102030405060708090A0B0C0D0E0F",
}
} # meshaddr.response
{
"id": 123,
"version": "1.0",
"method": "meshaddr.response",
"timestamp": xxxxx, //时间戳,单位秒
"params": {
"node_uuid":"00010203040506070809",
"addr": 2
}
} # productconfig.response
{
"id": 123,
"version": "1.0",
"method": "productconfig.response",
"params":
{
"product_key":"xxxxx",
"config":"xxxxx"
}
}