Mashing Socket.io & JohnnyFive
This project demonstrates the ability to control an arduino unit with a webpage.
Web page ---> HTTP server / TCP Server ---> TCP Client / JohnnyFive Arduino controller ---> Arduino
There are four components to this project:
- Arduino
- Node program running Johnny-Five & and a TCP client
- Node server serving static files via HTTP, running Socket.io, and a TCP server
- Static webpage which uses Socket.io to connect to the server.
- Connect your arduino via USB & load the Firmata sketch. See Johnny-Five repo for instructions.
- Run
node server.js
on the remote host which will also serve the web page. - Set the IP in
arduino.js
to the IP of your remote host: e.g.host:'66.172.10.186'
- Run
node arduino.js
locally on the computer which is connected to the arduino. - You'll see the arduino's LED start to blink in response to the remote server. Eventually this will be controlled through a webpage.
- npm install socket.io
- npm install node-static
- npm install johnny-five