Skip to main content

Provide a bidirectional connection to a serial interface via zeroMQ

Project description

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.

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

pysomq-0.13.tar.gz (14.1 kB view details)

Uploaded Source

Built Distribution

pysomq-0.13-py3-none-any.whl (7.7 kB view details)

Uploaded Python 3

File details

Details for the file pysomq-0.13.tar.gz.

File metadata

  • Download URL: pysomq-0.13.tar.gz
  • Upload date:
  • Size: 14.1 kB
  • Tags: Source
  • Uploaded using 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

File hashes

Hashes for pysomq-0.13.tar.gz
Algorithm Hash digest
SHA256 ee6409dce861a1e4c8de46d047c6e4425e582b876abdf3fdf34cf0bbf625164f
MD5 5ae9b5a64c665854e45956f1bc8540ba
BLAKE2b-256 64ffd00d38c299d08d8d09c5b3b5550e678e527678c651844d5bd8dc77375b20

See more details on using hashes here.

File details

Details for the file pysomq-0.13-py3-none-any.whl.

File metadata

  • Download URL: pysomq-0.13-py3-none-any.whl
  • Upload date:
  • Size: 7.7 kB
  • Tags: Python 3
  • Uploaded using 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

File hashes

Hashes for pysomq-0.13-py3-none-any.whl
Algorithm Hash digest
SHA256 4634f493949ee6ae8b7a0c589602bdb6d458c3ea392420dc5aee978ea2b7b7ce
MD5 f7c08585af809d28051333df5a5ceeee
BLAKE2b-256 5fa48ff7dd49d1c3d68dd22316ceab6e0b9ed69a05951b040d0ad692ff0b3cb3

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page