tello-drone-controller

1.0.1 • Public • Published

Tello Drone Controller API

  • This project provides a API interface to control a Tello drone using Express.js.
  • It allows users to send commands to the Tello drone through HTTP GET requests, making it easier to integrate drone control into web applications or services.

Install Globally

npx tello-drone-controller

or

npm install -g tello-drone-controller

This will install the package globally and you can run the server from any directory.

Usage

tello-drone-controller # starts the server on port 9000

Development

Prerequisites

Before you begin, ensure you have met the following requirements:

  • Node.js (version 12 or newer recommended)
  • A Tello drone connected to your computer's Wi-Fi network

Installation

To install the Tello Drone Controller API, follow these steps:

  1. Clone the repository to your local machine:

    git clone git@github.com:cagataycali/tello-drone-controller.git
  2. Navigate to the project directory:

    cd tello-drone-controller
  3. Install the required npm packages:

    npm install

Usage

To start the server, run the following command in your project directory:

npm start

The server will listen on port 9000. You can change the port by modifying the port variable in the server script.

API Endpoints

The API currently supports the following endpoints:

  • GET /:command - Send a command to the Tello drone.

    • command: The command to send to the drone (e.g., takeoff, land, up, down, etc.).
    • Query Parameters:
      • value: (Optional) The value for commands that require it (e.g., distance, angle).
      • Additional command-specific parameters as needed.

Example Request

To make the drone take off:

GET http://localhost:9000/takeoff

To move the drone up by 30 cm:

GET http://localhost:9000/up?value=30
Command Description or Example Usage
command Initializes the command mode. GET http://localhost:9000/command
takeoff Commands the drone to take off. GET http://localhost:9000/takeoff
land Commands the drone to land. GET http://localhost:9000/land
streamon Turns on video streaming. GET http://localhost:9000/streamon
streamoff Turns off video streaming. GET http://localhost:9000/streamoff
emergency Stops all motors immediately. GET http://localhost:9000/emergency
up Moves the drone up. Example: GET http://localhost:9000/up?value=30
down Moves the drone down. Example: GET http://localhost:9000/down?value=30
left Moves the drone left. Example: GET http://localhost:9000/left?value=30
right Moves the drone right. Example: GET http://localhost:9000/right?value=30
forward Moves the drone forward. Example: GET http://localhost:9000/forward?value=30
back Moves the drone back. Example: GET http://localhost:9000/back?value=30
cw Rotates the drone clockwise. Example: GET http://localhost:9000/cw?value=90
ccw Rotates the drone counterclockwise. Example: GET http://localhost:9000/ccw?value=90
flip Flips the drone. Example: GET http://localhost:9000/flip?value=l (l for left)
go Sends the drone to coordinates. Example: GET http://localhost:9000/go?x=20&y=20&z=20&speed=10
curve Commands the drone to fly in a curve. Example: GET http://localhost:9000/curve?x1=20&y1=20&z1=20&x2=30&y2=30&z2=30&speed=10
speed Sets the speed of the drone. Example: GET http://localhost:9000/speed?value=10
rc Remote control the drone with more granularity. Example: GET http://localhost:9000/rc?a=0&b=0&c=0&d=0
wifi Sets the Wi-Fi SSID and password. Example: GET http://localhost:9000/wifi?ssid=yourSSID&pass=yourPass
speed? Queries the current speed. GET http://localhost:9000/speed?
battery? Queries the current battery percentage. GET http://localhost:9000/battery?
time? Queries the current flight time. GET http://localhost:9000/time?
wifi? Queries the current Wi-Fi SNR. GET http://localhost:9000/wifi?
sdk? Queries the SDK version. GET http://localhost:9000/sdk?
sn? Queries the serial number. GET http://localhost:9000/sn?

Note: For commands that require parameters (like up, down, left, right, go, curve, etc.), replace the value=30, x=20, y=20, z=20, speed=10, a=0, b=0, c=0, d=0, ssid=yourSSID, and pass=yourPass with actual values you intend to use. The example parameters provided here are for illustration purposes only.

Contributing

Contributions to the Tello Drone Controller API are welcome. To contribute, please fork the repository and create a new branch for your feature or fix.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Package Sidebar

Install

npm i tello-drone-controller

Weekly Downloads

1

Version

1.0.1

License

MIT

Unpacked Size

8.94 kB

Total Files

4

Last publish

Collaborators

  • cagataycali