Time to Expand your Yún disk space and install Node.js

Following the announcement of the new Yún image, we are happy to announce two new features of the Arduino Yún.
- The first feature allows you to use a micro SD card as a replacement for the Yún’s internal flash memory. We have a tutorial that demonstrates how using this expands your Yún’s free disk space from the original 7 Megabytes to the available Gigabytes of your SD card.
Having more disk space allows you to make more complex projects, like activating webcams and saving pictures taken with it. In addition, by using an external SD card you avoid using the internal flash memory, thus extending the life of your Yún.
To upgrade your Yún to access this feature, follow the tutorial. Report back to the Arduino Yún forum if you have any issues or questions.
- The second new feature is the availability of Node.js as an installable package.
In order to install Node.js on your Yún, use the Arduino IDE to upload the YunSerialTerminal example or access your Yún via SSH.
Be sure your Yún has access to the internet, then type the following commands:
opkg update
opkg install node
And voilà! You’ve got Node.js on your Yún.
Try it out with the following command:
node -e "console.log('Hello_Yun')"
If you are a Node.js fan, you probably want to use your favourite modules. Unfortunately, not every Node.js module is “pure javascript”, so some modules won’t work on the Yún. We are solving this by preparing packages for the most common native Node.js modules. We have already prepared node-serialport (opkg install node-serialport) and noble is on the way. If you miss your favourite module and want it added to the list, please consider joining us in developing the Yún.
May 6th, 2014 at 17:12:50
Try this code:
var crypto = require(‘crypto’);
var name = ‘I love Node.js’;
var hash = crypto.createHash(‘md5’).update(name).digest(“hex”);
console.log(hash);
It will gives you the wrong hash.
Two things:
1) Why do you use dm-dev-mipsbe instead of dm-mipsbe-3.14 that is better?
2) If you are interested I made a fix (a small change in the nodejs source code) for the hashes bug.
May 6th, 2014 at 18:29:14
is there a procedure to revert? I would like to adjust the space that I initially alloted 🙂 thanks in advance!
May 6th, 2014 at 19:51:21
Is this not still installing to the flash?
Have I missed a step to install Node to the SD card, as I’ve already run out os space.
May 6th, 2014 at 20:37:32
Guys, it’s easy! just copy the node files in your sd and make a soft link.
May 7th, 2014 at 10:07:07
@chiari-show, I missed that branch! I’m going to update v8 in the coming days
May 7th, 2014 at 10:50:15
No problem! When I have time I will clone the actual nodejs source in my github and insert the hashes fix. If you want I let you know when.
May 7th, 2014 at 11:23:11
It would be great if you can contribute with a patch or better a pull request on our github repo http://is.gd/dQfPno
May 12th, 2014 at 14:02:35
Hello Together,
Is there already a way to install the serialport node.js module thru
opkg?
opkg install node-serialport
does not find any packages matching node-serialport
Thank you
May 13th, 2014 at 09:35:27
Hi angeldimitrov
I think you have to use npm install node-serialport
May 13th, 2014 at 17:47:19
Sorry did you do opkg update before opkg install …?
May 13th, 2014 at 23:21:43
@DavidMJBos
1) npm install node-serialport
does not work, the right package name is serialport and i it can not be compiled on the Yun;
2) yes i did opkg update before trying to install it.
Did anyone had success installing this package?
May 23rd, 2014 at 00:04:58
are there any updates on that “hashes fix” mentioned earlier??? i may have encountered a node-ws issue that could be impacted by this
May 24th, 2014 at 13:10:01
Hi,
I have a bug with npm install express after the installation of node.js on the Yun:
FATAL ERROR: Evacuation Allocation failed – process out of memory
Aborted
Do you know what I can do for that ?
May 24th, 2014 at 15:01:52
@bast64 – did you activate the swap partition? In my case this was the solution. Otherwise i was not able to compile the node modules.
May 31st, 2014 at 21:27:36
@biosbob, are you getting “invalid server key” if you try to open a WebSocket between the Yun and a computer?
October 4th, 2015 at 06:08:19
Does this mean I can update my Yun boards in the field with new sketches (hex files) simply by inserting an updated SD card?