Change a machine's network | Viam Documentation
Change a machine's network
Change the WiFi network on a machine that has already been provisioned and deployed. There are three approaches depending on your situation.
Option 1: Move to a new WiFi network using provisioning mode
If the machine’s current network is no longer available (for example, you moved the machine to a new facility), force the machine back into provisioning mode:
- Connect to the machine with a shell (if possible):
viam machines part shell --part=<part-id>
- Create a file that forces provisioning mode on next boot:
sudo touch /opt/viam/etc/force_provisioning_mode
Reboot the machine. On boot,
viam-agententers provisioning mode and creates a WiFi hotspot.Follow the end-user device setup instructions to connect the machine to the new network.
If you cannot shell into the machine, power cycle it. If the current network is truly unavailable, viam-agent enters provisioning mode automatically after the configured timeout (retry_connection_timeout_minutes, default 10 minutes).
Option 2: Add a new network while keeping the current one
If the machine is still connected to its current network and you want to add a second network (for example, when moving between locations):
- Add the new network credentials in the machine’s system settings. See configure additional networks.
- Set the
priorityvalue higher than the current network’s priority if you want the machine to prefer the new one. Priority is an integer; higher values win. Default is0. - Save the configuration. The machine picks up the new network on its next config sync.
Option 3: Pre-configure multiple networks during provisioning
If you know the machine will need to connect to multiple networks, add them to the additional_networks section of the viam-defaults.json file before provisioning. See provision additional networks.
Verify the network change
After changing the network:
- In the Viam app, navigate to the fleet dashboard or the machine’s page.
- Confirm the machine shows as Live.
- If the machine does not come back online within a few minutes, it may not have connected to the new network. Power cycle the device to restart provisioning mode.