DragonX-cloud / dji_flutter_plugin

A Flutter plugin for DJI SDK.
BSD 3-Clause "New" or "Revised" License
34 stars 8 forks source link

Cannot connect to drone #20

Closed SSIvanov19 closed 1 year ago

SSIvanov19 commented 1 year ago

I am trying to connect my drone to an app built with Flutter and DJI Mobile SDK. The app runs on iOS and registers successfully, but when I try to connect to my drone, I get the following error:

[dji.flutter] connectDrone requested
=== DjiPlugin iOS: Connect Drone Started
Returning connectedAccessories count 0

I have followed the steps in the plugin documentation and checked the App Key and the build settings. I have also tried different devices and cables, but nothing works. My drone model is Mavic Air 2 and my iOS version is 16.5.

Please help me fix this issue. Thank you.

orenagiv commented 1 year ago

Hey @SSIvanov19 From your iOS device - if you open the official DJI GO app and connect to your drone - does it work? And are you connecting your iOS device to the Remote Control of the drone with a cable? or Wifi?

SSIvanov19 commented 1 year ago

Hi, I can successfully connect to my drone with the DJI Fly app. I connect to my remote control with а USB cable.

orenagiv commented 1 year ago

Hey @SSIvanov19 Are you using the Example project in the plugin? Can you share the full logs?

orenagiv commented 1 year ago

Closing due to no response. Please re-open if needed @SSIvanov19

somasekimoto commented 9 months ago

I had the same error and solved it already, I spent an enormous time and effort to get it work though.

I managed to solve the issue, although it wasn't mentioned in the documentation. By adding the following line to Info.plist, the problem was resolved. I'm not entirely sure why this works. I've also found that the documentation can be quite unhelpful in other areas, so I recommend checking out the forum for more information.

    <array>
        <string>com.dji.video</string>
        <string>com.dji.protocol</string>
        <string>com.dji.common</string>
        <string>com.dji.logiclink</string> <----------- this 
    </array>

https://github.com/dji-sdk/Mobile-SDK-iOS/blob/master/Sample%20Code/SwiftSampleCode/DJISDKSwiftDemo/Info.plist

https://forum.dji.com/thread-231089-1-1.html