打开r40平台tinav2.1下的AP6212A0版本的WIFI(分色排版)

来源:互联网 发布:初中生编程 编辑:程序博客网 时间:2024/05/18 01:25

 

打开r40平台tinav2.1下的AP6212A0版本的WIFI

2017/10/18 16:34

版本:V1.0

 

 

0、开发板使用:CB-S

切记:在调板的时候请严重注意:WIFI模块的供电以及GPIO控制引脚的设置!

W:\r40\r40_tinav2.1\target\allwinner\azalea-m2ultra\configs\sys_config.fex

;wlan_regon                            = port:PG10<1><1><1><0>

wlan_regon                            = port:PH00<1><1><1><0>

wlan_hostwake                         = port:power0<0><default><default><default>

 

 

 

 

1、原始编译r40平台的tinav2.1系统:

rootroot@cm-System-Product-Name:/home/wwt/r40$ tar zxvf r40_tinav2.1_leo_20170112.tar.gz 

rootroot@cm-System-Product-Name:/home/wwt/r40$ mv tina/ r40_tinav2.1

rootroot@cm-System-Product-Name:/home/wwt/r40$ cd r40_tinav2.1/

rootroot@cm-System-Product-Name:/home/wwt/r40/r40_tinav2.1$ source build/envsetup.sh

rootroot@cm-System-Product-Name:/home/wwt/r40/r40_tinav2.1$ lunch

     13. azalea_m2ultra-tina

Which would you like?13

rootroot@cm-System-Product-Name:/home/wwt/r40/r40_tinav2.1$ make -j12

rootroot@cm-System-Product-Name:/home/wwt/r40/r40_tinav2.1$ pack

 

 

 

 

2、打开AP6212A0版本的WIFI(由于DEBUG调试口中有太多打印信息,使用adb了):

Microsoft Windows [版本 6.1.7600]

版权所有 (c) 2009 Microsoft Corporation。保留所有权利。

 

C:\Users\Administrator>adb shell

 

 

BusyBox v1.24.1 () built-in shell (ash)

 

 _____  _              __     _

|_   _||_| ___  _ _   |  |   |_| ___  _ _  _ _

  | |   _ |   ||   |  |  |__ | ||   || | ||_'_|

  | |  | || | || _ |  |_____||_||_|_||___||_,_|

  |_|  |_||_|_||_|_|  Tina is Based on OpenWrt!

 ----------------------------------------------

 Tina Linux (Neptune, 5861D22E)

 ----------------------------------------------

root@TinaLinux:/#

确认WIFI模块AP6212A0的驱动模块:bcmdhd.ko已经加载了!

root@TinaLinux:/# lsmod

lsmod

bcmdhd                530496  0

crc_ccitt               1003  1 ppp_async

disp                 1024221  1 mali

ft5x_ts                56095  0

fuse                   59395  0

mali                  144801  0

ov5640                 23589  0

ppp_async               6125  0

snd_mixer_oss          11447  1 snd_pcm_oss

snd_pcm_oss            32590  0

snd_rawmidi            15038  0

snd_seq_device          4206  1 snd_rawmidi

uvcvideo               55997  0

vfe_io                 24990  2 vfe_v4l2

vfe_v4l2              170636  0

videobuf2_core         20745  2 uvcvideo

videobuf2_dma_contig    7462  1 vfe_v4l2

videobuf2_memops        1167  2 videobuf2_vmalloc

videobuf2_vmalloc       2260  1 uvcvideo

root@TinaLinux:/#

 

 

确认wlan0默认没有启动:

root@TinaLinux:/# ifconfig

ifconfig

eth0      Link encap:Ethernet  HWaddr 36:6E:30:E4:98:81

          UP BROADCAST MULTICAST  MTU:1500  Metric:1

          RX packets:0 errors:0 dropped:0 overruns:0 frame:0

          TX packets:1 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:1000

          RX bytes:0 (0.0 B)  TX bytes:342 (342.0 B)

          Interrupt:117

 

lo        Link encap:Local Loopback

          inet addr:127.0.0.1  Mask:255.0.0.0

          UP LOOPBACK RUNNING  MTU:65536  Metric:1

          RX packets:20 errors:0 dropped:0 overruns:0 frame:0

          TX packets:20 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:0

          RX bytes:1564 (1.5 KiB)  TX bytes:1564 (1.5 KiB)

 

root@TinaLinux:/#

 

 

确认WIFI模块AP6212A0的驱动模块:bcmdhd.ko已经正常加载:生成wlan0了!

