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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Close
Hashes for thingsboard-micropython-0.1.4.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | f6f1c56fb57c77b1025cda16aca4bde756d3b7baf15242971fb3c11a84175d90 |
|
MD5 | 180a4ec4c6ac3295e360e198cde1534c |
|
BLAKE2b-256 | 9f4d6b706cb62462dddd79577dac176243da9d606d5f4f461f185b165f9f7390 |