Disabling built-in Wi-Fi / Bluetooth from Raspberry Pi CM4 on Home Assistant Yellow?

Since no one has answered, I’ll ask an uneducated question: Why?

Hi @stevemann, to avoid interferences. I naively thought the way I worded it made it clear. Sorry.

A question for you: is the expression “educated opinion” somewhat offensive?

Interference with what?

No, “uneducated” just means that I don’t know.

I’m curious to know this as well. I have an external USB Bluetooth adapter I used on my HA Blue and was wondering if disabling BT on my Yellow and using the Bluetooth adapter to put some (6ft) distance between the other radios in the Yellow and the BT module would be beneficial?

You might know this, but for other readers: Zigbee, Thread, “IoT” Wi-Fi and Bluetooth all operate at 2.4GHz. I’ve seen comments from Yellow owners having issues with Zigbee when they have built-in wifi/BT on their CM4. I’ve had myself issues with a Pi 4 and Zigbee. Also the “turnkey” Yellow doesn’t have the radio module and I wonder if it is partly to avoid interferences.

In addition, now that I’ve spent a bit of time playing with the dtoverlays without success, I’d like to know why it doesn’t seem to disable the devices. I want to understand what I’m missing, even if it’s deemed unnecessary to disable the radio module.

From what I understand, yes it’s possibly recommended to have a distance between the built-in Zigbee/Thread radio module, and a Bluetooth dongle.

I haven’t looked in depth, but that’s probably what they don’t have USB 3.0 ports in the Yellow either:
Demo: Zigbee interference caused by USB 3.0

I have the same problem.

I added the dtoverlay=disable-bt and dtoverlay=disable-wifi commands in the config.txt file, but it doesn’t work. The wifi and the bluetooth is still active.

How can I disable wifi and bluetooth in home assistant yellow ?

It is surprising that you cannot do this from the home assistant interface.

Same here… the BT module is throwing all sorts of bizarre errors on my Yellow via the console (UART with PuTTY) and I just want to disable it for the time being and I can’t figure out how.

Hello friends!

Apologies as I figured this out over 2 weeks ago but didn’t have the time to write it down since. Your replies to the thread reminded me to come share my findings.

Note: I did an update of Home Assistant Operating System while typing this stuff down, and I think it deleted the DT Blobs I mention below in step 4. I’ll keep an eye out during the next HassOS update and report back here…


So, I did go and read up a little more on the concept of Device Tree Overlays.
For now, this is how I managed to disable Bluetooth and Wi-Fi:

Disabling built-in Wi-Fi / Bluetooth from Raspberry Pi 4 / CM4 running HassOS

  1. Enable SSH access to the host on port 22222

  2. SSH to the Yellow and check that the devices are up:

ssh [email protected] -p 22222
ip a show wlan0
hcitool dev

You should see something like that:

# ip a show wlan0
3: wlan0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc fq_codel state DOWN group default qlen 1000
link/ether d8:3a:dd:78:5x:xx brd ff:ff:ff:ff:ff:ff
# hcitool dev
Devices:
hci0 D8:3A:DD:78:5X:XX

  1. Add the following 2 lines under the [all] section in the file /mnt/boot/config.txt.
    I personally do it with vi /mnt/boot/config.txt
dtoverlay=disable-wifi
dtoverlay=disable-bt

Note: at the time of writing, there’s already this line in there:

device_tree=bcm2711-rpi-cm4-ha-yellow.dtb

And I’ve also added these 2 lines because I like my Pi 4s to be faster:

over_voltage=6
arm_freq=2000

  1. Here’s the trick: currently HassOS doesn’t have the Device Tree Overlay Blobs necessary to disable these 2 devices. Add them manually with these commands:
cd /mnt/boot/overlays/
curl -L -O https://github.com/raspberrypi/firmware/raw/master/boot/overlays/disable-wifi.dtbo
curl -L -O https://github.com/raspberrypi/firmware/raw/master/boot/overlays/disable-bt.dtbo
  1. Reboot and run the commands from step 2) again:

# ip a show wlan0
Device “wlan0” does not exist.
# hcitool dev
Devices:

Gone! (for now)…

4 Likes

Thank you very much for this @oxyd , I was going nuts since I could not disable bluetooth nor wifi on my new and shiny Pi 5. However, for all that are following your superb steps to disable devices on a Raspberry Pi 5 here’s the thing. They use other Device Tree Overlay Blobs for the Pi 5: https://github.com/raspberrypi/firmware/tree/master/boot/overlays

To disable bluetooth and / or wifi on a Raspberry Pi 5 you’d need to do adjust @oxyd original steps:

  1. Add the following 2 lines under the [all] section in the file /mnt/boot/config.txt.
    I personally do it with vi /mnt/boot/config.txt
dtoverlay=disable-wifi-pi5
dtoverlay=disable-bt-pi5
  1. Here’s the trick: currently HassOS doesn’t have the Device Tree Overlay Blobs necessary to disable these 2 devices. Add them manually with these commands:
cd /mnt/boot/overlays/
curl -L -O https://github.com/raspberrypi/firmware/raw/master/boot/overlays/disable-wifi-pi5.dtbo
curl -L -O https://github.com/raspberrypi/firmware/raw/master/boot/overlays/disable-bt-pi5.dtbo

Alternatively:
Use the “generic” dtoverlay names and rename the blobs

