Posts | Comments

Planet Arduino

Archive for the ‘node.js’ Category

Mar
25

Play with the Basketball Robot running on Intel Edison

arduino, ArduinoCertified, edison, Featured, Intel Edison, node.js, Robot Comments Off on Play with the Basketball Robot running on Intel Edison 

basketball_intel1

After you had an introduction to Intel Edison  following the Getting Started guide, and our previous tutorial, the Intel Edison mini-breakout Getting Started Guide, it’s now time to work on something a bit more complex. You’ll be also able to play a bit with Node.js,  a programming platform that runs on javascript and a good choice for building a web-based application. It is supported by the Intel® Edison standard system image so you can run node.js scripts directly on it.

He shoots! He scores! The crowd goes wild! Let’s build a robot that plays basketball with you. This tutorial is a step-by-step guide for a simple and small differential-drive robot that uses the Intel Edison. You’ll get to know a few more tricks on how to use Mini Breakout Kit and set up a node.js server for the communication.

Go and follow the steps to build it

basketball_intel2

Jul
07

Node.js on the Arduino Yún via the Bridge library

arduino, Featured, node.js, Yun Comments Off on Node.js on the Arduino Yún via the Bridge library 

ArduinoYun

Tom Igoe some days ago wrote an interesting post about Arduino Yún on his blog.  We post it here as it could be useful to the Arduino Community.

————————–

Recently, Federico Fissore added node.js to the package repository for the Arduino Yún. Here’s how you get node to communicate with the Arduino processor on the Yún via the Bridge library.

To do this, you’ll need an Arduino Yún, a microSD card, a microUSB cable and a wifi connection. You should be familiar with the basics of the Arduino Yún and node.js in order to get the most out of this post.

All of the code for this post can be found on my GitHub repository.

First you’ll need to install node on the Yún. Make sure you’ve upgraded to the current Yún software image and have connected to the internet via wifi. Then ssh into your Yún, or connect to the command line interface using the the YunSerialTerminal sketch, and issue the following commands:


$ opkg update
$ opkg install node

That’s it. Now you have node.js onboard. You can check that it’s okay by checking the version:

$ node -v

You should get the version number in reply.

Once you’ve got that working, you’ll undoubtedly want to communicate with the Yún’s Arduino processor from node. You can do this using the Bridge library. On a microSD drive, make a directory for your node scripts. I called mine /arduino/node. Then insert it into your Yún. For reference, its path from the command line is /mnt/sda1/arduino/node.

Note: The Yún automatically treats the microSD card’s /arduino/www/ directory as a public web directory. Anything you put in there will be served out as static HTML. So you may not want to put your node scripts in this directory, so they’re not visible via the browser. That’s why I created a node directory at the same level as the www directory, but outside it.

Read the complete post at this link>>

Jun
03

Controlling lights and sensors with Arduino Yún, Node js server and firmata

arduino, Arduino Yún, Firmata, node.js, Yun Comments Off on Controlling lights and sensors with Arduino Yún, Node js server and firmata 

Arduino-nodejs

Arduino user DavidMJBos sent us a project using Node js server on the Arduino Yún to control the lights, heating and some other sensors in the office of Appsaloon, the company where he’s doing an internship.

They already use Node.js for a lot of things and some of them are pretty cool with it.
That’s how they did it:

 

First of all you need to expand your flash, because there is not enough flash (16 MB) on the Arduino Yún. Sounds reasonable right? Not when you got the Yún for the first time in your hands. Luckily someone wrote this tutorial.

To start with you need to be on the same network to reach the Arduino :-) .
Open your terminal

ssh root@arduino.local

It will ask for a password, which will by default be: ‘arduino’:

Now you can install Node.js on the Yún type :

opkg update
opkg install node

When the install is finished verify it by :

 node -v

It should give you something like this v0.10.28 (it may vary in the future)

Next you have to install the node-serialport package. This is necessary because the Atheros AR9331 needs to communicate with the ATmega32u4.

opkg update
opkg install node-serialport

After this you will need firmata for Node.js. This will control the inputs and outputs of the ATmega32u4.

Normally you would install firmata like this:

npm install firmata

But because the Arduino Yún does not have enough RAM this is ‘not possible’.

Keep reading it on their blog and fork it on Github!

May
06

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

Announcements, arduino, Arduino Yún, node.js, sd, Yun Comments Off on Time to Expand your Yún disk space and install Node.js 

ArduinoYun

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.

Raspberry Pi and RobosapienToday I spent the day somewhere where you might not think to find makers: the Great British Node Conference. For those of you who haven't come across it yet, node.js is a server-side solution for JavaScript—it's an event-driven Javascript platform which does non-blocking I/O—and is rapidly gaining popularity, and mindshare amongst the web communit

Read more on MAKE

Jul
11

Animating a lamp with the Leap Motion

arduino, arduino hacks, Hardware, Leap motion, node.js Comments Off on Animating a lamp with the Leap Motion 

leap

The Leap Motion is a very cool device, but so far we haven’t seen many applications of interacting with physical devices. [Xavier] wanted to control a cute servo animated desk lamp with his hands, and with the help of a Leap and an Arduino he was able to do just that.

The Leap Motion API has a handy feature that will output all its data over a websocket. It’s a very easy way to transfer hand positions with a minimum amount of overhead, and with just a little bit of Node.js, it’s only two lines of code to connect the Leap to a websocket server.

With the Leap data on a web server, the only thing left to do is pulling it down to an Arduino. Again, [Xavier] used Node.js, this time in the form of johnny five, a Javascript-based Arduino framework. After that, it was a simple matter of mapping the data from the Leap to servo movements in [Xavier]‘s Pixar-inspired lamp.

Video of the build below.


Filed under: Arduino Hacks, hardware
Oct
22

Add an Arduino to a Google+ Hangout

amazon ec2, arduino hacks, google, google hangout, node.js Comments Off on Add an Arduino to a Google+ Hangout 

Google+ Hangouts provide a group video chat with the ability to add apps. [RobotGrrl] created a Node.js web app to control an Arduino that can be added to a Hangout.

There’s a Javascript client that runs inside of the Hangout and communicates with the Node.js server running on an EC2 server over WebSockets. The server receives this client data and sends commands to Processing using TCP sockets. Processing deals with communicating with the Arduino, allowing you to control many things from the Hangout.

In this simple example, [RobotGrrl] demonstrates how to toggle an LED from the Hangout. This includes a tutorial on setting up your EC2 instance, full source for the server and client apps, the processing sketch to control an Arduino, and the code to allow the app to be added to a Hangout.

This example shows the basics, but there’s a whole slew of things that could be controlled with this system. [RobotGrrl] even demonstrates some robots that are controlled from a Hangout interface.

Check out an overview video after the break.


Filed under: arduino hacks


  • Newsletter

    Sign up for the PlanetArduino Newsletter, which delivers the most popular articles via e-mail to your inbox every week. Just fill in the information below and submit.

  • Like Us on Facebook