Collect and view sensor data from any machines

You can use the data management service to capture sensor data from any or all of your machines and sync that data to the cloud. For example, you can configure data capture for several sensors across one or multiple machines to report the current memory usage or the ambient operating temperature.

You can do all of this using the Viam app user interface. You do not need to write any code to follow this guide.

Prerequisites

You don’t need to buy or own any hardware to complete this tutorial. You do need:

A running machine connected to the Viam app. Click to see instructions.
Add a new machine in the Viam app. Then follow the setup instructions to install viam-server or viam-micro-server on the device you’re using for your project and connect to the Viam app. Wait until your machine has successfully connected.
At least one configured sensor. Click to see instructions.

Navigate to the CONFIGURE tab of your machine’s page in the Viam app. Click the + icon next to your machine part in the left-hand menu and select Component. Then find and add a sensor model that supports your sensor.

If you have a physical sensor, make sure to connect it physically to your computer.

If you do not have a physical sensor or if you’re not sure which sensor model to choose, add the viam:viam-sensor:telegrafsensor which captures performance data (CPU, memory usage, and more) from your machine. After adding the component, use the following attribute configuration:

{
  "disable_cpu": false,
  "disable_disk": false,
  "disable_disk_io": false,
  "disable_kernel": false,
  "disable_mem": false,
  "disable_net": false,
  "disable_netstat": false,
  "disable_processes": false,
  "disable_swap": false,
  "disable_system": false,
  "disable_temp": true,
  "disable_wireless": true
}

Gather and sync data

Viam’s data management service lets you capture data locally from sensors and then sync it to the cloud where you can access all data across different machines or locations.

Configure the data management service

1. Add the data management service

Navigate to the CONFIGURE tab of your machine’s page in the Viam app. Click the + icon next to your machine part in the left-hand menu and select Service. Then add the data management service.

Enable Syncing to ensure captured data is synced to the cloud and set the sync interval, for example to 0.5 minutes to sync every 30 seconds.

configure a camera component

2. Capture data from sensor

On the CONFIGURE tab, go to the sensor’s card and find the Data capture section. Add a new method, Readings, to capture data for and set the frequency. For example, setting a frequency of 0.05 will capture data once every 20 seconds.

Train models

3. Save to start capturing

Save the config. With cloud sync enabled, captured data is automatically uploaded to the Viam app after a short delay.

View sensor data

Click on the menu of the sensor component and click on View captured data. This takes you to the DATA tab.

View captured data option in the component menu

If you do not see data from your sensor, try waiting a minute and refreshing the page to allow time for the readings to be captured and then synced to the app at the interval you configured.

Stop data capture

If this is a test project, make sure you stop data capture to avoid incurring fees for capturing large amounts of test data.

In the Data capture section of your sensor’s configuration, toggle the switch to Off.

Click the Save button in the top right corner of the page to save your config.

Next steps

Now that you have collected sensor data, you can query it, access it programmatically or visualize it with third-party tools.

To see sensor data in action, check out this tutorial:

Have questions, or want to meet other people working on robots? Join our Community Discord.

If you notice any issues with the documentation, feel free to file an issue or edit this file.