As I’m about to go on holiday, I don’t have a lot of time to dig in and really explore the uses but there was one thing I knew I could do pretty quickly – get it set up and send an email from it.
Set up the Tessel
After unpacking the unit from the anti-static bag, plug it in and run the following commands from terminal:
Write some code
In the above example I’ve used Needle for the HTTP request, so it needs to be added by creating a package.json file and declaring it in the dependencies. You could of course use the standard library HTTP request contained within NodeJS itself, but I think it looks ugly and over the top for an example like this, so I’ve used something cleaner and more readable.
Next we need to test the code. Tessel’s CLI includes a quick and easy way to test out what you’re building:
The output of which should look something like this:
INFO Bundling directory /Users/martyndavies/code/tessel (~405.34 KB)
INFO Deploying bundle (562.50 KB)...
INFO Running script...
No errors, so hit the button and wait for the…
If everything works, push all the code to the Tessel so it persists:
Happy days! Now here are some caveats…
It’s early days for Tessel. That’s cool, they’ve achieved a lot and the board is great fun to hack with. There are also lots of updates and lots of work on compatibility, but here are some things I struggled with that are worth noting:
- Why not use sendgrid-nodejs? I tried but one of the other libs that it depends on isn’t compatible with Tessel, so it fails when trying to load.
- Why not use Request? See above.
- Tessel WiFi can be problematic. A lot of time was wasted on being too far away from my router for requests to successfully complete but not really knowing why.
Relatively trivial and I’m sure this won’t be the case for too long. I look forward to digging into this board further now that the awesome Cylon.js is ready for it.