dtoverlay=disable-wifi
dtoverlay=disable-bt
cd /mnt/boot/overlays/
curl -L -O https://github.com/raspberrypi/firmware/raw/master/boot/overlays/disable-wifi-pi5.dtbo
curl -L -O https://github.com/raspberrypi/firmware/raw/master/boot/overlays/disable-bt-pi5.dtbo
mv disable-wifi-pi5.dtbo disable-wifi.dtbo
mv disable-bt-pi5.dtbo disable-bt.dtbo

PS: @oxyd for better understanding I used the exact same wording as you ie copied them, I hope thats ok

2 Likes

You bet!
Very glad my research could help others :smile:

Just want to verify these instructions, because

/mnt/boot/overlays/

doesn’t exist. Am I creating that folder? Also I have to enable UART, is there an additional step for that? I’m trying to get my Raz 7 Pro working, and so far this thread has gotten me further than anything else I have researched

Hi @mckaycr

Just to make sure, since this topic actually is about Pi CM4 on HA Yellow not Pi5, the following did work for me on a Raspberry Pi 5 with Home Assistant OS.

If you want to get the overlay files from github (or elsewhere), then yes you have to create that directory yourself and put the files in there. This is the default lookup location for overlay files.

However, I noticed later that the overlay files in my case have been in

/mnt/boot/slot-A/overlays

but that location is not used nor looked up.
To make use of it, I had to put the following into /mnt/boot/config.txt

...
# Use OS prefix for A/B slot (RAUC)
os_prefix=slot-A/
cmdline=/cmdline.txt
...

I did manage to get my Razberry 7 Pro running on a Pi5 with the following configuration regarding UART in /mnt/boot/config.txt:

...
[all]
dtoverlay=disable-bt-pi5
dtoverlay=disable-wifi-pi5
dtparam=uart0=on
dtparam=uart0           # Enable UART0/ttyAMA0 on GPIO 14 & 15
dtparam=uart0_console   # Enable UART0/ttyAMA0 on GPIO 14 & 15 and make it the console UART

enable_uart=1 is not going to work anymore on a Pi5.

After rebooting you should have

/dev/ttyAMA0
/dev/ttyAMA10

and use ttyAMA0 in your further Z-Wave JS (UI) configuration.

As a side note, theoretically one should be able to use the non-specific version like dtoverlay=disable-bt and the system would tie the relevant flavor if needed. But this did for some reason or an other not work for me. However this would be the official way.

I personally have 2 active 2.4 GHz Wifi networks, a Zigbee network and a Thread network parallel.
All 4 networks are working properly.

Maybe your channels are too close to each other.
There are a lot of frequency charts out there for the different 2.4 GHz channels for Wifi, Zigbee and Thread.

I wouldnt say this has to do with the computing hardware.

@el_migu_el

Was this part also still required?

I ask because after a reboot I see bluetooth still working in HAOS

Actually after looking further

This was already in my config.txt so I just went ahead and downloaded the required files. Bluetooth is still enabled though according to Home Assistant

UPDATE: It works, bluetooth shows enabled, but the raz 7 pro works

This might seem like a dumb question but I know the Yellow has the built-in Bluetooth of the Pi, but on the Yellow documentation it also says it comes with Silicon Labs MGM210P Mighty Gecko Module (which according to its own page supports Bluetooth as well). So I’m confused. Does this mean you can use either Bluetooth adapter for the Yellow or only the built-in Pi one?

Thanks

for me the overlay files were all-ready present (running HAOS 12.0 on rpi4) so I only had to enable root SSH and add 2 lines to /mnt/boot/config.txt

pi5 files are also present btw:

# ls /mnt/boot/overlays/ | grep disable
disable-bt-pi5.dtbo
disable-bt.dtbo
disable-emmc2.dtbo
disable-wifi-pi5.dtbo
disable-wifi.dtbo

el_migu_el
Could you write in more detail how you did this?.

I created a mnt directory, a boot directory and an overlays directory.
I then created a config.txt file and put the information in it.

[all]
dtoverlay=disable-bt-pi5
dtoverlay=disable-wifi-pi5
dtparam=uart0=on
dtparam=uart0           # Enable UART0/ttyAMA0 on GPIO 14 & 15
dtparam=uart0_console   # Enable UART0/ttyAMA0 on GPIO 14 & 15 and make it the console UART

Uploaded overlay files to directory overlays .

cd /mnt/boot/overlays/
curl -L -O https://github.com/raspberrypi/firmware/raw/master/boot/overlays/disable-wifi-pi5.dtbo
curl -L -O https://github.com/raspberrypi/firmware/raw/master/boot/overlays/disable-bt-pi5.dtbo

But after a reboot, HAOS simply deletes the boot, overlays directory and the config.txt file.
The directory mnt is empty :grimacing:.

Hi @alekslegkih

Sorry for the late response.

This is in the Z-Wave JS > Settings > Z-Wave > Serial Port > drop down where you can choose the serial port. Here you should select

/dev/tty/AMA0

Hope this helps.

For those who came for this solution, I disabled both Wi-Fi and Bluetooth as instructed on my Yellow. But then, after a reboot, my ZHA failed due to missing /dev/tty/AMA1. Maybe disabling BT on CM4 somehow also disables the Gecko Module on the Yellow @xpal. So maybe the best approach for HA Yellow is only disabling the Wifi, which I found decreased the interference to ZHA quite a lot.

2 Likes