Hello Tello!
Join our DJI Tello community & remove this banner.
Sign up

A Tello Library

Krag

Well-known member
Joined
Mar 22, 2018
Messages
223
Likes
163
#1
I have been working on a C# library that wraps what we have learned about the API into something a little easier to use. It isn't as easy to use as say python. But the goal is to make it easier to develop apps for Android, PC and eventually iOS. It uses Xarmin for cross platform because I vastly prefer C# over Java and Objective C.

So far I have been focusing on getting it to reliably connect and reconnect under network conditions and making sure the basic commands and functions work. The API isn't complete. And the UI in the apps is very basic.

The github is here:
Kragrathea/TelloLib

There is the TelloLib, a Hello World example, an Android app and a PC Console app. Here is the example:
Code:
using TelloLib;

namespace HelloTello
{
    class Program
    {
        static void Main(string[] args)
        {
            //Subscribe to Tello connection events. Called when connected/disconnected.
            Tello.onConnection += (Tello.ConnectionState newState) =>
            {
                if (newState == Tello.ConnectionState.Connected)
                {
                    //When connected update maxHeight to 5 meters
                    Tello.setMaxHeight(5);
                }
                //Show connection messages.
                Console.WriteLine("Tello " + newState.ToString());
            };

            //subscribe to Tello update events. Called when update data arrives from drone.
            Tello.onUpdate += (Tello.FlyData newState) =>
            {
                Console.WriteLine("FlyMode:" + newState.flyMode +" Height:" + newState.height);
            };

            Tello.startConnecting();//Start trying to connect.

            //Parse commands from console and send to drone.
            var str = "";
            while (str != "exit")
            {
                str = Console.ReadLine().ToLower();
                if (str == "takeoff" && Tello.connected && !Tello.state.flying)
                    Tello.takeOff();
                if (str == "land" && Tello.connected && Tello.state.flying)
                    Tello.land();
            }
        }
    }
}
To build the app you "just" need the free Visual Studio Community Edition. I say just because it is a huge download. But once it is running you can build and deploy to an android phone.

Installing Xamarin in Visual Studio 2017 - Xamarin
 

javaguy

Active member
Joined
May 1, 2018
Messages
28
Likes
18
#3
This is awesome, great work Krag!

I'm much more familiar with c# and java than go, so I will definitely be using this if I can't get image tracking to work using the gobot version of OpenCV.
 

Avellas

Well-known member
Joined
Mar 25, 2018
Messages
84
Likes
14
#13
There are a lot of users that ended up purchasing the Td1, therefore you may want to at least support this version!
 

Krag

Well-known member
Joined
Mar 22, 2018
Messages
223
Likes
163
#14
I have one too. But Gamesir is not compatible with generic bluetooth and they keep the SDK proprietary. So no Gamesir support.
 

Avellas

Well-known member
Joined
Mar 25, 2018
Messages
84
Likes
14
#15
I’m sorry to hear that, but to be honest with you I would not go out and buy another controller just for the app. Sorry I just want to be honest with you!
 

Krag

Well-known member
Joined
Mar 22, 2018
Messages
223
Likes
163
#16
I don't blame you. And the official Tello app has more features than this, so you won't lose out on much.

The major point of this app is so that people can use existing controllers and not get locked into Gamesir/Ryze's walled garden. I paid $6 for my PS3 controller and I can use it with other stuff than the Tello.
 

Avellas

Well-known member
Joined
Mar 25, 2018
Messages
84
Likes
14
#17
Fair enough and I sincerely wish you the best with the app and for thinking of those who are stuck with a non compatible controller. I’m sure that they will appreciate it!
 

javaguy

Active member
Joined
May 1, 2018
Messages
28
Likes
18
#18
Have you managed to figure out how to get values for the rest of the variables in the FlightData that we saw in the decompiled apk?

I've only been able to get height, battery percentage, and speed, with the rest of the values at 0.

Also, for the wifi - it always stays at 90? The wifi status I read from the drone is always 90 lol. I don't think thats correct...
 

Krag

Well-known member
Joined
Mar 22, 2018
Messages
223
Likes
163
#19
I haven't really figured out anything new. Some values will probably only change when things go wrong, like wind. electricalMachineState changes as the drone tilts but I don't know what good it is.

Wifi strength does vary. It tends to go down fast as it gets far away.
 
Joined
Mar 29, 2018
Messages
13
Likes
7
#20
Hello Krag,
As you connect the PS3 controller to the application Tello ?.
Is it with the Octopus APK ?.

Cheers.
 

New Threads

Forum statistics

Threads
1,124
Messages
7,318
Members
2,381
Latest member
lloydpearsoniv