npm support. That puts the immense Node.js ecosystem at your prototyping fingertips.
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
Date manipulation (
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).
- (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.
- (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
npmCLI (command-line utility) for provisioning, managing and deploying code to your Tessel. Once installed, you’ll have the
t2command available for working with your Tessel.
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:
npm install -g t2-cli
t2 listwill show the USB-attached Tessel, and
t2 rename <a better name>will give it whatever name you prefer
- Get it on Wifi:
t2 wifi -n <network-name> -p <password>and provision it so you’re authorized to shove code at it:
t2 listshould now show your Tessel, with its nicer name, connected both via USB and LAN.
- Update firmware with
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:
- Button-controlled LED: Pressing a pushbutton (momentary switch) toggles an LED on and off. Uses digital input and digital output.
- Photoresistor and Fading LED: A “nightlight” that grows brighter as ambient light decreases (and vice versa). Uses analog input and PWD output.
- I2C magnetometer (compass) and websockets: A websockets-driven real-time display of compass headings. Uses serial (I2C) and software integration (websockets).
I was able to use baseline code
Photoresistor and PWM “Nightlight”
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.
Note: Johnny-Five “knows” to look for SCL and SDA for the HMC5883L on
A1, respectively (those pins on the Tessel support those features).
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