Installing Node.js on Arduino Yún

written by giorrrgio on

EDIT 2: Official support for node has been added!

EDIT: I've added some tips on how to compile the package at the end!

After a few days of waiting, this evening I finally got my Arduino Yún, Yay!

In these last days I have been thinking about running node.js on this little jewel and, investigating a bit, I found a repository with an openWrt nodejs package for MIPS devices.
Since Arduino Yún's core is a Atheros AR9331, a MIPS SoC, and its OS is linino, based on OpenWRT, I was very positive about a happy ending :-)

And here we are! After a little effort to get the cross-compiling working, I came out with a couple of packages:

- uclibcxx_0.2.4-1_ar71xx.ipk
- node_v0.10.17-2_ar71xx.ipk

You can download them zipped here.

Unzip them, copy them to your Yún:

scp *.ipk root@myArduinoaddress:/tmp

install them:

opkg install uclibcxx_0.2.4-1_ar71xx.ipk
opkg install node_v0.10.17-2_ar71xx.ipk

And enjoy!

You can help me improving the package, contributing to the repo (forked from the bristone's one):

Note that by now only 0.10.* node versions are supported, because the v8 libraries for MIPS are not aligned with the latest v8 which is used by 0.11.* versions of nodejs.

If you want to compile the package you have to follow these steps:

But, as indicated, before compiling a package you have to follow the OpenWRT  building process:
When asked to checkout openwrt, clone instead linino from its repo.
The file structure will be the same.
Now copy the contents of the linino nodejs package inside trunk/package/nodejs and continue following the  single package tutorial referring to nodejs instead of nano and uclibc++ instead of ncurses.
The whole process will take a long long time (about 40 minutes on i5 with ssd), but only the first time you build the linino tools.