masalinas / node-accelerometer-js

IoC proof of concept with Raspberry pi + I2C accelerometer + node-red only using javascript
Apache License 2.0
4 stars 1 forks source link

node accelerometer javascript

A proof of concept to demostrate any measure captured from a accelerometer attached to a raspberry pi 3 and transport this information throw mqtt protocol to a hub server thats centralize this information using a mqtt message broker like mosca and message router like node-red to parse and manage. In this case we will use a node-red flow on the raspberry 3 and not python service to capture the accelerometer measures.

The Node-RED flow Designer in raspberry pi:

picapp - apple macbook air

The Node-RED flow Designer in server side:

picapp - apple macbook air 2

The Raspberry pi 3 and accelerometer connected

node-red-accelerometer

Architecture

architecture

Hardware:

Infraestructure Techonologies on server

Infraestructure Techonologies on device

Frontend Techonologies on server

Installation:

Install GPIO Node-red packages on raspberry-pi 3 device:

Install mosca mqtt message broker on the server side:

  npm install mosca bunyan -g
  mosca -v | bunyan

Execute npm to install node-red message router and the UI modules on the server, the package.json has all dependencies:

  npm install

Start node-red

  node node_modules/node-red/red.js

Access Node-Red server Web designer

  http://localhost:1880/

Licenses

The source code is released under Apache 2.0.