This is a boilerplate to create Node.js IoT system with Arduino and Socket.io I have been using this system for most of my network controlled hardware project.
The system is divided to of 3 parts.
- Web server (hosts controller website & socket.io connections)
- Controller website
- Arduino Client
For sample, I've included small code to turn LED on and off from website, & receive message on webserver when button is pressed.
- Set up your hard ware as below
- From your computer (or on your server) start a server
- From your computer connected to Arduino via USB, start Arduino client
localhost:5030in your browser to see controller site
note: if you are running
client.js from different computer (i.e
server.js on hosting service &
client.js on your Raspberry Pi) You'll need to change socket.io address in
Setup for your own system
- For hardware setup, I recommend browsing Johnny-five doc and edit
- You can add as many socket message as you like and customize your controller website by editing