The Tessel 2 is a platform that has JavaScript at its heart (although the team that makes it is also doing some work to support Rust). You get to use Node.js and, yay!, there’s npm support. That puts the immense Node.js ecosystem at your prototyping fingertips.

Tessel 2

How it Works

The Tessel 2 runs your deployed Node.js scripts on-board. You can include third-party modules from npm to your heart’s delight (as long as the total packaged size doesn’t exceed the Tessel’s available 32MB or so of program memory space). That means you don’t have to reinvent low-level wheels to get, say, websockets (so well handled by socket-io already) or JavaScript Date manipulation (moment FTW).

For Node.js developers, the workflow with the Tessel 2 will feel pretty natural. There are a few initial steps to provision the device and get it on WiFi, but they’re pretty fast.

What’s Different About it

The Tessel 2 uses a Mediatek MT7620n WiFi System-on-a-Chip (WiSOC) as its main processor, but also has an Atmel SAMD21 coprocessor. The coprocessor takes on the task of I/O management, freeing up the Mediatek processor to do its main jobs. You can deploy code over a USB connection, or over WiFi to a Tessel 2 that is on your LAN.

Tessel provides a collection of Tessel-specific hardware modules that can be used with the device. You can also just use standard electronic components, serial sensors, etc. (that’s what I did).

Terminology

  • (GPIO) port: The Tessel 2 has two GPIO ports of 10 pins each (8 GPIO and 2 power), port A and port B. As with other platforms, different pins support different kinds of I/O. Pin numbers are prefixed with their port letter, e.g. A2, B6.
  • (Hardware) modules: Open-source bits of hardware specifically designed for use with the Tessel, e.g. a relay module, accelerometer module, etc. Some are created by the Tessel team and some are user-contributed.
  • tessel-io: Johnny-Five I/O plugin for Tessel 2
  • t2-cli: A globally-installed npm CLI (command-line utility) for provisioning, managing and deploying code to your Tessel. Once installed, you’ll have the t2 command available for working with your Tessel.

Getting Started

Getting a Tessel 2 provisioned was a quick and easy process. Not a lot else to say.

Unboxing and Setup

Unlike some of the platforms we’ve tested that come with dongles, DC adapters, antennae, spacers and feet, the Tessel 2 is pretty simple. You attach to a USB port on your computer (USB micro on the Tessel end). Note that the Tessel takes about 30 seconds to boot (you can tell it’s done when it’s on-board blue LEDs stop blinking). Then:

  1. npm install -g t2-cli
  2. t2 list will show the USB-attached Tessel, and t2 rename <a better name> will give it whatever name you prefer
  3. Get it on Wifi: t2 wifi -n <network-name> -p <password> and provision it so you’re authorized to shove code at it: t2 provision. t2 list should now show your Tessel, with its nicer name, connected both via USB and LAN.
  4. Update firmware with t2 update

These instructions are nicely documented in the Tessel site’s getting-started guide.

Note: The Tessel 2 cannot connect to 5GHz Wifi networks.

Developing for the Tessel 2

To explore the Tessel 2, I used johnny-five, which is supported via the tessel-io I/O plugin. Johnny-Five takes care of abstracting some details and makes code I’ve written for other devices portable.

A couple of things to note: Tessels run a LTS Node.js, which at time of writing is 4.4.3 on the device. You’ll want to keep that in mind when writing code for the Tessel 2. I made it a habit of using a matching version of Node.js within the project on my laptop for consistency (and to prevent surprises and confusion).

Representative Tasks and Applications

The following three representative tasks demonstrate typical hardware capabilities for IoT platforms:

  1. Button-controlled LED: Pressing a pushbutton (momentary switch) toggles an LED on and off. Uses digital input and digital output.
  2. Photoresistor and Fading LED: A “nightlight” that grows brighter as ambient light decreases (and vice versa). Uses analog input and PWD output.
  3. I2C magnetometer (compass) and websockets: A websockets-driven real-time display of compass headings. Uses serial (I2C) and software integration (websockets).

Button-controlled LED

I was able to use baseline code

Wiring Diagram for Button-Controlled LED on Tessel 2

Source

Photoresistor and PWM “Nightlight”

Wiring Diagram for Photoresistor-controlled "Nightlight"

Source

I2C and Websockets

I was able to use mostly portable code for the I2C-and-websockets example on the Tessel. The exception was a necessity for a .tesselinclude file so that all of the component pieces of the app made it to the Tessel.

Wiring Diagram for I2C and Websockets on Tessel 2

Source

Note: Johnny-Five “knows” to look for SCL and SDA for the HMC5883L on A0 and A1, respectively (those pins on the Tessel support those features).

The Verdict

For developers comfortable with the Node.js way of looking at the world, there’s probably no platform that’s zero-to-prototyping faster. However, JavaScript it is (though Rust support is probably coming)—this is not a multi-purpose, flexible platform. There’s debate as to whether JavaScript is (or ever can be) performant and efficient enough in at-scale constrained production hardware, though the Tessel Project is currently evaluating and building Rust language support to help with this. Then again, the message can feel a little unclear: all JavaScript all the time, JavaScript for all the things, but use Rust when you really mean it?

I’ll leave aside discussion about production-readiness—currently a significant aim of the Tessel Project—for now, but this is a great JavaScript hobbyist’s board—easy, solid and straightforward.

The Tessel 2 is Good For…

  • Getting hands-on prototypes going, quickly
  • Novice tinkerers, learners
  • Those who want a Node.js-capable device
  • Projects that make use of the Node.js ecosystem, especially web-connected projects
  • Folks who want to use a platform that has some packaged, specific hardware modules instead of lower-level components