AIBOX设备集成协议 V1.0
AIBOX采用MQTT和GB28181协议实现外部平台对接,基本上参考大疆的上云API。MQTT消息用于控制,事件上报等。GB28181用于视频相关流媒体传输。
用户可以对照着大疆的MQTT Topic协议文档https://developer.dji.com/doc/cloud-api-tutorial/cn/api-reference/pilot-to-cloud/mqtt/topic-definition.html
巨视安防
,赞2
MQTT Topic 定义
Topic Name |
发送者 -> 订阅者 |
Message |
说明 |
---|---|---|---|
thing/product/{device_sn}/osd |
设备 > 云平台 |
盒子定频向云平台推送的设备属性 |
|
thing/product/{device_sn}/state |
设备 > 云平台 |
盒子按需上报向云平台推送的设备属性 |
|
thing/product/{gateway_sn}/services |
云平台 -> 设备 |
云平台向盒子请求的服务 |
|
thing/product/{gateway_sn}/services_reply |
设备 > 云平台 |
设备对 service 的回复、处理结果 |
|
thing/product/{gateway_sn}/events |
设备 > 云平台 |
设备端向云平台发送的事件 |
|
thing/product/{gateway_sn}/requests |
设备 > 云平台 |
设备端向云平台发送请求,为了获取一些信息,比如上传的临时凭证 |
|
thing/product/{gateway_sn}/requests_reply |
云平台 -> 设备 |
云平台对设备请求的回复 |
|
sys/product/{gateway_sn}/status |
设备 > 云平台 |
设备上下线 |
|
thing/product/{gateway_sn}/drc/up |
设备 > 云平台 |
DRC 协议上行 |
|
thing/product/{gateway_sn}/drc/down |
云平台 > 设备 |
DRC 协议下行 |
公共字段:
Column |
Name |
Type |
Description |
---|---|---|---|
tid |
事务uuid |
text |
事务(Transaction)的 UUID:表征一次简单的消息通信 |
bid |
业务uuid |
text |
业务(Business)的 UUID |
timestamp |
毫秒时间戳 |
int |
消息的发送时间 |
gateway |
网关设备的序列号 |
text |
发送该消息的网关设备的序列号 |
data |
消息内容 |
object |
消息内容 |
开始直播
topic: thing/product/{gateway_sn}/services
Direction: down
Method: live_start_push
字段:
Column |
Name |
Type |
Description |
---|---|---|---|
url_type |
直播协议类型 |
enum |
"3" //GB28181 |
url |
直播参数 |
text |
"serverIP=192.168.1.1&serverPort=8080&serverID=34000000000000000000&agentID=300000000010000000000&agentPassword=0000000&localPort=7060&channel=340000000000000000000&agentID1=300000000010000000001&agentPassword1=0000000&localPort1=7061&channel1=340000000000000000001" |
video_id |
直播视频流的ID编号 |
text |
1ZNDH1D0010098/39-0-7/normal-0 |
video_quality |
直播质量 |
enum |
{"0":"自适应","1":"流畅","2":"标清","3":"高清","4":"超清"} |
示例: |
{
"bid":"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"data":{
"url_type":"3",//gb28181
"url":"serverIP=192.168.1.1&serverPort=8080&serverID=34000000000000000000&agentID=300000000010000000000&agentPassword=0000000&localPort=7060&channel=340000000000000000000&agentID1=300000000010000000001&agentPassword1=0000000&localPort1=7061&channel1=340000000000000000001",
"video_id":"1ZNDH1D0010098/39-0-7/normal-0",
"video_quality":0
},
"tid":"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"timestamp":1654070968655,
"method":"live_start_push"
}
停止直播
topic: thing/product/{gateway_sn}/services
Direction: down
Method: live_stop_push
字段:
Column |
Name |
Type |
Description |
---|---|---|---|
video_id |
直播视频流的ID编号 |
text |
1ZNDH1D0010098/39-0-7/normal-0 |
示例: |
{
"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"timestamp:": 1654070968655,
"method": "live_stop_push",
"data": {
"video_id": "1ZNDH1D0010098/42-0-0/zoom-0"
}
}
盒子Osd
topic: thing/product/{device_sn}/osd
说明:此消息1hz定时上报
字段:
Column |
Name |
Type |
Description |
---|---|---|---|
height |
绝对高度 |
float |
|
latitude |
当前位置纬度 |
float |
|
longitude |
当前位置经度 |
float |
|
authority_change |
bool |
控制权变化 |
|
flight_authority_type |
int |
||
flight_authority_user |
string |
||
live_status |
int |
||
live_quality |
int |
||
live_video_type |
string |
||
available_network |
int |
||
real_use_network |
int |
||
wireless_status_list |
无线信号质量 |
array |
wireliess_status_list字段
Column |
Name |
Type |
Description |
---|---|---|---|
module_name |
string |
||
module_installed |
bool |
||
module_connected |
bool |
||
in_use |
bool |
||
sim_card_status |
enum_int |
// 0: no sim card, 1: not ready, 2: sim card ready, 3: pin code required, 4: puk code required, 5: network personalization, 6: bad |
|
ue_state |
string |
||
network_type |
string |
||
cell_id |
string |
||
rsrp |
int |
||
sinr |
int |
||
sdr_quality |
int |
示例:
{
"bid":"00000000-0000-0000-0000-000000000000",
"tid":"00000000-0000-0000-0000-000000000000",
"timestamp":1727505066666,
"gateway":"1ZMBJBF0030041",
"data":{
wireless_status_list:[
{
"module_name":"5G_A",//Module name in AIBOX
"module_installed":true,
"sim_card_status":0,// 0: no sim card, 1: not ready, 2: sim card ready, 3: pin code required, 4: puk code required, 5: network personalization, 6: bad
"ue_state":"NOCONN",// "SEARCH", "LIMSRV", "NOCONN", "CONNECT"
"network_type":"NR",// LTE, NR
"cell_id":0,// cell id
"rsrp":-70,// received signal strength, dbm
"sinr":-20,//signal to interference plus noise ratio, db
},
{
"module_name":"5G_B",
"module_installed":true,
"sim_card_status":0,// 0: no sim card, 1: not ready, 2: sim card ready, 3: pin code required, 4: puk code required, 5: network personalization, 6: bad
"ue_state":"NOCONN",
"network_type":"NR",// LTE, NR
"cell_id":0,
"rsrp":-70,
"sinr":-20,
},
{
"module_name":"1.4G",
"module_installed":true,
"sim_card_status":0,// 0: no sim card, 1: not ready, 2: sim card ready, 3: pin code required, 4: puk code required, 5: network personalization, 6: bad
"ue_state":"NOCONN",
"network_type":"LTE",// LTE, NR
"cell_id":0,
"rsrp":-70,
"sinr":-20,
},
]
},
}
飞机Osd
topic: thing/product/{device_sn}/osd
说明:此消息1hz定时上报
字段:
Column |
Name |
Type |
Description |
---|---|---|---|
attitude_head |
偏航轴角度 |
float |
偏航轴角度与真北角(经线)的角度,0到6点钟方向为正值,6到12点钟方向为负值 |
attitude_pitch |
俯仰轴角度 |
float |
|
attitude_roll |
横滚轴角度 |
float |
|
battery |
飞行器电池信息 |
struct |
|
distance_limit_status |
struct |
||
elevation |
相对起飞点高度 |
float |
|
firmware_version |
固件版本 |
string |
{"length":"64"} |
gear |
档位 |
enum |
{"0":"A","1":"P","2":"NAV","3":"FPV","4":"FARM","5":"S","6":"F","7":"M","8":"G","9":"T"} |
height |
绝对高度 |
float |
相对地球椭球面高度, 计算:相对起飞点的高度 + 起飞点的椭球高 |
height_limit |
飞行器限高 |
int |
{"max":"1500","min":"20","step":"1","unit_name":"米 / m"} |
home_distance |
距离 Home 点的距离 |
float |
|
horizontal_speed |
水平速度 |
float |
|
latitude |
当前位置纬度 |
float |
{"max":"3.4028235E38","min":"-1.4E-45","step":"0.1"} |
longitude |
当前位置经度 |
float |
{"max":"3.4028235E38","min":"-1.4E-45","step":"0.1"} |
mode_code |
飞行器状态 |
enum |
{"0":"待机","1":"起飞准备","2":"起飞准备完毕","3":"手动飞行","4":"自动起飞","5":"航线飞行","6":"全景拍照","7":"智能跟随","8":"ADS-B 躲避","9":"自动返航","10":"自动降落","11":"强制降落","12":"三桨叶降落","13":"升级中","14":"未连接","15&# |