Skip to main content

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:

[https://koscis.wordpress.com/2017/03/03/raspberry-pi-as-a-node/](https://koscis.wordpress.com/2017/03/03/raspberry-pi-as-a-node/)

[https://koscis.wordpress.com/2019/08/31/upgrades-to-message_listener/](https://koscis.wordpress.com/2019/08/31/upgrades-to-message_listener/)

Release files for message-listener 1.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for message-listener 1.1.0
File Size Uploaded
message_listener-1.1.0.tar.gz 3.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for message-listener 1.1.0
File Interpreter ABI Platform
message_listener-1.1.0-py3-none-any.whl Python 3 none any Details

Total release size:8.8 kB

Release files / message_listener-1.1.0.tar.gz

Download URL message_listener-1.1.0.tar.gz
Size 3.8 kB
Tags Source
SHA-256 checksum
How to use checksums
ca4fbdae9b5d92d6915d617892fb3a9daddb381f4c02860d96b8ef6b815c4790
BLAKE2b-256 checksum
How to use checksums
2266551ed3ad6248bc9a772e7f19ef010fbba092e1c0e60400d3841e6b5d60b8
Upload date
Uploaded using Trusted Publishing?
What is 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

Release files / message_listener-1.1.0-py3-none-any.whl

Download URL message_listener-1.1.0-py3-none-any.whl
Size 5.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b8a723a5c59b45954b8d9ada738f55748cc5262dc17dd2cf52e6a52003784d1b
BLAKE2b-256 checksum
How to use checksums
b281db45b86e3bbb8590c30e370475225a508065901ca3d7e363b0d5b905fedd
Upload date
Uploaded using Trusted Publishing?
What is 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

Release history Release notifications | RSS feed

This release

1.1.0 This release

2 release files

1.0.1

2 release files

1.0.0

2 release files

0.1.2

2 release files

0.1.1

1 release file

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page