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
| 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"
	}
}
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,
            },           
        ]
    },
}
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":"APAS","16":"虚拟摇杆状态","17":"指令飞行","18":"空中 RTK 收敛模式"} | 
| payload | 负载 | Struct | |
| position_state | 搜星状态 | struct | |
| storage | 存储容量 | Struct | |
| total_flight_distance | 飞行器累计飞行总里程 | Float | {"unit_name":"米 / m"} | 
| total_flight_time | 飞行器累计飞行航时 | Int | {"unit_name":"秒 / s"} | 
| track_id | 航迹 ID | string | {"length":"64"} | 
| vertical_speed | 垂直速度 | float | {"unit_name":"米每秒 / m/s"} | 
| wind_direction | 当前风向 | Enum | {"1":"正北","2":"东北","3":"东","4":"东南","5":"南","6":"西南","7":"西","8":"西北"} | 
| wind_speed | 风速 | float | 风速估计,该风速是通过飞行器姿态推测出的,有一定的误差,仅供参考,不能作为气象数据使用 | 
Position state字段
| Column | Name | Type | Description | 
|---|---|---|---|
| gps_number | GPS 搜星数量 | int | |
| is_fixed | 是否收敛 | Enum | {"0":"未开始","1":"收敛中","2":"收敛成功","3":"收敛失败"} | 
| quality | 搜星档位 | enum | {"1":"1档","2":"2档","3":"3档","4":"4档","5":"5档"} | 
| rtk_number | RTK 搜星数量 | int | 
drone battery字段
| Column | Name | Type | Description | 
|---|---|---|---|
| batteries | 电池详细信息 | array | |
| capacity_percent | 电池的总剩余电量 | int | {"max":100,"min":0} | 
| landing_power | 强制降落电量百分比 | int | {"max":100,"min":0} | 
| remain_flight_time | 剩余飞行时间 | int | {"unit_name":"秒 / s"} | 
| return_home_power | 返航所需电量百分比 | int | {"max":100,"min":0} | 
battery字段
| Column | Name | Type | Description | 
|---|---|---|---|
| capacity_percent | 电池剩余电量 | int | {"max":100,"min":0} | 
| firmware_version | 固件版本 | string | |
| high_voltage_storage_days | 高电压存储天数 | int | {"unit_name":"日 / day"} | 
| index | 电池序号 | int | left: 0 right: 1 | 
| loop_times | 电池循环次数 | int | |
| sn | 电池序列号(SN) | string | |
| sub_type | 电池子类型 | enum_int | |
| temperature | 温度 | float | {"unit_name":"摄氏度 / °C"} 保留小数点后一位 | 
| type | 电池类型 | enum_int | |
| voltage | 电压 | int | {"unit_name":"毫伏 / mV"} | 
storage字段
| Column | Name | Type | Description | 
|---|---|---|---|
| total | 总容量 | int | {"unit_name":"千字节 / KB"} | 
| used | 已使用容量 | int | {"unit_name":"千字节 / KB"} | 
示例:
topic: sys/product/{gateway_sn}/status
字段:
| Column | Name | Type | Description | 
|---|---|---|---|
| device_secret | 网关设备的密钥 | ||
| domain | 网关设备的命名空间 | ||
| nonce | nonce | ||
| sub_devices | 子设备列表 | ||
| sub_type | 网关子设备的产品子类型 | ||
| thing_version | 网关设备的物模型版本 | ||
| type | 网关设备的产品类型 | 
sub_device字段
| Column | Name | Type | Description | 
|---|---|---|---|
| device_secret | 子设备的密钥 | ||
| domain | |||
| index | |||
| nonce | nonce | ||
| sn | 子设备序列号(SN) | ||
| sub_type | |||
| thing_version | |||
| type | 
示例:
{
	"tid": "tid001",
	"bid": "bid001",
	"method": "update_topo",
	"timestamp": 1234567890123,
  "gateway": "gw123456",
  "from": "gw123456",
	"data": {
		"type": 98,
		"sub_type": 0,
		"device_secret": "secret",
		"nonce": "nonce",
		"version": 1,
		"sub_devices": [
			{
				"sn": "drone001",
				"type": 116,
				"sub_type": 0,
				"index": "A",
				"device_secret": "secret",
				"nonce": "nonce",
				"version": 1
			}
		]
	}
}
Topic: thing/product/{gateway_sn}/services
Direction: down
Method: flight_authority_grab
Data: null
Example:
{
	"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
	"data": {},
	"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
	"timestamp": 1654070968655,
	"method": "flight_authority_grab"
}
Topic: thing/product/{gateway_sn}/services_reply
Direction: up
Method: flight_authority_grab
Data:
| Column | Name | Type | constraint | Description | 
|---|---|---|---|---|
| result | 返回码 | int | 非 0 代表错误 | 
Example:
{
	"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
	"data": {
		"result": 0
	},
	"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
	"timestamp": 1654070968655,
	"method": "flight_authority_grab"
}
Topic: thing/product/{gateway_sn}/services
Direction: down
Method: takeoff_to_point
Data:
| Column | Name | Type | Description | 
|---|---|---|---|
| commander_flight_height | 【必填】指点飞行高度 | float | {"max":3000,"min":2,"step":0.1,"unit_name":"米 / m"} 相对(机场)起飞点的高度,相对高 ALT | 
| commander_flight_mode | 【必填】指点飞行模式设置值 | enum_int | {"0":"智能高度飞行","1":"设定高度飞行"} | 
| commander_mode_lost_action | 【必填】指点飞行失控动作 | enum_int | {"0":"继续执行指点飞行任务","1":"退出指点飞行任务,执行普通失控行为"} | 
| flight_id | 一键起飞任务 UUID | string | 任务 UUID,全局唯一,用于染色,云端区分该值是普通计划任务还是一键起飞任务 | 
| max_speed | 一键起飞的飞行过程中能达到的最大速度 | int | {"max":15,"min":1,"unit_name":"米每秒 / m/s"} | 
| rth_altitude | 返航高度 | int | {"max":1500,"min":2,"step":1,"unit_name":"米 / m"}相对(机场)起飞点的高度,相对高 ALT | 
| rc_lost_action | 遥控器失控动作 | enum_int | {"0":"悬停","1":"着陆(降落)","2":"返航"}遥控器失控动作 | 
| rth_mode | 【必填】返航模式设置值 | enum_int | {"0":"智能高度","1":"设定高度"}智能返航模式下,飞行器将自动规划最佳返航高度。大疆机场当前不支持设置返航高度模式,只能选择'设定高度'模式。当环境,光线不满足视觉系统要求时(譬如傍晚阳光直射、夜间弱光无光),飞行器将使用您设定的返航高度进行直线返航 | 
| security_takeoff_height | 安全起飞高度 | float | {"max":1500,"min":20,"step":0.1,"unit_name":"米 / m"}相对(机场)起飞点的高度(ALT),飞行器先升到特定的高度,然后再飞向目标点。 | 
| target_height | 目标点高度 | float | {"max":1500,"min":2,"step":0.1,"unit_name":"米 / m"}目标点高度(椭球高),使用 WGS84 模型,飞行器到点后默认行为:悬停 | 
| target_latitude | 目标点纬度 | double | {"max":90,"min":-90} 目标点纬度,角度值,南纬是负,北纬是正,精度到小数点后6位 | 
| target_longitude | 目标点经度 | double | {"max":180,"min":-180} 目标点经度,角度值,东经是正,西经是负,精度到小数点后6位 | 
Example:
{
	"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
	"data": {
		"commander_flight_height": 80,
		"commander_mode_lost_action": 1,
		"flight_id": "ABDEAC21DCADDA",
		"max_speed": 12,
		"rc_lost_action": 0,
		"rth_altitude": 100,
		"security_takeoff_height": 100,
		"target_height": 100,
		"target_latitude": 12.23,
		"target_longitude": 12.32
	},
	"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
	"timestamp": 1654070968655,
	"method": "takeoff_to_point"
}
Topic: thing/product/{gateway_sn}/services_reply
Direction: up
Method: takeoff_to_point
Data:
| Column | Name | Type | constraint | Description | 
|---|---|---|---|---|
| result | 返回码 | int | 非 0 代表错误 | 
Example:
{
	"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
	"data": {
		"result": 0
	},
	"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
	"timestamp": 1654070968655,
	"method": "takeoff_to_point"
}
Topic: thing/product/{gateway_sn}/events
Direction: up
Method: takeoff_to_point_progress
Data:
| Column | Name | Type | Description | 
|---|---|---|---|
| flight_id | 一键起飞任务 UUID | text | |
| planned_path_points | 规划的轨迹点列表 | array | 指点飞行为什么不要这个字段 | 
| remaining_distance | 剩余任务距离 | float | {"step":0.1,"unit_name":"米 / m"} | 
| remaining_time | 剩余任务时间 | float | {"step":0.1,"unit_name":"秒 / s"} | 
| result | 返回码 | int | 非 0 代表错误 | 
| status | 任务状态 | enum_string | {"task_finish":"一键起飞任务完成","task_ready":"准备起飞","wayline_cancel":"取消飞向目标点","wayline_failed":"执行失败","wayline_ok":"执行成功,已飞向目标点","wayline_progress":"执行中"} | 
| track_id | 航迹 ID | text | |
| way_point_index | 当前执行到第几个航点 | int | 指点飞行为什么不要这个字段 | 
planned_path_points字段:
| Column | Name | Type | Description | 
|---|---|---|---|
| height | 目标点高度 | float | {"max":10000,"min":2,"step":0.1,"unit_name":"米 / m"} 目标点高度(椭球高),使用 WGS84 模型 | 
| latitude | 目标点纬度 | float | {"max":90,"min":-90} 目标点纬度,角度值,南纬是负,北纬是正,精度到小数点后6位 | 
| longitude | 目标点经度 | float | {"max":180,"min":-180} 目标点经度,角度值,东经是正,西经是负,精度到小数点后6位 | 
示例:
{
	"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
	"data": {
		"flight_id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
		"planned_path_points": [
			{
				"height": 123.234,
				"latitude": 13.23,
				"longitude": 123.234
			}
		],
		"remaining_distance": 0,
		"remaining_time": 0,
		"result": 0,
		"status": "wayline_ok",
		"track_id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
		"way_point_index": 1
	},
	"need_reply": 1,
	"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
	"timestamp": 16540709686556,
	"method": "takeoff_to_point_progress"
}
Topic: thing/product/{gateway_sn}/services
Direction: down
Method: fly_to_point
Data:
| Column | Name | Type | Description | 
|---|---|---|---|
| fly_to_id | 飞向目标点 ID | text | |
| max_speed | flyto 的飞行过程中能达到的最大速度 | int | {"max":15,"min":0,"unit_name":"米每秒 / m/s"} | 
| points | flyto 目标点列表 | array | 仅支持 1 个目标点 | 
points字段:
| Column | Name | Type | Description | 
|---|---|---|---|
| height | 目标点高度 | float | {"max":10000,"min":2,"step":0.1,"unit_name":"米 / m"} 目标点高度(椭球高),使用 WGS84 模型 | 
| latitude | 目标点纬度 | float | {"max":90,"min":-90} 目标点纬度,角度值,南纬是负,北纬是正,精度到小数点后6位 | 
| longitude | 目标点经度 | float | {"max":180,"min":-180} 目标点经度,角度值,东经是正,西经是负,精度到小数点后6位 | 
Example:
{
	"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
	"data": {
		"fly_to_id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
		"max_speed": 12,
		"points": [
			{
				"height": 100,
				"latitude": 12.23,
				"longitude": 12.23
			}
		]
	},
	"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
	"timestamp": 1654070968655,
	"method": "fly_to_point"
}
Topic: thing/product/{gateway_sn}/services_reply
Direction: up
Method: fly_to_point
Data:
| Column | Name | Type | constraint | Description | 
|---|---|---|---|---|
| result | 返回码 | int | 非 0 代表错误 | 
Example:
{
	"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
	"data": {
		"result": 0
	},
	"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
	"timestamp": 1654070968655,
	"method": "fly_to_point"
}
Topic: thing/product/{gateway_sn}/events
Direction: up
Method: fly_to_point_progress
Data:
| Column | Name | Type | Description | 
|---|---|---|---|
| fly_to_id | 飞向目标点 ID | text | |
| remaining_distance | 剩余任务距离 | float | {"step":0.1,"unit_name":"米 / m"} | 
| remaining_time | 剩余任务时间 | float | {"step":0.1,"unit_name":"秒 / s"} | 
| planned_path_points | 规划的轨迹点列表 | array | {"size": -, "item_type": struct} | 
| result | 返回码 | int | 非 0 代表错误 | 
| status | 状态 | enum_string | {"wayline_cancel":"取消飞向目标点","wayline_failed":"执行失败","wayline_ok":"执行成功,已飞向目标点","wayline_progress":"执行中"} | 
| way_point_index | 当前执行到第几个航点 | int | 
planned_path_points字段:
| Column | Name | Type | Description | 
|---|---|---|---|
| height | 目标点高度 | float | {"max":10000,"min":2,"step":0.1,"unit_name":"米 / m"} 目标点高度(椭球高),使用 WGS84 模型 | 
| latitude | 目标点纬度 | float | {"max":90,"min":-90} 目标点纬度,角度值,南纬是负,北纬是正,精度到小数点后6位 | 
| longitude | 目标点经度 | float | {"max":180,"min":-180} 目标点经度,角度值,东经是正,西经是负,精度到小数点后6位 | 
Example:
{
	"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
	"data": {
		"fly_to_id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
		"planned_path_points": [
			{
				"height": 123.234,
				"latitude": 13.23,
				"longitude": 123.234
			}
		],
		"remaining_distance": 0,
		"remaining_time": 0,
		"result": 0,
		"status": "wayline_progress",
		"way_point_index": 0
	},
	"need_reply": 1,
	"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
	"timestamp": 16540709686556,
	"method": "fly_to_point_progress"
}
Topic: thing/product/{gateway_sn}/services
Direction: down
Method: fly_to_point_stop
Data: null
Example:
{
	"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
	"data": {},
	"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
	"timestamp": 1654070968655,
	"method": "fly_to_point_stop"
}
Topic: thing/product/{gateway_sn}/services_reply
Direction: up
Method: fly_to_point_stop
Data:
| Column | Name | Type | constraint | Description | 
|---|---|---|---|---|
| result | 返回码 | int | 非 0 代表错误 | 
Example:
{
	"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
	"data": {
		"result": 0
	},
	"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
	"timestamp": 1654070968655,
	"method": "fly_to_point_stop"
}
说明:「一键起飞」或「flyto 飞向目标点」的过程中,可以通过该命令快速更新目标点
Topic: thing/product/{gateway_sn}/services
Direction: down
Method: fly_to_point_update
Data:
| Column | Name | Type | constraint | Description | 
|---|---|---|---|---|
| max_speed | 指令飞行过程中能达到的最大速度 | int | {"max":15,"min":1,"unit_name":"米每秒 / m/s"} | |
| points | 更新的目标点列表 | array | {"size": -, "item_type": struct} | 仅支持 1 个目标点 | 
| »latitude | 目标点纬度 | double | {"max":90,"min":-90} | 目标点纬度,角度值,南纬是负,北纬是正,精度到小数点后6位 | 
| »longitude | 目标点经度 | double | {"max":180,"min":-180} | 目标点经度,角度值,东经是正,西经是负,精度到小数点后6位 | 
| »height | 目标点高度 | float | {"max":10000,"min":2,"step":0.1,"unit_name":"米 / m"} | 目标点高度(椭球高),使用 WGS84 模型 | 
Example:
{
	"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
	"data": {
		"max_speed": 12,
		"points": [
			{
				"height": 100,
				"latitude": 12.23,
				"longitude": 12.23
			}
		]
	},
	"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
	"timestamp": 1654070968655,
	"method": "fly_to_point_update"
}
Topic: thing/product/{gateway_sn}/services_reply
Direction: up
Method: fly_to_point_update
Data:
| Column | Name | Type | constraint | Description | 
|---|---|---|---|---|
| result | 返回码 | int | 非 0 代表错误 | 
Example:
{
	"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
	"data": {
		"result": 0
	},
	"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
	"timestamp": 1654070968655,
	"method": "fly_to_point_update"
}
Topic: thing/product/{gateway_sn}/services
Direction: down
Method: flighttask_execute
Data:
| Column | Name | Type | constraint | Description | 
|---|---|---|---|---|
| flight_id | 计划 ID | text | ||
| file | 航线文件对象 | struct | ||
| »url | 文件 URL | text | ||
| »fingerprint | 文件签名 | text | 文件内容 MD5 签名 | 
示例:
{
	"bid": "00000000-0000-0000-0000-000000000000",
	"data": {
        "file": {
			"url": "https://cloud.3g.com.cn/kmz/waypoint_v3_test_file.kmz",
    		"fingerprint": "MD5"        
        },
		"flight_id": "12345678"
	},
	"tid": "00000000-0000-0000-0000-000000000000",
	"timestamp": 1654070968655,
	"method": "flighttask_execute"
}
Topic: thing/product/{gateway_sn}/services
Direction: down
Method: flighttask_pause
Data: null
Example:
{
	"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
	"data": {},
	"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
	"timestamp": 1654070968655,
	"method": "flighttask_pause"
}
Topic: thing/product/{gateway_sn}/services_reply
Direction: up
Method: flighttask_pause
Data:
| Column | Name | Type | constraint | Description | 
|---|---|---|---|---|
| result | 返回码 | int | 非 0 代表错误 | 
Example:
{
	"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
	"data": {
		"result": 0
	},
	"need_reply": 1,
	"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
	"timestamp": 1654070968655,
	"method": "flighttask_pause"
}
Topic: thing/product/{gateway_sn}/services
Direction: down
Method: flighttask_recovery
Data: null
Example:
{
	"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
	"data": {},
	"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
	"timestamp": 1654070968655,
	"method": "flighttask_recovery"
}
Topic: thing/product/{gateway_sn}/services_reply
Direction: up
Method: flighttask_recovery
Data:
| Column | Name | Type | constraint | Description | 
|---|---|---|---|---|
| result | 返回码 | int | 非 0 代表错误 | 
Example:
{
	"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
	"data": {
		"result": 0
	},
	"need_reply": 1,
	"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
	"timestamp": 1654070968655,
	"method": "flighttask_recovery"
}
Topic:** thing/product/{gateway_sn}/services
Direction: down
Method: flighttask_stop
Data:
| Column | Name | Type | constraint | Description | 
|---|---|---|---|---|
| flight_id | 任务id | text | ||
| reason | 结束原因 | enum_int | {"0":"正常结束","1":"另一机场状态机异常"} | 
Example:
{
	"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
	"data": {
		"flight_id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
		"reason": 0
	},
	"method": "flighttask_stop",
	"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
	"timestamp": 1234567890123
}
Topic: thing/product/{gateway_sn}/services_reply
Direction: up
Method: flighttask_stop
Data:
| Column | Name | Type | constraint | Description | 
|---|---|---|---|---|
| result | 返回码 | int | 非 0 代表错误 | 
Example:
{
	"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
	"data": {
		"result": 0
	},
	"method": "flighttask_stop",
	"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
	"timestamp": 1695634358385
}
Topic: thing/product/{gateway_sn}/events
Direction: up
Method: flighttask_progress
Data:
| Column | Name | Type | constraint | Description | 
|---|---|---|---|---|
| flight_id | 任务 ID | text | ||
| state | 断点状态 | enum_int | {"0":"在航段上","1":"在航点上"} | |
| way_point_index | 航线 ID | int | 
Example:
{
	"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
	"data": {
				"way_point_index": 3,
				"flight_id": "flight_id",
				"state": 1,
		},
		"result": 0
	},
	"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
	"timestamp": 1654070968655,
	"method": "flighttask_progress"
}
Topic: thing/product/{gateway_sn}/services
Direction: down
Method: return_home
Data: null
Example:
{
	"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
	"data": {},
	"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
	"timestamp": 1654070968655,
	"method": "return_home"
}
Topic: thing/product/{gateway_sn}/services_reply
Direction: up
Method: return_home
Data:
| Column | Name | Type | constraint | Description | 
|---|---|---|---|---|
| result | 返回码 | int | 非 0 代表错误 | 
Example:
{
	"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
	"data": {
		"result": 0
	},
	"need_reply": 1,
	"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
	"timestamp": 1654070968655,
	"method": "return_home"
}
Topic: thing/product/{gateway_sn}/services
Direction: down
Method: return_home_cancel
Data: null
Example:
{
	"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
	"data": {},
	"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
	"timestamp": 1654070968655,
	"method": "return_home_cancel"
}
Topic: thing/product/{gateway_sn}/services_reply
Direction: up
Method: return_home
Data:
| Column | Name | Type | constraint | Description | 
|---|---|---|---|---|
| result | 返回码 | int | 非 0 代表错误 | 
Example:
{
	"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
	"data": {
		"result": 0
	},
	"need_reply": 1,
	"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
	"timestamp": 1654070968655,
	"method": "return_home_cancel"
}
Topic: thing/product/{gateway_sn}/services
Direction: down
Method: landing_smart
Data: null
Example:
{
	"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
	"data": {},
	"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
	"timestamp": 1654070968655,
	"method": "landing_smart"
}
Topic: thing/product/{gateway_sn}/services_reply
Direction: up
Method: return_home
Data:
| Column | Name | Type | constraint | Description | 
|---|---|---|---|---|
| result | 返回码 | int | 非 0 代表错误 | 
Example:
{
	"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
	"data": {
		"result": 0
	},
	"need_reply": 1,
	"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
	"timestamp": 1654070968655,
	"method": "landing_smart"
}
Topic: thing/product/{gateway_sn}/services
Direction: down
Method: emergency_stop
Data: null
Example:
{
	"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
	"data": {},
	"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
	"timestamp": 1654070968655,
	"method": "emergency_stop"
}
Topic: thing/product/{gateway_sn}/services_reply
Direction: up
Method: emergency_stop
Data:
| Column | Name | Type | constraint | Description | 
|---|---|---|---|---|
| result | 返回码 | int | 非 0 代表错误 | 
Example:
{
	"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
	"data": {
		"result": 0
	},
	"need_reply": 1,
	"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
	"timestamp": 1654070968655,
	"method": "emergency_stop"
}
Topic: thing/product/{gateway_sn}/services
Direction: down
Method: drc_mode_enter
Data::
| Column | Name | Type | Description | 
|---|---|---|---|
| hsi_frequency | HSI 频率 | int | {"max":30,"min":1,"step":"","unit_name":"赫兹 / Hz"} 设置 HSI 上报频率 | 
| mqtt_broker | Broker 连接信息 | struct | 获取 MQTT 中继服务的地址与认证信息 | 
| osd_frequency | OSD 频率 | int | {"max":30,"min":1,"step":"","unit_name":"赫兹 / Hz"} 设置 OSD 上报频率 | 
mqtt_broker字段:
| Column | Name | Type | Description | 
|---|---|---|---|
| address | |||
| client_id | |||
| enable_tls | |||
| expire_time | |||
| password | |||
| username | 
Example:
{
	"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
	"data": {
		"hsi_frequency": 1,
		"mqtt_broker": {
			"address": "mqtt.dji.com:8883",
			"client_id": "sn_a",
			"enable_tls": true,
			"expire_time": 1672744922,
			"password": "jwt_token",
			"username": "sn_a_username"
		},
		"osd_frequency": 10
	},
	"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
	"timestamp": 1654070968655,
	"method": "drc_mode_enter"
}
Topic: thing/product/{gateway_sn}/services_reply
Direction: up
Method: drc_mode_enter
Data:
| Column | Name | Type | constraint | Description | 
|---|---|---|---|---|
| result | 返回码 | int | 非 0 代表错误 | 
Example:
{
	"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
	"data": {
		"result": 0
	},
	"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
	"timestamp": 1654070968655,
	"method": "drc_mode_enter"
}
进入指令飞行模式后允许通过该指令控制飞行器航行方向与速度,发送的频率需要保持在5-10hz以内让设备能够比较精准的控制速度变化与方向。
Topic: thing/product/{gateway_sn}/drc/down
Direction: down
Method: drone_control
Data:
| Column | Name | Type | Description | 
|---|---|---|---|
| h | 上下方向的速度 | double | {"max":5,"min":-4,"unit_name":"米每秒 / m/s"} 向上向下移动的最大速度,负值表示向下移动 | 
| seq | 命令序号 | int | 递增的序号,保证指令顺序执行。若 x、y、h、w 参数发生变化,seq 需要从 0 开始增长。 | 
| w | 机身角速度 | double | {"max":90,"min":-90,"unit_name":"弧度每秒 / rad/s"} 顺时针与逆时针的最大角速度,负值表示逆时针转动 | 
| x | 前进后退方向的速度 | double | {"max":17,"min":-17,"unit_name":"米每秒 / m/s"} 前进后退的最大速度,负值表示向后移动 | 
| y | 左右方向的速度 | double | {"max":17,"min":-17,"unit_name":"米每秒 / m/s"} 左右移动的最大速度,负值表示向左移动 | 
Example:
{
	"data": {
		"h": 2.76,
		"seq": 1,
		"w": 2.86,
		"x": 2.34,
		"y": -2.45
	},
	"method": "drone_control"
}
Topic: thing/product/{gateway_sn}/drc/up
Direction: up
Method: hsi_info_push
Data:
| Column | Name | Type | Description | 
|---|---|---|---|
| around_distances | 周边的障碍物距离 | array | 水平方向观察点,分布在[0,360)的角度区间,0对应机头方向正前方,顺时针分布,例如0度为机头正前方,90度为飞行器正右方。每个数值表示该角度上障碍物与飞行器距离,60000 表示该角度没有障碍物。若上报空数组,意味任意角度都无障碍物。若上报 4 个数据的数组,意味该数据为 TOF 避障数据,在红外避障失效时上报,譬如夜晚场景。 | 
| back_enable | 后视避障开关状态 | bool | |
| back_work | 后视避障工作状态 | bool | |
| down_distance | 下方的障碍物距离 | int | {"unit_name":"毫米 / mm"} | 
| down_enable | 下视避障开关状态 | bool | |
| down_work | 下视避障工作状态 | bool | |
| front_enable | 前视避障开关状态 | bool | |
| front_work | 前视避障工作状态 | bool | |
| horizontal_enable | 水平避障开关状态 | bool | |
| horizontal_work | 水平避障工作状态 | bool | |
| left_enable | 左视避障开关状态 | bool | |
| left_work | 左视避障工作状态 | bool | |
| right_enable | 右视避障开关状态 | bool | |
| right_work | 右视避障工作状态 | bool | |
| up_distance | 上方的障碍物距离 | int | {"unit_name":"毫米 / mm"} | 
| up_enable | 上视避障开关状态 | bool | |
| up_work | 上视避障工作状态 | bool | |
| vertical_enable | 垂直避障开关状态 | bool | |
| vertical_work | 垂直避障工作状态 | bool | 
Example:
{
	"method": "hsi_info_push",
	"timestamp": 1670415891013,
	"data": {
		"up_distance": 10,
		"down_distance": 10,
		"around_distance": [
			10,
			8,
			9,
			16,
			2
		],
		"up_enable": true,
		"up_work": true,
		"down_enable": true,
		"down_work": true,
		"left_enable": true,
		"left_work": true,
		"right_enable": true,
		"right_work": true,
		"front_enable": true,
		"front_work": true,
		"back_enable": true,
		"back_work": true,
		"vertical_enable": true,
		"vertical_work": true,
		"horizontal_enable": true,
		"horizontal_work": true
	}
}
Topic: thing/product/{gateway_sn}/drc/up
Direction: up
Method: osd_info_push
Data:
| Column | Name | Type | Description | 
|---|---|---|---|
| attitude_head | 飞行器姿态 head 角 | float | {"unit_name":"度 / °"} 飞行器姿态 head 角 | 
| gimbal_pitch | 云台 pitch 角 | float | {"unit_name":"度 / °"} | 
| gimbal_roll | 云台 roll 角 | float | {"unit_name":"度 / °"} | 
| gimbal_yaw | 云台 yaw 角 | float | {"unit_name":"度 / °"} | 
| height | 飞行器高度 | float | {"unit_name":"度 / °"} 飞行器海拔高度 | 
| latitude | 飞行器纬度 | float | {"unit_name":"度 / °"} | 
| longitude | 飞行器经度 | float | {"unit_name":"度 / °"} | 
| speed_x | 当前飞行器 x 坐标方向的速度 | float | {"unit_name":"米每秒 / m/s"} | 
| speed_y | 当前飞行器 y 坐标方向的速度 | float | {"unit_name":"米每秒 / m/s"} | 
| speed_z | 当前飞行器 z 坐标方向的速度 | float | {"unit_name":"米每秒 / m/s"} | 
Example:
{
	"data": {
		"attitude_head": 60,
		"gimbal_pitch": 60,
		"gimbal_roll": 60,
		"gimbal_yaw": 60,
		"height": 10,
		"latitude": 10,
		"longitude": 10,
		"speed_x": 10,
		"speed_y": 10,
		"speed_z": 10
	},
	"timestamp": 1670415891013
}
Topic: thing/product/{gateway_sn}/drc/down
Direction: down
Method: drone_emergency_stop
Data: null
Example:
{
	"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
	"data": {
		"result": 0
	},
	"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
	"timestamp": 1654070968655,
	"method": "drone_emergency_stop"
}
Topic: thing/product/{gateway_sn}/drc/down
Direction: down
Method: heart_beat
Data:
| Column | Name | Type | Description | 
|---|---|---|---|
| seq | 命令序号 | int | 递增的序号,保证指令顺序执行 | 
| timestamp | 心跳发送时间戳 | int | {"unit_name":"毫秒 / ms"} 若超过 1 分钟未收到业务方发送心跳协议,设备将会认为 DRC 链路处于空闲退出 DRC 链路。 | 
Example:
{
	"data": {
		"seq": 10,
		"timestamp": 1670415891013
	},
	"method": "heart_beat",
	"seq": 1
}
Topic: thing/product/{gateway_sn}/services
Direction: down
Method: drc_mode_exit
Data::
Example:**
{
	"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
	"data": {
	},
	"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
	"timestamp": 1654070968655,
	"method": "drc_mode_exit"
}
Topic: thing/product/{gateway_sn}/services_reply
Direction: up
Method: drc_mode_exit
Data:
| Column | Name | Type | constraint | Description | 
|---|---|---|---|---|
| result | 返回码 | int | 非 0 代表错误 | 
Example:
{
	"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
	"data": {
		"result": 0
	},
	"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
	"timestamp": 1654070968655,
	"method": "drc_mode_exit"
}
Topic: thing/product/{gateway_sn}/property/set
Direction: down
Method: param_set
Data:
| Column | Name | Type | Description | 
|---|---|---|---|
| obstacle_avoidance_horizon_enable | 水平避障 | int | |
| obstacle_avoidance_downside_enable | 下避障 | int | |
| obstacle_avoidance_upside_enable | 上避障 | int | |
| rc_lost_action | 
Example:
{
	"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
	"data": {
			"obstacle_avoidance_horizon_enable": 0,
    	"obstacle_avoidance_downside_enable": 0,
    	"obstacle_avoidance_upside_enable": 0,
    	"rc_lost_action": 0,
	},
	"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
	"timestamp": 1654070968655,
	"method": "param_set"
}
Topic: thing/product/{gateway_sn}/events
Direction: up
Method: has
Data:
| Column | Name | Type | constraint | Description | 
|---|---|---|---|---|
| list | hms信息列表 | list | 
list字段:
| Column | Name | Type | constraint | Description | 
|---|---|---|---|---|
| args | 产生hms的组件信息 | Struct | ||
| code | hms编码 | string | ||
| device_type | 设备编码 | string | ||
| imminent | 是否紧急 | bool | ||
| in_the_sky | 是否在空中 | bool | ||
| level | 等级 | int | ||
| module | 模块 | 
Example:
{
    "bid":"7785a02f-b630-4d1d-be12-36d91520ab7f",
    "data":{
        "list":[
            {
                "args":{"component_index":0,"sensor_index":0},
                "code":"0x1B080003",
                "device_type":"0-89-0",
                "imminent":true,
                "in_the_sky":false,
                "level":2,
                "module":3
            }
        ]
    },
    "tid":"f1e89554-a96e-43a9-926f-b1fe3859675b",
    "timestamp":1729504021399,
    "from":"1581F6GKB24790040093",
    "gateway":"4LGZM7300A01VV",
    "method":"hms",
    "need_reply":false
}