IoT Relay - Relay data between data sources and destinations.

## IoT Relay: Giving Voice to Your Things

Release v1.2.3

In greater and greater numbers, “things” are capable of gathering data about their environment. These things have an interface to retrieve the measurements being taken but contain no way of pushing this data to the Internet. For example, home weather stations often contain only a USB interface and no network capability. Other devices may have network capability, such as ZigBee®, but still don’t have a direct way to send data to Internet connected hosts.

Internet of Things Relay is an application and framework for gathering data from sources and relaying it to destinations. It is somewhat like publish/subscribe except that it’s geared more toward devices that are unable to initiate a connection (they must be polled to get at their data).

IoT Relay provides basic setup and matches data sources with interested handlers. The rest of the work is left to plugins.

### Installation

IoT Relay is available via PyPI.

#### Data Handler Sample Plugin

Like the previous example, create a new directory with two files:

# iotrelay_sample_handler.py

class Handler(object):
def __init__(self, config):
self.config = config

# setup.py

from setuptools import setup

setup(name='iotrelay-sample-handler',
install_requires=['iotrelay'],
py_modules=['iotrelay_sample_handler'],
entry_points={
'iotrelay': ['handler=iotrelay_sample_handler:Handler']
}
)

Install the handler plugin by typing:

$python setup.py install #### Plugin Configuration The minimal source plugin used in this example does not require any configuration. The ‘reading types’ option in a handler’s configuration specifies which reading types a handler will receive. In order to receive readings from the ‘iotrelay-sample-source’ plugin, the ‘reading type’ option in the iotrelay-sample-handler would be ‘sample’. This corresponds to the reading_type attribute set by the Reading constructor when get_readings() was called. The section names correspond directly to the plugin names, as defined in setup.py. ; ~/.iotrelay.cfg [iotrelay] [iotrelay-sample-source] [iotrelay-sample-handler] reading types = <s>sample</s> Any options specified in each plugins section will be passed to that plugin’s constructor during initialization. ### Running IoT Relay Start IoT Relay with the following command:$ iotrelay

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

• Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

• Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

## Project details

### Source Distribution

iotrelay-1.2.3.tar.gz (6.6 kB view hashes)