Architectural Design
-
Configure AWS Cloud OSS details and callback address in FlightHub 2.
-
After completing the wayline mission, the dock uploads media files to the corresponding AWS Cloud OSS.
-
Upon receiving successful file upload notification, FlightHub 2 sends callback data to the user's specified cloud platform through the configured callback address.
Integration Process
Operator: Third-party Partners
Process Details
Preparation
Media transmission parameter configuration.
Storage Address
Use STS temporary credentials to access OSS, refer to AWS Cloud's official documentation for configuration information.
{
"access_key_id":"xxxxxxx", // required
"access_key_secret":"xxxxxxxx", // required
"bucket":"xx-bucket", // required
"region":"us-east-1", // required
"arn":"xxxxxx", // required
"policy": "xxxxxxx", // optional
"role_session_name":"xxxxx", // required
"provider":"aws"// required, aws or ali
}
API Address (Notification Receiving Interface)
Must be an HTTPS interface, such as https://x.com/xxx
Request Parameters:
{
"notify_type":"drc_file_upload_complete",
"org_id":"Organization ID",
"org_name":"Organization Name",
"prj_id":"Project ID",
"prj_name":"Project Name",
"sn":"Device SN",
"task_info":{
"task_type":"Task Type",
"tags":["Tag 1","Tag 2"]
},
"files":[
{
"name":"Name",
"key":"AWS Cloud key"
}
],
"folder_info":{
"expected_file_count":0,
"uploaded_file_count":0,
"folder_id":0
}
}
Return:
{
"code":0,
"message":"Error Message when code is not 0"
}
Configuration
-
Access organization settings with admin rights.
-
Configure storage bucket details.
-
Refer to the preparation section, formatted as JSON.
-
Enable the Media File Direct Transfer function
-
Schedule tasks for Media File Direct Transfer and set tags.
Testing
- After flight, check if the media file library transmission is completed, and there should be a popup notification says "media uploaded to third party platform + task tag".
2. Confirm third-party platforms receive notifications on time with right format and complete information (organization + project + device + task + file + tag).
{
"notify_type":"drc_file_upload_complete",
"org_id":"Organization ID",
"org_name":"Organization Name",
"prj_id":"Project ID",
"prj_name":"Project Name",
"sn":"Device SN",
"task_info":{
"task_type":"Task Type",
"tags":["Tag 1","Tag 2"]
},
"files":[
{
"name":"Name",
"key":"AWS Cloud key"
}
],
"folder_info":{
"expected_file_count":0,
"uploaded_file_count":0,
"folder_id":0
}
}
FAQ
-
What happens if the STS credentials are incorrect in FlightHub 2?FlightHub 2 will display an error when saving STS. Successful setup means correct STS.
-
If the client platform doesn't process FlightHub 2 callbacks, will there be retries?Yes, in the first 2 hours, there's a callback every 30 minutes. Afterwards, it's every 2 hours.
-
Supported oss
AWS, Ali
Comments
9 comments
Hi. I've been trying to configure my AWS Cloud OSS in Flighthub2. I noticed two things:
The inputed data follows exactly the JSON format described in this document:
Could you provide more information regarding the "Storage Location" JSON? Is the format correct? The ARN needed is the one of the Role or the one of the Bucket?
Could you provide documentation regarding the error code and message? I couldn't find documentation associated with this online.
Thanks,
Hi Matias. I've written an article about it: DJI FlightHub Sync: Media File Direct Transfer to AWS. Maybe you will find it useful.
Hi Jacek, thank you for sharing your article. It is updated and very well detailed!
JacekKosciesza thaks for putting this, as we have been working on this also.
How has your testing gone? Can you confirm this is only currently working for DJI dock and no drones like Mavic 3? this is really annoying as we use both for or worklows, yet as usual DJI provide half-baked solution..
Have you experimented with the RTMP streaming? we are finding a latency of over 12 seconds, its really bad...
Hi Alex Hall,
Yes, it works with Dock, but I couldn't make it work with my Mavic 3E. I sent question about it to the DJI with a list of several issues/questions/suggestions) e.g.
DJI never responded to those questions.
Yes, I'm currently working on livestreaming feature, so yeah I experimented with stream forwarding and telemetry.
BTW: in both cases I would have suggestion to the DJI to make it work using secure protocols (using TLS) + more advanced auth e.g. using certificates + fully customizable stream forwarding URL, because I couldn't make it work directly with AWS services like IVS and IoT Core and I had to use some proxy services.
From my experience (with my Mavic 3E, architecture like: DJI -> NGINX proxy -> Amazon IVS) latency was around 6 seconds I think. But yeah, it would be great if they would support lower latency protocols like WebRTC or SRT.
Jacek
Hi Jacek, so you tested KMZ upload to flight hub from your own OSS bucket?
One thought I had, if we are exporting KMZ files created by third party mission planner to go direct to flight hub, if we find that we have to reupload the same file again (due to parameter changes in the KMZ) but KMZ file name stays the same, how does flight hub deal with duplicate file name? Can it overwrite the original?
But also another point- how does one define under which project the uploaded KMZ files are allocated? I.e once uploaded to FH, how are they then viewed?
Any experience you have on this greatly appreciated.
Also re image sync, is it still true it’s only working with the Docks only? Or do you know now if it’s also working with Mavic 3 / M30 etc?
Alex
Hello JacekKosciesza
Have you succeed to solve the following issue :
"
Incomplete notification (sometimes files are uploaded to S3 bucket, but list of the files is not present in notification, I just get one entry in the files array which is "Remote-Control")
"
?
Have a great day.
Hello Mateus Martins Correa,
Where you able to find a solution to this issue?
Hi Mateus Martins Correa, Juan Salas
I created a workaround for that problem.
Files are still uploaded to S3 bucket, so the idea is simple - find those is S3 and create that missing list of files yourself. You can do that using task ID, which is in notification (that task ID is part of the object key in S3 bucket). Reality is of course more complicated, because AFAIK AWS SDK v3 doesn't have a way to filter/find objects this way - you would have to list all objects and filter it yourself, which is not very scalable. Solution is to create your own index of files, which you can easily query. I use Amazon S3 Event Notifications for that, together with SQS (to process it in batches), Lambda function and DynamoDB (where I create index: PK is task ID, SK is object key from S3, plus I store size just in case).
There is a catch however:
That means that potentially you will get notification from the DJI before your DynamoDB index is fully created. That's why I postpone processing by 15 minutes using EventBridge Scheduler.
Rest of the workaround is relatively simple - Lambda is triggered by EventBridge Scheduler with original notification from the DJI as input/event. I build that missing list of files by querying DynamoDB (PK equal task ID) and proceed normally.
This is not the only issue with FlightHub Sync. I'll try to describe other problems which we are facing in a separate comment.
I hope it will help you,
Jacek
Please sign in to leave a comment.