MQTT transport extension for iqrfpy
Project description
iqrf-mqtt-transport
An extension for iqrfpy for MQTT communication with IQRF Gateway daemon.
Quick start
Before installing the library, it is recommended to first create a virtual environment. Virtual environments help isolate python installations as well as pip packages independent of the operating system.
A virtual environment can be created and launched using the following commands:
python3 -m venv <dir>
source <dir>/bin/activate
iqrfpy can be installed using the pip utility:
python3 -m pip install -U iqrfpy-mqtt-transport
Example use:
from iqrfpy.ext.mqtt_sync_transport import MqttTransport, MqttTransportParams
from iqrfpy.peripherals.coordinator.requests.bonded_devices import BondedDevicesRequest
from iqrfpy.peripherals.coordinator.responses.bonded_devices import BondedDevicesResponse
params = MqttTransportParams(
host=..., # MQTT broker host
port=..., # MQTT broker port
client_id=..., # MQTT client ID
request_topic=..., # Request topic that Daemon subscribes to
response_topic=..., # Response topic that Daemon publishes responses to
qos=1,
keepalive=25
)
transport = MqttTransport(params=params, auto_init=True)
request = BondedDevicesRequest()
response: BondedDevicesResponse = transport.send_and_receive(request=request, timeout=10)
print(response.bonded)
Documentation
For more information, check out our API reference.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file iqrfpy-mqtt-transport-0.1.0.tar.gz.
File metadata
- Download URL: iqrfpy-mqtt-transport-0.1.0.tar.gz
- Upload date:
- Size: 10.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7d1100e2cc2b4c79938d7af4b635ab46a05ff21e4d456f2359dea63ec7726026
|
|
| MD5 |
731b986c7f9d359dcf549de21496f82d
|
|
| BLAKE2b-256 |
ca145ff80166de3b9be795af89d728afc97ad4c1fbf9b08af362587659231483
|
File details
Details for the file iqrfpy_mqtt_transport-0.1.0-py3-none-any.whl.
File metadata
- Download URL: iqrfpy_mqtt_transport-0.1.0-py3-none-any.whl
- Upload date:
- Size: 11.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
933a522ac64f216fcea50e84314a638509f127139ab8c0af5773cc463bcadeb7
|
|
| MD5 |
e9612e9d43cf637c388996ac4ab05688
|
|
| BLAKE2b-256 |
6744dc70d00abf0f16662187958e72fc9193d4d63261b31a747b54609f49ef29
|