开发板:荔枝派zero
linux:linux-zero-4.10.y
rootfs:Debian9.9

Debian软件安装:

apt install  wpa_supplicant
apt install  udhcpc

在linux-zero-4.10.y版本源码的drivers/staging/目录下没有rtl8723bs驱动。
所以后面clone了linux-zero-4.14.y,在drivers/staging/目录下可以发现存在rtl8723bs驱动文件夹,所以下面记录下使用linux-zero-4.14.y编译与开启rtl8723bs

1、我先查看下rtl8723bs文件夹下的Kconfig文件

config RTL8723BStristate "Realtek RTL8723BS SDIO Wireless LAN NIC driver"depends on WLAN && MMC && CFG80211depends on mselect WIRELESS_EXTselect WEXT_PRIV---help---This option enables support for RTL8723BS SDIO drivers, such asthe wifi found on the 1st gen Intel Compute Stick, the CHIPand many other Intel Atom and ARM based devices.If built as a module, it will be called r8723bs.

可以发现RTL8723BS依赖于 WLAN && MMC && CFG80211。

创建zero的配置文件

make ARCH=arm licheepi_zero_defconfig

根目录下看了下.config配置文件,licheepi_zero_defconfig中相关依赖都已经打开了。

2、配置编译r8723bs模块

make ARCH=arm menuconfig



这里只能选择编译成模块。

3、安装r8723bs.ko驱动
编译后的驱动在drivers/staging/rtl8723bs目录下。
拷贝到根文件系统里。

#安装命令
insmod  r8723bs.ko


安装后提示error:
rtl8723bs mmc1:0001:1: Direct firmware load for rtlwifi/rtl8723bs_nic.bin failed with error -2

4、拷贝 rtl8723bs_nic.bin 到根文件系统的 /lib/firmware/rtlwifi/ 目录下。

mkdir -p  /lib/firmware/rtlwifi/
##拷贝 rtl8723bs_nic.bin 到根文件系统的 /lib/firmware/rtlwifi/ 目录下
##重新安装模块
rmmod  r8723bs
insmod  r8723bs.ko

执行结果如下:

root@ubuntu:/# insmod r8723*
[ 4114.732347] r8723bs: module is from the staging directory, the quality is unk
nown, you have been warned.
[ 4114.748990] RTL8723BS: module init start
[ 4114.752932] RTL8723BS: rtl8723bs v4.3.5.5_12290.20140916_BTCOEX20140507-4E40
[ 4114.760105] RTL8723BS: rtl8723bs BT-Coex version = BTCOEX20140507-4E40
[ 4114.777679] pnetdev = c33d6000
[ 4114.804573] RTL8723BS: rtw_ndev_init(wlan0)
[ 4114.841420] RTL8723BS: module init ret =0
[ 4115.015582] rtl8723bs: acquire FW from file:rtlwifi/rtl8723bs_
nic.binroot@ubuntu:/# ifconfig -a
eth0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500ether 02:01:c8:0e:b2:12  txqueuelen 1000  (Ethernet)RX packets 0  bytes 0 (0.0 B)RX errors 0  dropped 0  overruns 0  frame 0TX packets 0  bytes 0 (0.0 B)TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0device interrupt 38lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536inet 127.0.0.1  netmask 255.0.0.0loop  txqueuelen 1000  (Local Loopback)RX packets 19924  bytes 1733352 (1.6 MiB)RX errors 0  dropped 0  overruns 0  frame 0TX packets 19924  bytes 1733352 (1.6 MiB)TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0usb0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500inet 192.168.1.10  netmask 255.255.255.0  broadcast 192.168.1.255ether b6:fb:ab:a7:ea:2a  txqueuelen 1000  (Ethernet)RX packets 325  bytes 78686 (76.8 KiB)RX errors 0  dropped 118  overruns 0  frame 0TX packets 80  bytes 11718 (11.4 KiB)TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0wlan0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500ether 00:e0:4c:87:00:00  txqueuelen 1000  (Ethernet)RX packets 0  bytes 0 (0.0 B)RX errors 0  dropped 0  overruns 0  frame 0TX packets 0  bytes 0 (0.0 B)TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

