Scott Hanselman

Exploring the Tessel 2 IoT and robotics development board

December 27, '16 Comments [25] Posted in Hardware
Sponsored By

13841-01I'm still on vacation and still on the mend from surgery. I'm continuing to play around with IoT devices on my staycation. Last week I looked at these devices:

Today I'm messing with the Tessel 2. You can buy it from SparkFun for the next few weeks for US$40. The  Tessel is pretty cool as a tiny device because it includes WiFi on the board as well as two USB ports AND on-board Ethernet. It includes a two custom "module" ports where you can pop in 10-pin modules like Accelerometers, Climate sensors, IR and more. There's also community-created Tessel modules for things like Color Sensing and Motion.

Tessel is programmable in JavaScript and runs Node. Here's the tech specs:

  • 580MHz Mediatek MT7620n
  • Linux built on OpenWRT
  • 802.11bgn WiFi
  • WEP, WPA, WPA2-PSK, WPA2-Enterprise
  • 64MB DDR2 RAM
  • 32MB Flash
  • 16 pins GPIO, 7 of which support analog in
  • 2 USB 2.0 ports with per-port power switching

Tessel isn't a company, it's a open source project! They are on Twitter at @tesselproject and on GitHub here https://github.com/tessel.

NOTE: Some users - including me - have had issues with some Windows machines not recognizing the Tessel 2 over USB. I spent some time exploring this thread on their support site and had to update its firmware but I haven't had issues since.

Once you've plugged your Tessel in, you talk to it with their node based "t2" command line:

>t2 list
INFO Searching for nearby Tessels...
USB Tessel-02A3226BCFA3
LAN Tessel-02A3226BCFA3

It's built on OpenWRT and you can even SSH into it if you want. I haven't needed to though as I just want to write JavaScript and push  projects to it. It's nice to know that you CAN get to the low-level stuff I you need to, though.

For example, here's a basic "blink an LED" bit of code:

// Import the interface to Tessel hardware
var tessel = require('tessel');

// Turn one of the LEDs on to start.
tessel.led[2].on();

// Blink!
setInterval(function () {
  tessel.led[2].toggle();
  tessel.led[3].toggle();
}, 600);

console.log("I'm blinking! (Press CTRL + C to stop)");

The programming model is very familiar, and they've abstracted away the complexities of most of the hardware. Here's a GPS example:

var tessel = require('tessel');
var gpsLib = require('gps-a2235h');

var gps = gpsLib.use(tessel.port['A']);

// Wait until the module is connected
gps.on('ready', function () {
console.log('GPS module powered and ready. Waiting for satellites...');
// Emit coordinates when we get a coordinate fix
gps.on('coordinates', function (coords) {
console.log('Lat:', coords.lat, '\tLon:', coords.lon, '\tTimestamp:', coords.timestamp);
});

// Emit altitude when we get an altitude fix
gps.on('altitude', function (alt) {
console.log('Got an altitude of', alt.alt, 'meters (timestamp: ' + alt.timestamp + ')');
});

// Emitted when we have information about a fix on satellites
gps.on('fix', function (data) {
console.log(data.numSat, 'fixed.');
});

gps.on('dropped', function(){
// we dropped the gps signal
console.log("gps signal dropped");
});
});

gps.on('error', function(err){
console.log("got this error", err);
});

Of course, since it's using node and it has great Wifi or wired, the Tessel can also be a web server! Here we return the image from a USB camera.

var av = require('tessel-av');
var os = require('os');
var http = require('http');
var port = 8000;
var camera = new av.Camera();

http.createServer((request, response) => {
response.writeHead(200, { 'Content-Type': 'image/jpg' });

camera.capture().pipe(response);

}).listen(port, () => console.log(`http://${os.hostname()}.local:${port}`));

I'll make a Hello World webserver:

var tessel = require('tessel');
var http = require('http');

var server = http.createServer(function (request, response) {
  response.writeHead(200, {"Content-Type": "text/plain"});
  response.end("Hello from Tessel!\n");
});
server.listen(8080);
console.log("Server running at http://192.168.1.101:8080/");

Then push the code to the Tessel like this:

>t2 push index.js
INFO Looking for your Tessel...
INFO Connected to Tessel-02A3226BCFA3.
INFO Building project.
INFO Writing project to Flash on Tessel-02A3226BCFA3 (3.072 kB)...
INFO Deployed.
INFO Your Tessel may now be untethered.
INFO The application will run whenever Tessel boots up.
INFO To remove this application, use "t2 erase".
INFO Running index.js...

Where is my Tessel on my network?

>t2 wifi
INFO Looking for your Tessel...
INFO Connected to Tessel-02A3226BCFA3.
INFO Connected to "HANSELMAN"
INFO IP Address: 192.168.0.147
INFO Signal Strength: (33/70)
INFO Bitrate: 29mbps

Now I'll hit the webserver and there it is!

image

