Turn off Bluetooth and WiFi on a running device

Hi @devsterp,

balenaOS uses NetworkManager to manage the connection. The documentation explains in detail on how you could manage the connections. If the documentation is not helpful or lacking, your feedback is appreciated.

As detailed in the doc, once you ssh into host OS, you could edit NetworkManager’s configuration to change the connection to be ethernet only (or in other ways). To edit the file:
vi /etc/NetworkManager/system-connections/resin-wifi-01

Before you turn off the wifi connection, make sure you have other ways of accessing the device via a direct physical connection or another networking setup in place (like ethernet conection). Else, you will lose remote access to the device.

Then also use NetworkManager’s nmcli to disable the wifi if you don’t want to persist the configuration:
nmcli radio wifi off

Next, you are right, I don’t see any mention of bluetooth in that documentation. So hcitool dev will output the bluetooth devices and systemctl status bluetooth shows the running bluetooth service. You could turn off the bluetooth via:
systemctl stop bluetooth.service
and disable it:
systemctl disable bluetooth.service

A reboot might be necessary for the disabling. Hope these are helpful.

Cheers…