Fork 0
Use node.js to interact with LLAP devices (example): https://github.com/flabbergast/node-llap
Go to file
flabbergast b5888e6887 Update README. 2014-02-03 19:20:58 +00:00
modules Add simple logging of data to csv. 2013-12-09 20:20:23 +00:00
public Fix client-side sensor code separation. 2013-12-04 10:06:40 +00:00
views Provide the app's version for rendering. 2013-12-05 10:17:04 +00:00
.gitignore Add simple logging of data to csv. 2013-12-09 20:20:23 +00:00
README.md Update README. 2014-02-03 19:20:58 +00:00
TODO.md Add init calls to sensors; update TODOs. 2013-12-08 21:40:39 +00:00
app.js Provide the app's version for rendering. 2013-12-05 10:17:04 +00:00
package.json Add simple logging of data to csv. 2013-12-09 20:20:23 +00:00


Sensors base server

A node.js app for collecting and displaying LLAP messages from sensors (a-la Ciseco sensors).

Hopefully it should not be too hard for you to poke around the sources, figuring out what code does what and how to modify it to one's needs.


While doing this project was fun, I have moved on to a different solution for the same "problem". The approach taken in this project is "one app to rule them all": the node app monitors the incoming transmissions, processes them, logs the data, takes care of displaying the data over http. I was having hard time making the logging work the way I wanted, and figuring out how to display graphs was a bit daunting. So, all in all, I probably won't work on this anymore.


The basic hardware setup is:

The software setup / server side:

  • have node installed
  • get the app's sources, e.g. clone this git repo: git clone https://github.com/flabbergast/node-llap
  • run npm install from the app's source directory
  • run the app by npm app.js
  • open the website and enjoy

Note that currently the app expects one Ciseco's sensor with a thermistor, in the cyclic sleep/transmit mode. The device name should be TM. All the other LLAP will be only displayed in the log.

More explanations

Since it's veery unlikely that you'll have the same setup as me, some editing of the sources might be necessary. For this reason, I'm including some explanations for the sources; and list some current limitations:

  • Problems:

    • only one serial port on the server: so one can't have wireless sensors together with, say, an Arduino over a USB
    • the displayed logs are not being continuously updated, one has to click the 'refresh' button
  • Structure:

    • On the server side there is a socket to each client (the main chunk of code for this is in modules/socket_server.js); and code to deal with the serial port (modules/serial_node.js).
    • The client side is connected to a socket (code is in public/js/socket_client.js).
    • Sockets are implemented via socket.io; for 'transmitting' a message via a socket one uses socket.emit(...); for 'listening' for a message and act upon its receipt one uses socket.on(...).
    • The sources for the web page are views/{index.jade,layout.jade}, public/css/style.styl and public/js/index.js. Clicking on buttons (code in index.js) socket.emit's, received messages are socket.on-listened to in socket_client.js, which then updates the page using jquery.
    • All received messages are logged to winston's file backend on receipt (function onDataOverSerial in socket_server.js).



Working code (on my machines). Running elsewhere will likely need some source modifications.


Originally inspired by Node-LEDS.