Giter VIP home page Giter VIP logo

dev0037-lifi-table's Introduction

DEV0037-LiFi-Table

This is the information for installing, starting and maintaining the lifi table software

Design

The table is an http server listening on port 3000. It is designed to recieve an array of image data from the client an update the table.

Avaliable endpoints are

  • / - access retrives the client
  • /stop - stop the animation and clears the LED buffer
  • /init - restarts the LEDS

The image data is send via a websocket the connection to which can be established at /render

Server

The server is a node.js server that listens on port 3000.

The server process is managed by pm2

The source for the server is in /server

Client

The client is single page web application that renders the vsualisation using webgl.

It provides some basic parameters to control the table animation

source can be found in /src

It is designed to run on chrome

The client is compiled by webpack and put into /dist where the server actually serves the page from

Hardware setup

The table server is set up to run node.js 9 on a Raspberry pi 3 Model B running Raspbian Stretch Lite

To set up on a new sd card run the following

  sudo apt-get update
  sudo apt-get upgrade
  curl -sL https://deb.nodesource.com/setup_9.x | sudo -E bash -
  sudo apt-get install -y nodejs
  npm install -g pm2
  sudo mkdir /var/www
  sudo chown pi /var/www
  sudo chmod 711 /var/www
  pm2 startup

follow the instructions from pm2 startup

Next on your development machine build the app by running

npm run build

Then copy /server, package.json, package-lock.json and /dist to /var/www on the server.

On the server install

  cd /var/www
  npm install

Its now ready to run

 sudo pm2 start /var/www/server/index.js
 sudo pm2 save 

Now the server will be avaliable and will start with server reboot

Raspberry Pi as access point

It may be usful to run the table server as a wireless access point so you can connect to it

We followed [this guide to set it up]https://www.raspberrypi.org/documentation/configuration/wireless/access-point.md

dev0037-lifi-table's People

Watchers

James Cloos avatar Seamus Foley avatar

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.