The process of sending and receiving UDP messages to Tello or the simulated Tello on the computer. I have tried the instructions in the Droneblocks modules, but have not been completely successfull. For example, one time I got the following message - “Package Sender attempted (and failed) to bind to port 8889.”
Other times I have been unsuccessful at sending a message to simulated Tello - message not showing up in Packet Sender. Not receiving string command.
One thing to double-check is when you have Tello simulated in Python it will start listening on port 8889 as specified here in this script:
You can certainly change that to any port you’d like. When you fire up Packet Sender there’s a good chance it’s trying to bind to this port as well (8889). But you don’t want to do that. You can turn off Packet Sender binding in the settings. That way Packet Sender will only be in client mode where you can send from Packet Sender to port 8889 (Python).
Please let us know if anything is unclear or you need clarification. Thanks.
the DroneBlocks instructional videos indicate to check Enable UPD Servers in PacketSender. How, they already come checked as a default setting. When you indicate “You can turn off Packet Sender in the settings”, what are you refering to? Where in settings?
Your comment that I “don’t want to” bind to part 8889 seems to contradict the guidance in the DroneBlocks instrutional video, unless I am misunderstanding.
The furthest that I have gotten in following the DroneBlocks instructional video on Python is that I successfully ran the part of the UDPSender script that printed out - “Message Sent!” I have not been able to get further. PacketSender is not recognizing the Run of my script. There is no connection there.
On another subject, although I am obviously able to bring up Jupiter notebook and work with it, Jupiter notebook is not showing up in my Windows Terminal (Command prompt). Where would i find it there?
Sorry if my message was unclear. Our curriculum is centered around the Python code interfacing with Tello, which is a different “computer” with a different IP address. When you run Packet Sender and the Python simulator on the same computer it adds complexity due to port limitations. I’m going to post a screenshot of my setup and explain what is going on:
I have Packet Sender sending to port 8889 on localhost, which is the script running the Python simulator. Then I have Packet Sender listening (running a UDP Server) on 9000. When you send a message to the simulator on port 8889 it will see the message coming from port 9000 (Packet Sender) and the simulator will send “OK” back to Packet Sender on that port.
In my screen example I’m sending the “takeoff” command from Packet Sender to the simulator on 127.0.0.1, port 8889. In the right hand side of the screen you’ll see Python receive the message and print the IP and port of where the message came from.
I hope this helps. Please let me know if I can provide any further clarification.
Where do I input ‘9000’ for a port? How do I “have Packet Sender listening (running a UDP Server) on 9000”? Is 127.0.0.1 your local wireless IPv Address? What does your Python script look like for your sample in the email below (‘127.0.0.1’, 8889?)? I have still not succeeded (even using your numbers).
in sending a message (using UDP) to the simulated Tello. Any suggestions?
Thank you. With help from this instructional video, I did succeed in sending (via UDP) a packet from port 8889 (simulated-tello script) to port 9000 (Packet-Sender)
However, my Windows powershell does not look at all like the one in the instructional video. How do I get the powershell so that I can input the commands in the instructional video?
But PowerShell should be fine. You’ll need to clone the repository and then change into the directory with the simulator.py script. You can then run it with:
python simulator.py
You’ll need to learn some of the commands to navigate the file system. The main one is cd (change directory)
This article talks about many of the commands available in powershell:
But once again cd will be the most important for what you’re trying to do.
Thank you. I’ll take a look. I’ve been using Windows 11 - I wonder if that accounts for any difficulty that i’ve had sending a packet from Tello-simulator to Packet Sender…
When you indicate “You’ll need to clone the repository and then change into the directory with the simulator.py script” - do you mean download the repository and open up the Tello-Simulator file (Notepad - PY File)?
(I downloaded the ZIP file at the GitHub repository - I think that that is what you mean by clone)
I have made some progress in the Python curriculum: I got through Lesson 2. However, I was not able to successfully achieve the tasks for Lesson 3 - sending and receiving message between the Python script & the Tello drone (with the Packet Sender CLOSED). I am attaching some images:
Here is an update: I have managed to Send & Receive UDP message from my Python script to Tello Drone - per the instructions in Lesson 3 (see image below):
Progress marches on! (thank you for your consideration)
Although I have made progress in the online curriculum, I am unsure when/where I would type in ‘python simulator.py’ in Windows Powershell. For example, I tried in the example (image) below, but was not sucessful:
The Tello class in the above package, handles all of the communication between the Tello and provides a nice Python API for us to program to. You can either use the high level methods, or you can send the low level SDK commands if you don’t find what you are looking for in the API.
There is a quick example script.
from djitellopy import Tello
import time
"""
* Using DJITelloPy package and Tello class.
"""
if __name__ == '__main__':
print("Create Tello object")
tello = Tello()
print("Connect to Tello Drone")
tello.connect()
battery_level = tello.get_battery()
print(f"Battery Life Percentage: {battery_level}")
print("Takeoff!")
tello.takeoff()
print("Sleep for 5 seconds")
time.sleep(5)
print("landing")
tello.land()
print("touchdown.... goodbye")
I hope that helps but if you still have questions please let me know.