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, mqtt.robust.

Installation

To install using pip:

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

Getting Started

Client initialization and telemetry publishing:

from uthingsboard.client import TBDeviceMqttClient

client = TBDeviceMqttClient('test01', '127.0.0.1', user='test01', password='test01')

# Connect 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()

# Disconnect from ThingsBoard
client.disconnect()

Examples

More examples can be found in examples directory.

Support

  • QoS 0 and 1 as supported by the backend MQTT library, mqtt.robust.
  • All Device, 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.1.4.tar.gz (3.5 kB view hashes)

Uploaded Source

Supported by

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