Server listener and iot_message handler
Project description
App used at Raspberry Pi as receiver of incoming messages and pass them to registered handlers (relay, screen, sensors)
from message_listener.server import Server
from iot_message.message import Message
from message_listener.handler_debug import HandlerDebug
from iot_message.cryptor.base64 import Cryptor as B64
Message.node_name = "PC"
Message.add_decoder(B64())
#Message.drop_unencrypted = True
svr = Server()
# svr.ignore_missing_decoders = False
svr.add_handler('NodeOne', HandlerDebug({}))
svr.start()
Add more than one handler:
svr = Server()
svr.add_handler('NodeOne', HandlerDebug({}))
svr.add_handler('NodeOne', HandlerDebug({}))
svr.start()
or
svr = Server()
svr.add_handler('NodeOne', [
HandlerDebug({}),
HandlerDebug({})
])
svr.start()
Add workers:
Handler1(Worker1(), Worker2())
Initialization:
__init__(self, port=5053, ip_address='0.0.0.0', buffer_size=65535)
Read more:
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file message_listener-1.1.0.tar.gz
.
File metadata
- Download URL: message_listener-1.1.0.tar.gz
- Upload date:
- Size: 3.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.35.0 CPython/3.7.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ca4fbdae9b5d92d6915d617892fb3a9daddb381f4c02860d96b8ef6b815c4790 |
|
MD5 | 05cea54643ef7e22fdbedffd6764c443 |
|
BLAKE2b-256 | 2266551ed3ad6248bc9a772e7f19ef010fbba092e1c0e60400d3841e6b5d60b8 |
File details
Details for the file message_listener-1.1.0-py3-none-any.whl
.
File metadata
- Download URL: message_listener-1.1.0-py3-none-any.whl
- Upload date:
- Size: 5.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.35.0 CPython/3.7.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b8a723a5c59b45954b8d9ada738f55748cc5262dc17dd2cf52e6a52003784d1b |
|
MD5 | e4249aa9fddde5ad84771a45001d5dff |
|
BLAKE2b-256 | b281db45b86e3bbb8590c30e370475225a508065901ca3d7e363b0d5b905fedd |