Code Monkey home page Code Monkey logo

ttn-sensor-maps's Introduction

The Things Network collaborative sensor maps

TTN Sensor Maps

Data gets a lot more exciting when you can visualize it. This project makes it easy to plot sensor data from LoRaWAN nodes connected to The Things Network on a map. Because everyone can add their sensors by just providing an API key, it's very useful for workshops or introductions to LoRaWAN. The maps work on desktop and mobile, and data is automatically synchronized between clients.

How to run

  1. Install Node.js.

  2. Clone this repository:

    $ git clone https://github.com/janjongboom/ttn-sensor-maps
    
  3. Install dependencies:

    $ npm install
    
  4. Run the server:

    $ node server.js
    
  5. Navigate to http://localhost:7270.

There is also a Dockerfile in this project if that's more your thing.

Google Maps API Key

Before deploying this application, you'll need your own Maps API key. Go to this web page and obtain one. Then open server.js and enter the API key in the config object.

Adding data to the map

  1. Go to your application in the The Things Network console and note down your application ID.
  2. At the bottom of this page there is an 'application key'. Also note it down.
  3. Switch back to the application and enter your application ID in the textbox in the right top corner.
  4. When prompted enter your application key.
  5. Data will now automatically show up on the map.

You can add many applications this way, which is great for workshops.

To remove an application again, look in db.json and remove the entry from there.

Configuration

To configure what data is shown open server.js. In here you have the config object. This is where you specify what graphs need to be drawn and how the data needs to be mapped.

Objects are automatically placed close to the center of the map, and can be dragged to their actual location. To change the zoom level, look in public/maps.js. If a device has GPS you can override this behavior and use the actual coordinates by setting the lat and lng properties of a device in server.js. Make sure to emit a location-change event after so all clients can see the new location.

The graphs can be configured in the config object in public/maps.js. E.g. to allow for more graphs to be displayed you can disable the ticks on the x-axes and then lower the height of the map canvas. This project uses Chart.js.

Authors and license

This project was funded by Arm Mbed, The Things Network and Multi-Tech and originally created for SXSW 2018. It's maintained by Jan Jongboom and Johan Stokking.

This project is licensed under the Apache 2.0 license, and thus can be used freely.

ttn-sensor-maps's People

Contributors

janjongboom avatar

Stargazers

 avatar  avatar Alejandro Taracido avatar  avatar Joachim Hummel avatar Ciira wa Maina avatar Jens Vorwerg avatar Jack Lam avatar Arnaud avatar John Caipa avatar Alex Kritikos avatar  avatar  avatar  avatar  avatar Gabor Dolla avatar Jordan Last avatar

Watchers

 avatar  avatar James Cloos avatar Danny Engelman avatar  avatar Alex Kritikos avatar  avatar Jens Vorwerg avatar  avatar

ttn-sensor-maps's Issues

Errors

Hi,
When I launch the server.js, there're several errors...
error
Thanks for your help. :)

node server.js responds with "illegal instruction"

Trying to install on Raspberry Pi (Linux bs440rpi 4.4.38+ #938 Thu Dec 15 15:17:54 GMT 2016 armv6l GNU/Linux).
Running node 6.11.3
Installation runs fine. Obtained Google maps API key and put it in server.js.
When running "node server.js" the only response is "illegal instruction".
sudo node server.js just returns the prompt after 10 seconds.
No access to the webpage on port 7270

do i miss anything obvious?

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.