Skip to content

Commit

Permalink
Create reset_config.md (#933)
Browse files Browse the repository at this point in the history
* Create reset_config.md
  • Loading branch information
pisuke authored Jul 22, 2024
1 parent 4fdff5e commit d74ea6b
Showing 1 changed file with 46 additions and 0 deletions.
46 changes: 46 additions & 0 deletions docs/tools/reset_config.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
[**UDMI**](../../) / [**Docs**](../) / [**Tools**](./) / [Reset Config](#)

# Send a configuration message to a specific device

The `reset_config` tool can be used to send a configuration message to a specific device.

The `reset_config` command can be invoked from the `udmi` folder in the following way:

```
bin/reset_config SITE_DIR PROJECT_ID DEVICE_ID [CONFIG_FILE]
```

For example, if the UDMI site model is in the `path/to/site_model` folder, if the GCP project ID is
`my_project` and the device id is `TEST-1`, the command line will look like this:

```
bin/reset_config path/to/site_model my_project TEST-1
```

In this case, the `reset_config` tool will use the `generated_config.json` file that the `registrar`
tool has created in the `devices/TEST-1/out` folder.

It is also possible to send a specific `config` payload.

In this case, it is necessary to store a file including the `config` payload in the `devices/DEVICE_ID/config` folder.

For example, if a file named `config.json` has been created for this purpose in the `devices/TEST-1/config` folder,
it will be possible to invoke the `reset_config` tool with the following command:

```
bin/reset_config path/to/site_model my_project TEST-1 config.json
```

Finally, it is possible to get `registrar` to send a user defined config instead of a generated config file.

For this purpose, edit the `metadata.json` file to include the following `cloud` configuration object:

```
"cloud": {
"config": {
"static_file": "config.json"
}
}
```

and store the `config.json` file in the `devices/DEVICE_ID/config` folder.

0 comments on commit d74ea6b

Please sign in to comment.