简体   繁体   中英

DJI iOS SDK (Swift) - App cannot connect to aircraft when iPhone is connected to the Mavic remote controller via USB

I have made the simplest app possible to connect to a Mavic Pro (basically the Swift version of this code (which comes from the Aircraft Binding and Activation demo on DJI's website.

My setup is as follows: iPhone running the App is connected via lightning cable to the main USB port on the RC (between the two joysticks on the bottom). The switch on the Mavic is set to "RC" (not Wifi).

When I run the app, the aircraft binding state is unknown and the DJISDKManager.product() returns nil, even though registration of the app completed successfully.

Here are some strange but helpful pieces of information:

  1. With the same setup as above, running the DJI Go App from the same device works perfectly.
  2. Using either the wireless bridge app or the wifi connections works perfectly and I'm able to connect with the aircraft no problem.

Is there some setting I'm missing? I looked at all of DJI's documentation very carefully, and have found no solutions.

The hardware accessory (the remote controller) may be associated with DJI Go now. With your app open, un-plug the lightening cable, and plug it back in. Now it will be associated with your app. With iOS 11 apps sharing hardware devices got a bit challenging.

(but thanks for mentioning DJI Go did work, then we don't have to worry the microUSB in the upper left corner of the RC was activated. Leaving the pigtail connector in will block the USB port you are using.)

I almost had the same problem. Here is the fix that worked for me.

Make sure in your info.plist file you have the following.

DJI-SDK

Also I am assuming that you calling DJISDKManager.startConnectionToProduct() after appRegisteredWithError(_ error: Error?) is called.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM