Client Sessions and Robot Network Connectivity
When connecting to a robot using the connection code from the code sample tab, a client session automatically uses the most efficient route to connect to your robot either through local LAN or WAN or the internet.
When a robot loses its connection to the internet but is still connected to a LAN or WAN:
- Client sessions connected through the same LAN or WAN will function normally.
- Client sessions connected through the internet will timeout and end. If the client is on the same LAN or WAN but the route it chose to connect is through the internet, the client will automatically disconnect and then reconnect over LAN.
- 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.
When a robot loses its connection to LAN or WAN, all client sessions will timeout and end by default.
Client session timeout and end
When your client cannot connect to your robot’s
viam-server will end any current client sessions on this robot and 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.
To disable the default behavior and manage resource timeout and reconfiguration over a networking session yourself, you can disable the default behavior of session management, then use Viam’s SDKs in your code to make calls to the session management API.
Have questions, or want to meet other people working on robots? Join our Community Discord.
Was this page helpful?
Glad to hear it! If you have any other feedback please let us know:
We're sorry about that. To help us improve, please tell us what we can do better: