Skip to main content

Proxy for reading bluesky hardware over ZMQ interface.

Project description

Bluesky Hardware Proxy

This is a proxy server to provide access to certain bluesky device methods over a zmq interface. The interface is based directly on the zmq interface of bluesky-queueserver, so an identical client (with a different address) can be used. For convenience, a version of zmq_single_request with the default address of tcp://localhost:60620 is provided as bluesky_hwproxy.comms.zmq_single_request.

Starting a server

start-hwproxy-server is an entry point provided to start up an instance of hwproxy. It accepts the same parameters for specifying the environment that contains device objects as start-re-manager from bluesky-queueserver.

for example:

$ start-hwproxy-server --startup-script ./startup.py
$ start-hwproxy-server --startup-module ophyd.sim
$ start-hwproxy-server --startup-dir ./startup/

Note that at present, --startup-profile is not connected, though will be in the near future.

Connecting via python

from bluesky_hwproxy.comms import zmq_single_request

devices = zmq_single_request("list")[0]["result"]

describe = zmq_single_request("describe", {"device":devices[-1]})[0]["result"]

Connecting via cli

We provide a hwproxy command line program to allow interfacing with the hwproxy server

Commands to interact with the server itself:

$ hwproxy list # List available hardware as string keys, one per line
motor1
motor2
det

$ hwproxy reload # reload available devices

The following print JSON response to the terminal:

$ hwproxy read <device>
$ hwproxy describe <device>
$ hwproxy config read <device>
$ hwproxy config describe <device>
$ hwproxy hints <device>

Output is colorized when run from an interactive shell, plain text when e.g. piped.

Finally, we allow checking if a set position is valid:

$ hwproxy check <device> <value>
true

The result is simply true or false printed to the terminal.

<value> can be any json encoded string (most of the time it is a simple float, however pseudopositioners and specialized hardware may use lists, etfc.

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

bluesky-hwproxy-2022.2.0.tar.gz (6.2 kB view details)

Uploaded Source

Built Distribution

bluesky_hwproxy-2022.2.0-py3-none-any.whl (7.6 kB view details)

Uploaded Python 3

File details

Details for the file bluesky-hwproxy-2022.2.0.tar.gz.

File metadata

  • Download URL: bluesky-hwproxy-2022.2.0.tar.gz
  • Upload date:
  • Size: 6.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.26.0

File hashes

Hashes for bluesky-hwproxy-2022.2.0.tar.gz
Algorithm Hash digest
SHA256 fe3334e8b7afde543c9d3b22d2a32fa6fb250d4ff8927912e62c26eb971a8eb6
MD5 5ac8ada2aa6c9e47692ce042f1c006c3
BLAKE2b-256 cb4c9d833846bb23851f872fa33971026c78d4cb8f03c62a005465ccb11852ae

See more details on using hashes here.

File details

Details for the file bluesky_hwproxy-2022.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for bluesky_hwproxy-2022.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 84567e64958a5706913f48d41b29fff83273c8bf9c9bda92da661da44c475cf5
MD5 14116bcd4ba29ab5d9adb24369c7c783
BLAKE2b-256 6c604e732d1b7dc436539e81fc18f07e7541bfe0326afd6366b58009dcf8f94b

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