Skip to main content

ALBA Python Serial with tango DeviceServer

Project description

ALBA Python Serial DeviceServer

ALBA Python Serial DeviceServer

ALBA Python Serial DeviceServer updates

ALBA Python Serial with tango DeviceServer

Apart from the core library, an optional tango device server is also provided.

Installation

From within your favorite python environment type:

$ pip install tango_serial

Library

The core of the tango_serial library consists of Serial object. To create a Serial object you need to pass a communication object.

The communication object can be any object that supports a simple API consisting of two methods (either the sync or async version is supported):

  • write_readline(buff: bytes) -> bytes or

    async write_readline(buff: bytes) -> bytes

  • write(buff: bytes) -> None or

    async write(buff: bytes) -> None

A library that supports this API is sockio (ALBA Python Serial DeviceServer comes pre-installed so you don't have to worry about installing it).

This library includes both async and sync versions of the TCP object. It also supports a set of features like re-connection and timeout handling.

Here is how to connect to a Serial controller:

import asyncio

from sockio.aio import TCP
from tango_serial import Serial


async def main():
    tcp = TCP("192.168.1.123", 5000)  # use host name or IP
    tango_serial_dev = Serial(tcp)

    idn = await tango_serial_dev.idn()
    print("Connected to {} ({})".format(idn))


asyncio.run(main())

Tango server

A tango device server is also provided.

Make sure everything is installed with:

$ pip install tango_serial[tango]

Register a Serial tango server in the tango database:

$ tangoctl server add -s Serial/test -d Serial test/tango_serial/1
$ tangoctl device property write -d test/tango_serial/1 -p address -v "tcp://192.168.123:5000"

(the above example uses tangoctl. You would need to install it with pip install tangoctl before using it. You are free to use any other tango tool like fandango or Jive)

Launch the server with:

$ Serial test

Credits

Development Lead

Contributors

None yet. Why not be the first?

History

0.1.0 (2020-12-15)

  • First release on PyPI.

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

py_ds_serial-0.1.0.tar.gz (9.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

py_ds_serial-0.1.0-py2.py3-none-any.whl (3.8 kB view details)

Uploaded Python 2Python 3

File details

Details for the file py_ds_serial-0.1.0.tar.gz.

File metadata

  • Download URL: py_ds_serial-0.1.0.tar.gz
  • Upload date:
  • Size: 9.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/51.0.0.post20201207 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.7.9

File hashes

Hashes for py_ds_serial-0.1.0.tar.gz
Algorithm Hash digest
SHA256 34da6b8987a605a33e1017fd14737b651ae6a9b0adfb8b6f85419ee3005ad726
MD5 2193e7e80698eaeb91bbc396d8673c89
BLAKE2b-256 ac0613d7ab34f287a33077eff3db01086c72b070ec2282cbc95fcf7c905a44d3

See more details on using hashes here.

File details

Details for the file py_ds_serial-0.1.0-py2.py3-none-any.whl.

File metadata

  • Download URL: py_ds_serial-0.1.0-py2.py3-none-any.whl
  • Upload date:
  • Size: 3.8 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/51.0.0.post20201207 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.7.9

File hashes

Hashes for py_ds_serial-0.1.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 4bb4ab485d65b526096e68dec4e5c966ce4256e384f539337ee4ff775e518038
MD5 bf58051b1db1d239708657710fe9ebbc
BLAKE2b-256 5ad68c89d469d7c534a96fe0f967b560aa09a4bd3bcbe83f9306108feab595d9

See more details on using hashes here.

Supported by

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