Android Question dji library

shb777

Active Member
Licensed User
Longtime User
Now that 8.0 has been released, is there any chance a temperary DJI library can be uploaded, that allows us to end the height and distance restrictions of the current library.
Most of the old library would probably still work.
 

shb777

Active Member
Licensed User
Longtime User
I went to that link, but I can't find where to download the new library.


"I was wrong. V4.41 which is available in the first post is the updated library and should work properly."

can you put a link in this post to the new library V4.41

ok i found it here www.b4x.com/android/files/dji.zip

it's version 2.50 if anyone cares. I'm charging my batteries now, and I'll let you know in a few hours if this works.
 
Last edited:
Upvote 0

shb777

Active Member
Licensed User
Longtime User
I flew with the new library, but I still got the Altitude and Distance limits. So maybe I have to change some code in my app?
 
Upvote 0

shb777

Active Member
Licensed User
Longtime User
added this line
B4X:
sdk.Initialize("sdk")
also this
B4X:
#BridgeLogger: true
#MultiDex: true
#AdditionalJar: dji-sdk-provided-4.4.1, ReferenceOnly

but I just tested it and I'm still getting the distance and altitude limits. Also, I kept getting check app on remote control. but was connected.
 
Upvote 0

shb777

Active Member
Licensed User
Longtime User
when I put this in the manifest the app crashes.
B4X:
SetApplicationAttribute(android:name, "anywheresoftware.b4a.objects.BaseApplication")
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
You can try to add this lines to the DjiFlightcontrollerWrapper.java

