Porting Driver of USB WiFi Module RTL8192EU and Set it to Auto-start in Debian

Recently Forlinx received feedback from users on the trial experience of OKMX8MP-C SBC. Users reported that after transplanting the self-built Debian system on OKMX8MP-C SBC, the original WiFi module on board doesn’t work, even add support items in kernel. Forlinx technical support engineer checked this issue. To solve it, user need to copy and replace the entire drive folder of /lib/modules.



The WiFi solution can be RTL8192EU, a USB WiFi module, very mature solution on market. It can be easily purchased. The source code for different Linux kernel versions can be downloaded online.

Download RTL8192EU source code and open Makefile:



Modify the architecture and kernel source location of I386_PC:


ifeq ($(CONFIG_PLATFORM_I386_PC), y)

EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN

EXTRA_CFLAGS += -DCONFIG_IOCTL_CFG80211 - DRTW_USE_CFG80211_STA_EVENT

SUBARCH := $(shell uname -m | sed -e s/i.86/i386/)

ARCH ?= ARM64

CROSS_COMPILE ?=

KVER := $(shell uname -r)

KSRC := /home/OK8MP-linux-kernel/

MODDESTDIR := /home/OK8MP-linux- kernel/drivers/net/wireless/

INSTALL_PREFIX :=

STAGINGMODDIR := /home/OK8MP-linux- kernel/drivers/staging

endif


Compile and generate 8192eu.ko, and directly insmod it. However, only this ko file is still not available. Because this ko driver will call the firmware under /lib/firmware/rtlwifi, rtl8192eu_nic.bin. This file is necessary. Otherwise the driver will not be loaded normally:



After successfully loaded, use ifconfig to view the correctly loaded network card device:



Then use networkmanager to manage the connection of WiFi hotspots:


nmcli dev wifi connect "xxx" password "xxx"


Just fill in hotspot name and password at xxx.

Then set WiFi driver to auto-start . It’s easy. Firstly, create a new shell script named autorun.sh under /etc/:



#!/bin/sh

insmod /home/rtl8192eu-linux-driver-realtek-4.4.x/8192eu.ko


Then create autorun.service under/usr/lib/systemd/system/


[Unit]

Description=autorun

After=basic.service X.service thermal-zone-init.service

[Service]

ExecStart=/etc/autorun.sh

[Install]

WantedBy=multi-user.target


Input command:


systemctl -f enable /lib/systemd/system/autorun.service

chmod 777 /etc/autorun.sh


Thank Forlinx users very much for the trial experience feedback of OKMX8MP-C SBC.

For the product manual, welcome inquiry sales engineer online and get product details.