root@TinaLinux:/#

root@TinaLinux:/# ifconfig -a

ifconfig -a

eth0      Link encap:Ethernet  HWaddr 36:6E:30:E4:98:81

          UP BROADCAST MULTICAST  MTU:1500  Metric:1

          RX packets:0 errors:0 dropped:0 overruns:0 frame:0

          TX packets:1 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:1000

          RX bytes:0 (0.0 B)  TX bytes:342 (342.0 B)

          Interrupt:117

 

gre0      Link encap:UNSPEC  HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00

          NOARP  MTU:1476  Metric:1

          RX packets:0 errors:0 dropped:0 overruns:0 frame:0

          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:0

          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

 

gretap0   Link encap:Ethernet  HWaddr 00:00:00:00:00:00

          BROADCAST MULTICAST  MTU:1476  Metric:1

          RX packets:0 errors:0 dropped:0 overruns:0 frame:0

          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:1000

          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

 

lo        Link encap:Local Loopback

          inet addr:127.0.0.1  Mask:255.0.0.0

          UP LOOPBACK RUNNING  MTU:65536  Metric:1

          RX packets:20 errors:0 dropped:0 overruns:0 frame:0

          TX packets:20 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:0

          RX bytes:1564 (1.5 KiB)  TX bytes:1564 (1.5 KiB)

 

tunl0     Link encap:UNSPEC  HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00

          NOARP  MTU:0  Metric:1

          RX packets:0 errors:0 dropped:0 overruns:0 frame:0

          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:0

          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

 

wlan0     Link encap:Ethernet  HWaddr B0:F1:EC:2C:74:96

          BROADCAST MULTICAST  MTU:1500  Metric:1

          RX packets:0 errors:0 dropped:0 overruns:0 frame:0

          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:1000

          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

 

root@TinaLinux:/#

 

 

启动wlan0:

root@TinaLinux:/#

root@TinaLinux:/# ifconfig wlan0 up

ifconfig wlan0 up

root@TinaLinux:/#

 

 

确认wlan0已经起来了:

root@TinaLinux:/#

root@TinaLinux:/# ifconfig

ifconfig

eth0      Link encap:Ethernet  HWaddr 36:6E:30:E4:98:81

          UP BROADCAST MULTICAST  MTU:1500  Metric:1

          RX packets:0 errors:0 dropped:0 overruns:0 frame:0

          TX packets:1 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:1000

          RX bytes:0 (0.0 B)  TX bytes:342 (342.0 B)

          Interrupt:117

 

lo        Link encap:Local Loopback

          inet addr:127.0.0.1  Mask:255.0.0.0

          UP LOOPBACK RUNNING  MTU:65536  Metric:1

          RX packets:20 errors:0 dropped:0 overruns:0 frame:0

          TX packets:20 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:0

          RX bytes:1564 (1.5 KiB)  TX bytes:1564 (1.5 KiB)

 

wlan0     Link encap:Ethernet  HWaddr B0:F1:EC:2C:74:96

          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

          RX packets:0 errors:0 dropped:0 overruns:0 frame:0

          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:1000

          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

 

root@TinaLinux:/#

 

 

确认WIFI的连接程序wifi_connect_ap_test已经默认编译了:

root@TinaLinux:/# cd bin

cd bin

root@TinaLinux:/bin# ll

ll

drwxr-xr-x    2 root     root          1205 Oct 18  2017 .

drwxr-xr-x    1 root     root          1024 Jan  1 08:00 ..

-rwxr-xr-x    1 root     root           128 Oct 18  2017 adb_shell

-rwxr-xr-x    1 root     root        102893 Oct 18  2017 adbd

lrwxrwxrwx    1 root     root             7 Oct 18  2017 ash -> busybox

-rwxrwxr-x    1 root     root           265 Oct 18  2017 board_detect

-rwxr-xr-x    1 root     root        374193 Oct 18  2017 busybox

lrwxrwxrwx    1 root     root             7 Oct 18  2017 cat -> busybox

lrwxrwxrwx    1 root     root             7 Oct 18  2017 chgrp -> busybox

lrwxrwxrwx    1 root     root             7 Oct 18  2017 chmod -> busybox

lrwxrwxrwx    1 root     root             7 Oct 18  2017 chown -> busybox

-rwxrwxr-x    1 root     root          7486 Oct 18  2017 config_generate

lrwxrwxrwx    1 root     root             7 Oct 18  2017 cp -> busybox

lrwxrwxrwx    1 root     root             7 Oct 18  2017 date -> busybox

