10.dock-access-to-cloud
Overview
The DJI Dock access to the Server requires the DJI Pilot 2 installed on the remote controller. As shown in the following figure, developers can complete the access process according to the instruction displayed in the Pilot. During the access process, developers need to check the device (such as checking the emergency stop buttons, and whether the internet is connected), connect the aircraft to the Dock, complete the configuration information (such as filling in the MQTT account and password to realize the MQTT connection), and so on. Through the Demo, operation instruction for the access process can be obtained. For the instruction video, please read the "Dock access to Cloud Server" in Function Display Video.

Dock access to the server needs License verification. The License comes from the App application of Cloud API type in the Developer Website. The application result is shown in the following figure. After the successful application, the developer can be determined as a developer authorized by DJI.

Notes:
When DJI Pilot 2 and the DJI Dock access third-party clouds, in scenarios with high-security requirements, the communication link needs to be encrypted to achieve secure data communication. By default, the SSL link believe that the device will authenticate the server, and the server will not authenticate the device. If the server enables the device authentication, the configuration of "clientAuth" needs to be performed on the server.
DJI Pilot 2 and DJI Dock support certificates issued by Godaddy. If developers need data security encryption, they can use the same certification authority certificate as DJI to achieve MQTT SSL authentication.
Interaction Sequence Diagram
sequenceDiagram
participant pilot as DJI Pilot 2
participant client as DJI Dock
participant server as Cloud Server
note over pilot: fill in the MQTT gateway address, MQTT account and password
client ->> server: MQTT is connected
note over pilot, server: License verification
client ->> server: request the required parameters of License verification Topic: thing/product/{gateway_sn}/requests<br/>Method: config
server -->> client: return parameter Topic: thing/product/{gateway_sn}/requests_reply<br/>Method: config
note over client: License verification success
opt If the verification fails, the following organization binding process will not proceed.
note over client: License verification fail
client -x server: MQTT is disconnected
end
note over pilot, server: organization bind
pilot ->> client: request device bind information
client ->> server: get device bind information Topic: thing/product/{gateway_sn}/requests<br/>Method: airport_bind_status
note over server: query device binding information
server -->> client: return query result Topic: thing/product/{gateway_sn}/requests_reply<br/>Method: airport_bind_status
opt If the device is not bound
pilot ->> client: request the organization information corresponding to the device binding code
client ->> server: request corresponding organization information Topic: thing/product/{gateway_sn}/requests<br/>Method: airport_organization_get
note over server: query corresponding organization information
server -->> client: return query result Topic: thing/product/{gateway_sn}/requests_reply<br/>Method: airport_organization_get
pilot ->> client: bind the device to the corresponding organization through the device bind code
client ->> server: device binds to organization Topic: thing/product/{gateway_sn}/requests<br/>Method: airport_organization_bind
note over server: device binds to organization
server -->> client: return binding result Topic: thing/product/{gateway_sn}/requests_reply<br/>Method: airport_organization_bind
endDetailed API Realization
Get the configuration
Obtain organization binding information
Search for the organization information that the device is bound to If the device is successfully bound, the DJI Dock and aircraft will be bound to the corresponding organization of the device binding code. Developers can custom design how to verify and get the organization name for binding through the device binding code and organization ID filled in the Pilot. In the Demo, the device binding code is filled by default, it is only for reference.
Device binds to organization
Last updated