Device Management

2023-07-13
No Rating

Device Topology Update

Topic: sys/product/{gateway_sn}/status

Direction: up

Method: update_topo

Data:

ColumnNameTypeconstraintDescription
typeProduct type of gateway deviceint{}Please refer to: Product Supportedopen in new window
sub_typesub product type of gateway sub deviceint{}Please refer to: Product Supportedopen in new window
device_secretSecret key of gateway devicetext{}
noncenoncetext{}
thing_versionThing module version of gateway devicetext{}
sub_devicesSub device listarray-
»[array_item]Elements in arraystruct-{"size": "1"}
»»snSerial number of sub devicetext{}
»»typeProduct type of sub deviceint{}Please refer to: Product Supportedopen in new window
»»sub_typeSub product type of sub deviceint{}Please refer to: Product Supportedopen in new window
»»indexChannel index of connecting the gateway deviceint{}
»»device_secretSecret key of sub devicetext{}
»»noncenoncetext{}
»»thing_versionThing module version of sub devicetext{}

Example:

## Gateway device + sub devibe online
{
	"tid": "tid001",
	"bid": "bid001",
	"method": "update_topo",
	"timestamp": 1234567890123,
	"data": {
		"type": 98,
		"sub_type": 0,
		"device_secret": "secret",
		"nonce": "nonce",
		"thing_version": "1.0.0",
		"sub_devices": [
			{
				"sn": "drone001",
				"type": 116,
				"sub_type": 0,
				"index": "A",
				"device_secret": "secret",
				"nonce": "nonce",
				"thing_version": "1.0.0"
			}
		]
	}
}

## Sub device offline
{
    "tid": "tid001",
    "bid": "bid001",
    "method": "update_topo",
    "timestamp": 1234567890123,
    "data": {
        "type": 98,
        "sub_type": 0,
        "device_secret":"secret",
        "nonce":"nonce",
        "thing_version": "1.0.0",
        "sub_devices":[]
    }
}

Device Property Push

Topic: thing/product/{device_sn}/state Status data: report when the status changes

Topic: thing/product/{device_sn}/osd Stable frequency data: Device will report in the frequency of 0.5HZ

Direction: up

API Explanation:
The payload property reporting refers to the property reporting of the payload mounted on the aircraft. For example, the property reporting of the camera. One payload is identified by payload index: {type-subtype-gimbalIndex}. The "type” and "subtype" can be referred to Product Typeopen in new window. The "gimbalindex" can be referred to the wpml:payloadPositionIndex of DJI WPMLopen in new window.

Currently, the protocols that involve the reporting of payload property are the Device Property Push of the gateway device and the Livestream ability update of the live streaming function. For Device Property Push, the property reported is mainly about the camera itself. For example, the pitch angle, roll angle, and yaw angle. For Livestream ability update, the property reported is mainly about the live stream ability of the camera. For example, the maximum code stream number of pushing streams at the same time. Please refer to the example below for the specific structure of the payload property. The payload property of the remote controller is sent in one message, but the payload property of the dock is sent by multiple messages.

Data:

ColumnNameTypeconstraintDescription
dataData contenttext{}The contant can refer to the property of device
»camera_indextype-subtype-gimbalIndextext{}gimbalIndex is camera location. For type, sub_type, please refer to Product Supportedopen in new window

Example:

Topic: thing/product/{dock_sn}/state

Topic: thing/product/{dock_sn}/osd

{
    "tid": "65717bf1-aee7-4abb-8ea3-9b1908548d74",
    "bid": "cf5ad2e6-2f32-4b59-980e-d5c9ee412805",
    "timestamp": 1667220873846,
    "data": {
        "job_number": 492,
        "acc_time": 1859010,
        "activation_time": 0,
        "maintain_status": {
            "maintain_status_array": [
                {
                    "state": 0,
                    "last_maintain_type": 17,
                    "last_maintain_time": 0,
                    "last_maintain_work_sorties": 0
                }
            ]
        },
        "electric_supply_voltage": 231,
        "working_voltage": 25440,
        "working_current": 1120,
        "backup_battery": {
            "voltage": 26631,
            "temperature": 27.9,
            "switch": 1
        },
        "drone_battery_maintenance_info": {
            "maintenance_state": 0,
            "maintenance_time_left": 0
        }
    },
    "gateway": "dock_sn"
} 
{
    "bid": "d6cfcea4-c6ca-439b-948f-b17d88fc308f",
    "data": {
        "flighttask_prepare_capacity": 1,
        "flighttask_step_code": 255,
        "media_file_detail": {
            "remain_upload": 0
        },
        "wireless_link": {
            "4g_freq_band": 2.4,
            "4g_gnd_quality": 0,
            "4g_link_state": 0,
            "4g_quality": 0,
            "4g_uav_quality": 0,
            "dongle_number": 0,
            "link_workmode": 0,
            "sdr_freq_band": 2.4,
            "sdr_link_state": 0,
            "sdr_quality": 0
        }
    },
    "tid": "e4c15182-776b-4c13-9973-3fc76848ca15",
    "timestamp": 1667220881576,
    "gateway": "dock_sn"
}
{
    "tid": "43d2e632-1558-4c4e-83d2-eeb51b7a377a",
    "bid": "7578f2ac-1f12-4d47-9ab6-5de146ed7b8a",
    "timestamp": 1667220916697,
    "data": {
        "network_state": {
            "type": 2,
            "quality": 0,
            "rate": 5.0970001220703125
        },
        "drone_charge_state": {
            "state": 0,
            "capacity_percent": 100
        },
        "drone_in_dock": 1,
        "rainfall": 0,
        "wind_speed": 0,
        "environment_temperature": 24,
        "temperature": 24.9,
        "humidity": 62,
        "latitude": 22.907809968,
        "longitude": 113.703482143,
        "height": 34.174125671386719,
        "alternate_land_point": {
            "latitude": 22.907898319908661,
            "longitude": 113.70347329676635,
            "safe_land_height": 0,
            "is_configured": 1
        },
        "first_power_on": 1631945855969,
        "position_state": {
            "is_calibration": 1,
            "is_fixed": 2,
            "quality": 5,
            "gps_number": 6,
            "rtk_number": 25
        },
        "storage": {
            "total": 82045336,
            "used": 51772
        },
        "mode_code": 1,
        "cover_state": 0,
        "supplement_light_state": 0,
        "emergency_stop_state": 0,
        "air_conditioner_mode": 0,
        "battery_store_mode": 1,
        "alarm_state": 0,
        "putter_state": 0,
        "sub_device": {
            "device_sn": "1581F5BKD225D00BP891",
            "device_model_key": "0-67-0",
            "device_online_status": 0,
            "device_paired": 1
        }
    },
    "gateway": "dock_sn"
}

