Failover for wifi connections

Hi Balena community,

what is the recommended way to handle failover for wifi connections and network prioritisation within balena.

I currently have two independent WiFi hotspots using different celular carriers in a remote location with multiple balena device connected to them. Lets suppose 20 devices are in reach of these two connections.

I would like to setup these devices in a way, that half of them (10 devices) will connect to one WiFi access point and the other half to the other one. Only if one wifi connection is not available or the internet connection is not stable, they should connect to the other access point as a fail over.

What is the most balena way to handle the problem?


My current approach would be to handle this manually in the code and set the dbus NetoworkManager settings. But this appears to be a bit hacky. Do you have other ideas on how to solve this?

Hey there, I think using D-Bus to create NetworkManager profiles via your app is the way to go, but you don’t need a ton of special logic to assign a priority to interfaces. By using autoconnect-priority and autoconnect=true on two connections the NetworkManager should be able to handle the rest. Just set 10 of your devices to prefer one interface over the other, maybe based on an environment variable set via the Dashboard?

Here’s another forum link where a user accomplished a similar thing:

1 Like

Thank you @klutchell this appears to be a the way to go. Furthermore the autoconnect=true hint, will probably save me a lot of time.

Let us know how it works out!