Update mentions of viam-provisioning.json to viam-defaults.json#4110
Update mentions of viam-provisioning.json to viam-defaults.json#4110
Conversation
This was part of the recent config migration for the agent. I missed it when we updated the docs.
✅ Deploy Preview for viam-docs ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
There was a problem hiding this comment.
This isn't sufficient for the changes involved. viam-defaults.json uses the new syntax and field names, including sections, identical to the agent section of the cloud config (though version_control section is ignored and shouldn't be included since that can only affect cloud-side App behavior.)
Meanwhile, the old viam-provisioning.json uses the OLD field names, and only a subset of them, mostly from what is now the network_configuration section.
So simply renaming the file in the docs will break things (putting the new format in the old file name/location.)
EDIT: Also, for the preinstall.sh usage, that script itself needs to be updated. Ticketed here: https://viam.atlassian.net/browse/APP-7902
3cfbaae to
b152c5b
Compare
|
@Otterverse good catch updated both docs here and the preinstall script |
|
Ok, so we'll have to continue documenting both for the time being I think. @ale7714 I can take over on that front and finish this next week if you want |
|
I think that the PR to update the preinstall script is merged viamrobotics/agent#86. This can also be merged. |
|
If I understand James correctly @ale7714 we may need to keep the docs for the old way as well |
|
@Otterverse does dd62b4a address your feedback? |
Otterverse
left a comment
There was a problem hiding this comment.
@npentrel Sorry I didn't get to this yesterday when I first got back. Still some fixes needed IMHO.
| "hotspot_prefix": "<PREFIX>", # machine creates a hotspot during setup | ||
| "disable_captive_portal_redirect": false, # set to true if using a mobile app | ||
| "hotspot_password": "<PASSWORD>", # password for the hotspot | ||
| "networks" : [] |
There was a problem hiding this comment.
The networks section isn't part of network_configuration.
| "user_idle_minutes": "2m30s", | ||
| "retry_connection_timeout_minutes": "15m", | ||
| "turn_on_hotspot_if_wifi_has_no_internet": true, | ||
| "networks": [ |
There was a problem hiding this comment.
There's no "networks" in network_configuration. There's a separate section for "additional_networks" and the format is now an object, not an array. Again, may be easier to just point to the main configuration page, as viam-defaults.json basically takes the exact same layout/format as the cloud config.
| | -------- | ----------- | | ||
| | `VIAM_JSON_PATH` | The path to the machine credentials <FILE>viam.json</FILE> file to be copied to the machine. The script will also prompt you for this file if not provided. | | ||
| | `PROVISIONING_PATH` | The path to the <FILE>viam-provisioning.json</FILE> file. The script will also prompt you for this file if not provided. | | ||
| | `PROVISIONING_PATH` | The path to the <FILE>viam-defaults.json</FILE> file. The script will also prompt you for this file if not provided. | |
There was a problem hiding this comment.
This is called "DEFAULTS_PATH" now I believe, though I'm not sure if the changes to preinstall.sh with the new path were published publicly yet.
| "offline_before_starting_hotspot_minutes": "3m30s", | ||
| "user_idle_minutes": "2m30s", | ||
| "retry_connection_timeout_minutes": "15m", | ||
| "turn_on_hotspot_if_wifi_has_no_internet": true, |
There was a problem hiding this comment.
This is mentioned as being "required" for additional_networks to work in lots of text body above/around this. That's not the case. It changes behavior, but it's not required.
Also, that other text should (most likely) be removed. We should really discourage people from adding additional_networks in the defaults file.
There was a problem hiding this comment.
There are a lot of references to agent-provisioning which is no longer an actual thing. There is the Agent, which has a provisioning functionality, but no longer any seperate subsystem called "agent-provisioning."
| 1. When you power on the machine that has `viam-agent` installed and `agent-provisioning` configured, `viam-agent` creates a WiFi hotspot. | ||
|
|
||
| - The [`agent-provisioning` configuration](/manage/fleet/provision/setup/#configure-agent-provisioning) is at <file>/etc/viam-provisioning.json</file> on your machine. | ||
| - The [`agent-provisioning` configuration](/manage/fleet/provision/setup/#configure-agent-provisioning) is at <file>/etc/viam-defaults.json</file> on your machine. |
There was a problem hiding this comment.
This isn't just the "agent-provisioning" config. As noted above, there is no longer anything specifically called "agent-provisioning." The defaults file is also not JUST for provisioning. It can be used to set ANY configuration value for agent to a preferred/custom default. Not sure if documentation explaining that belongs on this page or elsewhere though.
| {{% changelog color="changed" title="Viam provisioning filename" date="2025-03-24" %}} | ||
|
|
||
| When provisioning devices, the configuration file for provisioning is now called <FILE>viam-defaults.json</FILE> and uses different syntax and field names. The old <FILE>viam-provisioning.json</FILE> is still required for older versions of `viam-agent`. |
There was a problem hiding this comment.
I'm not certain exactly how this should be phrased, but this isn't JUST a filename change. The new viam-defaults.json file allows setting ANY agent config values to customized defaults. So while it should now be used instead of the old, more limited viam-provisioning.json, it's not just a direct replacement.
|
I'm gonna close this for now, my plate is pretty full. I was hoping we could fina more minimal change that would get people to stop using provisioning.json but it sounds like we maybe need a more complete update. |
|
Hey @ale7714 that's fine - I'm going to make the changes James suggested on this branch and see how far I get. You don't need to work on this further! |
d8b3b36 to
1a8909f
Compare
| {{< alert title="Important" color="note" >}} | ||
| You must enable `turn_on_hotspot_if_wifi_has_no_internet` in the [`agent-provisioning` configuration](/manage/fleet/provision/setup/#configure-agent-provisioning) of the machine to allow the machine to connect to the specified networks after provisioning. | ||
| {{< /alert >}} |
There was a problem hiding this comment.
@Otterverse can you just reconfirm that the note about turn_on_hotspot_if_wifi_has_no_internet can be removed? I was under the impression this was crucial
There was a problem hiding this comment.
It's not required, but it changes the criteria for a connection being "good enough." If the ONLY connection that works is an additional network, and it provides full internet, then it'll work without the setting. But if the "primary" network is available, (but doesn't provide internet) then it'll prefer that one, and consider it "good enough" even without internet. So it won't "try all networks until it gets internet" in that situation.
| "retry_connection_timeout_minutes": "15m", | ||
| "turn_on_hotspot_if_wifi_has_no_internet": true | ||
| }, | ||
| "additional_networks": [ |
There was a problem hiding this comment.
Additional_networks is an object, not an array. Networks have to have a field name/label. I can't make the actual suggested change as the lines below aren't part of the diff, but it looks something like:
"additional_networks": {
"testNet": {
"priority": 30,
"psk": "myFirstPassword",
"ssid": "otherNetworkOne",
"type": "wifi"
}
}
| | -------- | ----------- | | ||
| | `VIAM_JSON_PATH` | The path to the machine credentials <FILE>viam.json</FILE> file to be copied to the machine. The script will also prompt you for this file if not provided. | | ||
| | `PROVISIONING_PATH` | The path to the <FILE>viam-provisioning.json</FILE> file. The script will also prompt you for this file if not provided. | | ||
| | `DEFAULTS_PATH ` | The path to the <FILE>viam-defaults.json</FILE> file. The script will also prompt you for this file if not provided. | |
There was a problem hiding this comment.
As I was worried about before, the version of the preinstall script with this change made wasn't yet uploaded. I've uploaded it now, so we should be good.
Co-authored-by: James Otting <james@viam.com>
Otterverse
left a comment
There was a problem hiding this comment.
Thanks for the extra fixes here. LGTM!
|
🔎💬 Inkeep AI search and chat service is syncing content for source 'Viam Docs (https://docs.viam.com)' |
|
Thank you for picking this up Naomi 🙏 |

This was part of the recent config migration for the agent. I missed it when we updated the docs.