Unsupported USB wifi adapter

Hello,
this is my first project so I don’t know a lot about balenaOS. I would like to make wifi repeater from RPi4 but my driver for my USB wifi adapter is not installed, so it can’t connect to the home network.
I do it with help of this website:


Is there any solution to solve it, please? My wifi adapter is: tp link tl-wn823n.

Hello,

If balenaOS doesn’t have the driver for your wifi adapter, you’ll need to build it yourself and add it.

This is not an easy task.

First check that it is indeed not supported by typing ifconfig -a in the host OS. Check if you see one or two wifi interfaces.

Looking at https://www.balena.io/docs/reference/hardware/wifi-dongles/#known-working-devices I think your adapter may work (rtl8192cu).

If it’s not you’ll need to find the sources of the driver and build them.

Check https://github.com/balena-os/kernel-module-build and https://www.balena.io/docs/learn/develop/multicontainer/#labels (look for io.balena.features.kernel-modules)

Thanks for response, but I found another problem. After self-update after the 1st boot, RPi4 couldn’t boot. I already reinstall balenaOS on SD card and it happened again. The green light repeatly blinks 4 times. :confused:

I already reinstall balenaOS on SD card and it happened again.

Did it boot right after flashing ?

You might find this link interesting https://www.raspberrypi.org/forums/viewtopic.php?p=437084#p437084

Yes, it did. After downloading the update, it will probably restart and won’t boot again.

The update is from which balenaOS version to which balenaOS version? Does it still refuse to boot if you flash the newest balenaOS version instead of updating it?

Hi, could you elaborate more on building my own drivers to install into BalenaOS? I have a cheap “ANEWKODI” USB wifi adapter that I had been using with Volumio on my Raspi2B, but it would appear as though BalenaOS does not automatically setup the device.

When connected to my PC in device manager, it registers as a “Realtek RTL8811AU Wireless LAN 802.11ac USB 2.0 Network Adapter”

I recognize that I could just go get one of the supported adapters, but I feel as though it would be a great learning experience for me to try and compile these drivers myself :slight_smile: I just need a slight steer in the right direction

Hello,

Please have a look at https://github.com/balena-os/kernel-module-build and check its README

I was able to build https://github.com/gnab/rtl8812au with it (couldn’t try as I don’t have a pi4)

Basically:

  • git clone git@github.com:balena-os/kernel-module-build.git;
  • cd kernel-module-build;
  • git clone https://github.com/gnab/rtl8812au;
  • edit Dockerfile.template, change VERSION to 2.60.1+rev5.prod and example_module to rtl8812au;
  • commit your changes;
  • balena push someRaspberryPi4Application;

Thank you @zvin. I’m fairly new to using BalenaOS and have all I need on the RaspberryPi, however the RTL8812AU driver clearly isn’t installed. Are you able to explain in a little more depth please the steps you took to update the driver. Using the instructions above, it seems to fail to compile with the below message. I would appreciate any assistance you are willing to offer. Thank you.

Has anyone experience with the above and able to assist please :slight_smile: ?

Hi, it looks like you have dropped the executable permission from build.sh somewhere on the way. One way to fix it would be to edit Dockerfile.template and add a new line containing RUN chmod a+x ./build.sh between the ENV VERSION... and RUN BALENA_MACHINE_...lines. Could you try that and see whether that helps?

Hi, thank you for your advice @mtoman, I managed to get everything to compile.

Using lsusb, I can see the Alfa card connected, however it does not seem to be seeing the driver as the blue LED is not lit on the adapter. Any additional ideas please as the compile appeared to go as it should without errors.

Hi, glad to hear you are making progress.

Can you check the module is actually loaded? You can do this by running lsmod | grep 8812au. It should output at least one line, if the output is empty, the module is not loaded. You can eventually load it using insmod 8812au.ko while in the directory with the 8812au.ko file.

You can also run dmesg looking for errors.

Thank you @mtoman, it would appear the module was not loaded. I have stripped back my Dockerfile.template file now to try and get just the driver installed before I add anymore code.

FROM balenalib/%%BALENA_MACHINE_NAME%%-debian

RUN apt-get update && apt-get install -y curl wget build-essential libelf-dev awscli bc flex libssl-dev python bison
COPY . /usr/src/app
WORKDIR /usr/src/app

ENV VERSION '2.77.0+rev1'
RUN chmod a+x ./build.sh
RUN chmod a+x ./workarounds.sh
RUN chmod a+x ./run.sh
RUN BALENA_MACHINE_NAME=%%BALENA_MACHINE_NAME%% ./build.sh build --device %%BALENA_MACHINE_NAME%% --os-version "$VERSION" --src rtl8812au

CMD ./run.sh

I can only assume something hasn’t compiled right as I cannot find the 8812au.ko, however the rtl8812au directory is there. Any suggestions to what I may be missing please?

Really appreciate you help and guidance as getting this driver working is the final piece to my puzzle on what has been a bit of a steep learning curve. Thanks again.

Hi,

Great that you made progress on this. I assume when you say 8812au.ko not found its with the command: lsmod | grep 8812au.

I would suggest checking the output of dmesg or add the output here - to debug further as to what might be the issue.

Thank you for your reply @nitish. That is correct, the module is not found when using the lsmod command and also doing a physical search for the file.

I have attached the log from dmesg as requested. Thanks again for all your help, feel so close :slight_smile:

log.txt (127.0 KB)

Hi @Tissy,

Considering you are building for a raspberry pi, Can you confirm if you changed this line to say CONFIG_PLATFORM_ARM_RPI = y ?

If not, that’s probably the issue and the module is not being compiled properly

Thanks

Hi @rahul-thakoor, thank you for your reply.

You are correct, CONFIG_PLATFORM_ARM_RPI = y was not set in the MakeFile, so thank you for suggesting that change.

Having made the change and repushed the code, although it is compiling still without apparent errors, using lsmod command, I still cannot see the module and the blue LED on the alfa card isn’t lit. I feel so close, any other help or suggestion would be very much appreciated :slight_smile:

Anyone able to offer further advice please, feel so close to getting this working :slight_smile: :point_up: