flaff / uranium-core

Server with services for raspberry pi

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

uranium-core

Backend for raspberry-pi

quick deploy with dependencies installed

Git, nodejs and forever are needed.

cd /usr/share
git pull https://github.com/flaff/uranium-core.git
cd uranium-core
npm install
forever start index.js

environmental gpio dependencies

Skip if using other service for handling GPIO (e.g. webiopi)

pigpio library

pigpio is a library for the Raspberry which allows control of the General Purpose Input Outputs (GPIO). pigpio works on all versions of the Pi.

using apt:

sudo apt-get pigpio

alternatively from pigpio official website:

rm pigpio.zip
sudo rm -rf PIGPIO
wget abyz.co.uk/rpi/pigpio/pigpio.zip
unzip pigpio.zip
cd PIGPIO
make
sudo make install

A wrapper for the pigpio C library to enable fast GPIO, PWM, servo control, state change notification and interrupt handling with Node.js on the Raspberry Pi Zero, 1, 2 or 3.

requirements:

  • nodejs
  • pigpio library
  • python
  • gcc and g++ 4.8 or higher

Checking gcc and g++ version:

gcc --version
g++ --version

Updating gcc and g++ (if < 4.8):

sudo apt-get install python-software-properties
sudo apt-get update

sudo apt-get install gcc-4.8
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.8 50

sudo apt-get install g++-4.8
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.8 50

Exporting environmental variables (if fails to use c++11 compiler):

export CC=/opt/rh/devtoolset-3/root/usr/bin/gcc CXX=/opt/rh/devtoolset-3/root/usr/bin/g++ npm install

Installing pigpio node package:

npm install --unsafe-perm -g pigpio

Setup

Installing rest node packages

npm install

Development

Installing nodemon:

npm install -g nodemon

Running nodemon:

nodemon index.js

Alternatively without nodemon (needs manual restarting):

node index.js

Running server

Server will run at all times using forever node module.

Installing forever:

npm install -g forever

Starting/stopping manually using forever:

forever start index.js
forever stop index.js

About

Server with services for raspberry pi


Languages

Language:JavaScript 99.8%Language:HTML 0.2%