iblrig.net

Network communication between rigs.

An example of a remote_rigs.yaml file:

`yaml neuropixel: '12.134.270.1' 'cameras:left': 'tcp://0.123.456.7:9998' 'cameras:right': 'tcp://0.123.456.6:9998' tasks: 'udp://123.654.8.8' `

Examples

Send a standard message (e.g. start) to all rigs and await their responses:

>>> responses = await services.start(exp_ref)

Send a standard message to all rigs without awaiting responses:

>>> for service in services.values():
...     await service.init()

Send exp info message to all rigs and await their responses:

>>> responses = await self.services._signal(ExpMessage.EXPINFO, 'confirmed_send', [ExpMessage.EXPINFO, ...])

Send exp info message to all rigs without awaiting responses:

>>> for service in services.values():
...     await service.confirmed_send([ExpMessage.EXPINFO, ...])

Request status from a single service (await echo):

>>> await services['cameras'].confirmed_send([ExpMessage.EXPSTATUS])

Send message to a single service without awaiting echo: NB: use with causion: can cause infinite loops if both not correctly configured

>>> services['cameras'].send([ExpMessage.EXPSTATUS])

Functions

check_uri_match

Log warning if URI in remote devices is wrong.

get_remote_devices

Return map of device name to network URI.

get_remote_devices_file

Return the location of the remote devices YAML file.

get_server_communicator

install_alyx_token

Save Alyx token sent from remote device.

read_stdin

Asynchronously reads lines from standard input.

update_alyx_token

Callback to update instance with Alyx token.

Classes

Auxiliaries

ExpInfo

A standard experiment information structure.