Setting up WIFI on a sbc

  • I've got a cheapo sbc off Amazon (Terryza W8 Pro) that I put LE on. Ethernet works but the connections tab of the LE Config addon is otherwise blank.

    The product page for the gizmo seems to suggest that wifi and bluetooth are handled by the same chip. The bluetooth tab allows me to attempt to connect with bluetooth devices but the connection always fails.

    dmesg | grep "Bluetooth" shows:

    [ 7.710636] Bluetooth: Core ver 2.22

    [ 7.710714] Bluetooth: HCI device and connection manager initialized

    [ 7.710726] Bluetooth: HCI socket layer initialized

    [ 7.710733] Bluetooth: L2CAP socket layer initialized

    [ 7.710747] Bluetooth: SCO socket layer initialized

    [ 7.776497] Bluetooth: hci0: RTL: examining hci_ver=08 hci_rev=000c lmp_ver=08 lmp_subver=8821

    [ 7.777476] Bluetooth: hci0: RTL: rom_version status=0 version=1

    [ 7.777483] Bluetooth: hci0: RTL: loading rtl_bt/rtl8821c_fw.bin

    [ 7.809164] Bluetooth: hci0: RTL: loading rtl_bt/rtl8821c_config.bin

    [ 7.809351] Bluetooth: hci0: RTL: cfg_sz 10, total sz 31990

    [ 8.116736] Bluetooth: BNEP (Ethernet Emulation) ver 1.3

    [ 8.116743] Bluetooth: BNEP filters: protocol multicast

    [ 8.116757] Bluetooth: BNEP socket layer initialized

    [ 8.266473] Bluetooth: hci0: RTL: fw version 0x829a7644

    there's no mention of my wifi device when I run lspci so I tried lsusb

    Bus 001 Device 002: ID 0bda:c820 Realtek Semiconductor Corp. 802.11ac NIC

    apparently that's an RTL 8821CU.

    I noticed the a line in the changelog for 10.0.2 that mentions it:

    linux: add udev rule to switch mode on Realtek RTL8821CU devices by @vpeter4 in #6105

    so I'm not sure what the status is for support for the device.

    FWIW that commit shows the product to be 1a2b, not c820 though

    a search on here for "rtl8821cu" shows the most recent post is from Jan of this year, a couple months before the 10.0.2 release.

    when I try to just manually "eject" the device (like that commit seems to do) using "usb_modeswitch -KW -v 0bda -p c820", i get an error

    Error: can't use storage command in MessageContent with interface 0; interface class is 224, expected 8. Abort


    here's my full dmesg output

    http://ix.io/4fb8

    and here's my full lsusb output


    http://ix.io/4fb9

  • The usb_modeswitch changed was merged to LE since it's harmless and will be needed at some future point when the upstream kernels that LE uses gain support for that chipset. There is support for RTL8821CU wifi in the CE codbease (for Amlogic hardware only) that vpeter works on. There is also existing support for the BT side of the module in current kernels, which is why that works.

    This set of changes should add support for WiFi https://patchwork.kernel.org/project/linux-…pengutronix.de/ .. but they are not merged and seem to be taking time. I would expect a couple more iterations of the patches before they get merged (and then we can pick them up or perhaps backport).

    You can probably borrow the build-system package for the vendor drive that CE uses, and use it in a home-built LE image. We refuse to add the Realtek vendor drivers into our main codebase due to low quality and the constant need to patch/update the ever-growing number of drivers every time we bump kernels (which is frequent).

  • Thank you for the guidance! I'm working on teaching myself how to build from the codebase. I found the guide in the wiki which suggests a 20.04LTS docker container. My only machine is a macbook, so I'm currently learning how to use docker on it (I found Docker Desktop and am installing it now)

    any tips as I dig into this? I'll first try to just make a home-built LE image of the 10.0.3 release w/o any changes as a sanity check before attempting to add the vendor driver from CE. I noticed you mentioned using Oracle Virtualbox in this thread:

    RE: 0bda:b812 rtl88x2bu kernel module

    Do you recommend this over attempting to use docker on a macbook?

    EDIT: found a box w/ debian 11 on it, so I'll try building on that first

    EDIT4: (deleted previous, now irrelevant edit). Building away... Assuming the build succeeds, how do I go about adding the vendor drivers from CE?

    Edited 4 times, last by fliz (November 9, 2022 at 1:00 AM).

  • I went ahead and added exactly what was in that closed merge request, built, and it worked (I confirmed by connecting to it via ssh)

    Nice one dude. You don’t wait around to be told what can and can’t work. You’ll go far on this forum.