Help with Wi-Fi Problem

I am not happy with the performance and stability of the WLE200NX card.

I therefore bought a USB Wi-Fi adapter with Ralink RT5572 chip: rt2800usb - Debian Wiki

I bought this USB Wi-Fi adapter because Debian supports the chip and many use the same adapter with the Raspberry Pi.

I did everything as written on the Debian website (apt-get install firmware-ralink). But I can not use the adapter. lsmod does not show any module and /proc/modules is empty. Is this due to the special kernel of the MNT Reform?

Does anyone have any advice for me please. :confused:

Thanks
Nils

Hi,

Are you sure the WLE200NX won’t do the job for you? It should be very stable. I use it all day long. But you can get better reception with a better antenna. For example I use Laird EFD2455A3S-10MHF1.

Anyway, I’ve tried to describe how to build a custom kernel and the desired modules:

The problem with chips like this is that they use firmware blobs that have to be loaded from disk. So you need to build a module for this chip and load the module after your system has booted. Also, the kernel itself needs to be rebuilt for Ralink devices support. To build the kernel and module, you have to clone the MNT Reform kernel sources, activate the module you need in the .config, and make modules. Afterwards, you can copy the resulting .ko file to /lib/modules, for example, and load it with insmod.

For convenience, you can do the following (on MNT Reform):

git clone https://source.mnt.re/reform/reform-system-image.git
cd reform2-imx8mq
./mkkernel.sh

This will configure and build the kernel once (this can take 15 minutes or so).

Afterwards, enable your desired module:

cd linux
make xconfig # or make menuconfig if you prefer

In your case, you have to enable “Ralink devices” under Device Drivers/Network device support/Wireless LAN: CONFIG_WLAN_VENDOR_RALINK. Then, enable “Ralink driver support”: CONFIG_RT2X00. Finally, set “Ralink rt2500 (USB) support” to M (module): CONFIG_RT2500USB.

Then, build the kernel and modules:

make -j4 Image modules

When it’s done, copy arch/arm64/boot/Image to the root of your MNT Reform boot SD card, and copy drivers/net/wireless/ralink/rt2x00/*.ko to /lib/modules. After a reboot, you should be able to insmod the 3 rt2x00 related modules, but I don’t know in which order. You’ll figure it out.

1 Like

Hi,

just chiming in with no help - the WiFi card that came with the Reform kit works like a charm, day in day out. I haven’t been tempted to plug in the ethernet cable even once.

Is there maybe something going on with the connections?

Best,

Michael

1 Like

Thank you for the explanation @mntmn . I have read up a bit and written it together to make it easier for others to get started. I was not very familiar with the Linux kernel. The level is a bit high for beginners, but the learning curve is much higher :slight_smile: :

Here is what I have done to get my USB Wi-Fi adapter with Ralink RT5572 chip (Amazon.de Link) to work:

# Install required packages
sudo apt install libssl-dev bc iw
# Create dirs
mkdir -p /lib/modules
mkdir -p /lib/firmware
# Clone MNT Reform system image repo
git clone https://source.mnt.re/reform/reform-system-image.git
cd reform2-imx8mq
# Download Linux kernel, patch and compile
./mkkernel.sh
# Change original configuration
cd linux
make menuconfig

Enable Ralink devices and Ralink driver support under Device Drivers > Network device support > Wireless LAN .

Then, build the kernel and modules:

# Compile
make -j4 Image modules
# Copy kernel
sudo cp arch/arm64/boot/Image /<ROOT-of-SD-CARD-or-RESCUE>/
# Copy modules
sudo cp lib/crc-ccitt.ko /lib/modules/
sudo cp drivers/net/wireless/ralink/rt2x00/*.ko /lib/modules/
# Download firmware
sudo curl "https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/plain/rt2870.bin" -o "/lib/firmware/rt2870.bin"
# Reboot
sudo reboot

After a reboot, you should be able to insmod the related modules:

sudo insmod /lib/modules/crc-ccitt.ko
sudo insmod /lib/modules/rt2x00lib.ko
sudo insmod /lib/modules/rt2800lib.ko
sudo insmod /lib/modules/rt2x00usb.ko
sudo insmod /lib/modules/rt2800usb.ko

After that dmesg should not show any errors and ip a should show wlan0.

Check with uname -a if the date matches today. If not, you are still using the old kernel.

Now you can test:

sudo iw wlan0 scan

To load the modules automatic after a reboot, do the following:

# Create dir with kernel version
sudo mkdir -p /lib/modules/$(uname -r)
# Link modules to kernel version
sudo ln -s /lib/modules/*.ko /lib/modules/$(uname -r)
# Generate modules.dep and map files
sudo depmod -a
# Edit /etc/modules, add rt2800usb
echo "rt2800usb" | sudo tee -a  /etc/modules

Done. After a reboot ip a should show wlan0 again.

With the WLE200NX I always had the following error (I blurred the MAC of my AP.):

[ 3327.499278] wlp1s0: disassociated from ▓▓:▓▓:▓▓:▓▓:▓▓:▓▓ (Reason: 1=UNSPECIFIED)

I cannot reproduce the connection failure. It just happened irregularly but frequently.

I have no problems with the USB Wi-FI adapter so far. I will further observe it.

1 Like

Super, thanks for the writeup. I’m sure this will be helpful to others.