{ "info": { "author": "MicroPython Developers", "author_email": "micro-python@googlegroups.com", "bugtrack_url": null, "classifiers": [], "description": "umqtt.simple\n============\n\numqtt is a simple MQTT client for MicroPython. (Note that it uses some\nMicroPython shortcuts and doesn't work with CPython).\n\nDesign requirements\n-------------------\n\n* Memory efficiency.\n* Avoid infamous design anti-patterns like \"callback hell\".\n* Support for both publishing and subscription via a single client\n object (another alternative would be to have separate client classes\n for publishing and subscription).\n\nAPI design\n----------\n\nBased on the requirements above, there are following API traits:\n\n* All data related to MQTT messages is encoded as bytes. This includes\n both message content AND topic names (even though MQTT spec states\n that topic name is UTF-8 encoded). The reason for this is simple:\n what is received over network socket is binary data (bytes) and\n it would require extra step to convert that to a string, spending\n memory on that. Note that this applies only to topic names (because\n they can be both sent and received). Other parameters specified by\n MQTT as UTF-8 encoded (e.g. ClientID) are accepted as strings.\n* Subscribed messages are delivered via a callback. This is to avoid\n using a queue for subscribed messages, as otherwise they may be\n received at any time (including when client expects other type\n of server response, so there're 2 choices: either deliver them\n immediately via a callback or queue up until an \"expected\" response\n arrives). Note that lack of need for a queue is delusive: the\n runtime call stack forms an implicit queue in this case. And unlike\n explicit queue, it's much harder to control. This design was chosen\n because in a common case of processing subscribed messages it's\n the most efficient. However, if in subscription callback, new\n messages of QoS>0 are published, this may lead to deep, or\n infinite recursion (the latter means an application will terminate\n with ``RuntimeException``).\n\nAPI reference\n-------------\n\nTaking into account API traits described above, umqtt pretty closely\nfollows MQTT control operations, and maps them to class methods:\n\n* ``connect(...)`` - Connect to a server. Returns True if this connection\n uses persisten session stored on a server (this will be always False if\n clean_session=True argument is used (default)).\n* ``disconnect()`` - Disconnect from a server, release resources.\n* ``ping()`` - Ping server (response is processed automatically by wait_msg()).\n* ``publish()`` - Publish a message.\n* ``subscribe()`` - Subscribe to a topic.\n* ``set_callback()`` - Set callback for received subscription messages.\n* ``set_last_will()`` - Set MQTT \"last will\" message. Should be called\n *before* connect().\n* ``wait_msg()`` - Wait for a server message. A subscription message will be\n delivered to a callback set with set_callback(), any other messages\n will be processed internally.\n* ``check_msg()`` - Check if there's pending message from server. If yes,\n process the same way as wait_msg(), if not, return immediately.\n\n``wait_msg()`` and ``check_msg()`` are \"main loop iteration\" methods, blocking\nand non-blocking version. They should be called periodically in a loop,\n``wait_msg()`` if you don't have any other foreground tasks to perform\n(i.e. your app just reacts to subscribed MQTT messages), ``check_msg()``\nif you process other foreground tasks too.\n\nNote that you don't need to call ``wait_msg()``/``check_msg()`` if you only\npublish messages, never subscribe to them.\n\nFor more detailed information about API please see the source code\n(which is quite short and easy to review) and provided examples.\n\n\nSupported MQTT features\n-----------------------\n\nQoS 0 and 1 are supported for both publish and subscribe. QoS2 isn't\nsupported to keep code size small. Besides ClientID, only \"clean\nsession\" parameter is supported for connect as of now.\n\n\nMQTT client with automatic reconnect\n------------------------------------\n\nThere's a separate `umqtt.robust` module which builds on `umqtt.simple`\nand adds automatic reconnect support in case of network errors.\nPlease see its documentation for further details.", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/micropython/micropython-lib", "keywords": null, "license": "MIT", "maintainer": null, "maintainer_email": null, "name": "micropython-umqtt.simple", "package_url": "https://pypi.org/project/micropython-umqtt.simple/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/micropython-umqtt.simple/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/micropython/micropython-lib" }, "release_url": "https://pypi.org/project/micropython-umqtt.simple/1.3.4/", "requires_dist": null, "requires_python": null, "summary": "Lightweight MQTT client for MicroPython.", "version": "1.3.4" }, "last_serial": 4116185, "releases": { "1.1": [ { "comment_text": "", "digests": { "md5": "d6c5b751d74156582eaaf9837955909c", "sha256": "c08ab51934684b0ca798f0fffeff130190f4c969e326d2bde903a7444e375d90" }, "downloads": -1, "filename": "micropython-umqtt.simple-1.1.tar.gz", "has_sig": false, "md5_digest": "d6c5b751d74156582eaaf9837955909c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4447, "upload_time": "2016-08-15T14:03:14", "url": "https://files.pythonhosted.org/packages/28/8b/b1544e38cbec6243889b553e0fd81fc4c39663f53761348a3665c1941126/micropython-umqtt.simple-1.1.tar.gz" } ], "1.2.1": [ { "comment_text": "", "digests": { "md5": "c1baed2e560b803af7c088eda32cc446", "sha256": "38c818dc58dfb6886ea7d4c856792f818c0e0747d911bdad4d0de93135a93089" }, "downloads": -1, "filename": "micropython-umqtt.simple-1.2.1.tar.gz", "has_sig": false, "md5_digest": "c1baed2e560b803af7c088eda32cc446", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3989, "upload_time": "2016-10-11T23:17:45", "url": "https://files.pythonhosted.org/packages/8f/f7/c9fc249819a3491f61687843e2a7139cc084a8ace2efeff18d039a6c1926/micropython-umqtt.simple-1.2.1.tar.gz" } ], "1.3": [ { "comment_text": "", "digests": { "md5": "24268966547a14d92089a58982931fc2", "sha256": "7dcb40a9cc01329dc549cc1c207e256c4ef4c80394163f4643355ee24fd54327" }, "downloads": -1, "filename": "micropython-umqtt.simple-1.3.tar.gz", "has_sig": false, "md5_digest": "24268966547a14d92089a58982931fc2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4122, "upload_time": "2016-10-29T21:32:37", "url": "https://files.pythonhosted.org/packages/c5/1d/31c6791e807f7de6b8078ba35078864c292f33b8d13d6dfbfaf8e8fec712/micropython-umqtt.simple-1.3.tar.gz" } ], "1.3.3": [ { "comment_text": "", "digests": { "md5": "28ecd336f9ed698fc04a0d798c1a7e61", "sha256": "f453c5ea7bd40d144cbbad745f894dcecc2b59a92de00c33f92c94d8c8c6df8d" }, "downloads": -1, "filename": "micropython-umqtt.simple-1.3.3.tar.gz", "has_sig": false, "md5_digest": "28ecd336f9ed698fc04a0d798c1a7e61", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4022, "upload_time": "2017-04-27T14:53:32", "url": "https://files.pythonhosted.org/packages/20/2a/e216ef8c9861f3d5f68a7bafe87865987bfb3badbf64ddea1b1affde68cc/micropython-umqtt.simple-1.3.3.tar.gz" } ], "1.3.4": [ { "comment_text": "", "digests": { "md5": "0dedeacae5f127c698cd18ff3bbcff4e", "sha256": "b6a2520239e3992c63a7de9370ee9b3d9d27819a90359c521f1c0f7ccab8d12f" }, "downloads": -1, "filename": "micropython-umqtt.simple-1.3.4.tar.gz", "has_sig": false, "md5_digest": "0dedeacae5f127c698cd18ff3bbcff4e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4048, "upload_time": "2017-06-27T18:19:15", "url": "https://files.pythonhosted.org/packages/bd/cf/697e3418b2f44222b3e848078b1e33ee76aedca9b6c2430ca1b1aec1ce1d/micropython-umqtt.simple-1.3.4.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "0dedeacae5f127c698cd18ff3bbcff4e", "sha256": "b6a2520239e3992c63a7de9370ee9b3d9d27819a90359c521f1c0f7ccab8d12f" }, "downloads": -1, "filename": "micropython-umqtt.simple-1.3.4.tar.gz", "has_sig": false, "md5_digest": "0dedeacae5f127c698cd18ff3bbcff4e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4048, "upload_time": "2017-06-27T18:19:15", "url": "https://files.pythonhosted.org/packages/bd/cf/697e3418b2f44222b3e848078b1e33ee76aedca9b6c2430ca1b1aec1ce1d/micropython-umqtt.simple-1.3.4.tar.gz" } ] }