The idea is an evolution of my last project M5Stack Tello drone for Santa coded with micropython.
Dji Tello is an awesome drone I'm currently learn through his SDK, to work with Python and Open CV for Face Detection (and, in my goal for detect mask wear or not, I think very important on this pandemic era).
All info on Tello SDK 1.3 (not for Tello EDU) here
Reading the SDK, Tello act as Soft AP WI-FI, (his ip is 192.168.10.1) and the M5 Core will take the ip 192.168.10.2, (he accept command by this IP only, on port 8889)
All the commands must be sent in UDP, there are interesting features to retrieve some information as battery level, barometric pressure, altitude, distance etc, but it require to execute a webserver to listen the answer on to port 8890 (already in my ToDoList)
Using Python is quite easy to retrieve a lot of projects based on this SDK, but using micropython and ESP32 is rare, I found only a great example on https://github.com/plugowski/micropython-tello (i would again thanks him), so after porting to M5Stack devices the micropython library, it's time to go to the next level:
Create blocks for M5Stack UIFLOW to make easy program sequence as mission for STEM project into classroom or simply make a funny use.
This is my fork from his code i'm evolving to easy use of block UIFLOW
As previous project the first step was to add the working lib (with Tello commands) to the M5 Grey structure (i'm using UiFlow firmware v 1.6.3), after some fails, I have success using a trick with Thonny Ide, simply copy on yor local drive "tello.py" from my UIFLOW repository and transfer it on M5 Core at root level (not /apps !) of Uiflow structure.
Follow this steps to start:
1) open UIFLOW (i prefer Desktop IDE )
2) select M5 Grey and connect your device to your pc (maybe on COM11)
3) select Custom (Beta) and select Open Custom blocks
4) load file Tello5.m5b (download before from my rep) it provide declarations and specific block as Init Drone and basic movements( TakeOff, Flip, Rotate CW Rotate CCW etc)
5) click on the burger menu to the right and select "open File, load TelloTest5.m5f (found on my rep)
6) change the SSID corresponding to your drone
7) select Manager from UIFLOW IDE and upload tello_iron.jpg.
8) clicking on the Python tab we are able to read line of codes corresponding to the blocks.
9) Now light on the drone (leave enough space around it! ), select play on UIFLOW IDE for testing or change movements, once you are satisfied, select download from burger menu to transfer the program to the device as APP (you can recall it selecting the name TelloTest5.py from the APP menu on you device.
Remember some constraint according to the SDK:
Tello command fly up, down, right, left with distance x cm range 20 to 500
Tello command Rotate CW Rotate CCW with degree range: 1 to 360 (no 1 to 3600 as said on the SDK)
Last, important recomendation: NEVER FORGET to put drone.land() command at fhe end of every mission (even two occurrence) to be sure your drone land correctly (otherways you have to wait discharge of the battery, or the timeout without receive command (maybe set to 15 seconds)
Enjoy the video example!
To Do List:
Add a UDP server in background to retrieve parameters like battery status, speed, etc
Add accelerometer to modify movements interactively (up / down / left / right)
Comments