/LED-head

Nodejs server for LED dome visualizations.

Primary LanguageJavaScript

NTNU CYBORG - LED-SERVER

The LED server is made as a driver for the NTNU Cyborg LED dome. The server will process all visuals for the dome and maintain state. There are two visualization tools for the dome, the development mode and the arduino mode.

  • Development mode hosts a web site that visualizes the animations on a selected device (Dome or head).
  • Arduino mode sends data to the arduino controlled LED dome or box.

Installation

Prerequisits:

NodeJS: https://nodejs.org/en/

Arduino drivers: https://github.com/arduino/arduino-create-agent.

NB! The arduino drivers needs to be installed through the Arduino Create Agent. The older IDEs will not work with the serialport library.

Instructions:

  1. Download the source code:
  $   git clone https://github.com/thentnucyborg/LED-server.git
  1. Create a .env inside /server file with the following:
ADDRESS = localhost
PORT = 8080
AUTO_START = false
AUTO_START_SHOW = 1
FREQUENCY = 500
START_DELAY = 500
  1. Install dependencies:
  $   npm i --prefix server && npm i --prefix client

Development:

The server and client needs to be started seperatively, with the following command inside /server and /client folders:

  $   npm run start

The server is now started and will be hosting the development tool at the default address: http://localhost:3000.

If visulaization on the arduino device is wanted, make sure the device is connected through USB serial before launching the server. The server software will autodetect the arduino device.

Production:

The server and client needs to be started seperatively, with the following command inside /server and /client folders: The client needs to be built first, where the files will be placed inside /server/src/build.

  $   cd client
  $   npm run build

Then the server can be started from inside the /server folder.

  $   cd server
  $   npm run build

Notable files:

ROOT/server/src/model/Program.js contains the different animations available on the device. All of the functions there are templates of how the animation callback looks.

Built With