lrwxrwxrwx    1 root     root             7 Oct 18  2017 dd -> busybox

lrwxrwxrwx    1 root     root             7 Oct 18  2017 df -> busybox

lrwxrwxrwx    1 root     root             7 Oct 18  2017 dmesg -> busybox

lrwxrwxrwx    1 root     root             7 Oct 18  2017 echo -> busybox

lrwxrwxrwx    1 root     root             7 Oct 18  2017 egrep -> busybox

lrwxrwxrwx    1 root     root             7 Oct 18  2017 false -> busybox

lrwxrwxrwx    1 root     root             7 Oct 18  2017 fgrep -> busybox

lrwxrwxrwx    1 root     root             7 Oct 18  2017 fsync -> busybox

lrwxrwxrwx    1 root     root             7 Oct 18  2017 grep -> busybox

lrwxrwxrwx    1 root     root             7 Oct 18  2017 gunzip -> busybox

lrwxrwxrwx    1 root     root             7 Oct 18  2017 gzip -> busybox

-rwxr-xr-x    1 root     root         20677 Oct 18  2017 healthd

-rwxrwxr-x    1 root     root          1550 Oct 18  2017 ipcalc.sh

lrwxrwxrwx    1 root     root             7 Oct 18  2017 kill -> busybox

lrwxrwxrwx    1 root     root             7 Oct 18  2017 ln -> busybox

lrwxrwxrwx    1 root     root             7 Oct 18  2017 lock -> busybox

lrwxrwxrwx    1 root     root             7 Oct 18  2017 login -> busybox

-rwxrwxr-x    1 root     root           383 Oct 18  2017 login.sh

lrwxrwxrwx    1 root     root             7 Oct 18  2017 ls -> busybox

lrwxrwxrwx    1 root     root             7 Oct 18  2017 mkdir -> busybox

lrwxrwxrwx    1 root     root             7 Oct 18  2017 mknod -> busybox

lrwxrwxrwx    1 root     root             7 Oct 18  2017 mktemp -> busybox

lrwxrwxrwx    1 root     root             7 Oct 18  2017 mount -> busybox

-rwxr-xr-x    1 root     root          9038 Oct 18  2017 mtop

lrwxrwxrwx    1 root     root             7 Oct 18  2017 mv -> busybox

lrwxrwxrwx    1 root     root             7 Oct 18  2017 netmsg -> busybox

lrwxrwxrwx    1 root     root             7 Oct 18  2017 netstat -> busybox

lrwxrwxrwx    1 root     root             7 Oct 18  2017 nice -> busybox

-rwxr-xr-x    1 root     root        116564 Oct 18  2017 opkg

lrwxrwxrwx    1 root     root             7 Oct 18  2017 pidof -> busybox

lrwxrwxrwx    1 root     root             7 Oct 18  2017 ping -> busybox

lrwxrwxrwx    1 root     root             7 Oct 18  2017 ping6 -> busybox

lrwxrwxrwx    1 root     root             7 Oct 18  2017 ps -> busybox

lrwxrwxrwx    1 root     root             7 Oct 18  2017 pwd -> busybox

lrwxrwxrwx    1 root     root             7 Oct 18  2017 rm -> busybox

lrwxrwxrwx    1 root     root             7 Oct 18  2017 rmdir -> busybox

lrwxrwxrwx    1 root     root             7 Oct 18  2017 sed -> busybox

lrwxrwxrwx    1 root     root             7 Oct 18  2017 sh -> busybox

lrwxrwxrwx    1 root     root             7 Oct 18  2017 sleep -> busybox

-rwxr-xr-x    1 root     root         16383 Oct 18  2017 smartlinkd

-rwxr-xr-x    1 root     root         20758 Oct 18  2017 smartlinkd_adt

-rwxr-xr-x    1 root     root          9488 Oct 18  2017 smartlinkd_setup

lrwxrwxrwx    1 root     root             7 Oct 18  2017 su -> busybox

lrwxrwxrwx    1 root     root             7 Oct 18  2017 sync -> busybox

lrwxrwxrwx    1 root     root             7 Oct 18  2017 tar -> busybox

-rwxr-xr-x    1 root     root          4087 Oct 18  2017 tinyplayer

lrwxrwxrwx    1 root     root             7 Oct 18  2017 touch -> busybox

lrwxrwxrwx    1 root     root             7 Oct 18  2017 true -> busybox

-rwxr-xr-x    1 root     root         12347 Oct 18  2017 ubus

