Skip to main content
Warning: You are using the test version of PyPI. This is a pre-production deployment of Warehouse. Changes made here affect the production instance of TestPyPI (testpypi.python.org).
Help us improve Python packaging - Donate today!

Custom iot:1 protocol

Project Description

#IOT:1

My custom protocol for communication between devices at home.
It uses UPD and broadcast.
Messages are json strings.

## Message body:

{
"protocol": "iot:1",
"node": "Rpi-lcd-1",
"chip_id": "RpiB",
"event": "lcd.content",
"parameters: [
"content": "-(=^.^)"
],
"response": '',
"targets": [
"nodemcu-lcd-40x4"
]
}

- protocol: defines name, currently iot:1
- node: friendly node name like light-room-big or screen-one-kitchen
- chip_id: a unique device id
- event: event name like light.on or dispay
- parameters: array of parameters. like rows to display
- response: used when responding to request, ie returning toilet state
- targets: message targets by nde name. special keyword ALL for all nodes in network

## functions

### Message(node, chip_id=None)

Create instance of class. Node is a node name, chip_id if blank will be generated

### prepare_message(data=None)

Returns empty message dictionary. If data is passed it copy values from it.

### decode_message(string)

Decode json string to dict message. Validates protocol and targets.
Return None on failure

Release History

This version
History Node

0.1.0

Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

File Name & Hash SHA256 Hash Help Version File Type Upload Date
iot_message-0.1.0-py2.py3-none-any.whl
(5.2 kB) Copy SHA256 Hash SHA256
3.4 Wheel Jan 15, 2017
iot_message-0.1.0.tar.gz
(2.9 kB) Copy SHA256 Hash SHA256
Source Jan 15, 2017

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting