Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tello.py program won't connect to Tello #3

Open
jsolderitsch opened this issue Jun 16, 2022 · 7 comments
Open

tello.py program won't connect to Tello #3

jsolderitsch opened this issue Jun 16, 2022 · 7 comments

Comments

@jsolderitsch
Copy link

I can operate ESPTelloCLI via the Arduino Serial Monitor.

I close the Serial monitor and then try the tello program. I get this:

connect TELLO-AA6D73

0
b'r\x82\x12nnnl|\x0cl\x90r\x92\x02\x82\x12nnn\xec\x9e\xe0\x8e\x02l\x9enn\xe0|\x82\x82n\xe3\x10\xe2b\x0elr\x92\x92nn|\xe2\x02\x0c\x9c\xf2r\x02\x02l\x82\x02\x0c\x0c\x82\x0c\x0c\x0c\x8c\xe2\xe2\x02\x8c\x0cl\x0c\xe4\x0c\x8e\x1c\x80\xec\x0c\x0c\x8c\x9cl\x0c\x9c\x0c\x8c\x0c\x0c\x8c\x0c\x0c\x0c\x8cl\xec\x8c\x8e\x0el\x0e\xf2n|\x12\x02\x0cl\x0c\x8c\x92\xf2\x12n|\x90\x92b\x02\x0c\x9c\xf2r\x02bl`\x02\x80r\x02\x0c\x0c\x0c\x0c\x0c\x8c\x0c\x0c\x0c\x82\x0c\x0c\x0c\x8c\xe2\xe2\xe2\x0c\x0c\x04\x92l\x00\x0c\x0c\x0c\x0c\x0c\x8c\x0c\x0c\x0c\x02\x0c\x0c\x8c\x8e\x8cr\x0c\x0c\x0cl\x02\x0c\x0c\x0c\x0c\x0c\x0c\x8c\x0c\x0c\x0c\x02\x0c\x0c\x0cl\x9c\x1c\x0e\x02\x0c\x0cl\x12\x0c\x0c\x04\x0c\x0c\x0c\x8c\x0c\x0c\x0cr\x8c\x9c\x9cp\x8c\x8c\x8ep\x80\x0c\x0cl`\x02\x02b\x0c\x0c\x0c\x0c\x0c\x0c\x8c\x0c\x0c\x0c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x1c\x8cl\xe2\x8c\x0c\x0cr\x8c\x9c\x9cp\x8c\xec\x8e\x0c\x0c\x0c\x0c\x82\x0c\x0c\x0c\x9c\x8e\x9c\x1c\x92\x8c\x0c\x0cr\x8c\x9c\x9cp\x8c\x0c\x8c\x0c\x0cl`\x02rlrlrlrl\x12\x82l\x90\x8c\x9c\xecp\x92\x02\xec\x12l\x80\x8cl\x8e\x8e\x1e\x00\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0c\x0cl`\x02rl\x8c\x92b\xf2nn\x9e\xec|\xf2\xe2bbb\x0elets Jun  8 2016 00:22:57\r\n\r\nrst:0xc (SW_CPU_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)\r\nconfigsip: 0, SPIWP:0xee\r\nclk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00\r\nmode:DIO, clock div:1\r\nload:0x3fff0030,len:1184\r\nload:0x40078000,len:12812\r\nload:0x40080400,len:3032\r\nentry 0x400805e4\r\n'
1
2

I am using a generic ESP32 Dev board. Software deployed with ESP board version 2.0.3.

Any ideas about this?

@jsolderitsch
Copy link
Author

Here are my board settings that I use to flash the program:
Screen Shot 2022-06-16 at 12 14 08 PM

@jsolderitsch
Copy link
Author

Here is what tello program reports about my serial port:

(venv) jjsretina:ESPSwarm jjs$ python telloTest.py 
Serial<id=0x7fc6d00f1d30, open=True>(port='/dev/cu.usbserial-0001', baudrate=115200, bytesize=8, parity='N', stopbits=1, timeout=1, xonxoff=False, rtscts=False, dsrdtr=False)
connect TELLOls-AA6D73

@touchgadget
Copy link
Owner

Is the Tello the regular or EDU or RMTT? Is the Tello is in its default mode? If not, consult the Tello docs to put it in default mode. I have only regular Tellos to test with. The Tello sometimes returns binary data but I just ignore it for now.

@jsolderitsch
Copy link
Author

It is a regular Tello. What do you mean by default mode?

@jsolderitsch
Copy link
Author

I tried another regular Tello and same result. I can connect to these Tello's with Packet Sender.

And the Serial Monitor works to connect and send commands from the Arduino IDE. Just not with the Python wrapper.

@jsolderitsch
Copy link
Author

I made some progress. The Serial connection provided with the USB mini to USB A connection that I use to program the ESP32 dev board that I have does not play nice with the Python Serial connection. A simple print loop using the default Serial connection will not display. Nothing to do with Tello CLI.

However if I use a USB-TTL USB connection device and name some pins like so:

#define RXD2 16
#define TXD2 17

and then in the setup method I use:

void setup()
{
  // Serial.begin(115200);
  Serial.begin(115200, SERIAL_8N1, RXD2, TXD2);
  Serial.setTimeout(0);
  Connected = false;
  WiFi.mode(WIFI_STA);
  WiFi.onEvent(WiFiEvent);
}

I can get the ESPTelloCLI python program to drive the CLI firmware on the ESP32 board after these modifications.

I am using a cheap ESP32 board made by Inland and sold by MicroCenter in the USA.

I even added commands in the Python program for motoron and motoroff that are part of SDK 2.0 and SDK 3.0 that are compatible with Tell EDU and Tello Talent. I have both of these models. These commands work.

I just took delivery of two AdaFruit Huzzah ESP32 boards because they can be LiPo battery powered and I have some hardware connections in development to connect to the Huzzah board and send commands to Tello from this hardware interface. Would not need Python serial except in testing these connections.

I will check if these ESP32 boards are as finicky with respect to the standard USB serial cable that is used to program the board.

The Talent's LED matrix device is connected to an ESP32 in the case. There is also 5Ghz Wifi in this case that is not driven by the embedded ESP32. The ESP32 itself is programmable with Arduino and I am experimenting with this as well.

I also made some small changes to the command_response method:

    def command_response(serial_port, command, expected, secs):
        """ Write Tello command then return Tello response """
        b_command = command.encode()
        serial_port.write(b_command)
        print(command)
        if secs == 0:
            return True

        for i in range(0, secs):
            a_line = serial_port.read_until('\n').decode()
            print(i)
            if a_line:
                print(a_line)
                if not expected or expected in a_line:
                    return a_line
        return False

@jsolderitsch
Copy link
Author

I tried the standard serial connection with the Adafruit Huzzah ESP32 board and the need for pin assignment is not true with this board. I deployed ESPTelloCLI to this board and both the Arduino Serial Monitor and Python can connect to the program using the same USB serial cable that is used to deploy the project in the first place. So there is something specific to the low cost ESP32 Dev board that I started with.

Do you have a particular ESP32 board to recommend? The one you used to test this project originally?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants