0bda:b812 rtl88x2bu kernel module

  • hey there, hi everybody this is my first post.
    I'm struggling try to make a realtek with code 0bda:b812.

    I've read many threads suggesting not to use such a device but that is what I have and I have no money at the moment to buy something else (and this device works very well indeed, apart from the bad support for linux drivers).

    I would like to understand how to cross compile its kernel module (on osx or linux) or even on a raspbian installation, I'm really confused from all the infos I fount here and elsewhere.

    Is there a guide I can follow step by step?

    Is there any module already compiled I can use straight away?

    my libreelec is 9.2.6 on RPI3

    Thanks for any hint I will receive

  • You can add the rtl88x2bu driver to the LE build system and compile an image.

    e.g.:

    Code
    cd ~
    git clone https://github.com/LibreELEC/LibreELEC.tv
    cd LibreELEC.tv/packages/linux-drivers
    mkdir RTL88x2BU
    cd RTL88x2BU
    touch package.mk

    add this to package.mk:

    Edit distributions/LibreELEC/options file, add RTL88x2BU to "ADDITIONAL_DRIVERS=" :

    ADDITIONAL_DRIVERS="RTL8192CU RTL8192DU RTL8192EU RTL8188EU RTL8812AU RTL88x2BU"

    Build an image:

    cd ~/LibreELEC.tv

    PROJECT=RPi ARCH=arm DEVICE=RPi2 make image

  • Yes.

    I forgot to mention that if you want to compile a custom 9.2.6 (stable) build run

    "git checkout libreelec-9.2" before making changes.

    Otherwise it will compile from a master branch (kodi 19).

  • last question! sorry about that! what are the best practices to load a module after reboot?
    I suppose the better way would be triggering modprobe on device id.. but how should I get this result?

  • Perhaps you could edit or create the /storage/.config/autostart.sh file and put there something like this: insmod /PathToFile/RTL88x2BU.ko ?

    reading other posts I have already tried this approach but wasn't successful..

    I've also read something about device ids to add somewhere but I can't figure out where exactly

  • Well, as it's really hard to discover what issue are you facing to without any description (or without at least the command error output ),

    I am afraid anybody can hardly help you...

    Usually - AFAIK - you need to load the appropriate driver module without device ID parameter. If it loads OK (it could depend on other modules which needs to be loaded before), it should recognize the device.
    lsmod

    dmesg

    modinfo RTL88x2BU.ko

    command outputs could perhaps give a hint to you.

  • never forget to give execution rights to a script......

    this is the file /storage/.config/autostart.sh

    Bash
    #!/bin/bash
    # autostart.sh
    
    insmod /storage/88x2bu.ko #to insert the module
    echo 0bda b812 >  /sys/bus/usb/drivers/rtl88x2bu/new_id #to trigger the driver if unplugged
    ~

    then chmod 755 autostart.sh

  • This method worked for me. I built it against the latest master branch 10.0 quick just to see if it would work. I had to set the Wireless Regulatory Domain to something other than the default setting under the menu LibreElec->Network.

    After a reboot I'm able to see my 5Ghz and 2.4Ghz channels and connect to them no problem. I still need to test the performance a bit but my library is indexing at a decent rate. This is on a Raspberry Pi 2 so I'm limited by the USB 2.0 bus.

    I'm using a Techkey model: "Techkey-6B06" USB 802.11AC adapter.

    I'll try building it against the latest stable branch when I have some time. Thanks smp!

  • I was able to make it work with 9.2.6 as well. Well, sort of. The adapter works but I was having problems with Kodi being able to play videos. Also, the performance of the menu seemed slower than the official builds. I don't know if it's a problem with my build environment or what. I'm using a Ubuntu 20.04 virtual machine to build these images. The 10.0 build that I made is still working fine.

    Edited once, last by lawndartdeath (March 30, 2021 at 4:44 PM).