Previous
Gazebo Simulation Setup
Viam represents every piece of physical hardware on your machine as a component. Each component has three things:
This abstraction means you can swap hardware without changing application code. A program that captures images from a webcam works identically with an IP camera. You change the model and attributes in configuration, not in your control logic.
When you add a component, you search for a model that matches your hardware. Models are drivers that know how to communicate with specific devices. Some models ship with viam-server (like webcam for USB cameras or gpio for motors wired to GPIO pins). Most hardware-specific models (arms, grippers, specialized sensors, motor controllers) come from modules in the Viam registry.
You don’t need to think about where a model comes from. The Viam app shows all available models in one search, and they all work the same way: same API, same data capture, same test sections, same SDKs.
If no model exists for your hardware, you can write a driver module that implements the Viam API for your device.
The process for adding any component is the same whether you’re adding a motor, a sensor, a board, or anything else. For step-by-step guides for specific hardware, see Add a component.
Go to app.viam.com and navigate to your machine.
Confirm it shows as Live in the upper left.
If it shows as offline, verify that viam-server is running on your machine.
After creating the component, you’ll see its configuration panel. Every model has its own set of attributes. These settings tell the driver how to communicate with your specific hardware.
Common attributes include:
/dev/video0, /dev/ttyUSB0): which physical
device to use.Check the model’s reference page for the full list of attributes and their defaults. You can configure attributes using the form fields in the UI, or switch to JSON mode to edit the configuration directly.
Some components depend on other components. For example:
If your component depends on another, that other component must already exist in your configuration. The model’s reference page documents required dependencies.
Click Save in the upper right of the configuration panel.
When you save, viam-server automatically reloads the configuration and
initializes the new component. You do not need to restart anything.
Every component in Viam has a test section on its component card in the CONFIGURE tab. The test section uses the same API your code will use, so if the component works here, it will work in your programs.
If the test section shows expected results, your component is configured correctly.
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:
Thank you!