pymeasure / leco-protocol

Design notes for a generic communication protocol to control experiments and measurement hardware
https://leco-laboratory-experiment-control-protocol.readthedocs.io
MIT License
6 stars 3 forks source link

Already existing "big" solutions/frameworks #2

Open bilderbuchi opened 1 year ago

bilderbuchi commented 1 year ago

From here

We should really check what protocols have already been defined. Protocol design is hard and finicky work, and it would pay to make use of the work of those who came before. I got the feeling that we can't be the first ones concerned with this problem space.

If there is something that

we should take a long hard look at reusing instead of coming up with our own stuff.

Specifically,

bilderbuchi commented 1 year ago

What's missing is a low entry point, many of those solutions, while powerful, are quite complicated to set up. Bluesky would be preferable to Sardana, but those synchrotron-focused projects are not that suitable for "quickly getting started" (with a small setup) or ramping up on if unfamiliar. Bluesky seems to focus on EPICS/Ophyd, possibly yaq is working on getting other things outside those environments to integrate.

It seems hard to get "just" the communication parts, without involving RunEngines (BlueSky), daemons (yaq), device servers (Tango), etc.

@bmoneke failed to install a working Tango installation. Tango needs C++ skills and SQL databases.

BenediktBurger commented 1 year ago

bluesky sends "message" objects and they are queued in the recipient. This seems a good idea to learn from.

bilderbuchi commented 1 year ago

There's an interesting paper "How to Design & Implement a Modern Communication Middleware Based on ZeroMQ" (https://doi.org/10.18429/JACoW-ICALEPCS2017-MOBPL05). I think it's definitely relevant to our design effort, and only a couple of pages. One decision in the paper that we probably will decide differently (because our trade-offs are different from CERN's) is to write a serialiser themselves instead of using something like Apache Avro.

BenediktBurger commented 1 year ago

Thanks for that source, it is really insightful.

BenediktBurger commented 1 year ago

A few ideas from that paper, which might be good for us or spark a discussion:

bilderbuchi commented 1 year ago

Yeah, this would ~ also have been my summary of the main points. Thank you for the excerpt!

BenediktBurger commented 1 year ago

Here is the COAP definition (an IoT protocol), which can serve as a language / definition reference and hints for protocol ideas: https://www.rfc-editor.org/rfc/rfc7252

wikipedia short article: https://en.wikipedia.org/wiki/Constrained_Application_Protocol

VigneshVSV commented 5 months ago

Following from my comment in https://github.com/pymeasure/pymeasure/discussions/676

Hi, experimental physics RPC called tango-controls developer here.

Late adder, but I already have most things sorted out in my package which is based on ZMQ, with HTTP support. Its a proper RPC, with possibility of REST like design. It already supports PUB-SUB, ZMQ's TCP, IPC & optionally HTTP.

Its pretty modern, pythonic and a good alternative for older packages coming from experimental physics world like EPICS and tango. I use a tested RPC pattern.

I am also adding support for Web of Things.

I wish to integrate with all devices you have defined here (in pymeasure). I also need some help to smoothen rough areas from people who are deep into this area and I am open to ideas.

Anybody interested?

Examples -

https://gitlab.com/hololinked-examples/oceanoptics-spectrometer

https://gitlab.com/hololinked-examples/serial-utility

VigneshVSV commented 5 months ago

My package's slowly upcoming doc is here : https://hololinked.readthedocs.io/en/latest/index.html

VigneshVSV commented 5 months ago

Just an update - If you guys are also doing RPC, I simply propose a merger.

BenediktBurger commented 5 months ago

Hey @VigneshVSV ,

thanks for telling about your project. It's sad to see, that another project does basically the same thing. I'm glad, that you found your way here to see, whether we could join our efforts.

Just an update - If you guys are also doing RPC, I simply propose a merger.

Yes, LECO offers RPC, we call it the "control protocol".

Don't get discouraged by the current state of the LECO protocol definitions. Most issues are sorted out, but due to personal challenges, the last details have not yet been reviewed and merged. The python implementation PyLECO is already in a stable state. In fact, we are using it in our lab for a year or more without on a daily base. It is also published on pypi (not yet on conda).

The core of LECO is the message transport among peers (called Components) in the network.

I simply propose a merger.

You're welcome to contribute to the protocol definitions (LECO), the python implementation (PyLECO), or add-ons.

Your web control sounds very interesting.

If you have questions, don't hesitate to ask.

VigneshVSV commented 5 months ago

I dont exactly see a double-effort as a negative thing because one still learns a lot and its better to own one's knowledge thoroughly with practice. I am open to changing stuff within my RPC/merging it, not a issue.

It would be best if we once discuss in terms of specifications of user features to see if a merger is possible because both are based on ZeroMQ. May be we can share a power point presentation to each other?

Can I write to your email ?

I heavily suggest this because the web of things paradigm has a lot of industrial players within it and no representatives from experimental physics side. Further, these industrial players themselves have a few different implementations, some commerical, some open source. Therefore its better to have some united approach from people like us. The web of things is becoming part of W3C and will likely be the future of IoT.

bilderbuchi commented 5 months ago

It would be best if we once discuss in terms of specifications of user features to see if a merger is possible because both are based on ZeroMQ. May be we can share a power point presentation to each other?

You can already study and compare what we have come up with on the specification side at the rendered documentation: https://leco-laboratory-experiment-control-protocol.readthedocs.io/en/latest/ :-)

VigneshVSV commented 5 months ago

For future reference - moved conversation to email.