How can I use / install the Realtek RTL8821CU wifi USB dongle on Home Assistant OS?

Hello,

I’ve purchased an Odroid N2+, as recommended on the home assistant website. I’ve decided to also buy the WiFi module from hardkernel, which seemed to be the recommended fit for the odroid N2+. It uses the Realtek RTL8821CU chip. However, this dongle is not recognized by the Home Assistant OS. What I tried :

  • plugging the dongle into an USB port ; 2 events are recorded :
22-04-26 23:56:15 INFO (MainThread) [supervisor.hardware.monitor] Detecting HardwareAction.ADD hardware /dev/bus/usb/001/006 - None
22-04-26 23:56:16 INFO (MainThread) [supervisor.hardware.monitor] Detecting HardwareAction.ADD hardware /dev/bsg/0:0:0:0 - None
  • using the following commands in the CLI on home assistant :
    login
    nmcli radio
    , which informed me that WIFI-HW is ENABLED, WIFI is ENABLED, WWAN-HW is ENABLED, WWAN is ENABLED
    nmcli device wifi rescan
    , which told me the following : Error : No Wi-Fi device found.
    nmcli device wifi
    , which told me nothing.

Does anyone have an idea on how to get this dongle to work ?
Thanks in advance

I’m in the same boat.

It seems to me that the kernel drivers are not installed, so the radio can’t be used. Home Assistant OS is also a super minimal distribution without a package manager (like apt) or a toolchain on it, so we can’t install or compile the kernel module on the device as well.

Therefore I think there are two solutions:

  1. Build your own HomeAssistant OS image with the RTL8821CU driver module included. It seems that some other wifi/bluetooth module drivers are already included so maybe this could be merged upstream at some point.
  2. Switch to Home Assistant Supervised:
    following these instructions. By installing Debian or Ubuntu as a base, it should be relatively straightforward to get the driver via apt. The downside is that now all the hardware configuration and supervisor setup is on you.

I think I’m going to investigate #1 right now, it’s more effort now but with some luck it doesn’t mean maintaining my local OS for the rest of my life :wink:

So the first piece of the puzzle is here:
when the dongle is connected, it first shows up as a CD-ROM with the (windows) driver on it. By running usb_modeswitch -KW -v 0bda -p 1a2b it can be put into operating mode and then immediately starts working as a bluetooth dongle on Home Assitant OS, but WIFI still doesn’t work.

Next clue: Hardkernel have breaktrus rtl8821cu driver in their linux kernel tree. Not sure if they made any changes.

However I downloaded their ubuntu-18.04.4-4.9-minimal-odroid-n2-20200229.img image, and I can’t find the driver in there:

find lib/modules/4.9.213-67/kernel/  |grep rtl
lib/modules/4.9.213-67/kernel/drivers/staging/rtl8712
lib/modules/4.9.213-67/kernel/drivers/staging/rtl8712/r8712u.ko
lib/modules/4.9.213-67/kernel/drivers/bluetooth/btrtl.ko
lib/modules/4.9.213-67/kernel/drivers/media/usb/dvb-usb-v2/dvb-usb-rtl28xxu.ko
lib/modules/4.9.213-67/kernel/drivers/media/dvb-frontends/rtl2832_sdr.ko
lib/modules/4.9.213-67/kernel/drivers/media/dvb-frontends/rtl2832.ko
lib/modules/4.9.213-67/kernel/drivers/media/dvb-frontends/rtl2830.ko
lib/modules/4.9.213-67/kernel/drivers/net/wireless/realtek/rtl818x
lib/modules/4.9.213-67/kernel/drivers/net/wireless/realtek/rtl818x/rtl8187
lib/modules/4.9.213-67/kernel/drivers/net/wireless/realtek/rtl818x/rtl8187/rtl8187.ko
lib/modules/4.9.213-67/kernel/drivers/net/wireless/rtl8812au
lib/modules/4.9.213-67/kernel/drivers/net/wireless/rtl8812au/rtl8812au.ko
lib/modules/4.9.213-67/kernel/drivers/net/wireless/rtl8188eu
lib/modules/4.9.213-67/kernel/drivers/net/wireless/rtl8188eu/8188eu.ko
lib/modules/4.9.213-67/kernel/drivers/net/wireless/rtl8192cu
lib/modules/4.9.213-67/kernel/drivers/net/wireless/rtl8192cu/8192cu.ko
lib/modules/4.9.213-67/kernel/drivers/net/usb/rtl8150.ko

EDIT: I managed to build and install the driver in a custom hassos image, a PR can be found here:

There appears to be a bug in the buildroot usb_modeswitch package that prevents it from functioning as expected (it should do the modeswitch automatically). I’ll try to bring that up upstream as well.

1 Like

Hi,

I’m trying to use the Odroid 5BK wifi/bluetooth module on a Home Assistant Blue but it seems to be not recognised.
I see this in Supervisor log when I connect the dongle:

In network settings it does not show up as new network adapter.

Can you advise how to get this dongle working on the HA Blue?

I found this description on Hardkernel’s product page:

“Only one minor difference from the previous 5B model is that doesn’t have a CD-ROM mode. So, we can skip the usb-modeswitch tweak.”

Can it be the reason why the 5BK version is not recognised?