Giter Site home page Giter Site logo

toit-qubitro's Introduction

Qubitro connector for the ESP32

Connect your devices to Qubitro and visualize your data in the Qubitro Portal.

This Toit package provides an easy and convenient way to connect to Qubitro via MQTT from devices running on the ESP32-family of chips.

Architecture

The Qubitro connector runs as a separate micro-service isolated from the rest of the system through Toit containers.

Installing the Qubitro connector

To install the Qubitro connector service on your device, we recommend that you use Jaguar. Jaguar makes it easy to experiment with the Qubitro services because it allows you to upload new services and applications via WiFi without having to restart your device.

The Qubitro credentials easily be provided to the service at install time, so you don't have to write it into your source code:

jag container install qubitro src/service.toit \
     -D qubitro.device.id=<PASTE_DEVICE_ID> \
     -D qubitro.device.token=<PASTE_DEVICE_TOKEN>

This install the Qubitro connector service in a separate container and it sticks around across device restarts:

$ jag container list
DEVICE      IMAGE                                  NAME
lunar-bet   3fb76dd5-5842-57ff-b19c-857669906b04   jaguar
lunar-bet   d04371a2-bb38-54cb-9124-5e48d06ff3d1   qubitro

Publishing data

Once the service is installed, you do not need to provide credentials to publish data from individual applications, although you still can by providing arguments to qubitro.connect. The code for publishing data is reasonably straight forward:

import qubitro
main:
  client ::= qubitro.connect
  10.repeat:
    client.publish { "MyData": random 1000 }
    sleep (Duration --s=2)
  client.close

To run code like the above, you can use jag run:

jag run examples/publish.toit

toit-qubitro's People

Contributors

floitsch avatar kasperl avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Forkers

floitsch

toit-qubitro's Issues

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.