Git Product home page Git Product logo

c8y-python-decoder-example-microservice's Introduction

Intro

This project is an example LPWAN decoder microservice in python that decodes a Base64 Hex payload, handles device creation and adds measurements.

Content

Quick Start Example

Use the provided zip here in the release and upload it as microservice. Send example payload to the decode endpoint of the service: { "payload": "KQUgAXgqAO8DOP//" }

There is one device being created and the decoded measurements will be attached.

Solution components

The microservice consists of 4 modules and a main runtime:

  • main.py: Main runtime that opens an health endpoint at /health and also triggers the request of decoding on /decode endpoint
  • API/authentication.py: Contains the Authentication class that requests the service user via the bootstrap user from within the microservice environment. See documentation for more details.
  • API/inventory.py: Consists of the logic to deliver the internalId of the device representation of the tenant or creates the device if a new one appears.
  • API/measurment.py: Creates the measurement payload and sends it to Cumulocity.
  • decoder.py: Contains the decoding logic.

Installation from scratch

To build the microservice run:

docker buildx build --platform linux/amd64 -t {NAMEOFSERVICE} .
docker save {NAMEOFSERVICE} > image.tar
zip {NAMEOFSERVICE} cumulocity.json image.tar

You can upload the microservice via the UI or via go-c8y-cli





These tools are provided as-is and without warranty or support. They do not constitute part of the Software AG product suite. Users are free to use, fork and modify them, subject to the license agreement. While Software AG welcomes contributions, we cannot guarantee to include every contribution in the master project.


For more information you can Ask a Question in the TECHcommunity Forums.

You can find additional information in the Software AG TECHcommunity.

c8y-python-decoder-example-microservice's People

Contributors

mbay-odw avatar mbie-sag avatar techcommunity avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Forkers

mbie-sag mbay-odw

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.