# Using Serial port to interact with Tello TT

**URL:** <https://community.droneblocks.io/t/using-serial-port-to-interact-with-tello-tt/416>\
**Category:** Tello Coding\
**Created:** [June 9, 2022, 4:51pm UTC](https://community.droneblocks.io/t/using-serial-port-to-interact-with-tello-tt/416 "2022-06-09T16:51:38Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![jjs357](https://yyz2.discourse-cdn.com/flex036/user_avatar/community.droneblocks.io/jjs357/32/258_2.png) [@jjs357](https://community.droneblocks.io/u/jjs357)\
**Post date:** [June 9, 2022, 4:51pm UTC](https://community.droneblocks.io/t/using-serial-port-to-interact-with-tello-tt/416/1 "2022-06-09T16:51:38Z")

</div>

In the SDK 3.0 manual I read:

```auto
Open-source Controller->Tello Commands

To program the open-source controller ESP32, sending "[TELLO] (space)"+ UDP->Tello command through a serial port can achieve the same effect as UDP->Tello command description. Note that all commands that the open-source controller ESP32 receives from TELLO contain the "ETT (space)" prefix and "\r\n" (line break) suffix.

For example: Instruct the drone to take off via open-source controller ESP32. ESP32->Tello: "[TELLO] takeoff"
Tello->ESP32: "ETT ok\r\n"

```

Does anyone know how to make this work? I have connected to the controller with a USB connection and the arduino environment sees the serial port. I open the Arduino Serial monitor and it does connect. But the [TELLO] command does not do anything.

I presume the controller needs to also be connected to the Tello for this to happen.

Dennis has opened up a can of worms with the sensor programming course I think.

---

<div class="post-metadata">

**Author:** ![dbaldwin](https://avatars.discourse-cdn.com/v4/letter/d/d2c977/32.png) [@dbaldwin](https://community.droneblocks.io/u/dbaldwin)\
**Post date:** [June 9, 2022, 6:31pm UTC](https://community.droneblocks.io/t/using-serial-port-to-interact-with-tello-tt/416/2 "2022-06-09T18:31:51Z")

</div>

Glad you’re digging into it, Jim! I don’t have a lot of time right now, but maybe this code will be helpful. This will do a takeoff and land mission using the ESP32 based on how the SDK describes it. Keep in mind that it’s a less ideal way than using the sendTelloCtrlMessage function. This function sends the command and listens for an “ok” from Tello. The way I demonstrate below is less intelligent and does not wait for Tello to respond. That’s why I’ve included a 10s delay between takeoff and land. Leave a reply and I can get back to you later. Thanks.

```auto
#include <RMTT_Libs.h>
#include <Wire.h>

RMTT_Protocol tt_sdk;

void setup() {
  Serial.begin(115200);

  // Serial port where we communicate with Tello from ESP32
  Serial1.begin(1000000, SERIAL_8N1, 23, 18);

  // Necessary so that we can launch the mission from button press on ESP32
  tt_sdk.startUntilControl();

  // Send takeoff command to Tello from ESP 32
  Serial1.print("[TELLO] takeoff");

  // Delay 10 seconds
  delay(10000);

  // Send land command to Tello from ESP 32
  Serial1.print("[TELLO] land");
  
// tt_sdk.sendTelloCtrlMsg("takeoff");
// tt_sdk.sendTelloCtrlMsg("left 30");
// tt_sdk.sendTelloCtrlMsg("right 30");
// tt_sdk.sendTelloCtrlMsg("land");
// tt_sdk.sendTelloCtrlMsg("takeoff");
// tt_sdk.sendTelloCtrlMsg("up 30");
// tt_sdk.sendTelloCtrlMsg("down 30");
// tt_sdk.sendTelloCtrlMsg("land");
}

void loop() {

}

```

---

<div class="post-metadata">

**Author:** ![jjs357](https://yyz2.discourse-cdn.com/flex036/user_avatar/community.droneblocks.io/jjs357/32/258_2.png) [@jjs357](https://community.droneblocks.io/u/jjs357)\
**Post date:** [June 9, 2022, 7:47pm UTC](https://community.droneblocks.io/t/using-serial-port-to-interact-with-tello-tt/416/3 "2022-06-09T19:47:50Z")

</div>

OK, thanks for the suggestion. I will check it out.

What I was thinking I could try was to wire up a USB to Serial converter to the ESP 32 pins exposed with the breakout board and then I could use the Arduino Serial monitor to interact with the Tello. I would start with non-flight commands since the ESP32 in the expansion would be cable connected to my computer.

I want the Serial monitor to allow me to enter [TELLO] commands if that seems possible.

What is the significance of the numbers 23 and 18 in the Serial1.begin command? Maybe I should look at the header files RMTT\_Libs and Wire.h to learn this. GPIO pins 23 and 18 are NOT exposed via the breakout board but pins 27 and 26 are so naively I was going to connect the USB to Serial to those pins thinking I could then communicate over the connected cable from Serial Monitor.

If we use the tt\_sdk style commands what serial port do we listen to see the OK messages, if it makes sense to ask that question.

---

<div class="post-metadata">

**Author:** ![jjs357](https://yyz2.discourse-cdn.com/flex036/user_avatar/community.droneblocks.io/jjs357/32/258_2.png) [@jjs357](https://community.droneblocks.io/u/jjs357)\
**Post date:** [June 10, 2022, 11:18pm UTC](https://community.droneblocks.io/t/using-serial-port-to-interact-with-tello-tt/416/4 "2022-06-10T23:18:01Z")

</div>

Here is something that works to use Serial2 to enter commands to pass to the Tello via Serial1:

```auto
#include <RMTT_Libs.h>
#include <Wire.h>

RMTT_Protocol tt_sdk;

void setup() {
  Serial.begin(115200);
  Serial2.begin(115200, SERIAL_8N1, 27, 26);
  Serial1.begin(1000000, SERIAL_8N1, 23, 18);

}
void loop() {
  while (Serial2.available() == 0) {
  }
  String Command = Serial2.readStringUntil('\n');
  Serial1.print(Command);
  Serial.println(Command);
  delay(2000);
}

```

I wonder why we can’t see the results of the commands sent to the Tello in some serial connection. Means that sending the command [TELLO] battery? won’t report battery status.

I am using the Controller breakout board to connect Serial2. Looks like my pin connections freshly soldered are working. Of course I can’t fly the Tello this way because of the serial connection cables.

---

<div class="post-metadata">

**Author:** ![jjs357](https://yyz2.discourse-cdn.com/flex036/user_avatar/community.droneblocks.io/jjs357/32/258_2.png) [@jjs357](https://community.droneblocks.io/u/jjs357)\
**Post date:** [June 10, 2022, 11:45pm UTC](https://community.droneblocks.io/t/using-serial-port-to-interact-with-tello-tt/416/5 "2022-06-10T23:45:18Z")

</div>

Better version with a Serial2 port. AND, I see the command responses.

```auto

#include <RMTT_Libs.h>
#include <Wire.h>

RMTT_Protocol tt_sdk;

void setup() {
  Serial.begin(115200);
  Serial2.begin(115200, SERIAL_8N1, 27, 26);
  Serial1.begin(1000000, SERIAL_8N1, 23, 18);

void loop() {
  if (Serial2.available()) {
    String Command = Serial2.readStringUntil('\n');
    Serial.println(Command); 
    Serial1.print(Command);   
  }
  if (Serial1.available()) {
    String CommandResponse = Serial1.readStringUntil('\r\n');
    Serial2.println(CommandResponse);    
  }
}

```

---

<div class="post-metadata">

**Author:** ![jjs357](https://yyz2.discourse-cdn.com/flex036/user_avatar/community.droneblocks.io/jjs357/32/258_2.png) [@jjs357](https://community.droneblocks.io/u/jjs357)\
**Post date:** [June 11, 2022, 12:23am UTC](https://community.droneblocks.io/t/using-serial-port-to-interact-with-tello-tt/416/6 "2022-06-11T00:23:12Z")

</div>

One more simplification is that you can use Serial to do the command entry. Don’t really need Serial2.  
Here is what the Arduino Serial Monitor looks like:

 ![Screen Shot 2022-06-10 at 8.11.49 PM](https://canada1.discourse-cdn.com/flex036/uploads/droneblocks/original/1X/0db0626807f0a3a48fb70ff0b3a1c67ec2014b43.png)

---

<div class="post-metadata">

**Author:** ![dbaldwin](https://avatars.discourse-cdn.com/v4/letter/d/d2c977/32.png) [@dbaldwin](https://community.droneblocks.io/u/dbaldwin)\
**Post date:** [June 11, 2022, 2:37am UTC](https://community.droneblocks.io/t/using-serial-port-to-interact-with-tello-tt/416/7 "2022-06-11T02:37:45Z")

</div>

This is great, Jim! Thanks for sharing and I’m looking forward to giving this a try over the weekend. Will report back with my findings.