There's a lot of cool community work happening around Tessel.  You can get involved with the Tessel community if you're interested:

  • Join us on Slack — Collaboration and real time discussions (Recommended! - ask your questions here).
  • Tessel Forums — General discussion and support by the Tessel community.
  • tessel.hackster.io — Community-submitted projects made with Tessel.
  • tessel.io/community — Join a Tessel meetup near you! Meetups happen around the world and are the easiest way to play with hardware in person.
  • #tessel on Freenode — IRC channel for development questions and live help.
  • Stack Overflow — Technical questions about using Tessel

Sponsor: Big thanks to Telerik! They recently published a comprehensive whitepaper on The State of C#, discussing the history of C#, what’s new in C# 7 and whether C# is the top tech to know. Check it out!

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by ORCS Web
Wednesday, 28 December 2016 03:38:20 UTC
I would love to make one of these mini computers to host my Plex server... maybe via WIFI & NAS, ideas?
Chris Go
Friday, 30 December 2016 07:03:35 UTC
I thought you hate Javascript :)
Friday, 30 December 2016 17:02:39 UTC
Chris, that IoT device doesn't have the capabilities to run Plex. If you want a small computer for Plex look into setting up an Intel NUC, install Linux and have fun with it.

Scott, great article. I play a lot with Robotics and IoT in general and wasn't aware of the Tessel. I recently got the powerful ODROID-C2, loaded ArchLinux and I am having lots of fun with it.
Thanks!
Tuesday, 03 January 2017 02:35:39 UTC
Nice! Hope you are healing up nicely from your surgery.
Dave
Tuesday, 03 January 2017 17:18:29 UTC
This is great!!
Satyabrata Mohapatra
Tuesday, 03 January 2017 17:48:47 UTC
It is amazing and exciting to see open source projects like this can get this mature and easy to use.
Tuesday, 03 January 2017 18:43:24 UTC
Very nice stuff. You make it look too easy.
Thanks for sharing this much; All the best for recovering from that surgery.
Our blog gives Xbox Live Gold one-month free memberships to the xbox gamers who already have Microsoft account. Get a gold code for premium Xbox Live membership during January 2017.
Tuesday, 03 January 2017 22:30:16 UTC
microsoft
Wednesday, 04 January 2017 20:20:11 UTC
It looks promising.
I played with Raspberry PI a while ago and found out that it's quite difficult to connect external devices to it. What's the case with Tessel? Can we connect an RFID reader or a printer?
Thursday, 05 January 2017 09:50:42 UTC
tank you
Friday, 06 January 2017 01:26:08 UTC
I am here due to your great workstation, and your blog is very helpful. Thank for sharing
Monday, 09 January 2017 09:54:52 UTC
nice
tudocikah
Monday, 09 January 2017 09:54:53 UTC
nice
tudocikah
Tuesday, 10 January 2017 08:31:27 UTC
Thanks for sharing this great post for us, very usefull.
http://www.blog10.info/
Luis
Monday, 16 January 2017 00:46:47 UTC
Cara Mengatasi Nafas Pendek Karena Maag - Nafas pendek atau sesak nafas dapat timbul secara tiba – tiba menyerang pernafasan. Hal itu terjadi karena penyempetan saluran udara pada bagian pernafasan.
Monday, 16 January 2017 00:53:07 UTC
Good read, thank you
Monday, 16 January 2017 00:53:35 UTC
nice :)
Monday, 16 January 2017 00:54:02 UTC
very nice
Monday, 16 January 2017 08:52:58 UTC
Vitamin Untuk Pertumbuhan Tulang dan Gigi Anak - Pertumbuhan tulang dan gigi pada anak merupakan prioritas utama untuk para orang tua. Hal itu karena pertumbuhan pada anak sangat berpengaruh untuk masa depannya kelak.
Monday, 16 January 2017 13:33:16 UTC
para orang tua. Hal itu karena pertumbuhan pada anak sangat berpengaruh untuk masa depan
Wednesday, 18 January 2017 07:41:55 UTC
nice post, thanks for sharing
Wednesday, 18 January 2017 07:43:59 UTC
pada anak sangat berpengaruh untuk masa depan
Saturday, 21 January 2017 12:56:51 UTC
Very nice stuff. You make it very easier then another posts, thanks for sharing
Valentines Day Quotes
Monday, 23 January 2017 08:32:55 UTC
https://spanish982.wordpress.com/
Monday, 23 January 2017 08:33:49 UTC
hsbhycgsygsygy database sql books jhchxhcbgdxhyghcdy
Name
E-mail (will show your gravatar icon)
Home page
 
Comment (Some html is allowed: a@href@title, b, blockquote@cite, em, i, li, ol, pre, strike, strong, sub, super, u, ul) where the @ means "attribute." For example, you can use <a href="" title=""> or <blockquote cite="Scott">.
Live Comment Preview

Disclaimer: The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.