@@ -112,7 +112,7 @@ Start by copying the initial example:
112
112
113
113
Connect your embedded board (raspberry pi, riotboard, …) to your computer and
114
114
adjust 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 ``:
116
116
117
117
.. code-block :: yaml
118
118
@@ -130,6 +130,14 @@ and ``password`` of the ShellDriver driver in ``local.yaml``:
130
130
login_prompt : ' login: '
131
131
username : ' root'
132
132
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 >`.
133
141
134
142
You can check which device name gets assigned to your USB-Serial converter by
135
143
unplugging the converter, running ``dmesg -w `` and plugging it back in. Boot up
@@ -179,11 +187,15 @@ We can simply start the coordinator:
179
187
Exporter
180
188
~~~~~~~~
181
189
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
+
182
194
The exporter needs a configuration file written in YAML syntax, listing
183
195
the resources to be exported from the local machine.
184
196
The config file contains one or more named resource groups.
185
197
Each group contains one or more resource declarations and optionally a location
186
- string (see the :doc: ` configuration reference < configuration >` for details) .
198
+ string.
187
199
188
200
For example, to export a ``USBSerialPort `` with ``ID_SERIAL_SHORT `` of
189
201
``ID23421JLK ``, the group name `example-group ` and the location
@@ -233,6 +245,9 @@ Additional groups and resources can be added:
233
245
match :
234
246
ID_SERIAL_SHORT : KSLAH2341J
235
247
248
+ More information about the exporter configuration file can be found
249
+ :ref: `here <exporter-configuration >`.
250
+
236
251
Restart the exporter to activate the new configuration.
237
252
238
253
.. Attention ::
@@ -277,7 +292,7 @@ To show more details on the exported resources, use ``-v`` (or ``-vv``):
277
292
' params' : {' host' : ' netio1' , ' index' : 3, ' model' : ' netio' }}
278
293
...
279
294
280
- You can now add a place with:
295
+ You can now add a place to the coordinator with:
281
296
282
297
.. code-block :: bash
283
298
@@ -309,6 +324,42 @@ See :ref:`remote-usage` for some more advanced features.
309
324
For a complete reference have a look at the :doc: `labgrid-client(1) <man/client >`
310
325
man page.
311
326
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
+
312
363
.. _remote-getting-started-systemd-files :
313
364
314
365
Systemd files
0 commit comments