Topic: thing/product/{aircraft_sn}/state

Topic: thing/product/{aircraft_sn}/osd

{
    "bid": "1bfdfbad-eb5a-4652-a90d-fa4d595d8c71",
    "data": {
        "52-0-0": {
            "measure_target_altitude": 0,
            "measure_target_distance": 591.70001220703125,
            "measure_target_error_state": 1,
            "measure_target_latitude": 0,
            "measure_target_longitude": 0,
            "payload_index": "52-0-0",
            "version": 1
        },
        "activation_time": 1667935211,
        "attitude_head": 41.7,
        "attitude_pitch": 2.7,
        "attitude_roll": 0,
        "battery": {
            "batteries": [
                {
                    "capacity_percent": 95,
                    "firmware_version": "02.00.20.44",
                    "high_voltage_storage_days": 16,
                    "index": 0,
                    "loop_times": 137,
                    "sn": "4BUPJ99DAD009W",
                    "sub_type": 0,
                    "temperature": 33.3,
                    "type": 0,
                    "voltage": 24303
                },
                {
                    "capacity_percent": 85,
                    "firmware_version": "02.00.20.44",
                    "high_voltage_storage_days": 5,
                    "index": 1,
                    "loop_times": 82,
                    "sn": "4BUPJ9EDAD01CE",
                    "sub_type": 0,
                    "temperature": 32,
                    "type": 0,
                    "voltage": 24311
                }
            ],
            "capacity_percent": 90,
            "landing_power": 0,
            "remain_flight_time": 0,
            "return_home_power": 0
        },
        "distance_limit_status": {
            "distance_limit": 5000,
            "state": 0
        },
        "elevation": 0,
        "firmware_version": "05.01.0214",
        "gear": 1,
        "height": 38.417465209960938,
        "height_limit": 120,
        "home_distance": 0,
        "horizontal_speed": 0,
        "latitude": 0,
        "longitude": 0,
        "maintain_status": {
            "maintain_status_array": [
                {
                    "last_maintain_flight_time": 0,
                    "last_maintain_time": 0,
                    "last_maintain_type": 1,
                    "state": 0
                },
                {
                    "last_maintain_flight_time": 0,
                    "last_maintain_time": 0,
                    "last_maintain_type": 2,
                    "state": 0
                },
                {
                    "last_maintain_flight_time": 0,
                    "last_maintain_time": 0,
                    "last_maintain_type": 3,
                    "state": 0
                }
            ]
        },
        "mode_code": 0,
        "night_lights_state": 0,
        "obstacle_avoidance": {
            "downside": 1,
            "horizon": 1,
            "upside": 1
        },
        "position_state": {
            "gps_number": 0,
            "is_fixed": 0,
            "quality": 0,
            "rtk_number": 0
        },
        "storage": {
            "total": 0,
            "used": 0
        },
        "total_flight_distance": 0,
        "total_flight_sorties": 0,
        "total_flight_time": 0,
        "track_id": "",
        "vertical_speed": 0,
        "wind_direction": 0,
        "wind_speed": 0
    },
    "tid": "2d2040eb-23b0-43dc-b7ac-64838276c4ac",
    "timestamp": 1670422793916,
    "gateway": "dock_sn"
}

Device Property Set

Topic: thing/product/{gateway_sn}/property/set

Direction: down

Data:

ColumnNameTypeconstraintDescription
dataData contenttext{}The contant can refer to the property of device

Example:

{
    "bid":"00000000-0000-0000-0000-000000000000",
    "data":{
        "distance_limit_status": {"state": 1}
    },
    "tid":"00000000-0000-0000-0000-000000000000",
    "timestamp":1643268212187
}

Topic: thing/product/{gateway_sn}/property/set_reply

Direction: up

Data:

ColumnNameTypeconstraintDescription
dataData contenttext{}The contant can refer to the property of device

Example:

{
    "bid":"00000000-0000-0000-0000-000000000000",
    "data":{
        "distance_limit_status": {
            "state": {
                "result": 0  // 0: Success,1:Fail,2:Time Out,0x123456 Precise error code
                }
       }
    },
    "tid":"00000000-0000-0000-0000-000000000000",
    "timestamp":1643268212187
}
If you have any comments or confusion about our documentation, you can click here to give feedback and we will get back to you as soon as possible.