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
Close
Hashes for iqrfpy-mqtt-transport-0.1.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7d1100e2cc2b4c79938d7af4b635ab46a05ff21e4d456f2359dea63ec7726026 |
|
MD5 | 731b986c7f9d359dcf549de21496f82d |
|
BLAKE2b-256 | ca145ff80166de3b9be795af89d728afc97ad4c1fbf9b08af362587659231483 |
Close
Hashes for iqrfpy_mqtt_transport-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 933a522ac64f216fcea50e84314a638509f127139ab8c0af5773cc463bcadeb7 |
|
MD5 | e9612e9d43cf637c388996ac4ab05688 |
|
BLAKE2b-256 | 6744dc70d00abf0f16662187958e72fc9193d4d63261b31a747b54609f49ef29 |