dji-sdk / Mobile-SDK-iOS

DJI Mobile SDK for iOS: http://developer.dji.com/mobile-sdk/
Other
577 stars 256 forks source link

Matrice 300 RTK - DJILens setWhiteBalance invalid parameters #451

Open edupazpix4d opened 3 years ago

edupazpix4d commented 3 years ago

Drone: DJI Matrice 300 RTK. Camera: Zenmuse H20T. Mobile SDK: 4.14.

When calling DJILens setWhiteBalance:

DJICameraWhiteBalance* cameraWhiteBalance = [[DJICameraWhiteBalance alloc]initWithPreset:DJICameraWhiteBalancePresetSunny];
....// I iterate over the lenses, getting the Zoom lens
DJILens *lens = self.djiCamera.lenses[i]; 
[lens setWhiteBalance:cameraWhiteBalance withCompletion:^(NSError * _Nullable error) {
...

I get: Error 1300, invalid parameter

dji-dev commented 3 years ago

Agent comment from Luce Luo in Zendesk ticket #45980:

Dear Customer,

Thank you for contacting DJI. Please use the whiteBalancePresetRange method to check the current valid presets for camera's white balance (see DJICameraWhiteBalancePreset). Returns nil if current camera does not support any white balance value or the camera is disconnected.

Thanks,

Luce Luo DJI Developer Support

federiconicoli commented 3 years ago

@dji-dev Can I set white balance to Zenmuse H20? If I access it's capabilities doing camera.lenses.first { $0.lensType == .wide }.capabilities.whiteBalancePresetRange() it returns an array with 0 as its only element. So, I should be able to set the white balance to automatic, right? However, if I do this

guard let whiteBalance = DJICameraWhiteBalance(preset: auto) else { return }
camera.lenses.first { $0.lensType == .wide }.setWhiteBalance(whiteBalance) { error in
      if let error = error {
          print("Error setting white balance: \(error.localizedDescription)")
      }
}

It fails: Error setting white balance: This command is no longer supported or not supported in this firmware version.(code:-3000)

So if in case it's not supported, whiteBalancePresetRange() should return an array with one element?

DJI SDK: 4.14 Matrice 300 RTK: V02.02.0301 Zenmuse H20: V02.02.0100