设备管理
设备拓扑更新
Topic: sys/product/{gateway_sn}/status
Direction: up
Method: update_topo
Data:
| Column | Name | Type | constraint | Description |
|---|---|---|---|---|
| domain | 网关设备的命名空间 | string | ||
| type | 网关设备的产品类型 | int | ||
| sub_type | 网关子设备的产品子类型 | int | ||
| device_secret | 网关设备的密钥 | text | ||
| thing_version | 网关设备的物模型版本 | text | ||
| sub_devices | 子设备列表 | array | {"size": 1, "item_type": struct} | |
| »sn | 子设备序列号(SN) | text | ||
| »domain | 子设备的命名空间 | string | ||
| »type | 子设备的产品类型 | int | ||
| »sub_type | 子设备的产品子类型 | int | ||
| »index | 连接网关设备的通道索引 | string | ||
| »device_secret | 子设备的密钥 | text | ||
| »thing_version | 子设备的物模型版本 | text |
Example:
//sub_devices online
{
"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"method": "update_topo",
"timestamp": 1234567890123,
"data": {
"domain": "3",
"type": 119,
"sub_type": 0,
"device_secret": "secret",
"nonce": "nonce",
"thing_version": "1.1.2",
"sub_devices": [
{
"sn": "drone001",
"domain": "0",
"type": 60,
"sub_type": 0,
"index": "A",
"device_secret": "secret",
"nonce": "nonce",
"thing_version": "1.1.2"
}
]
}
}
//sub_devices offline
{
"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"method": "update_topo",
"timestamp": 1234567890123,
"data": {
"domain": "3",
"type": 119,
"sub_type": 0,
"device_secret":"secret",
"nonce":"nonce",
"thing_version": "1.1.2",
"sub_devices":[]
}
}
设备属性推送
Topic: thing/product/{device_sn}/state 状态数据:设备在状态变化时上报
Topic: thing/product/{device_sn}/osd 定频数据:设备将以 0.5HZ 的频率定时上报
Direction: up
API 说明:
负载属性上报是指无人机挂载的负载的属性上报,如相机的属性上报。一个负载由负载索引唯一确定(负载索引:产品类型-子类型-挂载位置 {type-subtype-gimbalIndex}),type、subtype数值
当前会涉及负载属性上报的协议有 网关设备的设备属性推送以及直播功能的直播能力更新。 对于设备属性推送,负载属性上报的内容为相机本身的信息,如 云台俯仰、偏航、横滚的角度等。对于直播能力更新,负载属性上报的内容更多为相机在直播时的能力,如最大可同时推流的码流数量。负载属性具体结构体请参考下文的example。需要注意遥控器的设备属性在一条消息体中上报,而机场的设备属性推送是分多条推送的。
Data:
| Column | Name | Type | constraint | Description |
|---|---|---|---|---|
| data | 消息内容 | text | {} | 内容可参考设备的设备属性 |
| »camera_index | type-subtype-gimbalIndex | text | {} | gimbalIndex为相机位置,type、sub_type |
Example:
Topic: thing/product/{dock_sn}/state
Topic: thing/product/{dock_sn}/osd
{
"bid": "e852fa28-955c-4510-8593-edcc67ee7d39",
"data": {
"air_conditioner": {
"air_conditioner_state": 0
},
"alarm_state": 0,
"alternate_land_point": {
"latitude": 23.0358041,
"longitude": 114.2302418,
"safe_land_height": 4,
"is_configured": 1
},
"backup_battery": {
"remain_cap": 100,
"temperature": 3131,
"voltage": 2440,
"switch": 1
},
"cover_state": 0,
"drc_state": 0,
"drone_charge_state": {
"capacity_percent": 96,
"state": 1
},
"drone_in_dock": 1,
"emergency_stop_state": 0,
"environment_humidity": 35.6,
"environment_temperature": 37.3,
"firmware_version": "1.4.0.43",
"flighttask_step_code": 5,
"height": 19.8307,
"humidity": 42,
"latitude": 23.035793,
"live_status": [
{
"error_status": 0,
"status": 0,
"video_id": "drone-camera-0",
"video_quality": 1,
"video_type": "zoom"
},
{
"error_status": 0,
"status": 1,
"video_id": "NM1923371002/nest-camera-out/normal",
"video_quality": 1,
"video_type": "normal"
},
{
"error_status": 0,
"status": 0,
"video_id": "HMB923411183/drone-camera-0/normal",
"video_quality": 1,
"video_type": "zoom"
}
],
"longitude": 114.23022,
"media_file_detail": {
},
"mode_code": 0,
"network_state": {
"type": 2
},
"position_state": {
"is_fixed": 1
},
"pressure": 0,
"putter_state": 0,
"rainfall": 0,
"rth_altitude": 30,
"scram_status": 0,
"storage": {
"storage_type": 0,
"total": 28156542976,
"used": 4042371072
},
"supplement_light_state": 0,
"takeoff_altitude": 30,
"temperature": 31,
"wind_speed": 0,
"wireless_link": {
}
},
"gateway": "NM1923371002",
"tid": "16f959cf-9a13-4d2b-9804-a92674e89a43",
"timestamp": 1715673626742
}
Topic: thing/product/{aircraft_sn}/state
Topic: thing/product/{aircraft_sn}/osd
{
"bid": "2cb37f9f-bc25-41d4-aa7d-e07462491f1e",
"data": {
"activation_time": 1715676726534,
"attitude_head": 0.0045256633,
"attitude_pitch": 0.02032269723713398,
"attitude_roll": 1.1378498077392578,
"battery": {
"capacity_percent": 96,
"remain_flight_time": 2010
},
"cameras": [
{
"camera_mode": 1,
"ir_zoom_factor": 1,
"payload_index": "68-0-0",
"zoom_factor": 1
}
],
"distance_limit_status": {
"distance_limit": 100000,
"state": 0,
"is_near_distance_limit": 0
},
"elevation": 51.005,
"height": 61.464,
"height_limit": 800,
"home_distance": 40.564087,
"horizontal_speed": 0.040024992,
"latitude": 23.035486,
"longitude": 114.23,
"mode_code": 9,
"night_lights_state": 0,
"obstacle_avoidance": {
"downside": 0,
"horizon": 1,
"upside": 0
},
"position_state": {
"calibration": 0,
"coordinate_sys": 0,
"fix_sta": 1,
"gps_number": 9,
"is_fixed": 2,
"quality": 0,
"rtk_number": 61,
"rtk_hgt": 60.688499450683594,
"rtk_inpos": 1,
"rtk_lat": 23.03548820713067,
"rtk_lon": 114.23000532515461,
"rtk_used": 1
},
"rid_state": 0,
"total_flight_time": 39825,
"vertical_speed": 1.064,
"alarm_status": 0,
"ned_altitude": -51.005,
"ned_latitude": -21.956568,
"ned_longitude": -33.985134,
"ntrip_status": "error",
"pos_type": "50",
"sn": "HMB923411183",
"total_armed_time": 63,
"vel_ned_x": 0.039,
"vel_ned_y": 0.009,
"vel_ned_z": 1.064,
"wireless_link": {
"4g_uav_quality": 34
},
"is_near_area_limit": 0,
"is_near_height_limit": 0,
"68-0-0": {
"gimbal_pitch": 0,
"gimbal_roll": 0,
"gimbal_yaw": -0.14,
"payload_index": "68-0-0",
"zoom_factor": 0.5678233438485805
}
},
"gateway": "NM1923371002",
"tid": "ab688165-77f3-4070-aefc-15414d776aec",
"timestamp": 1715676726534
}
#设备属性设置
Topic: thing/product/{gateway_sn}/property/set
Direction: down
Data:
| Column | Name | Type | constraint | Description |
|---|---|---|---|---|
| data | 消息内容 | text | 内容可参考设备的设备属性 |
RTK账号设置:
| Column | Name | Type | constraint | Description |
|---|---|---|---|---|
| data | 消息内容 | struct | ||
| »rtk_acount | 机巢rtk | struct | ||
| »»rtk_method | 方式 | text | ntrip | |
| »»type | 类型 | int | 0:机巢 1:无人机4g | |
| »»domain_name | 域名 | text | ||
| »»port | 端口 | text | ||
| »»mount_point | 挂载点 | text | ||
| »»user_name | 用户名 | text | ||
| »»password | 密码 | text | ||
| »»is_default_on | 是否默认使用 | int | 0:不默认 1:默认 |
RTK清除
| Column | Name | Type | constraint | Description |
|---|---|---|---|---|
| data | 消息内容 | struct | ||
| »rtk_acount_clear | 机巢rtk | struct |
RID配置
| data | 消息内容 | struct | ||
|---|---|---|---|---|
| »rid_config | rid配置信息机巢rtk | struct | ||
| Column | Name | Type | constraint | Description |
| »»region | 地区 | int | 0:UNKNOWN, 1:CN 2:US 3:EU 4:JP | |
| »»flight_purpose | 飞行目的地, CN,US地区必填 | text | ||
| »»key | key JP地区必填 | text | ||
| »»pilot_id | 飞手id | text | ||
| »»remote_id | RID JP地区必填 | text |
RID配置清除:
| Column | Name | Type | constraint | Description |
|---|---|---|---|---|
| data | 消息内容 | struct | ||
| »rid_config_clear | 机巢rtk | struct |
4G图传融合链路配置
| Column | Name | Type | constraint | Description |
|---|---|---|---|---|
| data | 消息内容 | struct | ||
| »wireless_link_config | 链路配置 | struct | ||
| link_work_mode | 链路工作模式 | int | {"0":"SDR 模式","1":"4G 融合模式"} | |
| 4G_uav_link_addr | 无人机端4G连接地址 | text | 4G融合模式下必填 | |
| gnd_link_addr | 地面端连接地址 | text | 4G融合模式下必填 |
设置起飞返航高度
| Column | Name | Type | constraint | Description |
|---|---|---|---|---|
| data | 消息内容 | struct | ||
| »takeoff_and_rth_altitude | 起飞和返航高度 | struct | ||
| »»rth_altitude | 返航高度 | int | ||
| »»takeoff_altitude | 起飞高度 | int |
Example:
{
"bid":"00000000-0000-0000-0000-000000000000",
"data":{
"distance_limit_status": {"state": 1}
},
"tid":"00000000-0000-0000-0000-000000000000",
"timestamp":1643268212187
}
设置起降高度
{
"bid":"00000000-0000-0000-0000-000000000000",
"data":{
"takeoff_and_rth_altitude": {
"rth_altitude": 100,
"takeoff_altitude": 100,
}
},
"tid":"00000000-0000-0000-0000-000000000000",
"timestamp":1643268212187,
"gateway" : "NM1923371002"
}
设置备降点:
{
"timestamp" : "1715675635202",
"data" : {
"set_nest_position" : {
"height" : 10.393,
"longitude" : 114.23022,
"latitude" : 23.035793,
"backupLon" : 114.2302418,
"backupLat" : 23.0358041,
"backupAlt" : 4.0
}
},
"tid" : "60933e0c-e1e3-42de-8154-948fe688103f",
"bid" : "6bb3acee-f9ed-4b31-812b-3ecf1e428cc7",
"gateway" : "NM1923371002"
}
设置RTK账号
{
"timestamp" : "1715676027869",
"data" : {
"rtk_account" : {
"type" : 0,
"rtk_method" : "Ntrip",
"domain_name" : "rtk.ntrip.qxwz.com",
"port" : 8002,
"mount_point" : "AUTO",
"user_name" : "xxxxxxx",
"password" : "xxxxx",
"is_default_on" : 1
}
},
"tid" : "4c334487-5dbf-4e1f-ab2e-295d1e578e52",
"bid" : "2b989d27-c6e5-4660-bd29-d0289ce3fa7e",
"gateway" : "NM1923371002"
}
清除RTK账号
{
"timestamp" : "1715676027869",
"data" : {
"rtk_acount_clear" : {
}
},
"tid" : "4c334487-5dbf-4e1f-ab2e-295d1e578e52",
"bid" : "2b989d27-c6e5-4660-bd29-d0289ce3fa7e",
"gateway" : "NM1923371002"
}
配置RID:
{
"timestamp" : "1715676027869",
"data" : {
"rid_config" : {
"region" : 1,
"flight_purpose" : "中国",
"key" : "xxxxxxxx",
"pilot_id" : "xxxxxxx",
"remote_id" : "xxxxxxxxx",
}
},
"tid" : "4c334487-5dbf-4e1f-ab2e-295d1e578e52",
"bid" : "2b989d27-c6e5-4660-bd29-d0289ce3fa7e",
"gateway" : "NM1923371002"
}
清除rid配置
{
"timestamp" : "1715676027869",
"data" : {
"rid_config_clear" : {
}
},
"tid" : "4c334487-5dbf-4e1f-ab2e-295d1e578e52",
"bid" : "2b989d27-c6e5-4660-bd29-d0289ce3fa7e",
"gateway" : "NM1923371002"
}
是否空中回传:
{
"timestamp" : "1715676027869",
"data" : {
"air_transfer_enable" : 1
},
"tid" : "4c334487-5dbf-4e1f-ab2e-295d1e578e52",
"bid" : "2b989d27-c6e5-4660-bd29-d0289ce3fa7e",
"gateway" : "NM1923371002"
}
Topic: thing/product/{gateway_sn}/property/set_reply
Direction: up
Data:
| Column | Name | Type | constraint | Description |
|---|---|---|---|---|
| data | 消息内容 | text | 内容可参考设备的设备属性 |
Example:
{
"bid":"00000000-0000-0000-0000-000000000000",
"data":{
"distance_limit_status": {
"state": {
"result": 0 // 0: 成功,1:失败,2:超时,0x123456 具体的错误原因码
}
}
},
"tid":"00000000-0000-0000-0000-000000000000",
"timestamp":1643268212187
}
答复备降点设置
{
"tid": "60933e0c-e1e3-42de-8154-948fe688103f",
"bid": "6bb3acee-f9ed-4b31-812b-3ecf1e428cc7",
"timestamp": 1715675635239,
"data": {
"set_nest_position": {
"result": 0
}
}
}
答复RTK账号设置:
{
"tid": "c9ecb956-931b-4cbf-bc8a-896b19963dfd",
"bid": "53e5fbfd-84e8-4c76-9bb2-bafdfa3f7d03",
"timestamp": 1715676627443,
"data": {
"rtk_account": {
"result": 0
}
}
}
答复rid配置
{
"timestamp" : "1715676027869",
"data" : {
"rid_config" : {
"result" : 0
}
},
"tid" : "4c334487-5dbf-4e1f-ab2e-295d1e578e52",
"bid" : "2b989d27-c6e5-4660-bd29-d0289ce3fa7e",
"gateway" : "NM1923371002"
}