[solved] Using devices connected on different servers

on a client, I would like to use devices connected on our TANGO_HOST, but I would need also to use a device installed on another server.
Our current issue is to get a status and send a command, but I propose to discuss in this topic about how we could deal with general case.

For the network configuration, I can create the rules to allow traffic between the client and the device, but I would prefer to understand how it is possible to do this in TANGO.

I imagine for a GUI, it is possible to make a dedicated GUI launched prefixed by a TANGO_HOST definition like this:

However, it would forbid to mix the foreign device with local devices in our GUI, which is annoying.

Since there is a Tango2epics gateway, this could be a solution but reading the doc, it seems it works through a unique device, connected to its own TANGO_HOST so I understand this would not be a solution.

Another walktrough I imagine would be to use REST API (as defined in https://tango-controls.readthedocs.io/en/latest/development/advanced/rest-api.html).

At last, a homemade solution would be to connect directly to the device through network, and talk to the DS port to get attribute or set attribute as needed.
I do not know if this solution already exists.

Did you already encounter this need?
Do you have any idea about how we could elegantly deal with this use using TANGO architecture at its best?

- Philippe
Edited 1 week ago
Hi Philippe,

A Tango client can easily talk to devices running in other Tango Hosts using the Tango Resource Locator concept (See https://tango-controls.readthedocs.io/projects/rfc/en/latest/16/TangoResourceLocator.html#tango-resource-locator-trl-specification).

So a Tango client can already easily talk to a client running in another TANGO_HOST by using a string like 'tango://host:port/' in front of the device name. You can create a DeviceProxy using such a long name and Tango will do what is required to contact this device running in another TANGO_HOST.

Here is an example of such device name: 'tango://db.example.com:10000/lab/powersupply/01'

For the network setup, if you are on separate and restricted network, you will have to create the rules to allow traffic between the client and the server and you will have to give access for the client to the ports of the device server.
Please note you can configure the port used by omniORB by starting the device server with the ORBendPoint omniORB option and since cppTango 9.3.5, you can configure the ports used by the ZMQ events using TANGO_ZMQ_EVENT_PORT and TANGO_ZMQ_HEARTBEAT_PORT environment variables.

Hoping this helps a bit.
Rosenberg's Law: Software is easy to make, except when you want it to do something new.
Corollary: The only software that's worth making is software that does something new.
Hello Reynald,
this helps a lot, thank you !
- Philippe
Register or login to create to post a reply.