Metadata-Version: 2.0
Name: asgimqtt
Version: 0.2.0
Summary: Interface between MQTT broker and ASGI
Home-page: https://github.com/edigiacomo/asgi-mqtt
Author: Emanuele Di Giacomo
Author-email: emanuele@digiacomo.cc
License: GPLv2+
Platform: UNKNOWN
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Web Environment
Classifier: License :: OSI Approved :: GNU General Public License v2 or later (GPLv2+)
Classifier: Framework :: Django
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 2
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.4
Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: 3.6
Classifier: Topic :: Internet :: WWW/HTTP
Requires-Dist: paho-mqtt

asgimqtt
========

``asgimqtt`` is a simple `MQTT <http://mqtt.org/>`_ interface for `ASGI
<http://channels.readthedocs.org/en/latest/asgi.html>`_.


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)


