当前位置:首页 > 技术 > LINUX > 正文内容

移植USB RTL8723DU WIFI无线驱动给LINUX【转】

Watrt3年前 (2023-09-01)LINUX24960

为了给手上的duo支持wifi无线,买了一个采用usb接口的RTL8723DU,在内核编译时把所有与RTL无线和RTL蓝牙相关的驱动都选择后,并且在内核配置中将usb设置成host模式。 

image

注意!!如果设置成了host模式,将不能通过rndis连接duo

把网卡接到自己画的扩展版,通过dmesg发现可以识别到设备为无线网卡,并驱动蓝牙,但是在ifconfig中没有找到对应的wlan0。 

image

 推断有可能是内核里面没有针对8723du wifi的驱动。所以需要查询当前的5.10内核是否包含8723du的驱动。

通过以下网址 https://linux-hardware.org/ 

image

并结合dmesg的usb信息 

image

可以得到信息6.3之前的内核是只包含了蓝牙驱动,6.3之后的内核才包含了内核驱动 

image

而当前duo的内核是5.10,不支持,需要移植驱动。

驱动我选择了lwfinger提供的驱动 https://github.com/lwfinger/rtl8723du

以下是具体移植操作步骤:

1、先下载duo-app-sdk https://github.com/milkv-duo/duo-app-sdk  

2、解压duo-sdk.tar.gz

tar zvxf duo-sdk.tar.gz

3、获取rtl8723du的驱动

git clone https://github.com/lwfinger/rtl8723du

4、进入到下载下来的驱动目录

5、执行编译命令

make ARCH=riscv CROSS_COMPILE=交叉编译工具链 KSRC=内核目录绝对路径

交叉编译工具链是sdk目录下的

riscv64-linux-musl-x86_64/bin/riscv64-unknown-linux-musl- 内核绝对路径是buildroot-sdk目录下的 linux_5.10/build/cv1800b_milkv_duo_sd

我自己的编译语句,因为有部分路径是不一样的,不要直接复制使用,供大家参考和修改

make arch=RISCV CROSS_COMPILE=/home/kamin/code/duo-examples/duo-sdk/riscv64-linux-musl-x86_64/bin/riscv64-unknown-linux-musl- KSRC=/home/kamin/code/duo-buildroot-sdk/linux_5.10/build/cv1800b_milkv_duo_sd

image

执行完成后,可以看到已经编译好8723du.ko,我们把它上传到duo中 

6、在duo中加载驱动

insmod 8723du.ko

image

再通过dmesg输出信息,我们可以看到成功加载了8723du的驱动 

7、启用WiFi网卡

ifconfig wlan0

8、设置连接信息,编辑duo系统中的 /etc/wpa_supplicant.conf,在network中加入以下两行,加入后保存

ssid="你的WiFi名称" psk="你的WiFi密码"

image

9、连接wifi

wpa_supplicant -D nl80211 -i wlan0 -c /etc/wpa_supplicant.conf &

10、手动设置IP或自动设置IP

通过DHCP获取IP

image

udhcpc -R -n -O search -p /var/run/udhcpc.wlan0.pid -i wlan0 -x hostname:milkv

手动设置静态IP

ifconfig wlan0 192.168.1.119 netmask 255.255.255.0 route add default gw 192.168.1.1

192.168.1.119 为要设置的静态ip

255.255.255.0 为要设置的子网掩码

192.168.1.1 为要设置的网关

image

PING测试

image

打赏 支付宝打赏 微信打赏

相关文章

Linux 压缩解压命令备忘

Linux 压缩解压命令备忘

01-.tar格式解包:[*******]$ tar xvf FileName.tar 打包:[*******]$ tar cvf FileName.tar DirName(注:tar是打包,不是压缩!) 02-.gz格式 解压1:[*******]$ gunzip FileName.gz 解压2:[*******]$ gzip -d FileName.gz 压 缩:[*******]$ gzip...

基于 debootstrap 和 busybox 构建 mini ubuntu

基于 debootstrap 和 busybox 构建 mini ubuntu

最近的工作涉及到服务器自动安装和网络部署操作系统,然后使用 ansible 和 saltsatck 进行配置并安装 openstack 。难点在于服务器的自动安装,由于不单只是通过 PXE 安装服务器,还需要能够安装时进行分区、配置网卡等工作,因此需要在开始安装前,必须先收集服务器的硬件信息。调研了一下目前的开源项目中,提供此类功能的有 tinycorelinux 、 puppet razor-el-mk 可做类似的工作。tinycorelinux 是个很好的工具,整个系统在 PXE 之后在内存...

LINUX 使用sendmail邮件备份

LINUX 使用sendmail邮件备份

首先安装:sudo apt-get install sendmail然后在终端可以使用mail来发邮件echo "ESP32固件"|mail -s "esp32" -A "./fw.bin" -r "bak@xxx.com" xb100@qq.com注意很有可能收到的邮件在垃圾箱里面。把发件地址加到白 名单中...

荔枝派Nano 全流程指南

荔枝派Nano 全流程指南

u-boot 初体验安装交叉编译链首先需要安装交叉编译链:# 此处为获取7.2.1版本,您可获取其他版本或者通过链接直接下载 wget http://releases.linaro.org/components/toolchain/binaries/7.2-2017.11/arm-linux-gnueabi/gcc-linaro-7.2.1-2017.11-x86_64_arm-linux-gnueabi.tar.xz tar -vxJf gcc-li...

 Debian 9.9 (stretch) 文件系统制作

Debian 9.9 (stretch) 文件系统制作

0. 准备工作:sudo apt install qemu-user-static -y sudo apt install debootstrap -y mkdir rootfs1. debootstrapdebootstrap --foreign --verbose --arch=armhf  stretch rootfs http...

debootstrap报"Release signed by unknown key"错误的解决方法

debootstrap报"Release signed by unknown key"错误的解决方法

1、下载最新的ASC文件:wget https://ftp-master.debian.org/keys/release-11.asc -qO- | gpg --import --no-default-keyring --keyring ./debian-release-11.gpg注意这里的11对应debian的版本号。我这里是debian11 (bullseye)2、debootstrap指定asc文件sudo&...

老是提示:newer kernel available 解决方法

老是提示:newer kernel available 解决方法

这个是由于没有正确的安装内核造成的。可以直接关掉提示 sudo apt purge needrestart...

Configure & Build

Configure & Build

Configure and build Linux kernel for Surface RTEditing kernel build configurationFirst run the command make ARCH=arm tegra_defconfigThis will create a standard kernel config for tegra SoC's.Open the file .config in the kernel source directory wit...