-rwxr-xr-x    1 root     root         16403 Oct 18  2017 uclient-fetch

lrwxrwxrwx    1 root     root             7 Oct 18  2017 umount -> busybox

lrwxrwxrwx    1 root     root             7 Oct 18  2017 uname -> busybox

lrwxrwxrwx    1 root     root             7 Oct 18  2017 vi -> busybox

lrwxrwxrwx    1 root     root            13 Oct 18  2017 wget -> uclient-fetch

-rwxr-xr-x    1 root     root          4102 Oct 18  2017 wifi_add_network_test

-rwxr-xr-x    1 root     root          4102 Oct 18  2017 wifi_connect_ap_test

-rwxr-xr-x    1 root     root          4102 Oct 18  2017 wifi_connect_ap_with_netid_test

-rwxr-xr-x    1 root     root          4102 Oct 18  2017 wifi_connect_chinese_ap_test

-rwxr-xr-x    1 root     root          4102 Oct 18  2017 wifi_get_netid_test

-rwxr-xr-x    1 root     root          4102 Oct 18  2017 wifi_list_networks_test

-rwxr-xr-x    1 root     root          8198 Oct 18  2017 wifi_longtime_test

-rwxr-xr-x    1 root     root          4102 Oct 18  2017 wifi_on_off_test

-rwxr-xr-x    1 root     root          4102 Oct 18  2017 wifi_remove_network_test

-rwxr-xr-x    1 root     root          4102 Oct 18  2017 wifi_scan_results_test

lrwxrwxrwx    1 root     root             7 Oct 18  2017 zcat -> busybox

root@TinaLinux:/bin#

 

 

(连接AP的格式:wifi_connect_ap_test SSID 密码:)

root@TinaLinux:/bin#

root@TinaLinux:/bin# wifi_connect_ap_test CityBrand citybrand200903

wifi_connect_ap_test CityBrand citybrand200903

 

*********************************

***Start wifi connect ap test!***

*********************************

wpa_suppplicant not running!

ctrl_interface != /etc/wifi/sockets

Cannot create "/data/misc/wifi/entropy.bin": No such file or directory

Wi-Fi entropy file was not created

Connected to wpa_supplicant!

event_label 0x0

WiFi on success!

do cmd LIST_NETWORKS

do cmd SCAN

call event 0xf004

event_label 0x0

It has no wifi auto connect when wifi on!

aw wifi connect state 0xf0

enter get_key_mgmt, ssid CityBrand

scan stauts 1

do cmd SCAN_RESULTS

ssid CityBrand, flag [WPA2-PSK-CCMP][ESS]

do cmd LIST_NETWORKS

do cmd ADD_NETWORK

do cmd SET_NETWORK 0 ssid "CityBrand"

do cmd SET_NETWORK 0 key_mgmt WPA-PSK

do cmd SET_NETWORK 0 psk "citybrand200903"

do cmd LIST_NETWORKS

do cmd GET_NETWORK 0 priority

do cmd SET_NETWORK 0 priority 1

do cmd SELECT_NETWORK 0

do cmd RECONNECT

do cmd LIST_NETWORKS

connecting id 0, connected id 0

 1885 root      1036 S    sh -c /etc/wifi/udhcpc_wlan0 restart

 1886 root      1128 S    {udhcpc_wlan0} /bin/sh /etc/rc.common /etc/wifi/udhc

Command failed: Not found

 1885 root      1036 S    sh -c /etc/wifi/udhcpc_wlan0 restart

 1886 root      1128 S    {udhcpc_wlan0} /bin/sh /etc/rc.common /etc/wifi/udhc

do cmd SAVE_CONFIG

wifi connected in inner!

do cmd LIST_NETWORKS

do cmd ENABLE_NETWORK 0

do cmd SAVE_CONFIG

wifi state busing,waiting

vflag= 4

call event 0xf00b

event_label 0x1

WiFi connected ap!

******************************

Wifi connect ap test: Success!

******************************

root@TinaLinux:/bin#

 

root@TinaLinux:/bin#

 

root@TinaLinux:/bin#

(确认获取到局域网的IP地址:)

root@TinaLinux:/bin# ifconfig

ifconfig

eth0      Link encap:Ethernet  HWaddr 36:6E:30:E4:98:81

          UP BROADCAST MULTICAST  MTU:1500  Metric:1

          RX packets:0 errors:0 dropped:0 overruns:0 frame:0

          TX packets:1 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:1000

          RX bytes:0 (0.0 B)  TX bytes:342 (342.0 B)

          Interrupt:117

 

