From a08d00cea88072ba551abaa9af3e8206f93ead0b Mon Sep 17 00:00:00 2001 From: Naomi Pentrel <5212232+npentrel@users.noreply.github.com> Date: Wed, 20 Sep 2023 16:08:14 -0400 Subject: [PATCH] Update connectivity page --- docs/program/apis/sessions.md | 2 ++ docs/program/connectivity.md | 23 ++++++++++------------- docs/program/run.md | 4 ++-- 3 files changed, 14 insertions(+), 15 deletions(-) diff --git a/docs/program/apis/sessions.md b/docs/program/apis/sessions.md index cb7073193d..cb35185be6 100644 --- a/docs/program/apis/sessions.md +++ b/docs/program/apis/sessions.md @@ -28,6 +28,8 @@ This is especially important for robots that physically move. For example, imagine a wheeled rover gets a [`SetPower()`](/components/base/#setpower) command as the last input from a client before the connection to the robot is interrupted. Without session management, the API request from the client would cause the rover's motors to move, causing the robot to continue driving forever and potentially colliding with objects and people. +For more information, see [Client Sessions and Robot Network Connectivity](/program/connectivity/). + If you want to manage operations differently, you can manage your robot's client sessions yourself. The Session Management API provides functionality for: diff --git a/docs/program/connectivity.md b/docs/program/connectivity.md index d5bf1c5180..6e10b0020c 100644 --- a/docs/program/connectivity.md +++ b/docs/program/connectivity.md @@ -3,26 +3,23 @@ title: "Client Sessions and Robot Network Connectivity" linkTitle: "Network Connectivity Issues" weight: 20 type: "docs" -description: "Whan a robot loses its connection to the internet, all client sessions will timeout and end by default." +description: "When a robot loses its connection to a LAN or WAN, all client sessions will timeout and end by default." tags: ["client", "sdk", "viam-server", "networking", "apis", "robot api", "session"] --- -What happens when your robot loses its connection to the internet over a LAN or WAN and can no longer communicate with clients through [the Viam app](https://app.viam.com). +A [client session](/program/apis/sessions/) uses the most efficient route to connect to your robot either through local LAN or WAN or the internet. -## How does `viam-server` work if your robot loses its network connection? +When a robot loses its connection to the internet but is still connected to a LAN or WAN: -When a robot loses its connection over LAN or WAN, it can no longer communicate with clients through [the Viam app](https://app.viam.com). -When no heartbeat has been received over a timeout period, `viam-server` will end any current client [_sessions_](/program/apis/sessions/) on this robot. +- Client sessions connected through the internet will timeout and end. +- Client sessions connected through the same LAN or WAN will function normally. +- [Cloud Sync](/services/data/#cloud-sync) for Data Management will pause until the internet connection is re-established since the robot will be unable to connect to the [Viam app](https://app.viam.com). -## What happens to clients connected to the robot when your robot loses its network connection? +When a robot loses its connection to LAN or WAN, all client sessions will timeout and end by default. -When your client cannot connect to your robot's `viam-server` instance, all client operations will timeout automatically and halt. -Any active commands will be cancelled, stopping any moving parts, and no new commands will be able to reach the robot until the connection is restored. +## Client session timeout and end -### How do Viam's client SDKs work if your robot loses its network connection? +When your client cannot connect to your robot's `viam-server` instance, `viam-server` will end any current client [_sessions_](/program/apis/sessions/) on this robot and all client operations will [timeout automatically](/program/apis/sessions/#heartbeats) and halt: any active commands will be cancelled, stopping any moving parts, and no new commands will be able to reach the robot until the connection is restored. -As a client of your robot, Viam's SDKs will by default have their session ended when the robot loses its connection to the internet. - -To disable the default behavior here and manage resource timeout and reconfiguration over a networking session yourself, follow [these instructions](/program/apis/sessions/). -[Disable the default behavior](/program/apis/sessions/#disable-default-session-management) of session management, then utilize [Viam's SDKs](/program/) in your code to make calls to [the session management API](https://pkg.go.dev/go.viam.com/rdk/session#hdr-API). +To disable the default behavior and manage resource timeout and reconfiguration over a networking session yourself, you can [disable the default behavior](/program/apis/sessions/#disable-default-session-management) of session management, then use [Viam's SDKs](/program/) in your code to make calls to [the session management API](https://pkg.go.dev/go.viam.com/rdk/session#hdr-API). diff --git a/docs/program/run.md b/docs/program/run.md index 86a3102a36..b427647117 100644 --- a/docs/program/run.md +++ b/docs/program/run.md @@ -12,11 +12,11 @@ After saving your [code sample](/program/#hello-world-the-code-sample-tab) and a ### Authentication -You must reference a robot's location secret to authenticate yourself to the robot. +You must authenticate yourself to the robot using the robot's location secret. However, the app hides the robot location secret from the sample by default for your security. To copy the robot location secret, select **Include Secret** on the **Code sample** tab of your robot's page on the [Viam app](https://app.viam.com). -Paste it into your SDK code as directed by the code sample. +Paste it into your environment variables or directly into your code. You must also include the robot's remote address, like `12345.somerobot-main.viam.cloud`, as an external or public address to connect to your robot. The code sample includes this address at default.