GithubHelp home page GithubHelp logo

mosaic-lopow / oss7-thingsboard-backend-example Goto Github PK

View Code? Open in Web Editor NEW
5.0 15.0 2.0 121 KB

An example on how to add custom parsing logic on top of TB with oss7-thingsboard gateways

Home Page: http://mosaic-lopow.github.io/dash7-ap-open-source-stack/

License: Apache License 2.0

Python 99.84% Shell 0.16%
dash7 oss-7 thingsboard iot iot-gateway

oss7-thingsboard-backend-example's Introduction

Introduction

This project is closely related to the oss7-thingsboard-gateway project, which allows to integrate an OSS-7 gateway with ThingsBoard. This project builds on top of the gateway and ThingsBoard platform and show how to build an application on top of this platform. Thingsboard is configured to forward all DASH7 ALP commands to an external MQTT broker.

The backend-example.py example subscribes to this broker and parser the ALP commands. The parsing happens here so we don't need to integrate the business logic and parsing logic in ThingsBoard. However, after the sensor value is parsed it is stored as an attribute attached to the device in ThingsBoard using it's API. In this way ThingsBoard contains all data (ie a digital twin of the devices).

The gateway-command-example.py shows how you can execute custom ALP commands on the modem in the GW (or the remote nodes reachable by the GW over DASH7), using thingsboard RPC API. In this example the ALP command used will switch the active access profile of the GW, allowing for instance to switch frequency band which is used for scanning.

Installation

  • clone the repository, including the submodules: $ git clone --recurse-submodules https://github.com/MOSAIC-LoPoW/oss7-thingsboard-backend-example.git
  • install the requirements: $ sudo pip2 install -r requirements.txt

Running

$ PYTHONPATH=lib/pyd7a/ python2 backend-example.py --help
usage: backend-example.py [-h] [-v] [-b BROKER] [-u URL] -t TOKEN

optional arguments:
  -h, --help            show this help message and exit
  -v, --verbose         verbose
  -b BROKER, --broker BROKER
                        mqtt broker hostname
  -u URL, --url URL     URL of the thingsboard server
  -t TOKEN, --token TOKEN
                        token to access the thingsboard API

The example will parse the sensor data as transmitted by OSS-7 sensor nodes by default, and store this in the my-sensor of the device.

oss7-thingsboard-backend-example's People

Contributors

glennergeerts avatar michielaernouts avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  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.