-
Notifications
You must be signed in to change notification settings - Fork 48
DOCS-3498: Add Bluetooth provisioning docs for viam-agent #4372
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DOCS-3498: Add Bluetooth provisioning docs for viam-agent #4372
Conversation
✅ Deploy Preview for viam-docs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
👋 Thanks for contributing! A reviewer will look at it on the next working day! |
Just a reminder: If you'd like me to act on any feedback you have via Github comments, just type @Promptless in your suggestion and I'll get right on it! (I won't show up in the user dropdown, but I'll process any request that has @Promptless in the comment body.) |
92d5028
to
d7c4135
Compare
@@ -74,100 +77,10 @@ If you do not yet have a fragment, follow the steps to [Create a configuration f | |||
If you are not using Flutter or TypeScript and would like to use provisioning, please [contact us](mailto:[email protected]). | |||
{{< /alert >}} | |||
|
|||
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>. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
moved further below
ed4f6a1
to
70564c6
Compare
70564c6
to
7befc24
Compare
It looks like the following files may have been renamed. Please ensure you set all needed aliases: |
7befc24
to
61b7005
Compare
61b7005
to
44c5986
Compare
| `disable_captive_portal_redirect` | boolean | Optional | By default, ALL DNS lookups using the provisioning hotspot will redirect to the device. This causes most phones/mobile devices to automatically redirect the user to the captive portal as a "sign in" screen. When disabled, only domains ending in .setup (ex: viam.setup) will be redirected. This generally avoids displaying the portal to users and is mainly used in conjunction with a mobile provisioning application workflow. Default: `false`. | | ||
| `fragment_id` | string | Optional | The `fragment_id` of the fragment to configure machines with. Required when using the Viam mobile app for provisioning. The Viam mobile app uses the fragment to configure the machine. | | ||
| `disable_wifi_provisioning` | boolean | Optional | When set to true, disables WiFi hotspot provisioning. The machine will not create a WiFi hotspot for provisioning. Both WiFi hotspot and Bluetooth provisioning can be enabled simultaneously. Default: `false`. | | ||
| `bluetooth_trust_all` | boolean | Optional | When true, the machine accepts all Bluetooth pairing requests for sharing the internet from a mobile device (tethering) without requiring devices to be added during provisioning first. Default: `false`. | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Otterverse Is this an accurate description? Is there a succinct reason why someone would want to do this? Aside from not having to go through the trust dialogue once? I suppose rather - is this because the trust dialogue would happen on the machine that is being provisioned which may have no screen so adding this here means headless provisioning will work?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
may have no screen so adding this here means headless provisioning will work?
i believe this is accurate
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| `bluetooth_trust_all` | boolean | Optional | When true, the machine accepts all Bluetooth pairing requests for sharing the internet from a mobile device (tethering) without requiring devices to be added during provisioning first. Default: `false`. | | |
| `bluetooth_trust_all` | boolean | Optional | Set to true to accept all Bluetooth pairing requests (which is only needed for bluetooth tethering) without requiring an unlock command from a mobile app. Default: `false`. | |
Suggestion is the same as comment in the json template earlier in this file.
|
||
The [Flutter Provisioning package](https://github.com/viamrobotics/viam_flutter_provisioning/) shows an example for Bluetooth provisioning. | ||
|
||
When developing your own application, if you support both Bluetooth and WiFi Hotspot provisioning, make the app choose the best available method. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This makes it sounds like the app should automatically figure out which method to use which this should be a decision made by the developer
|
||
1. Verify the device supports Bluetooth Low Energy (BLE) | ||
|
||
1. **Check Bluetooth permissions**: Ensure the Viam mobile app has Bluetooth permissions enabled on your device. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are the specific permissions document it in the flutter package?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not really. https://github.com/viamrobotics/viam_flutter_provisioning/?tab=readme-ov-file#usage
How to check and which permissions are needed will vary I expect. I also expect an app developer to know/google to do that. @kevin49999 would you be able to tell us more here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep in that package^ it's more rudimentary and the example project ends up handling permissions.
In this package: https://github.com/viamrobotics/viam_flutter_bluetooth_provisioning_widget with the end-to-end provisioning flow setup for anyone who adds it to the app, permission asking is all handled by the package (and there are a few location permissions we require on android, so we can get the name of your machine).
I have really been putting off the README for that "widget" package way too long^ but I think it's definitely a better repo to direct people who are interested in using bluetooth provisioning with Viam. The viam_flutter_provisioning
example would be much much harder to get a device online with (though still possible).
I will do this today or tomorrow: https://viam.atlassian.net/browse/APP-8457. It will explain the "usage description" plist strings you need on iOS to ask for permission, and the updates to the Android manifest files you need / permissions you need related to location and bluetooth in your app.


this will be a lot easier to write with my README done in the much more expansive and user friendly bluetooth provisioning widget/flow package so my apologies for not finishing writing that sooner @npentrel
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| `disable_captive_portal_redirect` | boolean | Optional | By default, ALL DNS lookups using the provisioning hotspot will redirect to the device. This causes most phones/mobile devices to automatically redirect the user to the captive portal as a "sign in" screen. When disabled, only domains ending in .setup (ex: viam.setup) will be redirected. This generally avoids displaying the portal to users and is mainly used in conjunction with a mobile provisioning application workflow. Default: `false`. | | ||
| `fragment_id` | string | Optional | The `fragment_id` of the fragment to configure machines with. Required when using the Viam mobile app for provisioning. The Viam mobile app uses the fragment to configure the machine. | | ||
| `disable_wifi_provisioning` | boolean | Optional | When set to true, disables WiFi hotspot provisioning. The machine will not create a WiFi hotspot for provisioning. Both WiFi hotspot and Bluetooth provisioning can be enabled simultaneously. Default: `false`. | | ||
| `bluetooth_trust_all` | boolean | Optional | When true, the machine accepts all Bluetooth pairing requests for sharing the internet from a mobile device (tethering) without requiring devices to be added during provisioning first. Default: `false`. | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
may have no screen so adding this here means headless provisioning will work?
i believe this is accurate
We recommend using Bluetooth by default for a smoother setup experience. | ||
|
||
The Flutter Provisioning package supports bluetooth tethering, that is sharing your mobile devices's internet connection with the machine that will be provisioned. | ||
Bluetooth tethering is slow and we recommend you use WiFi where possible. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure why we mention BT tethering here. It's not intricately related to provisioning. Is so the user discovers BT tethering? I guess my concern would be that if someone is confused about provisoning maybe this will add more confusion
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think what I should probably do is list the permissions of the provisioning package. I'll make that change
## Set up your machine using a custom Flutter app | ||
|
||
The [Flutter Provisioning package](https://github.com/viamrobotics/viam_flutter_provisioning/) shows an example for Bluetooth provisioning. | ||
|
||
When developing your own application, if you support both Bluetooth and WiFi Hotspot provisioning and both are available, we recommend using Bluetooth by default for a smoother setup experience. | ||
We recommend using Bluetooth by default for a smoother setup experience. | ||
|
||
The Flutter Provisioning package supports bluetooth tethering, that is sharing your mobile devices's internet connection with the machine that will be provisioned. | ||
Bluetooth tethering is slow and we recommend you use WiFi where possible. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
## Set up your machine using a custom Flutter app | |
The [Flutter Provisioning package](https://github.com/viamrobotics/viam_flutter_provisioning/) shows an example for Bluetooth provisioning. | |
When developing your own application, if you support both Bluetooth and WiFi Hotspot provisioning and both are available, we recommend using Bluetooth by default for a smoother setup experience. | |
We recommend using Bluetooth by default for a smoother setup experience. | |
The Flutter Provisioning package supports bluetooth tethering, that is sharing your mobile devices's internet connection with the machine that will be provisioned. | |
Bluetooth tethering is slow and we recommend you use WiFi where possible. | |
## Set up your machine using a custom Flutter app | |
The [Flutter Provisioning package](https://github.com/viamrobotics/viam_flutter_provisioning/) shows an example for Bluetooth provisioning. | |
Features: | |
- **Bluetooth provisioning**: We recommend using Bluetooth over WiFi hotspot provisioning for a smoother setup experience. | |
- **WiFi Hotspot provisioning** | |
- **Bluetooth tethering**: Bluetooth tethering (sharing your mobile devices's internet connection with the machine that will be provisioned) is slow and we recommend you use WiFi where possible. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry there are so many notes, also apologies in advance if any sound too terse. Feel free to poke me with follow-up questions.
When developing your own application, if you support both Bluetooth and WiFi Hotspot provisioning and both are available, we recommend using Bluetooth by default for a smoother setup experience. | ||
We recommend using Bluetooth by default for a smoother setup experience. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Duplicated text on the second line.
|
||
### App Development Considerations | ||
|
||
When developing mobile apps with Bluetooth provisioning, ensure your app requests appropriate Bluetooth permissions. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should explicitly say what permissions these are or maybe link to that elsewhere (is it mentioned in the readme/docs for the flutter repo?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes - in face I will jsut remove this here
|
||
If you're having trouble with Bluetooth provisioning: | ||
|
||
1. Verify the device supports Bluetooth Low Energy (BLE) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the actual action a user should take here?
I'm not asking that rhetorically... I don't have a full answer to this myself, as it's complicated, and we've really only tested on a few devices. But it feels wrong to tell people "verify this is supported" when we're the ones that should be saying what is or is not supported.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
data sheet? I'll point there - really not much I can say beyond that I think
|
||
1. **Verify Bluetooth is enabled**: Make sure Bluetooth is turned on in your mobile device settings. | ||
|
||
1. **Check device compatibility**: Ensure your mobile device supports Bluetooth Low Energy (BLE). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar to above comment. Exactly how/what is a user supposed to check here?
Two other issues.
First, this says "check device compatibility" but a couple lines up we have "verify the device supports BLE". That feels very confusing to me. I think terminology needs to much more clearly separate "mobile phone (device)" and "smart machine (device)"
Lastly, this COULD probably just be removed entirely. The installation of the mobile app itself should be able to report when it cannot work because of missing hardware... and I don't think there's any phone from the past 10 years that doesn't have BLE, so this would only apply to some weird, one-off android devices (like a kiosk or something) at best.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sounds good will do
docs/manage/fleet/provision/setup.md
Outdated
| `priority` | int | Priority to choose the network with. Values between -999 and 999. Default: `0`. | | ||
|
||
{{% /tablestep %}} | ||
{{< /table >}} | ||
|
||
## (Optional) Create a machine in advance | ||
|
||
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>. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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>. | |
If you provision devices using a captive web portal (instead of a mobile app), you'll need to create a machine in advance and provide its machine cloud credentials in the portal. Alternately, you may directly write them to the file <FILE>/etc/viam.json</FILE>. |
docs/manage/fleet/provision/setup.md
Outdated
WiFi provisioning may be less reliable in environments with many WiFi networks. | ||
If possible, use Bluetooth provisioning or move to an area with fewer WiFi networks in range. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bluetooth is just as likely to have interference from nearby sources as wifi is, so I don't think this suggestion is useful. Have we actually seen cases of this? If not, I'm wondering where this advice came from.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we had something like this elsewhere as a recommendation but I don't know that it is based on something. will remove
docs/manage/fleet/provision/setup.md
Outdated
|
||
### Bluetooth provisioning not working | ||
|
||
If Bluetooth provisioning is not working, check the following: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't this section duplicating the same info that is in end-user-setup.md? Feels like one of these troubleshooting sections should just link to the other, rather than be duplicated.
Also, the same comments I had on the other apply here is well.
| `disable_captive_portal_redirect` | boolean | Optional | By default, ALL DNS lookups using the provisioning hotspot will redirect to the device. This causes most phones/mobile devices to automatically redirect the user to the captive portal as a "sign in" screen. When disabled, only domains ending in .setup (ex: viam.setup) will be redirected. This generally avoids displaying the portal to users and is mainly used in conjunction with a mobile provisioning application workflow. Default: `false`. | | ||
| `fragment_id` | string | Optional | The `fragment_id` of the fragment to configure machines with. Required when using the Viam mobile app for provisioning. The Viam mobile app uses the fragment to configure the machine. | | ||
| `disable_wifi_provisioning` | boolean | Optional | When set to true, disables WiFi hotspot provisioning. The machine will not create a WiFi hotspot for provisioning. Both WiFi hotspot and Bluetooth provisioning can be enabled simultaneously. Default: `false`. | | ||
| `bluetooth_trust_all` | boolean | Optional | When true, the machine accepts all Bluetooth pairing requests for sharing the internet from a mobile device (tethering) without requiring devices to be added during provisioning first. Default: `false`. | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| `bluetooth_trust_all` | boolean | Optional | When true, the machine accepts all Bluetooth pairing requests for sharing the internet from a mobile device (tethering) without requiring devices to be added during provisioning first. Default: `false`. | | |
| `bluetooth_trust_all` | boolean | Optional | Set to true to accept all Bluetooth pairing requests (which is only needed for bluetooth tethering) without requiring an unlock command from a mobile app. Default: `false`. | |
Suggestion is the same as comment in the json template earlier in this file.
@@ -135,6 +138,53 @@ Note that any features that require internet access will not function if the con | |||
{{% /tablestep %}} | |||
{{< /table >}} | |||
|
|||
## Set up your machine using a custom Flutter app | |||
|
|||
When developing your own application, if you support both Bluetooth and WiFi Hotspot provisioning and both are available, we recommend using Bluetooth by default for a smoother setup experience. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am correct in assuming that you can use bluetooth without bluetooth tethering... right? So Bluetooth with the machine having a wifi connection is preferred, then wifi, then bluetooth tethering?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did just run the app and it looks like the options are to write network config or to write robot part config, so I assume the latter is the tethering option?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for confusion, this package has the tethering support but no readme yet: https://github.com/viamrobotics/viam_flutter_bluetooth_provisioning_widget/blob/main/lib/src/flow/bluetooth_tethering_flow.dart
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And to answer the original question: You can use bluetooth for provisioning (without tethering), and still use wifi for connectivity. But if you want to use BT tethering, you must do the provisioning via BT as well.
b5eae3f
to
3a649fd
Compare
| Provisioning method | Description | Notes | Package | | ||
| ------------------- | ----------- | ----- | ------- | | ||
| **Bluetooth with WiFi** | Ask the user to connect to the machine over Bluetooth. The user then provides network credentials for an internet-connected WiFi network, through which machine setup can then occur. | Recommended, if available. | [Example](https://github.com/viamrobotics/viam_flutter_provisioning/) | | ||
| **WiFi** | Ask the user to connect to the machine's temporary WiFi network. The user then provides network credentials for an internet-connected WiFi network, through which machine setup can then occur. | Slower than Bluetooth with WiFi but faster than Bluetooth tethering. | TODO | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kevin49999 do you mind taking another look here:
- Is this table covering this correctly?
- Do we have an example for WiFi?
Table is easier to look at here: https://deploy-preview-4372--viam-docs.netlify.app/manage/fleet/provision/end-user-setup/#set-up-your-machine-using-a-custom-flutter-app
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good to me! Tethering is definitely still in development right now, it works on iOS but working through issues on Android - I should make that clear in my README I will go update
Here is the hotspot example: https://github.com/viamrobotics/viam_flutter_hotspot_provisioning_widget/tree/main/example/hotspot_provisioning
@@ -135,6 +138,59 @@ Note that any features that require internet access will not function if the con | |||
{{% /tablestep %}} | |||
{{< /table >}} | |||
|
|||
## Set up your machine using a custom Flutter app | |||
|
|||
If you are building your own app to provide provisioning functionality you have three options for provisioning: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kevin49999 do you mind taking another look here:
Is this table covering this correctly?
Table is easier to look at here: https://deploy-preview-4372--viam-docs.netlify.app/manage/fleet/provision/end-user-setup/#set-up-your-machine-using-a-custom-flutter-app
Going to merge this for now so I can start on more provisioning work. @Otterverse once you're back have another look and ping me if we need to make more changes |
🔎💬 Inkeep AI search and chat service is syncing content for source 'Viam Docs' |
See:
Note: these do not go in detail through the flutter provisioning widget. I think currently providing that is enough but if you think differently let me know.