Skip to content

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

promptless[bot]
Copy link
Contributor

@promptless promptless bot commented Jun 2, 2025

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.

Copy link

netlify bot commented Jun 2, 2025

Deploy Preview for viam-docs ready!

Name Link
🔨 Latest commit 579f7fa
🔍 Latest deploy log https://app.netlify.com/projects/viam-docs/deploys/688887cdbc39190008e552cb
😎 Deploy Preview https://deploy-preview-4372--viam-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 50 (🔴 down 3 from production)
Accessibility: 100 (no change from production)
Best Practices: 100 (no change from production)
SEO: 92 (no change from production)
PWA: 70 (no change from production)
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify project configuration.

@viambot
Copy link
Member

viambot commented Jun 2, 2025

👋 Thanks for contributing! A reviewer will look at it on the next working day!

Copy link
Contributor Author

promptless bot commented Jun 2, 2025

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.)

@npentrel npentrel force-pushed the docs-update-e68716ac-6be7-45c4-a6cf-67c928da318a-20250602-115258 branch 2 times, most recently from 92d5028 to d7c4135 Compare June 2, 2025 15:54
@npentrel npentrel changed the title docs: Add comprehensive Bluetooth provisioning documentation for viam-agent DOCS-3498: Add comprehensive Bluetooth provisioning documentation for viam-agent Jun 2, 2025
@npentrel npentrel changed the title DOCS-3498: Add comprehensive Bluetooth provisioning documentation for viam-agent DOCS-3498: Add Bluetooth provisioning docs for viam-agent Jun 2, 2025
@@ -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>.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

moved further below

@npentrel npentrel force-pushed the docs-update-e68716ac-6be7-45c4-a6cf-67c928da318a-20250602-115258 branch 2 times, most recently from ed4f6a1 to 70564c6 Compare June 2, 2025 16:19
@npentrel npentrel marked this pull request as draft June 12, 2025 20:01
@npentrel npentrel force-pushed the docs-update-e68716ac-6be7-45c4-a6cf-67c928da318a-20250602-115258 branch from 70564c6 to 7befc24 Compare July 28, 2025 12:25
@viambot
Copy link
Member

viambot commented Jul 28, 2025

It looks like the following files may have been renamed. Please ensure you set all needed aliases:
rename docs/data-ai/{train => ai/advanced}/_index.md (37%) rename docs/data-ai/{train => ai/advanced}/upload-external-data.md (91%) rename docs/data-ai/{train => ai}/train-tflite.md (84%) rename docs/data-ai/{train => ai}/train.md (97%) rename docs/operate/get-started/other-hardware/{create-module => }/dependencies.md (82%) rename docs/operate/get-started/other-hardware/{create-module => }/hello-world-module.md (96%) rename docs/operate/{get-started/other-hardware => reference}/module-configuration.md (74%) rename docs/operate/{get-started/other-hardware => reference}/naming-modules.md (69%) rename docs/operate/{mobility => reference}/orientation-vector.md (97%)

@npentrel npentrel force-pushed the docs-update-e68716ac-6be7-45c4-a6cf-67c928da318a-20250602-115258 branch from 7befc24 to 61b7005 Compare July 28, 2025 12:38
@npentrel npentrel force-pushed the docs-update-e68716ac-6be7-45c4-a6cf-67c928da318a-20250602-115258 branch from 61b7005 to 44c5986 Compare July 28, 2025 12:50
@npentrel npentrel marked this pull request as ready for review July 28, 2025 13:31
| `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`. |
Copy link
Collaborator

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?

Copy link
Member

@ale7714 ale7714 Jul 28, 2025

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

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
| `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.
Copy link
Member

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.
Copy link
Member

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?

| `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`. |
Copy link
Member

@ale7714 ale7714 Jul 28, 2025

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.
Copy link
Member

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

Copy link
Collaborator

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

Comment on lines +142 to +150
## 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.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested 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.
## 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.

Copy link
Member

@Otterverse Otterverse left a 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.

Once you are connected to your machine's WiFi hotspot return to the Viam mobile app.
Return to the Viam mobile app once connected

You may need to wait a short time for your machine to boot and start its provisioning services.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't this basically duplicating the instructions in line 62 above?

Comment on lines +146 to +147
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.
Copy link
Member

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.
Copy link
Member

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?)


If you're having trouble with Bluetooth provisioning:

1. Verify the device supports Bluetooth Low Energy (BLE)
Copy link
Member

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.


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).
Copy link
Member

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.

| `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>.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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>.

Comment on lines +499 to +500
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.
Copy link
Member

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.


### Bluetooth provisioning not working

If Bluetooth provisioning is not working, check the following:
Copy link
Member

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`. |
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
| `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.

| `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`. |
| `fragment_id` | string | Optional | The `fragment_id` of the fragment to configure machines with. Required when using Bluetooth or the Viam mobile app for provisioning. The Viam mobile app uses the fragment to configure the machine. |
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should check with the mobile team on this. AFAIK, this CAN be used by a mobile app, but current implementations aren't using it.

It is definitely in no way bluetooth specific though, so not sure why or where that idea came from.

Suggested change
| `fragment_id` | string | Optional | The `fragment_id` of the fragment to configure machines with. Required when using Bluetooth or the Viam mobile app for provisioning. The Viam mobile app uses the fragment to configure the machine. |
| `fragment_id` | string | Optional | The `fragment_id` of the fragment to configure machines with. Can be used by a mobile app (during provisioning) to automatically configure a newly created machine. |

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants