I have now got the example working with the information from this forum. However, I cannot get a connection to the DJI Mavic Mini. When you click the "Start Mission" button, an error message appears:
The log output looks like this:
B4X:
Logger connected to: samsung SM-A520F
--------- beginning of main
**************************** BaseApplication2 **************************
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
Call B4XPages.GetManager.LogEvents = True to enable logging B4XPages events.
** Activity (main) Resume **
Registered successfully!
activation state: UNKNOWN
binding state: UNKNOWN
b4xmainpage$ResumableSub_btnStartMission_Clickresume (java line: 373)
java.lang.RuntimeException: Object should first be initialized (DJIHotpointMissionOperator).
at anywheresoftware.b4a.AbsObjectWrapper.getObject(AbsObjectWrapper.java:67)
at anywheresoftware.b4a.objects.HotpointMissionOperatorWrapper.StartMission(HotpointMissionOperatorWrapper.java:81)
at gd.dronemaster.b4xmainpage$ResumableSub_btnStartMission_Click.resume(b4xmainpage.java:373)
at gd.dronemaster.b4xmainpage._btnstartmission_click(b4xmainpage.java:346)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:213)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:193)
at anywheresoftware.b4a.objects.ViewWrapper$1.onClick(ViewWrapper.java:80)
at android.view.View.performClick(View.java:6897)
at android.widget.TextView.performClick(TextView.java:12727)
at android.view.View$PerformClick.run(View.java:26104)
at android.os.Handler.handleCallback(Handler.java:789)
at android.os.Handler.dispatchMessage(Handler.java:98)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6944)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:327)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1374)
(RuntimeException) java.lang.RuntimeException: Object should first be initialized (DJIHotpointMissionOperator).
** Activity (main) Pause event (activity is not paused). **
--------- beginning of system
** Service (starter) Destroy (ignored)**
I am a little overwhelmed with the solution to this problem. The DJI Mavic Mini is definitely supported by the SDK. The connection with the DJI Fly app works perfectly.
It looks like in your Sub btnstartmission_click you are using an instance of DJIHotpointMissionOperator that has not been initialized. Look at the code in there.
Is the Aircraft connected? DJIHotpointMissionOperator variable HotpointOperator is initialised in Sub AfterAircraftConnected. If btnStartMission is pressed before this is run it would give that error.
Thanks. So it is due to the lack of connection between the app and the drone. The reason for this is currently still in the dark. Erel tested with the DJI Mavic Air. I use the DJI Mavic Mini. Maybe it's related to that. The SDK should actually support both.
1. You should never post questions in existing threads.
2. Have you actually connected to the flight controller? Are you sure that the official app didn't "steal" the USB connection? Worth testing it with a device where no other USB app is installed.
Greetings, I hope you are well, this is what comes out in three devices: NVIDIA Shield 8 "16GB, huawei p30 pro, and
Samsung Galaxy S21 (S30), with the same failure. I apologize for my ignorance, but I think it is the library, since from the previous one it is the same failure, thanks.
I tell you that I read in a forum that dji and androidx were not compatible, but I only read it.
2. Have you actually connected to the flight controller? Are you sure that the official app didn't "steal" the USB connection? Worth testing it with a device where no other USB app is installed.