-
Notifications
You must be signed in to change notification settings - Fork 5
How to use Node.js and Socket.io labratories with Raspberry Pi and Arduino
To use these laboratories you need:
-A Raspberry Pi board (Model A or B)
-An Arduino UNO board (Rev. 3)
-An Internet connection
The easy way is reading and following this tutorial https://learn.adafruit.com/downloads/pdf/adafruits-raspberry-pi-lesson-3-network-setup.pdf
Raspberry Pi Firmware and Software Update
Firmware (https://github.com/raspberrypi/firmware):
To update the firmware of Raspberry Pi
follow the instruction of https://github.com/Hexxeh/rpi-update
Restart when finish.
Verified firmware version:
/opt/vc/bin/vcgencmd version
The date of the version should be after of 1st of June
To Update the Kernel and Distributions:
Write on shell:
sudo apt-get update
sudo apt-get dist-upgrade
Verified software version
uname -a
the date of software should have changed to more recent date
From Raspbian:
Install Node.js: You should use the official tutorial
https://github.com/joyent/node/wiki/Installation
Install Node Package Manager https://www.npmjs.org/. Use “sudo apt-get install npm”
Once it is installed, you should install the libraries socket.io and serialport
The libary socket.io is developed in JasvaScript and supports realtime web applications.
The Robotic Arms will be connected to Raspberrypi by an USB port, therefore the library serialport must be installed to communicate Raspberry Pi with Arduino.
- Install Socket.io, https://www.npmjs.org/package/socket.io). Use “sudo npm install socket.io”.
- Install “serialport” to use Arduino via serial port (https://www.npmjs.org/package/serialport). Again “sudo npm install serialport”.
These laboratories only work with an Arduino UNO board. So you can to connect your Arduino UNO board to the USB port of Raspberry Pi.
Project folder into Apache server: “C:\....\www\Node_LabX” (your folder in Apache server)
Project folder into Raspbian: “\var\www\Node_LabX” (your folder in Raspbian)
Download bootstrap from: https://github.com/twbs/bootstrap/releases/download/v3.1.1/bootstrap-3.1.1-dist.zip
Download bootstrap slider from: http://www.eyecon.ro/bootstrap-slider/slider.zip
For use each laboratory you can download the files into repository of Github. You can use 3 different laboratories:
-Led RGB laboratory. You can go to the tutorial of this laboratory here (Led RGB)
-Robotic Arm laboratory. You can go to the tutorial of this laboratory here (Robotic Arm)
-Servo laboratory. You can go to the tutorial of this laboratory here (Servo)