1. 程式人生 > >RTL8723藍芽wifi移植8723bu系列

RTL8723藍芽wifi移植8723bu系列

8723buwifi

軟體包下載

http://download.csdn.net/detail/qqchangjianfei/9554279

WIFI:            增加路徑

linux/kernel/kernel-3.4.39/drivers/net/wireless/Makefile

obj-$(CONFIG_BRCMSMAC) += brcm80211/

obj-$(CONFIG_RTL8723BU) += rtl8723BU_WiFi/

linux/kernel/kernel-3.4.39/drivers/net/wireless/Kconfig

source"drivers/net/wireless/DHD_REL_1_141_44_3/Kconfig"

source"drivers/net/wireless/rtl8723BU_WiFi/Kconfig"

核心新增

-> Device Drivers                                                       

    -> Network device support (NETDEVICES[=y])                          

       -> Wireless LAN (WLAN [=y])

<*>   Realtek8723B USB WiFi  

測試:

-----------------------------------------wpa_supplicant

方法---------------------

開啟wifi裝置:ifconfig wlan0 up

顯示wifi熱點:iwlist scanning

增加連線的wifi 的名稱和密碼

vi etc/wpa_supplicant.conf

內容如下:

# WPA-PSK/TKIP

ctrl_interface=/var/run/wpa_supplicant

network={

       ssid="dlink" //WIFI名稱

       key_mgmt=WPA-PSK

       proto=WPA

       pairwise=TKIP

       group=TKIP

       psk="12345" //WIFI

密碼

}

 wpa_supplicant -d -Dwext-iwlan0 -c/etc/wpa_supplicant.conf &

wpa_supplicant wpa_supplicant可執行程式path

-d :增加除錯資訊

-Dwext wext,驅動名稱

-iwlan0 wlan0,網路介面名稱

 iwconfig

 ifconfig wlan0 192.168.12.198  //設定無線網絡卡IP

 ifconfig wlan0

Ping 同一網段的IP

ping 192.168.12.102

64 bytes from 192.168.12.102: seq=0 ttl=64 time=54.105 ms

64 bytes from 192.168.12.102: seq=1 ttl=64 time=278.848ms

64 bytes from 192.168.12.102: seq=2 ttl=64 time=199.479ms


8723bu  藍芽部分

BT4.0:      驅動和應用移植:

驅動:從網上下載8723bu_bt驅動RTL8723BU.rar(藍芽wifi驅動都有)

解壓到linux/QT_6818/kernel/drivers/Bluetooth

修改Makefile

obj-$(CONFIG_BT_RTKBTUSB_CJF)   += rtk_btusb_cjf.o

rtk_btusb_cjf-y= rtk_coex.o rtk_bt.o

Kconfig

configBT_RTKBTUSB_CJF

    tristate "RTK HCI USB driver byCJF"

    depends on USB

    help

      RTK Bluetooth HCI USB driver by CJF

核心增加該選項

[*] Networking support --->

   <*>   Bluetooth subsystem support  --->

                   Bluetooth device drivers  --->

                                       <*>RTK HCI USB driver by CJF

應用層程式移植:需要移植bluez-4.95

http://blog.csdn.net/u011408697/article/details/44459239

1、交叉編譯 expat-2.0.1

./configure-prefix=/usr/local/bluez-4.95 -host=arm-linux CC=arm-linux-gcc

make

makeinstall

2、交叉編譯 dbus-1.4.1

./configure-prefix=/usr/local/bluez-4.95 -host=arm-linux -with-x=no-enable-abstract-sockets CC=arm-linux-gccCFLAGS=-I/usr/local/bluez-4.95/include LDFLAGS=-L/usr/local/bluez-4.95/lib

make

makeinstall

3、交叉編譯 glib-2.16.2

./configure-prefix=/usr/local/bluez-4.95 -host=arm-linux CC=arm-linux-gcc glib_cv_stack_grows=noglib_cv_uscore=yes glib_cv_have_qsort_r=yes ac_cv_func_posix_getpwuid_r=yesac_cv_func_posix_getgrgid_r=yes

make

makeinstall

4、交叉編譯 bluez-4.95

sudoapt-get install libdbus-1-dev libdbus-glib-1-dev

exportPKG_CONFIG_LIBDIR=/usr/local/bluez-4.95/lib/pkgconfig

