Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/edigiacomo/asgi-mqtt
Interface between MQTT and ASGI
https://github.com/edigiacomo/asgi-mqtt
django django-channels mqtt paho-mqtt python
Last synced: 22 days ago
JSON representation
Interface between MQTT and ASGI
- Host: GitHub
- URL: https://github.com/edigiacomo/asgi-mqtt
- Owner: edigiacomo
- License: gpl-2.0
- Created: 2016-07-26T10:12:00.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-11-11T14:42:10.000Z (almost 7 years ago)
- Last Synced: 2024-09-14T12:39:40.141Z (about 2 months ago)
- Topics: django, django-channels, mqtt, paho-mqtt, python
- Language: Python
- Size: 21.5 KB
- Stars: 37
- Watchers: 11
- Forks: 14
- Open Issues: 2
-
Metadata Files:
- Readme: README.rst
- License: LICENSE.md
Awesome Lists containing this project
README
asgimqtt
========``asgimqtt`` is a simple `MQTT `_ interface for `ASGI
`_.Installation
------------Install with ``pip``::
pip install asgimqtt
Usage
-----Connect the server to a running `MQTT` broker::
asgimqtt --host localhost --port 1883 django_project.asgi:channel_layer
In your Django code::
# routing.py
channels_routing = [
route("mqtt.sub", mqtt_consumer),
]**Note**: you can only receive messages published in ``MQTT`` broker (channel
``mqtt.sub``).The keys are:
* ``host``: host of the ``MQTT`` broker
* ``port``: port of the ``MQTT`` broker
* ``topic``: topic of the ``MQTT`` message
* ``payload``: payload of the ``MQTT`` message
* ``qos``: quality of service of the ``MQTT`` message (0, 1 or 2)