Skip to main content

PySoMQ: Python bindings for serial over ØMQ

This package utilizes the Python bindings of ØMQ in order to provide a lightweight and fast serial bidirectional PySerial communication interface.

Getting started

Install the package from Pypi

pip install pysomq

Run as permanent streaming service

If you want to run the SerialServer as a permanent streamer, please start the module with our specific parameters by

python -m pysomq --serial-port=YourSerialPort --serial-baudrate=YourBaudrate --timeout=1 --streaming-socket=tcp://*:5555 --listening-socket=tcp://*:5556

Stream from script

If you want to utilize the SerialServer within your own scripts, start streaming by using the following snippet with our parameters

import pysomq


serial_port = '/dev/ttyS0'
baudrate = 9600
stream_socket = 'tcp://*:5555'
listen_socket = 'tcp://*:5556'
timeout = 1
serial_server = pysomq.SerialServer(port='/dev/ttyS0', baudrate=baudrate,
                                    streaming_socket=stream_socket, listening_socket=listen_socket,
                                    timeout=timeout)
serial_server.start()

Receive streaming data

If you want to utilize the SerialServer within your own scripts, start receiving by using the following snippet with our parameters

import pysomq


stream_socket = 'tcp://localhost:5555'
listen_socket = 'tcp://localhost:5556'
timeout = 1

serial_client = pysomq.SerialClient(streaming_socket=stream_socket, listening_socket=listen_socket,
                                    timeout=timeout)
serial_client.write(b'my first line')
answer = serial_client.readline()

Default values

The default values for calling the module or instantiating the classes are

  • --serial-port / port: /dev/ttyS0 for Linux and COM1 for Windows

  • --serial-baudrate / baudrate: 9600

  • --timeout / timeout: 1 second

  • --streaming-socket / streaming_socket: tcp://*:5555 respectively tcp://localhost:5555

  • --listening-socket / listening_socket: tcp://*:5556 respectively tcp://localhost:5556

Contributing

I welcome any contributions, enhancements, and bug-fixes. Open an issue on GitHub and submit a pull request.

License

pySoMQ is 100% free and open-source, under the MIT license. Use it however you want.

This package is Treeware. If you use it in production, then we ask that you buy the world a tree to thank us for our work. By contributing to the Treeware forest you’ll be creating employment for local families and restoring wildlife habitats.

Release files for pysomq 0.13

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

Source distribution (sdist)

Source distribution for pysomq 0.13
File Size Uploaded
pysomq-0.13.tar.gz 14.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pysomq 0.13
File Interpreter ABI Platform
pysomq-0.13-py3-none-any.whl Python 3 none any Details

Total release size: 21.9 kB

Release files / pysomq-0.13.tar.gz

Download URL pysomq-0.13.tar.gz
Size 14.1 kB
Tags Source
SHA-256 checksum
How to use checksums
ee6409dce861a1e4c8de46d047c6e4425e582b876abdf3fdf34cf0bbf625164f
BLAKE2b-256 checksum
How to use checksums
64ffd00d38c299d08d8d09c5b3b5550e678e527678c651844d5bd8dc77375b20
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.8.0 pkginfo/1.8.2 readme-renderer/33.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.63.0 importlib-metadata/4.11.2 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10

Release files / pysomq-0.13-py3-none-any.whl

Download URL pysomq-0.13-py3-none-any.whl
Size 7.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4634f493949ee6ae8b7a0c589602bdb6d458c3ea392420dc5aee978ea2b7b7ce
BLAKE2b-256 checksum
How to use checksums
5fa48ff7dd49d1c3d68dd22316ceab6e0b9ed69a05951b040d0ad692ff0b3cb3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.8.0 pkginfo/1.8.2 readme-renderer/33.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.63.0 importlib-metadata/4.11.2 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10

Release history Release notifications | RSS feed

This release

0.13 This release

2 release files

0.12

2 release files

0.11

2 release files

0.1.0

3 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