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

My first python program

Skywalker

Member
Joined
Oct 28, 2018
Messages
19
Reaction score
8
Location
México
This is the code I wrote today. It read the battery level:

import socket

sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)

sock.sendto(b'command', 0, ('192.168.10.1', 8889))
sock.sendto(b'battery?', 0, ('192.168.10.1', 8889))

while True:
data, ip = sock.recvfrom(1024)
print("{}: {}".format(ip, data.decode()))
 
  • Like
Reactions: FlandersNed

Members online

No members online now.

Forum statistics

Threads
5,701
Messages
39,968
Members
17,064
Latest member
wroxel