Programming the Ryze/DJI Tello with Python

in python •  last year 

Did you see my post on Python and UDP?

Well, it turns out that is exactly how you can communicate with the DJI Tello drone, programatically!

Use the official list of commands and the following code

import socket

tello = ("", 8889)

# create our udp socket
    socket = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
except socket.error:
    print("Oops, something went wrong connecting the socket")

while 1:
    message = input("> ")

    # encode the message
    message = message.encode()

        # send the message
        socket.sendto(message, tello)

        # output the response (if any)
        data, ip = socket.recvfrom(1024)

        print("{}: {}".format(ip, data.decode()))

    except socket.error:
        print("Error! {}".format(socket.error))
Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!
Sort Order:  

So did you actually fly your drone from the above app?

Not very well but yes. I will do an update using the controller code from previous articles :)