Skip to main content

ThingsBoard MQTT MicroPython client

Project description

ThingsBoard MQTT MicroPython client

This project is a MicroPython library that provides an client for the Device API of ThingsBoard open-source IoT Platform.

The library consists of a thin wrapper around the MicroPython MQTT module, umqtt.robust.

Installation

To install using pip:

import upip
upip.install('thingsboard-micropython')

Getting Started

Client initialization and telemetry publishing:

from uthingsboard.client import TBDeviceMqttClient

# See examples for more authentication options
client = TBDeviceMqttClient('demo.thingsboard.io', access_token='test01')

# Connecting to ThingsBoard
client.connect()

# Sending telemetry
telemetry = {'temperature': 41.9, 'enabled': False}
client.send_telemetry(telemetry)

# Checking for incoming subscriptions or RPC call requests (non-blocking)
client.check_msg()

# Disconnecting from ThingsBoard
client.disconnect()

Examples

More examples can be found in examples directory.

Support

  • SSL and QoS (0 or 1) as supported by the backend MQTT library, umqtt.robust.
  • All Device API's, except Provisioning.
  • Tested only on ESP32 board running MicroPython v1.16 generic.

Acknowledgment

This library is an adapted version of the official ThingsBoard client SDK for Python, to run in MicroPython.

License

This project is released under Apache 2.0 License.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

thingsboard-micropython-0.2.0.tar.gz (3.7 kB view details)

Uploaded Source

File details

Details for the file thingsboard-micropython-0.2.0.tar.gz.

File metadata

  • Download URL: thingsboard-micropython-0.2.0.tar.gz
  • Upload date:
  • Size: 3.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.7.3

File hashes

Hashes for thingsboard-micropython-0.2.0.tar.gz
Algorithm Hash digest
SHA256 2002e3d6ac7e26d5ac11ddcb014f142e2d41780502b5bb3437927f5cbae062eb
MD5 2eda1ba3b7f59edecc0d22cf4c5d6258
BLAKE2b-256 4d9dc9ec9283ecdbcf826a7a170e43173bb3eb371eced7509d2240e00c6850d7

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page