Coder Social home page Coder Social logo

rpi-ubeacon-gateway's Introduction

Raspberry Pi uBeacon Gateway

Introduction

This is the project for the web graphical user interface available on the RaspberryPi to manage local beacons.

Getting started

Installation

Run npm install to install all the dependencies.

Configuration

Configuration variables, such as the app port, the serial port for UART communication, etc... should be provided to the app via ENV variables.

This is to be compliant with the [http://12factor.net/](Twelve Factor App) principles. This way, we can have:

Running in dev mode

In dev mode, I use https://toolbelt.heroku.com/ which is part of the Heroku Toolbelt. It's a great tool to ensure multiple processes run simultaneously and with the correct environment variables.

A Procfile file specifies which processes should run and a .env file specifies the ENV variables.

To get up and running, copy the Procfile.dist and .env.dist into a Procfile and a .env and update them to suit your needs.

Now run:

foreman start

https://github.com/petruisfan/node-supervisor is a great tool in development to ensure the app is restarted whenever there is a JS file change.

With the [http://livereload.com](Chrome LiveReload plugin) installed, in dev mode, whenever a file in /public or a Jade view changes, the web page is reloaded.

Running in production

There are also multiple options, https://github.com/Unitech/pm2 is one of them.

To use PM2, simply copy .env.dist into .env, update the config to suit your needs and run:

pm2 start bin/www

rpi-ubeacon-gateway's People

Contributors

paztek avatar 1am avatar fkruta avatar

Stargazers

 avatar

Watchers

 avatar James Cloos avatar  avatar Thomas Saphir avatar  avatar

rpi-ubeacon-gateway's Issues

Exception on venue page

After inserting the OOAUTH token I get this excerption when going on the venue-info page :

TypeError: Cannot read property 'id' of null
    at /home/pi/rPi-uBeacon-gateway/routes/venue.js:50:69
    at callback (/home/pi/rPi-uBeacon-gateway/node_modules/nedb/lib/executor.js:30:17)
    at Cursor.execFn (/home/pi/rPi-uBeacon-gateway/node_modules/nedb/lib/datastore.js:460:14)
    at Cursor._exec (/home/pi/rPi-uBeacon-gateway/node_modules/nedb/lib/cursor.js:172:17)
    at /home/pi/rPi-uBeacon-gateway/node_modules/nedb/lib/executor.js:40:13
    at Immediate.q.process [as _onImmediate] (/home/pi/rPi-uBeacon-gateway/node_modules/nedb/node_modules/async/lib/async.js:731:21)
    at processImmediate [as _immediateCallback] (timers.js:367:17)

I have encountered an ERROR after running the app

/home/pi/uBeacon_gateway/rPi-uBeacon-gateway/node_modules/nedb/lib/datastore.js:77
if (err) { throw err; }
^

Error: ENOENT: no such file or directory, open '/home/pi/uBeacon_gateway/rPi-uBeacon-gateway/db/../data/venues.db'
at Error (native)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.