@@ -112,7 +112,7 @@ Start by copying the initial example:
112112
113113 Connect your embedded board (raspberry pi, riotboard, …) to your computer and
114114adjust the ``port `` parameter of the ``RawSerialPort `` resource and ``username ``
115- and ``password `` of the ShellDriver driver in ``local.yaml ``:
115+ and ``password `` of the ShellDriver driver in the environment file ``local.yaml ``:
116116
117117.. code-block :: yaml
118118
@@ -130,6 +130,14 @@ and ``password`` of the ShellDriver driver in ``local.yaml``:
130130 login_prompt : ' login: '
131131 username : ' root'
132132
133+ For, now it is sufficient to know that labgrid tries to "bind" appropriate drivers
134+ and resources to each other automatically if possible. The ``ShellDriver `` will use
135+ the ``SerialDriver `` to connect to the ``RawSerialPort `` resource. If an automatic
136+ binding is not possible due to ambiguity, the bindings can also be specified
137+ explicitly.
138+
139+ More information about this and the environment configuration file in general can
140+ be found :ref: `here <environment-configuration >`.
133141
134142You can check which device name gets assigned to your USB-Serial converter by
135143unplugging the converter, running ``dmesg -w `` and plugging it back in. Boot up
@@ -179,11 +187,15 @@ We can simply start the coordinator:
179187 Exporter
180188~~~~~~~~
181189
190+ The exporter is responsible for exporting resources to the client. It is noted
191+ that drivers are not handled by the exporter. In the distributed case, drivers
192+ are managed by the client.
193+
182194The exporter needs a configuration file written in YAML syntax, listing
183195the resources to be exported from the local machine.
184196The config file contains one or more named resource groups.
185197Each group contains one or more resource declarations and optionally a location
186- string (see the :doc: ` configuration reference < configuration >` for details) .
198+ string.
187199
188200For example, to export a ``USBSerialPort `` with ``ID_SERIAL_SHORT `` of
189201``ID23421JLK ``, the group name `example-group ` and the location
@@ -233,6 +245,9 @@ Additional groups and resources can be added:
233245 match :
234246 ID_SERIAL_SHORT : KSLAH2341J
235247
248+ More information about the exporter configuration file can be found
249+ :ref: `here <exporter-configuration >`.
250+
236251Restart the exporter to activate the new configuration.
237252
238253.. Attention ::
@@ -277,7 +292,7 @@ To show more details on the exported resources, use ``-v`` (or ``-vv``):
277292 ' params' : {' host' : ' netio1' , ' index' : 3, ' model' : ' netio' }}
278293 ...
279294
280- You can now add a place with:
295+ You can now add a place to the coordinator with:
281296
282297.. code-block :: bash
283298
@@ -309,6 +324,42 @@ See :ref:`remote-usage` for some more advanced features.
309324For a complete reference have a look at the :doc: `labgrid-client(1) <man/client >`
310325man page.
311326
327+ Now, to connect drivers to the resources, you can configure an environment file,
328+ which we call ``remote.yaml `` in this case:
329+
330+ .. code-block :: yaml
331+
332+ targets :
333+ main :
334+ resources :
335+ RemotePlace :
336+ name : myplace
337+ drivers :
338+ SerialDriver : {}
339+ ShellDriver :
340+ prompt : ' root@[\w-]+:[^ ]+ '
341+ login_prompt : ' login: '
342+ username : ' root'
343+
344+ The ``RemotePlace `` resource makes all resources available that are assigned to
345+ to the place ``myplace `` on your coordinator.
346+
347+ Now, this environment file can be used interactively with the client:
348+
349+ .. code-block :: bash
350+
351+ labgrid-venv $ labgrid-client -c remote.yaml acquire
352+ labgrid-venv $ labgrid-client -c remote.yaml console
353+ labgrid-venv $ labgrid-client -c remote.yaml release
354+
355+ or directly with a test:
356+
357+ .. code-block :: bash
358+
359+ labgrid-venv $ labgrid-client -c remote.yaml acquire
360+ labgrid-venv $ pytest --lg-env remote.yaml test_shell.py
361+ labgrid-venv $ labgrid-client -c remote.yaml release
362+
312363 .. _remote-getting-started-systemd-files :
313364
314365Systemd files
0 commit comments