B4X:
/**
/* Allowed are values from 20 to 500 based on the Documentation
/**
    public Object SetMaxFlightHeight(int height) {
        B4ACompletionCallback cc = new B4ACompletionCallback();
        getObject().setMaxFlightHeight(height, cc);
        return cc;
    }
    public Object SetMaxFlightRadius(int radius) {
        B4ACompletionCallback cc = new B4ACompletionCallback();
        getObject().setMaxFlightRadius(radius, cc);;
        return cc;
    }
    public Object SetMaxFlightRadiusLimitationEnabled(boolean enabled) {
        B4ACompletionCallback cc = new B4ACompletionCallback();
        getObject().setMaxFlightRadiusLimitationEnabled(enabled, cc);
        return cc;
    }
    public Object GetMaxFlightHeight() {
        B4ACompletionCallback cc = new B4ACompletionCallback();
        getObject().getMaxFlightHeight(cc);;
        return cc;
    }
    public Object GetMaxFlightRadius() {
        B4ACompletionCallback cc = new B4ACompletionCallback();
        getObject().getMaxFlightRadius(cc);
        return cc;
    }
    public Object GetMaxFlightRadiusLimitationEnabled() {
        B4ACompletionCallback cc = new B4ACompletionCallback();
        getObject().getMaxFlightRadiusLimitationEnabled(cc);
        return cc;
    }

And then compile the library new...

Alternatively you can probably use JavaObject to call this Methods from the Flightcontroller...
 
Last edited:
Upvote 0

shb777

Active Member
Licensed User
Longtime User
when I compile the drone program I'm getting an error"


Error compiling program.
Error description: Unknown member: activationstate
Error occurred on line: 122
sb.Append($"Simulator: ${controller.SimulatorStarted}
FlightMode: ${St.FlightMode}
Altitude: $1.0{St.AircraftLocation.Altitude} m
Location: $1.3{St.AircraftLocation.Latitude} / $1.3{St.AircraftLocation.Longitude}
speed: $1.0{speed} m/s
VelocityZ: $1.1{-St.VelocityZ} m/s
Activation: ${sdk.ActivationState}
Binding: ${sdk.AircraftBindingState}
"$)
Word: activationstate
 
Upvote 0

shb777

Active Member
Licensed User
Longtime User
You can try to add this lines to the DjiFlightcontrollerWrapper.java

B4X:
/**
/* Allowed are values from 20 to 500 based on the Documentation
/**
    public Object SetMaxFlightHeight(int height) {
        B4ACompletionCallback cc = new B4ACompletionCallback();
        getObject().setMaxFlightHeight(height, cc);
        return cc;
    }
    public Object SetMaxFlightRadius(int radius) {
        B4ACompletionCallback cc = new B4ACompletionCallback();
        getObject().setMaxFlightRadius(radius, cc);;
        return cc;
    }
    public Object SetMaxFlightRadiusLimitationEnabled(boolean enabled) {
        B4ACompletionCallback cc = new B4ACompletionCallback();
        getObject().setMaxFlightRadiusLimitationEnabled(enabled, cc);
        return cc;
    }
    public Object GetMaxFlightHeight() {
        B4ACompletionCallback cc = new B4ACompletionCallback();
        getObject().getMaxFlightHeight(cc);;
        return cc;
    }
    public Object GetMaxFlightRadius() {
        B4ACompletionCallback cc = new B4ACompletionCallback();
        getObject().getMaxFlightRadius(cc);
        return cc;
    }
    public Object GetMaxFlightRadiusLimitationEnabled() {
        B4ACompletionCallback cc = new B4ACompletionCallback();
        getObject().getMaxFlightRadiusLimitationEnabled(cc);
        return cc;
    }

And then compile the library new...

Alternatively you can probably use JavaObject to call this Methods from the Flightcontroller...



but DjiFlightcontrollerWrapper.java is never used in the drone program
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
but DjiFlightcontrollerWrapper.java is never used in the drone program
B4X:
Private controller As DJIFlightController
False. It is used as it is one of the Basecomponents needed to fly the Drone.....

From DjiFlightControllerWrapper.java
B4X:
@ShortName("DJIFlightController")

dji048.png


Note that it is the FlightController where all these Informations are coming from:
dji049.png
 
Last edited:
Upvote 0

shb777

Active Member
Licensed User
Longtime User
No need to add any other methods to disable the flight limits.

Start with a new project based on the example. If it crashes then please post the logs.
it's not compiling for me. see the previous post
 
Upvote 0

shb777

Active Member
Licensed User
Longtime User
B4X:
Private controller As DJIFlightController
False. It is used as it is one of the Basecomponents needed to fly the Drone.....

From DjiFlightControllerWrapper.java
B4X:
@ShortName("DJIFlightController")

dji048.png


Note that it is the FlightController where all these Informations are coming from:
dji049.png


After it's compiled, but I don't even know how to compile it.
 
Upvote 0

shb777

Active Member
Licensed User
Longtime User
OK that was it. I thought I had the new lib but I didn't. now I have 4.4.1

Also I noticed that there was code in drone first that I didn't put in my app. So my app would compile but wouldn't get rid of the limits.
 
Upvote 0

shb777

Active Member
Licensed User
Longtime User
I'm not connecting the drone first app to the mavic. no video or telemetry. after I turn the mavic off, I get a message SDK_ActivationStateChanged not found.
 
Upvote 0

shb777

Active Member
Licensed User
Longtime User
Have you added the missing event sub then?


No. I did a search, and it's not in the drone first program. I can add it, but what code should go in it, and why wouldn't it be in drone first?

Also these are not defined:

Dim DJICameraCaptureWidget1 As DJICameraCaptureWidget
Dim DJIRemoteControlSignalWidget1 As DJIRemoteControlSignalWidget
Dim DJIDistanceRCWidget1 As DJIDistanceRCWidget
Dim DJIRemainingFlightTimeWidget1 As DJIRemainingFlightTimeWidget

I have the djiui libraries in my extra libraries, but they're not showing up in my libraries tab, so I can't add them to my project.
 
Last edited:
Upvote 0

shb777

Active Member
Licensed User
Longtime User
Start with DroneMission example.


I ran the new DroneMission example, but still no video or telemetry.

when calling SDK_RegisteredResult I get this error message.

"the metadata recieved from the server is invalid, please reconnect to the server and try.
 
Last edited:
Upvote 0
Top