这里可以看到wlan0网络就是了。

5、配置连接WiFi
编辑/etc/network/interfaces文件

# Configure Loopback
auto lo
iface lo inet loopback
# 增加wlan0描述
auto wlan0
iface wlan0 inet dhcp

wpa_supplicant连接WIFI的时候会从配置文件中读取账号和密码,以及加密方式等, 所以我们再运行wpa_supplicant工具的时候要提前写好配置文件。
配置文件名称自定,但是要以 .conf 为后缀,并保存在 /etc/ 目录下,这边给出一个配置文件的例子。
编辑 /etc/wpa_supplicant.conf 文件:


ctrl_interface=/var/run/wpa_supplicant
ctrl_interface_group=0
ap_scan=1
network={ssid="wifi_name"scan_ssid=1key_mgmt=WPA-EAP WPA-PSK IEEE8021X NONEpairwise=TKIP CCMPgroup=CCMP TKIP WEP104 WEP40psk="wifi_password"priority=5
}

注意wifi名与密码不要多了空格,自己犯过这个错误。。
导致出现:

[  100.248490] RTL8723BS: nolinked power save leave
[  102.446737] RTL8723BS: nolinked power save enter

#创建一个socket通信的目录

mkdir -p /var/run/wpa_supplicant

#安装r8723bs驱动

root@ubuntu:/# cd / ;insmod r8723bs.ko
[   29.104243] r8723bs: module is from the staging directory, the quality is unk
nown, you have been warned.
[   29.122015] RTL8723BS: module init start
[   29.126115] RTL8723BS: rtl8723bs v4.3.5.5_12290.20140916_BTCOEX20140507-4E40
[   29.133158] RTL8723BS: rtl8723bs BT-Coex version = BTCOEX20140507-4E40
[   29.148730] pnetdev = c3bde000
[   29.346349] RTL8723BS: rtw_ndev_init(wlan0)
[   29.363866] RTL8723BS: module init ret =0

#启动wlan0

root@ubuntu:/# ifconfig wlan0 up
[   28.250324] rtl8723bs: acquire FW from file:rtlwifi/rtl8723bs_nic.bin
[   28.476287] random: crng init done

#连接WiFi

root@ubuntu:/# wpa_supplicant -B -c /etc/wpa_supplicant.conf -i wlan0
Successfully initialized wpa_supplicant
[   54.751545] RTL8723BS: rtw_set_802_11_connect(wlan0)  fw_state
= 0x00000008
[   54.984523] RTL8723BS: start auth
[   54.990049] RTL8723BS: auth success, start assoc
[   55.000233] RTL8723BS: rtw_cfg80211_indicate_connect(wlan0) BSS not found !!
[   55.007440] RTL8723BS: assoc success
[   55.026198] RTL8723BS: send eapol packet
[   55.037239] RTL8723BS: send eapol packet
[   55.041820] RTL8723BS: set pairwise key camid:4, addr:cc:08:fb:76:c1:66, kid:
0, type:AES
[   55.053800] RTL8723BS: set group key camid:5, addr:cc:08:fb:76:c1:66, kid:1,
type:AES

#自动获取IP地址

root@ubuntu:/# udhcpc -i wlan0
udhcpc (v1.22.1) started
Sending discover...
Sending select for 192.168.1.103...
Lease of 192.168.1.103 obtained, lease time 7200

#查看网络状态

root@ubuntu:/# wpa_cli -iwlan0 status
bssid=cc:08:fb:76:c1:66
freq=2462
ssid=TP-LINK_C166
id=0
mode=station
pairwise_cipher=CCMP
group_cipher=CCMP
key_mgmt=WPA2-PSK
wpa_state=COMPLETED
ip_address=192.168.1.103
address=00:e0:4c:87:00:00
uuid=39d339de-d9f2-54e4-ab0c-fa9487e8849b