lo        Link encap:Local Loopback

          inet addr:127.0.0.1  Mask:255.0.0.0

          UP LOOPBACK RUNNING  MTU:65536  Metric:1

          RX packets:44 errors:0 dropped:0 overruns:0 frame:0

          TX packets:44 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:0

          RX bytes:3436 (3.3 KiB)  TX bytes:3436 (3.3 KiB)

 

wlan0     Link encap:Ethernet  HWaddr B0:F1:EC:2C:74:96

          inet addr:192.168.0.89  Bcast:192.168.0.255  Mask:255.255.255.0

          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

          RX packets:7 errors:0 dropped:0 overruns:0 frame:0

          TX packets:4 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:1000

          RX bytes:1426 (1.3 KiB)  TX bytes:942 (942.0 B)

PING通外网:百度)

root@TinaLinux:/bin# ping www.baidu.com

ping www.baidu.com

PING www.baidu.com (14.215.177.38): 56 data bytes

64 bytes from 14.215.177.38: seq=0 ttl=56 time=7.098 ms

64 bytes from 14.215.177.38: seq=1 ttl=56 time=7.698 ms

64 bytes from 14.215.177.38: seq=2 ttl=56 time=47.787 ms

64 bytes from 14.215.177.38: seq=3 ttl=56 time=10.891 ms

64 bytes from 14.215.177.38: seq=4 ttl=56 time=7.871 ms

64 bytes from 14.215.177.38: seq=5 ttl=56 time=9.378 ms

64 bytes from 14.215.177.38: seq=6 ttl=56 time=8.965 ms

64 bytes from 14.215.177.38: seq=7 ttl=56 time=7.420 ms

64 bytes from 14.215.177.38: seq=8 ttl=56 time=7.207 ms

64 bytes from 14.215.177.38: seq=9 ttl=56 time=7.863 ms

64 bytes from 14.215.177.38: seq=10 ttl=56 time=7.247 ms

64 bytes from 14.215.177.38: seq=11 ttl=56 time=7.330 ms

64 bytes from 14.215.177.38: seq=12 ttl=56 time=63.251 ms

64 bytes from 14.215.177.38: seq=13 ttl=56 time=10.530 ms

64 bytes from 14.215.177.38: seq=14 ttl=56 time=9.613 ms

64 bytes from 14.215.177.38: seq=15 ttl=56 time=16.344 ms

64 bytes from 14.215.177.38: seq=16 ttl=56 time=7.467 ms

64 bytes from 14.215.177.38: seq=17 ttl=56 time=36.795 ms

64 bytes from 14.215.177.38: seq=18 ttl=56 time=7.365 ms

64 bytes from 14.215.177.38: seq=19 ttl=56 time=7.306 ms

64 bytes from 14.215.177.38: seq=20 ttl=56 time=9.825 ms

64 bytes from 14.215.177.38: seq=21 ttl=56 time=17.949 ms

64 bytes from 14.215.177.38: seq=22 ttl=56 time=12.409 ms

64 bytes from 14.215.177.38: seq=23 ttl=56 time=7.420 ms

64 bytes from 14.215.177.38: seq=24 ttl=56 time=8.865 ms

64 bytes from 14.215.177.38: seq=25 ttl=56 time=9.603 ms

64 bytes from 14.215.177.38: seq=26 ttl=56 time=10.551 ms

64 bytes from 14.215.177.38: seq=27 ttl=56 time=17.536 ms

64 bytes from 14.215.177.38: seq=28 ttl=56 time=7.050 ms

64 bytes from 14.215.177.38: seq=29 ttl=56 time=97.825 ms

64 bytes from 14.215.177.38: seq=30 ttl=56 time=11.891 ms

64 bytes from 14.215.177.38: seq=31 ttl=56 time=8.199 ms

PING通内网:)

root@TinaLinux:/bin# ping 192.168.0.88

ping 192.168.0.88

PING 192.168.0.88 (192.168.0.88): 56 data bytes

64 bytes from 192.168.0.88: seq=0 ttl=64 time=10.483 ms

64 bytes from 192.168.0.88: seq=1 ttl=64 time=4.269 ms

64 bytes from 192.168.0.88: seq=2 ttl=64 time=2.143 ms

64 bytes from 192.168.0.88: seq=3 ttl=64 time=38.314 ms

64 bytes from 192.168.0.88: seq=4 ttl=64 time=2.426 ms

 

 

阅读全文
0 0
原创粉丝点击