Skip to content

Commit e5b7b33

Browse files
committed
Use copy paste from app
1 parent d7c40f2 commit e5b7b33

File tree

1 file changed

+51
-47
lines changed

1 file changed

+51
-47
lines changed

docs/operate/reference/module-configuration.md

Lines changed: 51 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -295,60 +295,64 @@ To set the path to a program or library on a machine, you can set a system varia
295295

296296
To configure a module that is uploaded to the Viam Registry but has [visibility](/operate/get-started/other-hardware/manage-modules/#change-module-visibility) set to **Unlisted**, you need to manually add the module to your configuration:
297297

298+
1. Navigate to the module's page in the Viam Registry, using the link to the module.
299+
300+
1. Find the **Unlisted module usage** section.
301+
302+
1. Copy the module configuration JSON snippet.
303+
298304
1. In the Viam app, navigate to the **CONFIGURE** tab of the machine you want to configure.
299305

300306
1. Switch to **JSON** mode.
301307

302-
1. Add the following template to your configuration.
303-
If you already have a `components` array and a `modules` array, add contents to them instead of duplicating them.
304-
305-
```json {class="line-numbers linkable-line-numbers"}
306-
"<components|services>": [
307-
{
308-
"name": "<resource-name>",
309-
"api": "<model-API-namespace>:<component|service>:<model-name>",
310-
"model": "<module-namespace>:<module-name>:<model-name>",
311-
"attributes": {}
312-
}
313-
],
314-
"modules": [
315-
{
316-
"type": "registry",
317-
"name": "<module-namespace><module-name>",
318-
"module_id": "<module-namespace>:<module-name>",
319-
"version": "latest"
320-
}
321-
]
322-
```
308+
1. Paste the copied module configuration into your `modules` array.
323309

324-
1. Navigate to the module's page in the Viam Registry, using the link to the module.
325-
326-
1. Look at the list of **Components and services** supported by the module and find the model you want to use.
327-
Copy the {{< glossary_tooltip term_id="model-namespace-triplet" text="model namespace triplet" >}}, for example `jessamy:hello-world:hello-camera`, and paste it into the `model` field of the component or service template.
310+
1. Copy the model configuration snippet for the model you want to use, and add it to your `components` or `services` array (as appropriate).
311+
For example:
328312

329-
1. Copy the API namespace triplet, for example `rdk:component:sensor`, and paste it into the `api` field of the component or service template.
313+
{{< tabs >}}
314+
{{% tab name="Example" %}}
330315

331-
1. For the `module_id` field, use just the first two parts of the model triplet, for example `jessamy:hello-world`.
316+
```json {class="line-numbers linkable-line-numbers"}
317+
"components": [
318+
{
319+
"name": "sensor-1",
320+
"api": "rdk:component:sensor",
321+
"model": "jessamy:hello-world:hello-camera",
322+
"attributes": {}
323+
}
324+
],
325+
"modules": [
326+
{
327+
"type": "registry",
328+
"name": "jessamyhello-world",
329+
"module_id": "jessamy:hello-world",
330+
"version": "latest"
331+
}
332+
]
333+
```
332334

333-
1. For the `name` field, use the `module_id` value but remove the colon, for example `jessamyhello-world`.
335+
{{% /tab %}}
336+
{{% tab name="Template" %}}
334337

335-
For example:
338+
```json {class="line-numbers linkable-line-numbers"}
339+
"<components|services>": [
340+
{
341+
"name": "<resource-name>",
342+
"api": "<model-API-namespace>:<component|service>:<model-name>",
343+
"model": "<module-namespace>:<module-name>:<model-name>",
344+
"attributes": {}
345+
}
346+
],
347+
"modules": [
348+
{
349+
"type": "registry",
350+
"name": "<module-namespace><module-name>",
351+
"module_id": "<module-namespace>:<module-name>",
352+
"version": "latest"
353+
}
354+
]
355+
```
336356

337-
```json {class="line-numbers linkable-line-numbers"}
338-
"components": [
339-
{
340-
"name": "sensor-1",
341-
"api": "rdk:component:sensor",
342-
"model": "jessamy:hello-world:hello-camera",
343-
"attributes": {}
344-
}
345-
],
346-
"modules": [
347-
{
348-
"type": "registry",
349-
"name": "jessamyhello-world",
350-
"module_id": "jessamy:hello-world",
351-
"version": "latest"
352-
}
353-
]
354-
```
357+
{{% /tab %}}
358+
{{< /tabs >}}

0 commit comments

Comments
 (0)