#最后尝试下ping网络

root@ubuntu:/# ping 192.168.1.1
PING 192.168.1.1 (192.168.1.1) 56(84) bytes of data.
64 bytes from 192.168.1.1: icmp_seq=1 ttl=64 time=1.95 ms
64 bytes from 192.168.1.1: icmp_seq=2 ttl=64 time=3.34 ms
64 bytes from 192.168.1.1: icmp_seq=3 ttl=64 time=10.3 ms
64 bytes from 192.168.1.1: icmp_seq=4 ttl=64 time=1.66 ms
^C
--- 192.168.1.1 ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3002ms
rtt min/avg/max/mdev = 1.669/4.334/10.371/3.543 ms

开机自动连接WiFi

cat /lib/systemd/system/rc.local.service#  SPDX-License-Identifier: LGPL-2.1+##  This file is part of systemd.##  systemd is free software; you can redistribute it and/or modify it#  under the terms of the GNU Lesser General Public License as published by#  the Free Software Foundation; either version 2.1 of the License, or#  (at your option) any later version.# This unit gets pulled automatically into multi-user.target by# systemd-rc-local-generator if /etc/rc.local is executable.[Unit]Description=/etc/rc.local CompatibilityDocumentation=man:systemd-rc-local-generator(8)ConditionFileIsExecutable=/etc/rc.localAfter=network.target[Service]Type=forkingExecStart=/etc/rc.local startTimeoutSec=0RemainAfterExit=yesGuessMainPID=no

新建一个rc.local文件

#!/bin/shsh /etc/init.d/S100auto_wifi_link.sh
echo "wifi finish!!"

创建脚本S100auto_wifi_link.sh

#!/bin/sh
insmod /r8723bs.ko
ifconfig wlan0 up
wpa_supplicant -B -c /etc/wpa_supplicant.conf -i wlan0
sleep 3s
udhcpc -i wlan0
修改rc.local 权限
# chmod +x /etc/rc.local启动rc-local了
#systemctl start rc-local查看rc-local启动过程中是否有错误出现
#systemctl status rc-local到这里,rc-local就能够正常工作了。

