{ "info": { "author": "Ivo Slanina", "author_email": "ivo.slanina@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Environment :: Console", "Environment :: No Input/Output (Daemon)", "Intended Audience :: Customer Service", "Intended Audience :: Information Technology", "Intended Audience :: Other Audience", "Intended Audience :: Telecommunications Industry", "License :: OSI Approved :: GNU Lesser General Public License v3 (LGPLv3)", "Natural Language :: English", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.0", "Programming Language :: Python :: 3.1", "Programming Language :: Python :: 3.2", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3 :: Only", "Topic :: Communications", "Topic :: Home Automation", "Topic :: Internet" ], "description": "# mqspeak - MQTT bridge\n\nmqspeak is [MQTT](http://mqtt.org/) client which collect data and transforms\nthem into [ThingSpeak](https://thingspeak.com/) channel updates or [Phant](http://phant.io/)\ndata streams. It is able to handle multiple MQTT connections and independetly update\nmultiple channels.\n\nThis is part of my IoT project. You can\nread more about it on my [blog](http://buben19.blogspot.com/).\n\n## Install\n\nApplication can be installed with following command:\n\n $ sudo pip3 install mqspeak\n\n## Configuration\n\nmqspeak is configured using configuration file specified with `-c` or `--config`\noption (default `/etc/mqspeak.conf`). This is sample configuration file:\n\n [Brokers]\n Enabled = temperature-broker humidity-broker door-broker\n\n [temperature-broker]\n Host = temperatureBrokerHostname\n Port = 1883\n User = brokerUser\n Password = brokerPass\n Topic = sensors/temperature sensors/something\n\n [humidity-broker]\n Host = humidityBrokerHostname\n Port = 1883\n User = brokerUser\n Password = brokerPass\n Topic = sensors/humidity\n\n [door-broker]\n Host = doorBrokerHostname\n Port = 1883\n User = brokerUser\n Password = brokerPass\n Topic = #\n\n [Channels]\n Enabled = channel1 channel2 channel3 channel4\n\n [channel1]\n Id = CHANNELID\n Key = CHANNELKEY\n Type = thingspeak\n UpdateRate = 15\n UpdateType = blackout\n UpdateFields = dht-update\n\n [channel2]\n Id = CHANNELID\n Key = CHANNELKEY\n Type = thingspeak\n UpdateRate = 15\n UpdateType = buffered\n UpdateFields = dht-update\n\n [channel3]\n Id = CHANNELID\n Key = CHANNELKEY\n Type = thingspeak\n UpdateRate = 15\n UpdateType = average\n UpdateFields = dht-update\n\n [channel4]\n Id = CHANNELID\n Key = CHANNELKEY\n Type = phant\n UpdateRate = 15\n UpdateType = onchange\n UpdateFields = door-update\n\n [dht-update]\n field1 = humidity-broker sensors/humidity\n field2 = temperature-broker sensors/temperature\n\n [door-update]\n state = door-broker sensors/door\n\nConfiguration file has two mandatory sections: `[Brokers]` and `[Channels]`, each with\none `Enabled` option. These options contains space separated broker and channel\nsection names.\n\n### Broker section\n\nBroker section has to define one mandatory `[Topic]` option, which is space separated\nlist of MQTT topic subscriptions. Full list of possible options in broker section:\n\n - `Host` - Broker IP address or hostname (default 127.0.0.1).\n - `Port` - Broker port (default 1883).\n - `User` - Username.\n - `Password` - Password.\n - `Topic` - Space separated list of topic subscriptions. Mandatory option.\n\n### Channel section\n\nEach channel section has to define `Key`, `UpdateRate` and `UpdateType` options.\n\n - `Id` - Channel ID. This field is mandatory for Phant channels.\n - `Key` - Channel API write key. Mandatory option.\n - `Type` - Specify channel type. Mandatory option. Following types are supported:\n - `thingspeak` - [ThinkSpeak](https://thingspeak.com/) channel.\n - `phant` - [Phant](http://phant.io/) channel.\n - `UpdateRate` - Channel update interval in seconds. Currently, ThinkSpeak allows\n interval 15 seconds or greater. Mandatory option.\n - `WaitInterval` - Maximum interval to wait for remaining data to arrive. When set to\n zero, wait forever (default). See **Update waiting** for more details.\n - `UpdateType` - Channel update type. Possible values are `blackout`, `buffered`,\n `average` and `onchange`. Mandatory option.\n - `blackout` - Until `UpdateRate` interval is expired, any incoming data are\n ignored. First data received after interval expiration are sent to ThingSpeak.\n - `buffered` - Incoming data are buffered during `UpdateRate` interval. After\n this interval expires, most recent values are immediately sent.\n - `average` - Similar to `buffered` but mqspeak calculates average value of these\n data. Any data which cannot be converted into real numbers are ignored. Channel\n is immediately updated after `UpdateRate` interval is expired.\n - `onchange` - Data are marked with timestamp and stored in queue. Each item is\n sent after `UpdateRate` interval expires. **_Not implemented yet._**\n - `UpdateFields` - Specify section which defines updates for this channel. Mandatory option.\n\n#### Update waiting\n\nWhen channel update consists of data from multiple sensors, it may happen that one\nsensor die. By default channel never will be updated until data from all sensors arrives.\nInactive sensor causes channel update will be stalled.\n\nWhen update waiting enabled, mqspeak will wait defined amount of seconds and then sends\nout even incomplete channel update.\n\nWaiting scenario can be divided into following cases:\n\n - **`UpdateRate` condition is met but there are no data.** Wait mechanism is not activated\n until some data arrives. After it received first part of channel update, mqspeak will wait\n defined time and tries collect remaining data. After `WaitInterval` expires,\n data will be send.\n - **Partial data arrives before `UpdateRate` condition is met.** Waiting is delayed\n until `UpdateRate` condition is met. After it expires and there are still not\n all required data, waiting is triggered. After `WaitInterval` expires, data\n will be send.\n - **All required data are collected before `UpdateRate` condition is met.** There is no\n need to activate update waiting. Simply send data.\n\n### UpdateFields section\n\nUpdateFields section consists of any number of options. Each option key specifies\nfield name. Its value must be space separated name of broker section and topic.\n\nFor ThinkSpeak channel, only option keys `Field1` ... `Field8` are valid.\n\n## Questions\n\n - **mqspeak runs in foreground only.** - Yes, there is no double fork combo to run\n mqspeak in background. I use systemd init and I prefer to run all services as simple\n systemd units, which runs in foreground. Sorry about that.\n - **It uses python3. Is python 2.x supported?** - No, I don't plan to support python 2.x.", "description_content_type": null, "docs_url": null, "download_url": null, "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://mqopen.org/", "keywords": "iot internetofthings mqopen mqtt sensors thingspeak phant", "license": "GPLv3", "maintainer": null, "maintainer_email": null, "name": "mqspeak", "package_url": "https://pypi.org/project/mqspeak/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/mqspeak/", "project_urls": { "Homepage": "http://mqopen.org/" }, "release_url": "https://pypi.org/project/mqspeak/0.2.1/", "requires_dist": null, "requires_python": null, "summary": "MQTT bridge", "version": "0.2.1" }, "last_serial": 2212745, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "f698507391239dd06035e514a21a4a56", "sha256": "4ff8b916fcf67960746d1af971381e9bc49fa71d8eef70e6c6ea2c661b913345" }, "downloads": -1, "filename": "mqspeak-0.1.0.tar.gz", "has_sig": false, "md5_digest": "f698507391239dd06035e514a21a4a56", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14002, "upload_time": "2016-03-09T12:54:33", "url": "https://files.pythonhosted.org/packages/8a/49/f7a5018d44a1284ddefa8edf06b47cdff67bedf1a892bf37ad2bb26404ab/mqspeak-0.1.0.tar.gz" }, { "comment_text": "", "digests": { "md5": "04ca4d11025686e996a8e29dff654100", "sha256": "0cd98aa922ce998ab958e5460252db9f626fef5dcf7bf6990d6467db0ef1a30f" }, "downloads": -1, "filename": "mqspeak-0.2.0.tar.gz", "has_sig": false, "md5_digest": "04ca4d11025686e996a8e29dff654100", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15695, "upload_time": "2016-07-10T11:04:14", "url": "https://files.pythonhosted.org/packages/ba/0f/d5e9b768e93a192bd432c2174b732a6c37b6dc5496db0b42bf8e5dfceb16/mqspeak-0.2.0.tar.gz" } ], "0.2.0": [], "0.2.1": [ { "comment_text": "", "digests": { "md5": "f8669c6278b85e403ef5bb17108c8277", "sha256": "1f850f2d5e1f1ad2fbe5291bfdf236d9945508cc5a914bac9bd38777fbd5a7b4" }, "downloads": -1, "filename": "mqspeak-0.2.1.tar.gz", "has_sig": false, "md5_digest": "f8669c6278b85e403ef5bb17108c8277", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 16546, "upload_time": "2016-07-10T12:45:56", "url": "https://files.pythonhosted.org/packages/31/1b/2d62d0a47d7706a577901890d080bb2c76a0f845adaa61938ccc9d7640c7/mqspeak-0.2.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "f8669c6278b85e403ef5bb17108c8277", "sha256": "1f850f2d5e1f1ad2fbe5291bfdf236d9945508cc5a914bac9bd38777fbd5a7b4" }, "downloads": -1, "filename": "mqspeak-0.2.1.tar.gz", "has_sig": false, "md5_digest": "f8669c6278b85e403ef5bb17108c8277", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 16546, "upload_time": "2016-07-10T12:45:56", "url": "https://files.pythonhosted.org/packages/31/1b/2d62d0a47d7706a577901890d080bb2c76a0f845adaa61938ccc9d7640c7/mqspeak-0.2.1.tar.gz" } ] }