Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fetchMediaListWithCompletion: fails when the SD card has a lot of photos... #51

Closed
jgrantr opened this issue Oct 14, 2016 · 4 comments
Closed

Comments

@jgrantr
Copy link
Contributor

jgrantr commented Oct 14, 2016

iOS Device: iPad Air 2
Xcode version: 7.3.1
iOS version: 9.3.1
DJI SDK version: 3.3

Once the SD card has a certain number of files, the [DJIMediaManager fetchMediaListWithCompletion:] fails with the following error:

Error Domain=DJISDKErrorDomain Code=-1003 "Execution of this process has timed out(code:-1003)" UserInfo={NSLocalizedDescription=Execution of this process has timed out(code:-1003)}

I have tried this on both the iPad Air 2 connected to the drone, and in the simulator connected to the drone over the DJIBridge app, and it fails in both cases with the same error.

I don't know what the exact limit on the number of files is, only that it worked when there were just a few hundred (200-500) but once I hit the current amount (779) it fails.

Please let me know what can be done to fix this. We are building an app around this, and this is a big showstopper for us to use DJI products.

@dji-dev
Copy link
Contributor

dji-dev commented Oct 17, 2016

Hi @jgrantr , thanks for your feedback. This is a known issue. We will investigate and fix it in our future SDK release. Here are the explanations:

The DJI Phantom 3 series, Inspire 1 series and Phantom 4 use the DJI Lightbridge to fetch the media files. When you are fetching a large number of media files(Like 779 as you mentioned), it requires a much more stable Lightbridge communication link. If the link is not stable during the process, it's easy to time out.

Here, we provide you with a temporary solution, you can use the following delegate method of DJICamera to get the latest generated media file and manage them by yourself:

- (void)camera:(DJICamera *_Nonnull)camera didGenerateNewMediaFile:(DJIMedia *_Nonnull)newMedia;

Hope this help!

@jgrantr
Copy link
Contributor Author

jgrantr commented Oct 17, 2016

Yes, I am aware of that delegate method, but it is an un-tenable solution, as there is no way that I can see in the SDK to be able to re-create a DJIMedia object.

An example will probably illustrate what I am talking about.

I want to take a series of photos, group them together, and then download them. As the photos are taken, I use the camera:didGenerateNewMediaFile: delegate method to save local information about each photo (taken from the DJIMedia object) along with a groupId. Some time later (could be the same run of the app, could be a day later after the app has been re-started), I want to then go and download those media files. I can't download them right when that delegate method gets called, as the camera is in shooting mode, not downloading mode. So, how would I then go download those media files at a later time without first grabbing the DJIMedia objects from the SDK? Those objects don't appear to conform to the NSCoding protocol, so I can't just archive them to disk, and all the properties are read-only, so I can't create a blank DJIMedia object and set the correct properties.

Am I missing something? Am I incorrect that I can't download the images from within that delegate callback?

@dji-dev
Copy link
Contributor

dji-dev commented Oct 18, 2016

Hi @jgrantr, if the app is not restarted, it can still work. You can cache the DJIMedia file, switch the DJICameraMode to DJICameraModeMediaDownload and then invoke the fetchMediaDataWithCompletion: method of DJIMedia to download it.

We will investigate this bug and fix it in the future SDK release.

@Michael-DJI
Copy link
Contributor

did you resolve your issue with new version?
if not, pls report the issue to dev@dji.com it's the official channel to request DJI SDK support now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants