This has never been an impediment to the success of projects I’ve created with Johnny-Five; which range from trivial input/output demonstration to objectively non-trivial 2, 3, 6, and 12 degree of freedom bipedal and quadrupedal robots. Regardless, all of these projects remain tethered – by cable or wifi signal – to a host machine.
Enter the Intel Galileo.
The Intel® Galileo board is a microcontroller board based on the Intel® Quark SoC X1000 application processor, a 32-bit Intel® Pentium® brand system on a chip (SoC). It is the first board based on Intel® architecture designed to be hardware and software pin-compatible with shields designed for the Arduino Uno* R3.
As the image above shows, the Galileo provides an UNO compatible form factor. For a simple comparison, the following table contains very basic data points for each of the boards mentioned:
|Board||JS Environment||JS Runtime||UNO Form Factor|
|Tessel||Node.js||Embedded Lua runtime||No|
(At this time, those that wish to actually follow along with their Galileo should read through Sparkfun’s Galileo Getting Started Guide or ROS.org’s Intel Galileo initial Yocto image install. To setup wireless networking, I followed Sergey Kiselev’s Intel Galileo Meets Wireless.)
A thorough overview of GPIO is out of scope for this article, but I highly recommend another article by Sergey Kiselev: Intel Galileo - Programming GPIO From Linux. In the simplest terms, GPIO programming can be described as a series of filesystem IO operations. Here’s a simple example of how programming GPIO looks:
In order to teach the Johnny-Five framework how to speak GPIO, we first introduced a plugin mechanism that will allow user code to specify a custom IO layer. Johnny-Five IO Plugins provide a mechanism to override the the default Firmata + SerialPort IO system with a custom “translation” layer that implements the specified interface. The interface protocol defines a minimal API surface with corresponding semantics to enable “drop-in” replacement. As long as the interface contract is fullfilled, the following two examples must produce the same result:
At the Johnny-Five level:
Galileo-IO is both a standalone module and a Johnny-Five IO Plugin. The module is still in its early stages but implements enough of the IO Plugin protocol to support a large class of both existing or new Johnny-Five programs. In practice, this means these two programs produce the same result:
Since the Galileo example is run directly from the board, Johnny-Five can infer details about the host environment and automatically switch its internal default behavior to use Galileo-IO without being told. This means that the following program works exactly the same when run on a host controlling an Arduino client as it does running directly on the Galileo:
Now that Johnny-Five is capable of on-board execution applications, I’m excited to see what users build. As of this writing, Johnny-Five IO Plugins for BeagleBone Black, Raspberry Pi, and Spark Core (Spark-IO is host/client) are in development. Earlier this month, linino.org published a guide to installing Node.js and Johnny-Five for the Arduino Yún – a great opportunity to create a IO plugin. Once the Arduino Tre and Intel Edison become available, we will work to prepare plugins for these platforms as well.
Since publishing this article, several IO Plugins have been contributed by members of the Nodebots community, a list is available here: Johnny-Five IO Plugins