Detect Drone restart on battery change
654 2 2020-10-3
Uploading and Loding Picture ...(0/1)
o(^-^)o
djiuser_OR8EW5uz3gSA
lvl.4

Canada
Offline

Is there a way in the mobile SDK to detect when the drone has physically been restarted/rebooted?
I want to call the product disconnect and reconnect functions when the drone battery is changed. Currently when I change the battery I have to either
- restart the remote controller

- physically remove the usb cable and reconnect to trigger a product reconnect
- restart the app or bakground/foreground the app

Without running the product disconnect and reconnect functions the drone is in a weird state and I get 'Navigation Mode not open' when trying to start a mission.

I have already tried startListeningOnComponentConnectionUpdatesWithListener, startListeningOnProductConnectionUpdatesWithListener, componentConnectedWithKey and componentDisconnectedWithKey but none of these seem to be triggered when the drone is powered off and back on while the remote is still connected to the app.

Drone: Mavic Pro
SDK Version: 4.13.1
2020-10-3
Use props
kv886
lvl.4

Hong Kong
Offline

setComponentListener can listen the connectivity status change.
2020-10-9
Use props
djiuser_OR8EW5uz3gSA
lvl.4

Canada
Offline

Just in case anyone has the same issue as I had. setComponentListener and ProductChanged delegate functions were not firing for me because the instance running the DJISDKManagerDelegate protocol was not running on the main thread so bizarrely sometimes they would fire and sometimes not


Screen Shot 2022-04-16 at 12.41.42 PM.png
2022-4-16
Use props
Advanced
You need to log in before you can reply Login | Register now

Credit Rules