• Stars
    star
    114
  • Rank 296,753 (Top 7 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created about 9 years ago
  • Updated over 4 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Tessel 2 Command Line Interface

t2-cli

Greenkeeper badge

Code of Conduct Slack Travis-CI Build Status Appveyor Build status Coverage Status Open Source Helpers

The starting point for the Tessel 2 command line interface.

Documentation: Tessel 2 Command Line Interface

Contents

Installation for development

Prerequisites for installation: Node.js and Git.

  1. Clone this repository by entering the following: git clone https://github.com/tessel/t2-cli.
  2. Go to the root directory of repository: cd t2-cli.
  3. Create a symbolic link: npm link --local.

Windows

You may encounter the following error when executing npm link on windows:

19798 error Windows_NT 6.3.9600
19799 error argv "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "link"
19800 error node v0.12.4
19801 error npm  v2.10.1
19802 error code ELIFECYCLE
19803 error [email protected] postinstall: `tessel install-drivers || true; tessel trademark || true`
19803 error Exit status 1
19804 error Failed at the [email protected] postinstall script 'tessel install-drivers || true; tessel trademark || true'.

This error occurs because of windows folder permissions. To resolve this make sure you are running cmd or powershell as an administrator and that the permissions on the node_modules folder is set to full control for the user.

Source Tab Completion

For bash users, add this line to your ~/.bashrc or ~/.bash_profile file:

source /PATH/TO/t2-cli/bash_completion

For zsh users, add these lines to your ~/.zshrc file:

# Add custom completion scripts
fpath=(/PATH/TO/t2-cli $fpath)

# compsys initialization
autoload -U compinit
compinit

Updating

Just run t2 update to make sure you are running the most recent build of OpenWRT and firmware.

Testing

Overview

In order to maintain a reliable code base, there is extensive code coverage and style checking involved with adding to or editing this repo. Grunt is used as the task runner, along with plugins for the following tools:

  • jshint: used to verify our best practices and prevents us from making mistakes that could lead to hard-to-find bugs, see .jshintrc for our configuration
  • jscs: used to maintain the project's preferred code style, see .jscsrc for our configuration
  • jsbeautifier: used to format code into the repo's preferred style, see Gruntfile.js for our configuration
  • nodeunit: used to create and run unit tests

All of these tasks can be run by entering npm test (an alias for grunt test without needing to have the grunt-cli installed globally) into your command line. Be sure to run this command before pushing new code so JSHint and style errors can be caught as soon as possible.

Writing Tests

Check out the nodeunit documentation for general usage of the library. For this project, there is a global test setup file (found under test/common/bootstrap.js) for including any dependencies needed to run the various test modules, as well as two simulator modules, RemoteProcessSimulator and TesselSimulator, for simulating command line and hardware interactions in the tests.

Unit tests are found in the test/unit/ directory, named after the feature being tested. A typical unit test looks like the following example:

// Test dependencies are required and exposed in common/bootstrap.js

// The module name is usually the name of the function being tested, i.e. Tessel.prototype.findAvailableNetworks
exports['functionName'] = {
  // this is called before the each test is run
  setUp(done) {
    // sinon is used to watch and mock parts of the Tessel codebase used by the tested function
    this.sandbox = sinon.sandbox.create();
    this.functionName = this.sandbox.spy(Tessel.prototype, 'functionName');

    // create a new TesselSimulator to be used by this module
    this.tessel = TesselSimulator();

    done();
  },

  // this is called after each test is run, should cleanup all mocks
  tearDown(done) {
    this.tessel.mockClose();
    this.sandbox.restore();
    done();
  },

  // this should be something recognizable and clearly states what outcome of the function is being tested
  testName(test) {
    // the number of assertions the test should expect
    test.expect(1);

    this.tessel.functionName();

    // `equal` is a function passed through by the Node.js `assert` module, see https://github.com/caolan/nodeunit#api-documentation for more info
    // `callCount` is a property from Sinon's spy, see http://sinonjs.org/docs/#spies for more info
    test.equal(this.functionName.callCount, 1);

    // this should always be called when every assertion is done
    test.done();
  }
};

Releasing

For all releases, a maintainer will complete the following steps:

  1. Update the version, commit it, and tag it (all of these things happen with the following command):
npm version [<newversion> | major | minor | patch]

Where <newversion> is either "major", "minor" or "patch" (currently, we are in pre-1.0 "patch" releases). More than likely, you will type npm version patch.

  1. git push --tags (or git push remote-name --tags, where remote-name is the name of your remote that points to [email protected]:tessel/t2-cli.git)

  2. git push remote-name master

  3. grunt changelog will produce a pre-formatted changelog that looks something like this:

| Commit | Message/Description |
| ------ | ------------------- |
| sha    | we fixed stuff      |

Copy the table to clipboard

  1. Open https://github.com/tessel/t2-cli/releases and click Edit on the right hand side of the "Latest Release":

Type the tag name into the "Release title" field:

Paste the changelog into the "Describe this release" field:

When complete it will look something like this:

  1. Publish updated module to npm:

If not logged in to npm through the cli, do so: npm login

Then: npm publish

Check the npm page to see the latest release!

More Repositories

1

project

The open source Tessel Project. Start here!
340
star
2

hardware

[UNMAINTAINED] Hardware documentation for the Tessel 1
174
star
3

t1-runtime

[UNMAINTAINED] Tessel 1 JavaScript runtime.
JavaScript
117
star
4

t1-docs

API documentation for Tessel 1. Start reading below. (Unmaintained)
JavaScript
97
star
5

t2-firmware

Firmware for Tessel 2's SAMD21 coprocessor and related SoC code
C
95
star
6

tessel-rust

Rust driver for Tessel 2.
Rust
86
star
7

colony-compiler

[UNMAINTAINED] "Compiles" JS to Lua to run on Colony.
JavaScript
80
star
8

t1-firmware

[UNMAINTAINED] Tessel 1 Firmware
C
69
star
9

servo-pca9685

JS library to run the PCA9685 PWM driver
JavaScript
56
star
10

t2-vm

Run and develop for Tessel 2 in a virtual machine.
JavaScript
38
star
11

tessel-av

USB Camera, Microphone, MP3 Player and Text Speaker support for Tessel 2.
JavaScript
38
star
12

t2-start

Tessel 2 start docs! Open for contributions.
CSS
35
star
13

openwrt-tessel

OpenWrt build scripts and package feed for Tessel 2
Makefile
32
star
14

t1-start

[UNMAINTAINED] Tessel 1's getting started page
HTML
32
star
15

climate-si7005

[UNMAINTAINED] JS library for the si7005 temperature and humidity sensor.
JavaScript
32
star
16

ble-ble113a

[UNMAINTAINED] JavaScript module for the BlueGiga BLE113 SOC.
JavaScript
29
star
17

t2-hardware

Tessel 2 KiCad design files
KiCad Layout
29
star
18

t2-docs

Documentation for Tessel 2.
28
star
19

t1-cli

[UNMAINTAINED] Command line interface to Tessel 1.
JavaScript
25
star
20

node-audiovideo

[UNMAINTAINED] Cross-platform Node module for audio record/playback and video recording.
C
24
star
21

ambient-attx4

Tessel library for the Ambient (light and sound) module.
JavaScript
20
star
22

tessel.io

The Tessel Website
CSS
18
star
23

rfid-pn532

JavaScript module for the PN532 driver for RFID.
JavaScript
18
star
24

t1-neopixels

[UNMAINTAINED] The library for running Neopixels on Tessel 1
JavaScript
17
star
25

sync-queue

Simple queue for completing tasks in series
JavaScript
16
star
26

bglib

A Node Library for communicating with BlueGiga Bluetooth Low Energy Devices.
JavaScript
16
star
27

colony-lua

[UNMAINTAINED] Lua 5.1 branch
C
15
star
28

accel-mma84

Driver for the Tessel accelerometer module
JavaScript
15
star
29

gprs-sim900

[UNMAINTAINED] JavaScript module for the SIM900 2G driver.
JavaScript
14
star
30

camera-vc0706

[UNMAINTAINED] JavaScript module for the VC0706 Camera.
JavaScript
14
star
31

climate-si7020

JS driver for the si7020 chip
JavaScript
14
star
32

uboot-mt7620

U-Boot bootloader for MT7620 (Tessel 2)
C
13
star
33

bleadvertise

Parse Bluetooth Low Energy peripheral advertising packets
JavaScript
13
star
34

t1-contribution-guide

[UNMAINTAINED] A thorough explanation of how the Tessel software architecture works as a whole, descriptions of the individual pieces, and the processes for contributing code.
11
star
35

avr-usi-spi

A USI Library implementing the SPI protocol specifically for AVR chips (tested on Attiny44/84)
C
10
star
36

gps-a2235h

Driver for the Tessel GPS module
JavaScript
10
star
37

reach-wg

Reach is a remote I/O board for connecting to sensors.
KiCad Layout
9
star
38

tm-kicad-library

kicad parts
8
star
39

ir-codes

[UNMAINTAINED] Generates signal buffers for different infrared device manufacturers. Designed to be used with Tessel
JavaScript
8
star
40

ir-attx4

JavaScript library for the Tessel Infrared module, built around an attiny84.
C
8
star
41

onboarding

Onboarding for team members. Follow this link:
8
star
42

relay-mono

Driver for the Tessel relay module
JavaScript
7
star
43

tessel-logo-generator

Generates the Tessel logo programmatically
JavaScript
7
star
44

t2-compiler

A server, VM and command line tool to pre-compile binaries for Tessel 2
Shell
7
star
45

thermocouple-max31855

Read data from the thermocouple amplifier MAX31855.
JavaScript
6
star
46

miniz

C
5
star
47

audio-vs1053b

[UNMAINTAINED] JavaScript module for the VS1053b audio driver.
JavaScript
5
star
48

rust-ble

Rust library for BLE. (Linux-only for now.)
Rust
5
star
49

hardware-modules

[DEPRECATED] Tessel 10-pin modules, USB modules, and community modules.
5
star
50

wifi-cc3000

[UNMAINTAINED] wifi-cc3000 driver
5
star
51

reach-nrf51822-hardware

KiCad Layout
4
star
52

openwrt

C
4
star
53

reach-nrf51822

Remote board
C
4
star
54

t2-rustlib

Cross-compiled libstd and core for Rust on Tessel.
Shell
4
star
55

avr-isp

AVR ISP programmer implemented in Tessel.
JavaScript
4
star
56

logos

Tessel Logos and Icons
Makefile
3
star
57

runtime-qemu

[UNMAINTAINED] Scripts to run Tessel's runtime as an emulated Cortex-M in qemu.
C
3
star
58

playground

[UNMAINTAINED] A silly playground for Tessel code.
JavaScript
3
star
59

scbot

Bot to run meetings
JavaScript
2
star
60

cloud

[UNMAINTAINED] Wireless firmware update proxy.
JavaScript
2
star
61

presentations

Slides and presentations about Tessel by the community
2
star
62

t2-build

Ansible and Vagrant scripts for building t2 firmware & OpenWRT.
Shell
2
star
63

hsregex

[UNMAINTAINED] Standalone regex library for embedded C
C
2
star
64

cc3000-async

[UNMAINTAINED] Asynchronous library for CC3000 WiFi
C
2
star
65

this-week-in-tessel

Tessel's community blog. Team Members are welcome to submit posts as PRs here for editing.
JavaScript
2
star
66

t2-crash-reporter

This project helps collect Tessel 2 CLI crash reports, and makes them easily accessible and searchable.
Python
2
star
67

protoboard-module

Design files in KiCad for a DIY hardware module for Tessel.
Prolog
2
star
68

rust-compilation-server

A server to run on an Linux box with Rust Cross Compilation capabilities
JavaScript
2
star
69

attiny-common

A common library for Tessel's ATTiny based modules
JavaScript
2
star
70

6LoWPAN-target

[UNMAINTAINED] Kicad design files for a 6LoWPAN board.
KiCad Layout
1
star
71

t1-continuous

[UNMAINTAINED] Build scripts for CLI and firmware.
JavaScript
1
star
72

rust-accel-mma84

Rust
1
star
73

rust-example

Simple example project to show how users could use a Tessel 2 with Rust
Rust
1
star
74

t2-release

A command line tool for deploying T2 releases
JavaScript
1
star
75

tm-eagle-library

[UNMAINTAINED]
1
star
76

rfcs

RFCs for changes to Tessel
1
star
77

tessel-wifi-tests

[UNMAINTAINED] wifi tests to run on Rampart
JavaScript
1
star
78

hardware-resolve

[UNMAINTAINED] Resolver for "hardware" spec in package.json
JavaScript
1
star
79

usb-daemon-parser

A node module used by the CLI to generate packets and parse communication from the Tessel 2 USB Daemon
JavaScript
1
star
80

diy-module

Tessel DIY Module
1
star
81

jobserver

[UNMAINTAINED] Distributed build+test job dispatch and monitoring
CoffeeScript
1
star
82

attiny-firmware-common

A firmware library shared by attiny-based modules
C
1
star
83

6LoWPAN-module

[UNMAINTAINED] Tessel module with an 802.15.4 radio (6LoWPAN, ZigBee, etc.)
KiCad Layout
1
star
84

tessel-node-red

[UNMAINTAINED] A library that allows users to get Node Red working with Tessel and it's module ecosystem
HTML
1
star
85

t2-auto-compiler

Runs the t2-compiler automatically
JavaScript
1
star
86

display-segment

Control a segmented LED display by Sparkfun.
JavaScript
1
star