荔枝派zero编译rtl8723bs驱动并连接WiFi相关推荐

  1. ubuntu 安装Qualcomm Atheros QCA9565 AR9565 无线网卡驱动并连接wifi网络

    9565的无线网卡驱动需要加载的是ath9k,所以下载驱动包编译,之后加载ath9k模块就可以使用无线网卡了. 下载驱动源码包: wgethttps://www.kernel.org/pub/linu ...

  2. Ubuntu 16.04 手动安装无线网卡驱动(连接WiFi)

    这里写自定义目录标题 引言 查看无线网卡型号 查看无线网卡驱动匹配的内核版本 查看ubuntu内核版本(一般需要升级) 升级内核 下载驱动 tips 引言 ubuntu16.04 无线网卡型号:Int ...

  3. 记一次解决Intel 9462无线网卡的笔记本安装Ubuntu16.04后无法连接WIFI问题的艰难历程

    文章目录 前言 安装环境 解决方案 安装过程 初始环境 安装Ubuntu16.04.2 硬件禁止问题 激活无线网卡 更新软件列表附加驱动 更新内核1 安装Ubuntu16.04.7 查找网卡版本 更新 ...

  4. 7.荔枝派 zero(全志V3S)-编译内核驱动,生成KO文件

    上面是我的微信和QQ群,欢迎新朋友的加入. 在网上溜了一大圈,发现竟然没人写过荔枝派编译内核驱动的帖子. 或许是我输入的关键字不对 今天特意做了一下这个事情. 1.改kernel makefile 当 ...

  5. 编译全志V3S(荔枝派zero)整个系统流程及后续故障答疑使用技巧等

    全志V3S(荔枝派zero)学习 购买到的硬件 声明一下用的主线Uboot + 主线linux,如果你是小白不幸买到了本产品建议弃坑既浪费时间,又浪费生命,香橙派树莓派是你更好的选择 Uboot 编译 ...

  6. 荔枝派ZERO_修改uboot添加自己的屏幕驱动(一)

    虽然经过前面的小白洗礼,终于将uboot如何切换开机画面弄好了,但是使用的毕竟还是她原本支持的800*480屏幕,而我的最终目的是要使用我自己的480*480屏. 面临的主要问题有:1.对uboot文 ...

  7. 荔枝派 Nano 全志 F1C100s 编译运行 Linux ubuntu并升级gcc

    首先是荔枝派的官方文档,写的不是很细,应当说我们必须明确几点: 出厂时 SPI Flash 自带了一个 U-Boot+Linux Kernel(出厂的时候可能烧过了),可直接拿来用.如果希望自己烧固件 ...

  8. 【全教程】qt连接mysql——从qt编译mysql驱动到qt连接mysql数据库(二、编译连接)

    本篇教程分为三个部分: [全教程]qt连接mysql--从qt编译mysql驱动到qt连接mysql数据库(一.编译连接前准备) [全教程]qt连接mysql--从qt编译mysql驱动到qt连接my ...

  9. 【全教程】qt连接mysql——从qt编译mysql驱动到qt连接mysql数据库(一、编译连接前准备)

    一.说明 电脑系统:win10 qt版本:5.13.2和5.14.1(测试均成功) mysql版本:MySQL-5.5 本篇教程分为三个部分: [全教程]qt连接mysql--从qt编译mysql驱动 ...

  10. 1.荔枝派 zero(全志V3S)-编译及SD烧录

    上面是我创建的群聊,欢迎新朋友的加入. 之前买了个荔枝派,全志的A3S芯片.折腾了两天,写一下编译和SD烧录的过程. 目录 1.直接烧录镜像文件 2.uboot编译 3.kernel编译 4.root ...

最新文章

  1. APUE(第四章)文件和目录
  2. 【Android测试】【第十四节】Appium——简述
  3. 总分第一!阿里云数据库应用迁移解决方案通过信通院首批最高级评测
  4. 监听edittext中文字个数变化··
  5. ordereddict有序字典
  6. 制作个性化gurb菜单背景图片
  7. 热烈欢迎 东北鸿顺山特产品有限公司网站正式上线
  8. Topcoder SRM 637 (Div.2)
  9. VS C++ 字符串分割 strtok
  10. Shopify!Shopify!Shopify!
  11. C#毕业设计——基于C#+ASP.NET+SQL Server的酒店入住信息管理系统设计与实现(毕业论文+程序源码)——酒店入住信息管理系统
  12. SEO入门到精通只需学会这10个关键技巧
  13. C# Thread详解
  14. MDS(多维尺度变换)降维算法
  15. “华为杯”研究生数学建模竞赛2005年-【华为杯】D题:仓库容量有限条件下的随机存贮管理问题(附获奖论文和matlab代码)
  16. BadBoy录制JMeter脚本
  17. 序列划分c语言,看懂了这些,你对缠论中的线段划分就基本掌握了!
  18. 反汇编代码分析--函数调用
  19. 算一下你来到这个世界多少天? java语言
  20. 带你了解下车牌识别技术——(1)

热门文章

  1. 宇视网络视频录像机添加摄像机提示离线
  2. 新ssd硬盘怎么安装efi_如何在PC中升级和安装新的硬盘驱动器或SSD
  3. XShell v7里的快捷键
  4. dlib人脸配准(人脸对齐)
  5. 修饰器 TypeError: A() missing 1 required positional argument: ‘func‘
  6. 工业相机SDK二次开发
  7. java观察者模式举例
  8. python怎么模拟鼠标移动点击_如何使用python来模拟鼠标点击?
  9. C/C++:std::thread构造函数死锁问题:WIN32下不可以在DllMain中创建线程
  10. vue项目添加emoji表情