Skip to content

Commit

Permalink
Add example config
Browse files Browse the repository at this point in the history
  • Loading branch information
npentrel committed Feb 16, 2024
1 parent 13b17db commit b8e6262
Show file tree
Hide file tree
Showing 3 changed files with 91 additions and 3 deletions.
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ This module allows you to configure Cloud Sync to occur only at a specific time

## Requirements

Before configuring your sensor, you must [create a machine](https://docs.viam.com/manage/fleet/machines/#add-a-new-machine).
Before configuring your sensor, you must [create a machine](https://docs.viam.com/fleet/machines/#add-a-new-machine).

To use the `sync-at-time` module you also need to:

Expand Down Expand Up @@ -75,11 +75,13 @@ On your machine's **Config** tab, switch to **JSON** mode and add a `selective_s
}
```

For an example configuration see [example.json](./example.json).

### Next steps

You have now configured sync to happen at a specific time slot.
You have now configured sync to happen during a specific time slot.
To test your setup, [configure a webcam](https://docs.viam.com/components/camera/webcam/) or another component and [enable data capture on one of the component methods](https://docs.viam.com/data/capture/#configure-data-capture-for-individual-components), for example `ReadImage`.
Data will now be captured.
The data manager will now capture data.
Go to the [**Control** tab](https://docs.viam.com/fleet/machines/#control). You should see the sensor.
Click on `GetReadings`.
If you are in the time frame for sync, the sensor will return true.
Expand Down
86 changes: 86 additions & 0 deletions example.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
{
"components": [
{
"type": "camera",
"namespace": "rdk",
"attributes": {
"video_path": "FDF90FEB-59E5-4FCF-AABD-DA03C4E19BFB"
},
"depends_on": [],
"service_configs": [
{
"type": "data_manager",
"attributes": {
"capture_methods": [
{
"capture_frequency_hz": 0.2,
"method": "ReadImage",
"additional_params": {
"mime_type": "image/jpeg"
}
}
]
}
}
],
"name": "webcam",
"model": "webcam"
},
{
"attributes": {
"start": "14:10:00",
"end": "15:35:00",
"zone": "CET"
},
"depends_on": [],
"name": "timesensor",
"model": "naomi:sync-at-time:timesyncsensor",
"type": "sensor",
"namespace": "rdk"
}
],
"services": [
{
"attributes": {
"selective_syncer_name": "timesensor",
"sync_interval_mins": 0.2,
"capture_dir": "",
"tags": [],
"additional_sync_paths": []
},
"name": "datamanager",
"type": "data_manager",
"namespace": "rdk"
}
],
"agent_config": {
"subsystems": {
"viam-server": {
"release_channel": "stable",
"pin_version": "",
"pin_url": "",
"disable_subsystem": false
},
"agent-provisioning": {
"release_channel": "stable",
"pin_version": "",
"pin_url": "",
"disable_subsystem": false
},
"viam-agent": {
"release_channel": "stable",
"pin_version": "",
"pin_url": "",
"disable_subsystem": false
}
}
},
"modules": [
{
"module_id": "naomi:sync-at-time",
"version": "0.0.1",
"type": "registry",
"name": "naomi_sync-at-time"
}
]
}
Binary file added sync-at-time
Binary file not shown.

0 comments on commit b8e6262

Please sign in to comment.