Giter Site home page Giter Site logo

cli's Introduction

tessel cli and module

This is the Node module for communicating with Tessel by the commandline, pushing code and controlling network settings / configuration, or for programmatically interacting with Tessel.

npm install tessel

Module API

You can interact with Tessel programmatically.

var tessel = require('tessel');

Module

This module creates a single-threaded local server to which multiple processes can connect to a single Tessel over USB, as well as a TesselClient object that acts as a connection to the Tessel.

var tessel = require('tessel-client');

# Object  tessel.descriptors
Hash of USB descriptors.

{
  TESSEL_VID: 0x1d50, TESSEL_PID: 0x6097,
  TESSEL_OLD_VID: 0x1fc9, TESSEL_OLD_PID: 0x2002,
  NXP_ROM_VID: 0x1fc9, NXP_ROM_PID: 0x000c
}

# tessel.connect( port, host ) → TesselClient
Connects to a local Tessel server.

# tessel.connectServer( path, callback(err, port) )
Connects a detached child server to a Tessel USB port. Returns the port at which the local Tessel server is listening.

# tessel.detectModems( callback(err, paths) )
Retrieve the path of each Tessel connected by USB in an array.

# tessel.selectModem( onnotfound(), callback(err, path) )
Interactive menu for selecting a Tessel to connect to. Will continue to poll until a suitable client is found, calling the onnotfound callback (perhaps continuously). Once a device is found, if multiple options exist, user is prompted for a selection. Then the callback is passed the path of the chosen device.

# tessel.acquire( [path, ], callback(err, client) )
Acquires a Tessel client, either interactively (via selectModem) or directly given the supplied path. The callback is passed a TesselClient object.

# tessel.bundleFiles( relpath, args, files, callback(err, bundle) )
relpath is the starting path of the application relative to root. args is the process.argv array. files is a map of tessel filesystem paths to local filesystem paths from the computer. This function returns to the callback with a bundle that can be deployed to Tessel.

TesselClient object

Created by tessel.connect.

# DuplexStream  client.stdout
Stream of output from the client module.

# client.send( json )
Sends a message to be read by process.on('message', callback) by the child script.

# client.wifiStatus( callback(err, wifiStatus) )
Returns the status of the board's Wifi. wifiStatus has the properties "connected" and "ip".

# client.configureWifi( ssid, pass, security, [opts,] callback(err, wifiStatus) )
Connects to the given Wifi network. security can be one of "wpa2", "wep", or null. pass can be null if no security is chosen. err is true if the network could not be connected to. An optional opts object allows an integer timeout number to be specified in seconds.

# client.deployBundle( tarbundle, opts, onScriptStart(err) )
Deploys a tar bundle of code to the device. opts can have a flag save to write the bundle to the local filesystem, or flash to flash the device instead of running from RAM.

# client.erase()
Erases internal flash on the device of any running code.

# client.stop()
Stops the current script.

# client.deploy( filepath, argv, onScriptStart(err) )
Given a file path, automatically deploys the file and its nearest directory with a package.json file to Tessel.

# client → emits "script-start"
Emitted when a client script starts.

# client → emits "script-stop"
Emitted when a client script exits.

License

MIT or Apache 2.0, at your option

cli's People

Contributors

jiahuang avatar johnnyman727 avatar jp1971 avatar kevinmehall avatar marie-x avatar natevw avatar olegas avatar ryanseys avatar shokai avatar tcr avatar xyziemba avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.