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

Multiple drones with python

yosis

New member
Joined
Oct 15, 2024
Messages
2
Reaction score
0
Hello, i am trying to connect two edu tello drones for a drone show for a python project on pycharm. I tried to connect them on the same network using UDP. on ip 192.168.10.1. I used different dongles and even changed the ip addresses to match 192.168.10.X format. But only one drone connects at a time
here is my code:
from djitellopy import Tello

# Setting up the first drone
drone1 = Tello(host='192.168.10.1')
drone1.connect()
print("Drone 1 Battery percentage:", drone1.get_battery())

# Setting up the second drone
drone2 = Tello(host='192.168.10.1')
drone2.CONTROL_UDP_PORT = 8890 # Different port for the second drone
drone2.connect()
print("Drone 2 Battery percentage:", drone2.get_battery())

and here is the output:


C:\Users\LENOVO\Desktop\CVZone\Advance_AI_drone\.venv\Scripts\python.exe "C:\Users\LENOVO\Desktop\CVZone\Advance_AI_drone\Multi Drone Show\battery_chcek.py"
[INFO] tello.py - 129 - Tello instance was initialized. Host: '192.168.10.1'. Port: '8889'.
[INFO] tello.py - 438 - Send command: 'command'
[INFO] tello.py - 462 - Response command: 'ok'
[INFO] tello.py - 129 - Tello instance was initialized. Host: '192.168.10.1'. Port: '8889'.
[INFO] tello.py - 438 - Send command: 'command'
Drone 1 Battery percentage: 67
[INFO] tello.py - 462 - Response command: 'ok'
Drone 2 Battery percentage: 67

it seems to be connecting to the same drone. i tried changing ip to 2 3 too but in vain Tried turning off firewall too
How can i tackle this issue? i have updated my firmware as well.
 
You must configure the Tellos to connect as client to your home WiFi. In that case, they get different IP adresses.
 
  • Like
Reactions: yosis
Hey Hacky!

Thanks for the help. I did just that. I figured using different wifi dongles wouldn't work. so I used my office router.

- I configured my drones to station mode through my wifi router using Packet Sender(Packet Sender - Free utility to for sending / receiving of network packets. TCP, UDP, SSL.)
- Then i went to my wifi's admin page and found out the IPs of my EDU drones (192.168.1.26,27 in my case)
- Finally i used some python scripts i found online to make a drone show(socket and threading DroneBlocks-TelloEDU-Python/swarm-box-mission.py at master · dbaldwin/DroneBlocks-TelloEDU-Python)

Now i'm coding with djitellopys's swarm library to make the code concise

Thank you!
 

New Posts

Members online

No members online now.

Forum statistics

Threads
5,760
Messages
40,279
Members
17,408
Latest member
hengtoo

New Posts