./configure-prefix=/usr/local/bluez-4.95 -host=arm-linux -disable-audio -enable-network-enable-serial -enable-input -enable-service -enable-health -enable-usb-enable-tools -enable-bccmd -enable-hid2hci -enable-hidd -enable-pand -enable-cups-enable-test CC=arm-linux-gcc CFLAGS=-I/usr/local/bluez-4.95/includeLDFLAGS=-L/usr/local/bluez-4.95/lib

make

makeinstall

錯誤

audio/pcm_bluetooth.c:40:fatal error: alsa/asoundlib.h: No such file or directory

compilationterminated.

$sudo apt-getinstall libasound2-dev

5、交叉編譯 bluez-hcidump-2.5

./configure-prefix=/usr/local/bluez-4.95 -host=arm-linux CC=arm-linux-gcc

make

makeinstall

四、使用方法:

1、把剛剛交叉編譯好的 bluez-4.95複製到開發板上,比如放在 /usr/local/

2、開發板上,vi /etc/passwd,在最後新增messagebus:x:500:500::/home/messagebus:/bin/sh,儲存

3、新增環境變數:

exportPATH=/mnt/sdcard/bluez-4.95/bin:$PATH

exportPATH=/mnt/sdcard/bluez-4.95/sbin:$PATH

exportLD_LIBRARY_PATH=/mnt/sdcard/bluez-4.95/lib:$LD_LIBRARY_PATH

mount/mnt/sdcard/bluez-4.95 /usr/local/bluez-4.95/

4、執行 dbus-daemon -system

dbus-daemon--system

注:啟動一次過後會生成某程序檔案,以後再啟用需要先刪除它

rm/mnt/sdcard/bluez-4.95/var/run/dbus/pid

5bluetoothd -f/mnt/sdcard/bluez-4.95/etc/bluetooth/main.conf

或者:直接 bluetoothd,預設會載入上邊的 conf

或者:bluetoothd -nd表示進入除錯並且不後臺執行

注:開啟 bluetoothd預設會 hci0 up

1\載入驅動

/lib/firmware # insmod rtk_btusb.ko

2\檢視藍芽裝置

/bin #hciconfig

hci0:Type: BR/EDR  Bus: USB

BDAddress: 00:00:00:00:00:00  ACL MTU:0:0  SCO MTU: 0:0

DOWN

RXbytes:0 acl:0 sco:0 events:0 errors:0

TX bytes:0acl:0 sco:0 commands:0 errors:0

3\啟動裝置,會自動載入韌體

/sbin #./hciconfig hci0 up 

rtk_btusb:btusb_open hdev->promisc ==0

rtk_btusb:download_patch start

5\掃描裝置

/sbin #./hcitool scan

Scanning...

00:74:23:8E:D2:A9

K-TouchT619(天語

38:BC:1A:88:59:E2

MEIZUMX2

6\開啟可檢測性和連線

[email protected]:~#./hciconfig hci0 up piscan

7\ ping測試

/sbin #./l2ping 00:74:23:8E:D2:A9

/*********************無密碼連結藍芽**************************/

將這2個檔案放在/lib/firmware下(此為韌體升級軟體 還有必要的路徑在核心配置總)

#CONFIG_BCM4339 is not set

CONFIG_BCMDHD_FW_PATH="/system/etc/firmware/fw_bcmdhd.bin"

CONFIG_BCMDHD_NVRAM_PATH="/system/etc/wifi/bcmdhd.cal"

#CONFIG_BRCMFMAC is not set

#CONFIG_HOSTAP is not set

(相信這裡把大部分人給卡住了,嘖嘖嘖,我可是研究好幾天呢)

rtl8723b_fw       rtl8723bu_config

vi/etc/passwd,在最後新增messagebus:x:500:500::/home/messagebus:/bin/sh,儲存

exportPATH=/mnt/sdcard/bluez-4.95/bin:$PATH

exportPATH=/mnt/sdcard/bluez-4.95/sbin:$PATH

exportLD_LIBRARY_PATH=/mnt/sdcard/bluez-4.95/lib:$LD_LIBRARY_PATH

mount/mnt/sdcard/bluez-4.95 /usr/local/bluez-4.95/

hciconfig

hciconfighci0 up

rm/mnt/sdcard/bluez-4.95/var/run/dbus/pid

dbus-daemon--system

bluetoothd

hciconfighci0 up piscan

hcitoolscan

hciconfighci0 up piscan

/***********************************************/