Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DOCS-2046: Update install and agent docs #3243

Merged
merged 9 commits into from
Aug 16, 2024
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added assets/configure/machine-part-info.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file added assets/platform/provisioning-demo.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions docs/appendix/troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ This is only required for the first `ssh` connection you make to a newly-imaged

**Full Error:** `Something went wrong trying to read the squashfs image. Open dir error: No such file or directory`

**Description:** The `viam-server` [installation](/installation/) or [update](/installation/manage/#update-viam-server) process may have been interrupted partway, with some files either partially-written or missing.
**Description:** The `viam-server` [installation](/installation/) or [update](/installation/manage-viam-server/#update-viam-server) process may have been interrupted partway, with some files either partially-written or missing.

**Solution:** Reinstall `viam-server` following the [installation instructions](/installation/).

Expand Down Expand Up @@ -186,7 +186,7 @@ In **JSON** mode, it will resemble the following:

The video path for your camera device is the first path listed under that camera, in this case `/dev/video0`.

1. Then, [stop `viam-server`](/installation/manage/#run-viam-server), and verify that your Linux OS is able to access that video device properly:
1. Then, [stop `viam-server`](/installation/manage-viam-server/#run-viam-server), and verify that your Linux OS is able to access that video device properly:

```sh {class="command-line" data-prompt="$"}
v4l2-ctl --stream-count 1 --device /dev/video0
Expand All @@ -196,7 +196,7 @@ In **JSON** mode, it will resemble the following:

The command returns successfully (with no output) if Linux is able to successfully communicate with the camera, or errors with `Cannot open device` if there was a problem communicating.
If this command errors, you should consult the documentation for your camera and Linux distribution to troubleshoot.
If you receive the error `Device or resource busy` instead, be sure you have [stopped `viam-server`](/installation/manage/#run-viam-server) first, then re-run the command above.
If you receive the error `Device or resource busy` instead, be sure you have [stopped `viam-server`](/installation/manage-viam-server/#run-viam-server) first, then re-run the command above.

- Ensure that your camera uses a supported pixel format:

Expand Down
4 changes: 2 additions & 2 deletions docs/configure/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ All communication happens securely over HTTPS using secret tokens that are in a
On Linux, the configuration is stored at <FILE>/etc/viam.json</FILE> by default and `viam-server` uses this configuration if no configuration is specified on startup.

You can store your config file in a custom location if desired.
See [Run `viam-server`](/installation/manage/#run-viam-server) for more information.
See [Run `viam-server`](/installation/manage-viam-server/#run-viam-server) for more information.
{{< /alert >}}

After you have completed the setup steps and successfully connected to your machine, go to the **CONFIGURE** tab to start adding to the configuration.
Expand Down Expand Up @@ -304,7 +304,7 @@ To restore to an earlier version of your configuration, click the **Restore vers
If you run into issues, here are some things to try:

- Check the [**LOGS** tab](/cloud/machines/#logs) to view log messages and errors from `viam-server`.
You can also [access the local log file](/installation/manage/#view-viam-server-logs) on your machine if needed.
You can also [access the local log file](/installation/manage-viam-server/#view-viam-server-logs) on your machine if needed.
- Make sure all configured components are saved to your config.
If they aren't, you will see an **Unsaved changes** note next to the **Save** button in the top right corner of the page.
- Try restarting `viam-server` by navigating to the app's **CONFIGURE** tab in **Builder** mode, clicking the **...** menu on the right side of the machine part's card, and selecting **Restart part**.
Expand Down
311 changes: 311 additions & 0 deletions docs/configure/agent.md

Large diffs are not rendered by default.

357 changes: 162 additions & 195 deletions docs/fleet/provision.md

Large diffs are not rendered by default.

93 changes: 39 additions & 54 deletions docs/installation/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,20 +83,7 @@ Proceed to [install the micro-RDK](/installation/#install-the-micro-rdk).

## Install `viam-server`

If you have a [compatible operating system](/installation/), follow along with the steps outlined below or with the video beneath it to install `viam-server`:

{{< tabs name="Install on computer" >}}
{{% tab name="Linux computer" %}}

{{< readfile "/static/include/install/install-linux.md" >}}

{{% /tab %}}
{{% tab name="macOS computer" %}}

`viam-server` is available for macOS users through Homebrew, and supports both Intel and Apple Silicon macOS computers.
To install `viam-server` on a macOS computer:

1. If not installed already, install [Homebrew](https://brew.sh/).
If you have a [compatible operating system](/installation/#compatibility), follow along with the steps outlined below to install `viam-server`:

1. Go to the [Viam app](https://app.viam.com). Create an account if you haven't already.

Expand All @@ -111,47 +98,31 @@ To install `viam-server` on a macOS computer:

Click **View setup instructions** to open the setup instructions.

1. Select **Mac** as your system's OS and **RDK** as your RDK type.

1. Follow the steps shown to install `viam-server` on your macOS computer.

1. Once you have followed the steps on the setup instructions, `viam-server` is installed and running.
Wait for confirmation that your computer has successfully connected.

{{% /tab %}}
{{% tab name="Windows" %}}

1. Go to the [Viam app](https://app.viam.com).
Create an account if you haven't already.

1. Add a new machine by providing a name in the **New machine** field and clicking **Add machine**:

![The 'First Location' page on the Viam app with a new machine name in the New machine field and the Add machine button next to the field highlighted.](/fleet/app-usage/create-machine.png)

1. Navigate to the **CONFIGURE** tab and find your machine's card.
An alert will be present directing you to **Set up your machine part**:

![Machine setup alert in a newly-created machine](/installation/setup-part.png)
1. Select your system's operating system and **RDK** as your RDK type.

Click **View setup instructions** to open the setup instructions:
1. Select your preferred installation method:

![Setup instructions](/installation/wsl-setup-instructions.png)
- `manual`: installs only `viam-server` on your machine.
- `viam-agent`: installs viam-agent, which will automatically install (or update) viam-server **and** provide additional functionality such as [provisioning](/fleet/provision/) and operating system update configuration.

1. Select **Windows** as your system's OS and **RDK** as your RDK type.
1. Follow the steps shown on your machine.

1. Follow the steps shown to install `viam-server` on your Windows machine.
1. Once you have followed the steps on the setup instructions, wait for confirmation that your machine has successfully connected.

1. Once you have followed the steps on the setup instructions, `viam-server` is installed and running.
Wait for confirmation that your computer has successfully connected.
On your machine's page on [the Viam app](https://app.viam.com), your machine will show that it's **Live**.

{{% /tab %}}
{{< /tabs >}}
{{< alert title="Linux: Automatic startup" color="note" >}}
On Linux installs, by default `viam-server` or `viam-agent` and `viam-server` will start automatically when your system boots.
You can change this behavior if desired.
If you installed `viam-server` manually see [Manage `viam-server`](/installation/manage-viam-server/).
If you installed `viam-server` through `viam-agent` see [Manage `viam-agent`](/installation/manage-viam-agent/).
{{< /alert >}}

{{<youtube embed_url="https://www.youtube-nocookie.com/embed/gmIW9JoWStA">}}
### Manage your installation

### Manage `viam-server`
To learn how to run, update, or uninstall `viam-agent`, see [Manage `viam-agent`](/installation/manage-viam-agent/).

To learn how to run, update, or uninstall `viam-server`, see [Manage `viam-server`](/installation/manage/).
For manual installs of only `viam-server`, see [Manage `viam-server`](/installation/manage-viam-server/).

### Next steps

Expand All @@ -176,19 +147,33 @@ If you want to program the chip directly, follow the setup instructions in [the

### Flash your ESP32 with the micro-RDK installer

Navigate to [the Viam app](https://app.viam.com) and [add a new machine](/cloud/machines/#add-a-new-machine) in your desired location.
If you have a [compatible microcontroller](/installation/#compatibility), follow along with the steps outlined below to install `viam-server`:

1. Go to the [Viam app](https://app.viam.com). Create an account if you haven't already.

1. Add a new machine by providing a name in the **New machine** field and clicking **Add machine**:

![The 'First Location' page on the Viam app with a new machine name in the New machine field and the Add machine button next to the field highlighted.](/fleet/app-usage/create-machine.png)

1. Navigate to the **CONFIGURE** tab and find your machine's card.
An alert will be present directing you to **Set up your machine part**:

1. Click on the name of the machine to go to its page.
2. Navigate to the **CONFIGURE** tab and find your machine's card. An alert will be present directing you to **Set up your machine part**. Click **View setup instructions** to open the setup instructions.
3. Select your computer's architecture and operating system, and select **Micro-RDK** as **RDK type**.
4. Follow the instructions to flash the micro-RDK directly to an ESP32 connected to your computer through a data cable.
![Machine setup alert in a newly created machine](/installation/setup-part.png)

Click **View setup instructions** to open the setup instructions.

1. Select your system's operating system and **Micro-RDK** as your RDK type.

1. Follow the instructions to flash the micro-RDK directly to an ESP32 connected to your computer through a data cable.

To see the micro-RDK server logs through the serial connection, add `--monitor` to the command in step 3.
If the program cannot auto-detect the serial port to which your ESP32 is connected, you may be prompted to select the correct one among a list.

Go back to your new machine's page on [the Viam app](https://app.viam.com).
If successful, your machine will show that it's **Live**.
If something is not working, see [Troubleshooting](/installation/#troubleshooting).
1. Once you have followed the steps on the setup instructions, the micro-RDK is installed and will run.
Wait for confirmation that your microcontroller has successfully connected.

On your machine's page on [the Viam app](https://app.viam.com), your machine will show that it's **Live**.
If something is not working, see [Troubleshooting](/installation/#troubleshooting).

For more `micro-rdk-installer` CLI usage options, see [GitHub](https://github.com/viamrobotics/micro-rdk/tree/main/micro-rdk-installer).

Expand Down
51 changes: 51 additions & 0 deletions docs/installation/manage-viam-agent.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
---
title: "Manage viam-agent"
linkTitle: "Manage viam-agent"
weight: 80
no_list: true
type: docs
draft: false
images: ["/installation/thumbnails/manage.png"]
imageAlt: "Manage viam-agent"
description: "Control and troubleshoot viam-agent."
---

[`viam-agent`](/configure/agent/) is installed as a `systemd` service named `viam-agent`.

- To start `viam-agent`:

```sh {class="command-line" data-prompt="$"}
sudo systemctl start viam-agent
```

- To stop `viam-agent`:

{{< alert title="Alert" color="note" >}}
When you stop `viam-agent`, the agent will stop `viam-server` as well.
{{< /alert >}}

```sh {class="command-line" data-prompt="$"}
sudo systemctl stop viam-agent
```

- To restart `viam-agent`:

{{< alert title="Alert" color="note" >}}
When you restart `viam-agent`, the agent will restart `viam-server` as well.
{{< /alert >}}

```sh {class="command-line" data-prompt="$"}
sudo systemctl restart viam-agent
```

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should probably also include the enable and disable commands (similar to what's on the viam-server version of this page) The commands are almost the same, "viam-server" just becomes "viam-agent" in each.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still think this would be good to add, especially as this is now linked from the alert about "Automatic Startup"

- To completely uninstall `viam-agent` and `viam-server`, run the following command:

```sh {class="command-line" data-prompt="$"}
sudo /bin/sh -c "$(curl -fsSL https://storage.googleapis.com/packages.viam.com/apps/viam-agent/uninstall.sh)"
```

This command uninstalls `viam-agent`, `viam-server`, the machine configuration file (<file>/etc/viam.json</file>), and the provisioning configuration file (<file>/etc/viam-provisioning.json</file>).

## Troubleshooting

You can find assistance in the [Troubleshooting section](/appendix/troubleshooting/).
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,18 @@ imageAlt: "Manage viam-server"
description: "Control and troubleshoot viam-server."
aliases:
- /installation/update/
- /installation/manage/
- /get-started/installation/manage/
- /installation/manage-viam-server/
- /get-started/installation/manage-viam-server/
---

Once you've [installed `viam-server`](/installation/), you can chose to run it as a system service or directly on the command line.
If you have manually [installed `viam-server`](/installation/), you can chose to run it as a system service or directly on the command line.
Running as a system service enables you to configure `viam-server` to start automatically when your system boots, and is the [default installation option](/installation/#install-viam-server) on Linux.
Running on the command line is suitable for local development.

{{< alert title="Note" color="note" >}}
If you have installed `viam-agent`, see [Manage `viam-agent`](/installation/manage-viam-agent/) instead.
{{< /alert >}}

## Run `viam-server`

Select the tab for your platform:
Expand Down
6 changes: 3 additions & 3 deletions docs/sdks/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ You can run SDK code from anywhere; it does not necessarily have to be run on th

## Backend SDKs

Use the backend SDK to build business logic to control [components](/appendix/apis/#component-apis) and [services](/appendix/apis/#service-apis), as well as manage your [fleet](/appendix/apis/#fleet-management-api) and [data](/appendix/apis/data-client/), and [billing information](/appendix/apis/billing-client/), or [provision](/fleet/provision/#provision-a-new-machine) machines.
Use the backend SDK to build business logic to control [components](/appendix/apis/#component-apis) and [services](/appendix/apis/#service-apis), as well as manage your [fleet](/appendix/apis/#fleet-management-api) and [data](/appendix/apis/data-client/), and [billing information](/appendix/apis/billing-client/), or [provision](/fleet/provision/) machines.
With the backend SDKs you can also create custom {{< glossary_tooltip term_id="modular-resource" text="modular resources" >}}.

{{< sectionlist-custom >}}
Expand All @@ -34,15 +34,15 @@ With the backend SDKs you can also create custom {{< glossary_tooltip term_id="m

## Frontend SDKs

Use the frontend SDK to control your machine's [components](/appendix/apis/#component-apis), as well as manage your [data](/appendix/apis/data-client/) or [provision](/fleet/provision/#provision-a-new-machine) machines.
Use the frontend SDK to control your machine's [components](/appendix/apis/#component-apis), as well as manage your [data](/appendix/apis/data-client/) or [provision](/fleet/provision/) machines.

{{< sectionlist-custom >}}
{{% sectionlist-custom-item link="/sdks/typescript/" %}}
{{< /sectionlist-custom >}}

## Mobile SDK

Use the mobile SDK to build iOS and Android apps to control your machine's [components](/appendix/apis/#component-apis), as well as manage your [fleet](/appendix/apis/#fleet-management-api) and [data](/appendix/apis/data-client/), or [provision](/fleet/provision/#provision-a-new-machine) machines.
Use the mobile SDK to build iOS and Android apps to control your machine's [components](/appendix/apis/#component-apis), as well as manage your [fleet](/appendix/apis/#fleet-management-api) and [data](/appendix/apis/data-client/), or [provision](/fleet/provision/) machines.

{{< sectionlist-custom >}}
{{% sectionlist-custom-item link="/sdks/flutter/" %}}
Expand Down
5 changes: 5 additions & 0 deletions layouts/shortcodes/tab.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,20 @@
{{ $name := trim (.Get "name") " " }}
{{ $include := trim (.Get "include") " "}}
{{ $codelang := .Get "codelang" }}
{{ $height := .Get "min-height" }}
{{ if not (.Parent.Scratch.Get "tabs") }}
{{ .Parent.Scratch.Set "tabs" slice }}
{{ end }}
{{ with .Inner }}
{{ if $codelang }}
{{ $.Parent.Scratch.Add "tabs" (dict "name" $name "content" (highlight . $codelang "") ) }}
{{ else }}
{{ if $height }}
{{ $.Parent.Scratch.Add "tabs" (dict "name" $name "height" $height "content" . ) }}
{{ else }}
{{ $.Parent.Scratch.Add "tabs" (dict "name" $name "content" . ) }}
{{ end }}
{{ end }}
{{ else }}
{{ $.Parent.Scratch.Add "tabs" (dict "name" $name "include" $include "codelang" $codelang) }}
{{ end }}
Expand Down
4 changes: 2 additions & 2 deletions layouts/shortcodes/tabs.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
{{- range $i, $e := $tabs -}}
{{- $id := printf "%s-%d" $tab_set_id $i -}}
{{- if (eq $i 0) -}}
<div id="{{ $id }}" class="tab-pane show active" role="tabpanel" aria-labelledby="{{ $id }}">
<div id="{{ $id }}" class="tab-pane show active" role="tabpanel" aria-labelledby="{{ $id }}" style="min-height: {{ .height }}">
{{ else }}
<div id="{{ $id }}" class="tab-pane" role="tabpanel" aria-labelledby="{{ $id }}">
<div id="{{ $id }}" class="tab-pane" role="tabpanel" aria-labelledby="{{ $id }}" style="min-height: {{ .height }}">
{{ end }}
{{- with .content -}}
{{- . -}}
Expand Down
4 changes: 2 additions & 2 deletions layouts/shortcodes/video.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@
{{ if (.Get "poster") }}
{{ $img := resources.GetMatch (.Get "poster") }}
{{if $img }}
<video class="video-shortcode lozad" preload="none" controls alt="{{ .Get "alt" }}" style="max-width: {{ .Get "max-width" }}" data-poster="{{ $img.RelPermalink }}">
<video class="video-shortcode lozad {{ .Get "class" }}" preload="none" controls alt="{{ .Get "alt" }}" style="max-width: {{ .Get "max-width" }}; {{ .Get "style"}}" data-poster="{{ $img.RelPermalink }}">
<source data-src="{{ relURL (substr (.Get "webm_src") 1) }}" type="video/webm">
<source data-src="{{ relURL (substr (.Get "mp4_src") 1) }}" type="video/mp4">
There should have been a video here but your browser does not seem
to support it.
</video>
<noscript>
<video class="video-shortcode" preload="none" controls alt="{{ .Get "alt" }}" style="max-width: {{ .Get "max-width" }}" poster="{{ $img.RelPermalink }}">
<video class="video-shortcode {{ .Get "class" }}" preload="none" controls alt="{{ .Get "alt" }}" style="max-width: {{ .Get "max-width" }}; {{ .Get "style"}}" poster="{{ $img.RelPermalink }}">
<source src="{{ relURL (substr (.Get "webm_src") 1) }}" type="video/webm">
<source src="{{ relURL (substr (.Get "mp4_src") 1) }}" type="video/mp4">
There should have been a video here but your browser does not seem
Expand Down
Loading
Loading