npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@harleylara/tello-js

v1.1.2

Published

A minimalist Javascript library for programming Tello drones.

Downloads

16

Readme

Tello Javascript

A minimalist Javascript library for programming Tello drones with a WebSocket interface for control, state and videoframes.

Banner

Table of content

How to install

ℹ️ [REQUIREMENT] To use this library you need to install:

Option 1: install using npm

Video Demo

  1. Open a terminal and run.
$ npm i @harleylara/tello-js -g
  1. Done

Option 2: install from source

  1. Download/clone this repository on your computer.
$ git clone https://github.com/harleylara/tello-js
  1. In the root directory of this project execute.
$ npm install -g .
  1. Done

At this point you are ready to have fun with your drone using javascript.

How to use

Basic usage:

const Tello = require('tello.js')

const drone = Tello();

drone.connect(); // without arguments uses default ip and ports
drone.takeoff();
// cool stuff ...
drone.land();
drone.disconnect();

List of functions

  • async connect(tello_ip: str, control_port: int, state_port: int, video_port: int)
  • disconnect(): Close all connections.
  • getState() returns the latest state of the drone as a object, check stateDefinition.json for more details.
  • initFfmpeg() harley's note: this should be replaced with a function like startVideo that containt streamon and initFfmpeg()
  • enableStream() for now is just sending the streamon command
  • async sendCmd(command: str)
  • async wait(time_ms: int)

IP address and ports config

In case the drone is not using the default IP address and ports you can change the parameters in the drone.json file in the root directory of this repository.

WebSocket Server for control

In case you want to control the drone using WebSocket you can configure the parameters in the server.json file in the root directory of this repository.

ℹ️ By default when the drone is initialized it broadcasts frames in BASE64 format to all clients connected to the default address ws://localhost:3000. You can change the address and port with the drone.json file in the "videoServer" section.

ℹ️ For more details: WebSocket Server (Control, Set and State)

Command Line Interface

This package contain two cli tools to manage the tello drone:

  • tello used launch tello-js and send command over the terminal
  • tello-server launch tello-js with the websocket interface.

tello command

To get help on how to use this command:

$ tello help

Usage: tello [options] [command]

CLI to manage Tello drone

Options:
  -V, --version       output the version number
  -h, --help          display help for command

Commands:
  start [options]     Start communication with the tello drone
  set-wifi [options]  Set Tello's WiFi network in station-mode (Tello create a WiFi network)
  set-ap [options]    Switch Tello into Access Point (AP) mode. Tello connect to an external WiFi network
  help [command]      display help for command

tello start

The command tello start launch tello-js in interactive mode, this allows you to send ℹ️ RAW commands ℹ️ to the drone directly from the terminal (commands from the SDK see list of commands)

$ tello start

To get documentation about to set flags use the command help before start

$ tello help start

Usage: tello start [options]

Start communication with the tello drone

Options:
  --drone-ip <address>            tello drone IP address (default: "192.168.10.1")
  --control-port <number>         port to send control commands (default: 8889)
  --state-port <number>           port to get drone internal state (default: 8890)
  --video-port <number>           port to get video frames from drone (default: 11111)
  --video-socket-ip <address>     IP address serving video frames over websocket (default: "0.0.0.0")
  --video-socket-port <number>    port to get video frames over websocket (default: 3001)
  --control-socket-port <number>  port to send control commands over websocket (default: 3000)
  -h, --help                      display help for command

E.g. to launch tello with an especific IP address:

$ tello start --drone-ip 192.168.1.10

tello set-wifi

The command tello set-wifi helps to setup drone's WiFi network in station-mode. ℹ️ Use the -i flag to do it interactively, the command terminal will ask for the name you want to give to the network and the password to be set.

$ tello set-wifi -i

You can also configure the wifi in non-interactive mode using the appropriate flags.

$ tello set-wifi -s NETWORK_NAME -p 123456789

To get documentation about to set flags user the command help before set-wifi

$ tello help set-wifi

Usage: tello set-wifi [options]

Set Tello's WiFi network in station-mode (Tello create a WiFi network)

Options:
  -s, --ssid <name>      name of the drone's wifi network.
                            A prefix is always added, TELO-<your ssid>
                            Default 'TELLO-WIFI' (default: "WIFI")
  -p, --password <pass>  set password to connect drone's wifi. Default 123456789 (default: "123456789")
  -i, --interactive      set wifi in interactive mode
  -h, --help             display help for command

tello set-ap

The tello set-ap command does a similar job to tello set-ap but sets the drone's network into access point mode.

$ tello set-ap -s TELLO-HOTSPOD -p 123456789

To get more informacion:

$ tello help set-ap

Usage: tello set-ap [options]

Switch Tello into Access Point (AP) mode. Tello connect to an external WiFi network

Options:
  -s, --ssid <name>      Access Point name
  -p, --password <pass>  Access Point password
  -i, --interactive      set access-point mode in interactive mode
  -h, --help             display help for command

tello-server

External Resources