Disable wi-fi in balenOS

Hi, I set up a device that is powered over ethernet but not connected to wired network, instead I configured it to connect to Wi-Fi as it was going to be a big job to run a network cable for it.

The device is outside and the Wi-Fi turned out to be unreliable as a result, so I have now installed the network cable and it is connected to wired ethernet. I have removed the device’s access to the Wi-Fi network and as a result it is broadcasting the BalenaWiFi SSID to aid connecting to a new network.

The problem with this device is it is in a sealed box mounted at the top of a tower and I can’t easily get to the device physically so I am not able to re-flash balenaOS with the Wi-Fi disabled. Is there any way I can remotely disable the Wi-Fi on this device so that it does not try to connect to the Wi-Fi network and then end up broadcasting the BalenaWiFi?

Thanks

The first step is understanding where that “BalenaWiFi” SSID is coming from. I bet it’s managed by a service, not the underlying BalenaOS.

Googling around, is it this?: GitHub - balena-os/wifi-connect: Easy WiFi setup for Linux devices from your mobile phone or laptop

Can you remove the service entirely (e.g. from docker-compose) and push an update to the device?

Hi, my apologies, I should have been more clear.

I am running this: GitHub - ketilmo/balena-ads-b: ADS-B Flight Tracker running on balena with support for FlightAware, Flightradar24, PlaneFinder, OpenSky Network, RadarBox, ADSB Exchange, Wingbits, and UAT.
it’s basically a suite of packages for receiving ADS-B data from aircraft and sending it to a bunch of flight tracking websites. I did not develop this app, I simply found it on github and used the “Deploy with Balena” button. I am not an expert with Balena (I have some experience with docker compose e.g. pulling, running containers etc but not developing stuff for Balena).

It includes a container called wifi-connect which basically if your device is configured for connection to a Wi-Fi network and it fails to connect after a certain amount of time, it starts up a hotspot called BalenaWiFi to which you can connect and then input details of a different Wi-Fi network to connect to. Once you hit connect it will stop the hotspot and connect to the network you have configured.

Ah, okay, so you’re a user of the ads-b application, not something you’re developing yourself. I think you’ll need to take it up with the maintainers of the app. But based on the readme I wouldn’t be too hopeful:

Please note: Due to how these services are integrated, it’s not currently possible to disable the wifi-connect and kiosk services.

Hi yes that’s correct, I also saw that text in the readme. That’s why I wondered if there was a way to disable wi-fi in the host OS.

THanks

Hi @superdave,

I’m the maintainer of balena-ads-b. Thanks for reaching out. A user with the same problem raised a ticket here: Disable wifi-connect service · Issue #119 · ketilmo/balena-ads-b · GitHub

Follow this ticket for updates regarding this question, or reach out directly if you have questions.

Happy flight feeding! :blush:

@superdave you can run this command on Host OS terminal to turn of wifi
nmcli radio wifi off

Thanks for sharing, @mani13jha!

Will this change be persisted through reboots?

@Ketil yes it will be persisted through reboots. I have tried this command myself. For turning on the wifi this is the command
nmcli radio wifi on

Awesome, thanks @mani13jha!

I will add your info to the issue mentioned above.

I also found this solution that should work for Raspberry Pis:

  1. Head into the balena dashboard, navigate to the desired fleet, and finally to the device you want to turn off WiFi.
  2. In the menu on the left side of the screen, click “Device Configuration.”
  3. Locate the setting “Define DT overlays” in the list.
  4. Add the following value to the setting, in straight quotes: “disable-wifi”. If there already is a value in this field, you should separate the old and new values using a comma, e.g., “vc4-kms-v3d”,“disable-wifi”
  5. Click the “Apply all changes”-button. The device should reboot and come up with the WiFi completely disabled.