Drone.getAttribute(AttributeType.Signal) returns invalid Signal

47 views Asked by At

I am attempting to implement the Dronekit-Android library on my own app with a 3DR Solo. I have a drone telemetry screen that already displays the drone's altitude, battery percentage, speed, etc. All of that data is successfully retrieved and displayed. However, signal information is not being returned by the following snippet:

val signal = drone.getAttribute(AttributeType.SIGNAL)
val signalStrength = signal.signalStrength

if (!signal.isValid) {
    controller_strength_image_view.setImageLevel(0)
} else if (signalStrength >= exceptionalWifi) {
    controller_strength_image_view.setImageLevel(5)
} else if (signalStrength >= veryGoodWifi) {
    controller_strength_image_view.setImageLevel(4)
} else if (signalStrength >= goodWifi) {
    controller_strength_image_view.setImageLevel(3)
} else if (signalStrength >= marginalWifi) {
    controller_strength_image_view.setImageLevel(2)
} else if (signalStrength >= poorWifi) {
    controller_strength_image_view.setImageLevel(1)
} else {
    controller_strength_image_view.setImageLevel(0)
}

signal.isValid always returns false, regardless of the drone's state (Idle, flying, hovering, etc). Using 3DR's app shows that the Signal information is being updated.

What am I missing?

0

There are 0 answers