You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -34,10 +34,10 @@ To parse the readings and provide tailored guidance to a ship's captain, the com
34
34
By having the end customer set up the machine, the company:
35
35
36
36
- eliminates per-device setup and individualization at the factory
37
-
- allows for tailored configurations per customer as needed
38
37
- allows customer to provide their own WiFi credentials
38
+
- allows for tailored configurations per customer as needed
39
39
40
-
This guide will show you how to install and configure `viam-agent`.
40
+
This guide shows you how to install and configure `viam-agent`.
41
41
42
42
## Prerequisites
43
43
@@ -62,49 +62,10 @@ For Bullseye, the installation of `viam-agent` changes the network configuration
62
62
63
63
## Choose provisioning methods
64
64
65
-
`viam-agent` supports two provisioning methods that can work independently or together:
66
-
67
-
-**WiFi Hotspot Provisioning**: Creates a WiFi hotspot that users connect to for setup via a captive web portal
68
-
-**Bluetooth Provisioning**: Uses Bluetooth Low Energy (BLE) for setup via mobile apps
69
-
70
-
You can enable both methods simultaneously for maximum flexibility, or disable one method if it's not suitable for your environment.
71
-
72
-
### WiFi Hotspot Provisioning
73
-
74
-
WiFi hotspot provisioning creates a temporary WiFi network that users connect to for machine setup. This method works well with both captive web portals and mobile apps.
75
-
76
-
**Advantages:**
77
-
- Works with any WiFi-enabled device
78
-
- Supports both web portal and mobile app interfaces
79
-
- Well-established and widely compatible
80
-
81
-
**Considerations:**
82
-
- Requires creating an open WiFi hotspot
83
-
- May be less reliable in environments with many WiFi networks
84
-
- Some corporate environments may block hotspot connections
85
-
86
-
### Bluetooth Provisioning
87
-
88
-
Bluetooth provisioning uses Bluetooth Low Energy (BLE) for machine setup, allowing mobile devices to connect directly to the machine without joining a WiFi network.
89
-
90
-
**Advantages:**
91
-
- More reliable in environments with many WiFi networks
92
-
- No need for an open WiFi hotspot
93
-
- Often easier for end-users on mobile devices
94
-
- Uses encrypted communication for security
95
-
96
-
**Considerations:**
97
-
- Requires Bluetooth Low Energy support on both device and mobile app
98
-
- Currently optimized for mobile app workflows
99
-
- Requires compatible mobile device with BLE support
100
-
101
-
{{< alert title="Note" color="note" >}}
102
-
Bluetooth provisioning is designed primarily for mobile app workflows. While both provisioning methods can be enabled simultaneously, mobile apps will typically prefer Bluetooth when available.
103
-
{{< /alert >}}
65
+
You can let your end users complete machine setup over WiFi or Bluetooth:
104
66
105
-
## Decide on the user interface
106
-
107
-
You can choose to let your end users complete machine setup by using a captive web portal or a mobile app.
67
+
-**WiFi Hotspot Provisioning**: When device boots, it creates a temporary WiFi hotspot that users connect to for setup either by using a captive web portal or a mobile app. Be aware that the WiFi hotspot is open to anyone.
68
+
-**Bluetooth Low Energy (BLE) Provisioning**: When device boots, it searches for Bluetooth connections and a user connects to it using a mobile app.
108
69
109
70
If you choose to have a mobile app experience, you can use the [Viam mobile app](/manage/troubleshoot/teleoperate/default-interface/#viam-mobile-app) or create your own custom mobile app using the [Flutter SDK](https://flutter.viam.dev/viam_protos.provisioning.provisioning/ProvisioningServiceClient-class.html) or the [TypeScript SDK](https://github.com/viamrobotics/viam-typescript-sdk/blob/main/src/app/provisioning-client.ts) to connect to `viam-agent` and provision your machines.
110
71
@@ -116,100 +77,10 @@ If you do not yet have a fragment, follow the steps to [Create a configuration f
116
77
If you are not using Flutter or TypeScript and would like to use provisioning, please [contact us](mailto:[email protected]).
117
78
{{< /alert >}}
118
79
119
-
If you choose to use the captive web portal, you can optionally create a machine in advance and provide its machine cloud credentials file at <FILE>/etc/viam.json</FILE>.
120
-
121
-
You can get the machine cloud credentials by clicking the copy icon next to **Machine cloud credentials** in the part status dropdown to the right of your machine's name on the top of the page.
122
-
123
-
{{<imgprocsrc="configure/machine-part-info.png"resize="500x"declaredimensions=truealt="Machine part info dropdown"class="shadow" >}}
124
-
125
-
{{% expand "Want to create a machine and obtain its machine cloud credentials programmatically?" %}}
126
-
127
-
You can use the [Fleet Management API](/dev/reference/apis/fleet/) to create machines, and obtain their machine cloud credentials:
The defaults file allows you to configure the provisioning experience for the users setting up their machines.
83
+
213
84
{{< table >}}
214
85
215
86
{{% tablestep number=1 %}}
@@ -356,6 +227,100 @@ The following configuration defines the connection information and credentials f
356
227
{{% /tablestep %}}
357
228
{{< /table >}}
358
229
230
+
## (Optional) Create a machine in advance
231
+
232
+
If you provision devices using a captive web portal, you can optionally create a machine in advance and provide its machine cloud credentials file at <FILE>/etc/viam.json</FILE>.
233
+
234
+
You can get the machine cloud credentials by clicking the copy icon next to **Machine cloud credentials** in the part status dropdown to the right of your machine's name on the top of the page.
235
+
236
+
{{<imgprocsrc="configure/machine-part-info.png"resize="500x"declaredimensions=truealt="Machine part info dropdown"class="shadow" >}}
237
+
238
+
{{% expand "Want to create a machine and obtain its machine cloud credentials programmatically?" %}}
239
+
240
+
You can use the [Fleet Management API](/dev/reference/apis/fleet/) to create machines, and obtain their machine cloud credentials:
`viam-agent` is a self-updating service manager that maintains the lifecycle for several Viam services and keeps them updated.
@@ -522,16 +487,23 @@ Some systems can't scan for WiFi networks while in hotspot mode, meaning they wo
522
487
The `retry_connection_timeout_minutes` causes your device to exit hotspot mode, at which point your device will be able to detect newly available networks.
523
488
If your device does not connect to your network, adjust the `retry_connection_timeout_minutes` value in the [`defaults` file](/manage/fleet/provision/setup/#configure-defaults).
524
489
490
+
### WiFi provisioning not working
491
+
492
+
WiFi provisioning may be less reliable in environments with many WiFi networks.
493
+
If possible, use Bluetooth provisioning or move to an area with fewer WiFi networks in range.
494
+
525
495
### Bluetooth provisioning not working
526
496
527
497
If Bluetooth provisioning is not working, check the following:
528
498
529
499
1.**Bluetooth adapter availability**: Ensure your device has a working Bluetooth adapter. You can check this with:
500
+
530
501
```sh {class="command-line" data-prompt="$"}
531
502
bluetoothctl list
532
503
```
533
504
534
505
1.**Bluetooth service status**: Verify the Bluetooth service is running:
506
+
535
507
```sh {class="command-line" data-prompt="$"}
536
508
sudo systemctl status bluetooth
537
509
```
@@ -547,19 +519,6 @@ If Bluetooth provisioning is not working, check the following:
547
519
If you need to test the GRPC components of the provisioning service, there is a CLI client available.
548
520
Get the code from the [`agent` repo](https://github.com/viamrobotics/agent/tree/main/cmd/provisioning-client) and run `go run ./cmd/provisioning-client/` for info.
549
521
550
-
The provisioning client supports both WiFi hotspot and Bluetooth modes:
551
-
552
-
```sh {class="command-line" data-prompt="$"}
553
-
# Test WiFi hotspot provisioning
554
-
go run ./cmd/provisioning-client/ --address localhost:4772 --status
555
-
556
-
# Test Bluetooth provisioning
557
-
go run ./cmd/provisioning-client/ --bluetooth --status
558
-
559
-
# Scan for Bluetooth devices
560
-
go run ./cmd/provisioning-client/ --scan
561
-
```
562
-
563
522
## End user setup experience
564
523
565
524
End users receive a machine, and use either a captive web portal or mobile app to complete the machine setup.
Copy file name to clipboardExpand all lines: docs/manage/reference/viam-agent/_index.md
+37-1Lines changed: 37 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -102,7 +102,10 @@ For information on managing the service, see [Manage `viam-agent`](/manage/refer
102
102
"viam_server_start_timeout_minutes": 10,
103
103
"disable_viam_server": false,
104
104
"disable_network_configuration": false,
105
-
"disable_system_configuration": false
105
+
"disable_system_configuration": false,
106
+
"viam_server_env": {
107
+
"CUSTOM_VAR": "value"
108
+
}
106
109
},
107
110
"network_configuration": {
108
111
"manufacturer": "viam",
@@ -205,9 +208,42 @@ To update the version of `viam-server` (or the RDK) update the machine settings.
205
208
|`disable_network_configuration`| boolean | Optional | Disables the network and hotspot configuration, as well as the configuration of additional networks. Default: `false`. |
206
209
|`disable_system_configuration`| boolean | Optional | Disables the system configuration. Default: `false`. |
207
210
|`disable_viam_server`| boolean | Optional | Disable `viam-server` remotely. This option is often used by developers working on Viam agent or when manually running `viam-server`. Default: `false`. |
211
+
|`viam_server_env`| object | Optional | A map of environment variable names to values that `viam-agent` passes to `viam-server` and its child processes (including modules). Both keys and values must be strings. See [Environment Variables for viam-server](#environment-variables-for-viam-server). Default: `{}` (empty). |
208
212
|`viam_server_start_timeout_minutes`| integer | Optional | Specify a time after which, if `viam-server` hasn't successfully started, Viam agent will kill it and restart. Default: `10`. |
209
213
|`wait_for_update_check`| boolean | Optional | If set to `true`, `viam-agent` will wait for a network connection and check for updates before starting `viam-server`. See [Reduce startup time](#reduce-startup-time). Default: `false`. |
210
214
215
+
### Environment Variables for viam-server
216
+
217
+
You can configure environment variables for `viam-server` using the `viam_server_env` setting in `advanced_settings`.
218
+
Environment variables set through `viam_server_env` are passed to `viam-server` and all child processes it launches, including modules.
219
+
`viam-server` also inherits existing environment variables from `viam-agent`, such as `HOME`, `PWD`, `TERM`, `PATH`.
220
+
221
+
{{< alert title="Important" color="note" >}}
222
+
When you change environment variables in `viam_server_env`, `viam-agent` will automatically restart `viam-server` to apply these and any other changes made before saving.
223
+
This restart will occur immediately if `viam-server` is in a maintenance window and not currently processing configuration changes.
224
+
{{< /alert >}}
225
+
226
+
Changes to `viam_server_env` are the only changes that automatically trigger a `viam-server` restart. Changing other configuration options requires a manual restart unless you've also changed `viam_server_env`.
227
+
228
+
#### Example configurations
229
+
230
+
```json
231
+
{
232
+
"agent": {
233
+
"advanced_settings": {
234
+
"viam_server_env": {
235
+
"PION_LOG_TRACE": "all", # Debug logging for WebRTC
To remove an environment variable, remove it from the `viam_server_env` object and save your configuration.
246
+
211
247
### Reduce startup time
212
248
213
249
You can set `wait_for_update_check` to `false` to bypass `viam-agent` waiting for a network connection to be established and checking for updates during initial startup.
0 commit comments