linux wifi ap无法连接(2)——已解决

倒腾了一两周了,wifi热点无法连接问题一直还没得到解决。

这过程中好像是查了很多资料,请教了很多同学、同行,根据他们提供的办法,做了很多验证,但是依然没有找到真因和解决办法。

我想是时候需要换一个方式来思考,根据个人调试驱动的经验规则,再重新调试一个模块功能的时候,一般多多少少都会有坑,出来的结果未能复合预期。

但是因为是新的一个功能模块,这里面涉及到的东西会比较多,软件、硬件、驱动、工具软件等等。

1、WIFI模块是否ok

2、电路设计是否ok。

3、WIFI驱动是否ok。

4、配置的工具软件是否ok。

5、配置参数是否ok。

在排查分析的时候,如果我们有一个成功的案例可以用来参照对比,那么分析排查起来就会事半功倍。

还好,我手上正好有个anddroid板子也是跑的这个wifi模块,可以拿过来对比。

1、WIFI模块:从另外一个android上ok的板子上,换了一个wifi模块过来,交叉验证,结果一样。

2、电路设计:由于新设计的板子还没那么快回来,现在用的板子是我自己临时飞线接的WIFI模块,和androidok的板子量测各路电压对比,都正常,一样。

3、wifi驱动:用compare对比android和linux的两份驱动,没有差别。

4、工具软件:linux用的hostapd是1.0版本 android用的是2.6版本,

更新hosptapd源码,重新编译打包测试,依然无法连接。

5、配置文件:

对比两份hostapd.conf,发现配置差异比较大,

android配置如下:

interface=wlan0
driver=nl80211
ctrl_interface=/var/run/hostapd
ssid=carwifi
channel=9
ieee80211n=1
hw_mode=g
ignore_broadcast_ssid=0
wpa=2
rsn_pairwise=CCMP
wpa_psk=f86d47f43be307baa3afdb8e862c8519bc832db87ab0e3937ae792e3dddab1c4

 这里的wpa_psk是密码00000000经过算法处理后的串码,因为andorid的hostapd.conf是动态生成的,根据用户在设置界面设置的热点名称密码等信息生成到/data/misc/wifi/hostapd.conf文件

首先直接套用andorid的hostapd.conf验证,显示密码错误,但是没有再出现reason(8)

第二步将密码部分依然采用wpa_passphrase=00000000设置,重新测试OK。

interface=wlan0
driver=nl80211
ctrl_interface=/var/run/hostapd
ssid=carwifi
channel=9
ieee80211n=1
hw_mode=g
ignore_broadcast_ssid=0
wpa=2
rsn_pairwise=CCMP
wpa_passphrase=00000000

log如下

[    5.585142] RTL871X: module init start
[    5.589276] RTL871X: rtl8188eu driver version = v4.2.5_9909.20131204_beta
[    5.597064] RTL871X: build time: May 21 2018 17:49:00
[    5.610198] 
[    5.610198] insmod_host_driver
[    5.610198] 
[    5.616829] [ehci0-controller]: sunxi_usb_enable_ehci
[    5.622711] [sunxi-ehci0]: probe, pdev->name: 1c14000.ehci0-controller, sunxi_ehci: 0xc0a7a474, 0x:f1c14000, irq_no:47
[    5.634778] sunxi-ehci 1c14000.ehci0-controller: SW USB2.0 'Enhanced' Host Controller (EHCI) Driver
[    5.644988] sunxi-ehci 1c14000.ehci0-controller: new USB bus registered, assigned bus number 1
[    5.656335] sunxi-ehci 1c14000.ehci0-controller: irq 71, io mem 0xce0e2240
[    5.680118] sunxi-ehci 1c14000.ehci0-controller: USB 0.0 started, EHCI 1.00
[    5.687981] ehci_irq: highspeed device connect
[    5.687983] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002
[    5.687990] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    5.687997] usb usb1: Product: SW USB2.0 'Enhanced' Host Controller (EHCI) Driver
[    5.688003] usb usb1: Manufacturer: Linux 3.10.65 ehci_hcd
[    5.688008] usb usb1: SerialNumber: sunxi-ehci
[    5.729627] usbcore: registered new interface driver rtl8188eu
[    5.730083] hub 1-0:1.0: USB hub found
[    5.730130] hub 1-0:1.0: 1 port detected
[    5.730702] [ohci0-controller]: sunxi_usb_enable_ohci
[    5.730715] [sunxi-ohci0]: probe, pdev->name: 1c14000.ohci0-controller, sunxi_ohci: 0xc0a79c94
[    5.730787] sunxi-ohci 1c14000.ohci0-controller: SW USB2.0 'Open' Host Controller (OHCI) Driver
[    5.730827] sunxi-ohci 1c14000.ohci0-controller: new USB bus registered, assigned bus number 2
[    5.730907] sunxi-ohci 1c14000.ohci0-controller: irq 72, io mem 0xce0e2240
[    5.787022] RTL871X: module init ret=0
[    5.794177] usb usb2: New USB device found, idVendor=1d6b, idProduct=0001
[    5.801889] usb usb2: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    5.809834] usb usb2: Product: SW USB2.0 'Open' Host Controller (OHCI) Driver
[    5.817955] usb usb2: Manufacturer: Linux 3.10.65 ohci_hcd
[    5.824102] usb usb2: SerialNumber: sunxi-ohci
[    5.830916] hub 2-0:1.0: USB hub found
[    5.835095] hub 2-0:1.0: 1 port detected
[    6.040193] usb 1-1: new high-speed USB device number 2 using sunxi-ehci
[    6.193070] usb 1-1: New USB device found, idVendor=0bda, idProduct=8179
[    6.200623] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[    6.208528] usb 1-1: Product: 802.11n WLAN NIC
[    6.213718] usb 1-1: Manufacturer: Realtek
[    6.232669] bFWReady == _FALSE call reset 8051...
[    6.335056] RTL871X: rtw_ndev_init(wlan0)
[    6.351283] RTL871X: rtw_ndev_init(wlan1)
[    8.211437] ==> rtl8188e_iol_efuse_patch 
[    8.650830] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready
random: Trying to read entropy from /dev/random
Configuration file: /etc/hostapd.conf
nl80211: Could not add multicast membership for vendor events: -2 (No such file or directory)
nl80211: Using driver-based roaming
nl80211: Supported cipher 00-0f-ac:1
nl80211: Supported cipher 00-0f-ac:5
nl80211: Supported cipher 00-0f-ac:2
nl80211: Supported cipher 00-0f-ac:4
nl80211: Using driver-based off-channel TX
nl80211: interface wlan0 in phy phy0
nl80211: Set mode ifindex 6 iftype 3 (AP)
nl80211: Setup AP(wlan0) - device_ap_sme=1 use_monitor=0
nl80211: Subscribe to mgmt frames with AP handle 0x145de30 (device SME)
nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0x145de30 match=04
nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0x145de30 match=0501
nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0x145de30 match=0504
nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0x145de30 match=06
nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0x145de30 match=08
nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0x145de30 match=09
nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0x145de30 match=0a
nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0x145de30 match=11
nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0x145de30 match=7f
nl80211: Enable Probe Request reporting nl_preq=0x145d900
nl80211: Register frame type=0x40 (WLAN_FC_STYPE_PROBE_REQ) nl_handle=0x145d900 match=
rfkill: initial event: idx=0 type=1 op=0 soft=0 hard=0
nl80211: Could not re-add multicast membership for vendor events: -2 (No such file or directory)
nl80211: Add own interface ifindex 6 (ifidx_reason -1)
nl80211: if_indices[16]: 6(-1)
phy: phy0
BSS count 1, BSSID mask 00:00:00:00:00:00 (0 bits)
nl80211: Regulatory information - country=00
nl80211: 2402-2472 @ 40 MHz 20 mBm
nl80211: 2457-2482 @ 40 MHz 20 mBm (no IR)
nl80211: 2474-2494 @ 20 MHz 20 mBm (no OFDM) (no IR)
nl80211: 5170-5250 @ 80 MHz 20 mBm (no IR)
nl80211: 5735-5835 @ 80 MHz 20 mBm (no IR)
nl80211: 57240-63720 @ 2160 MHz 0 mBm
nl80211: Added 802.11b mode based on 802.11g information
Completing interface initialization
Mode: IEEE 802.11g  Channel: 9  Frequency: 2452 MHz
DFS 0 channels required radar detection
nl80211: Set freq 2452 (ht_enabled=1, vht_enabled=0, bandwidth=20 MHz, cf1=2452 MHz, cf2=0 MHz)
  * freq=2452
  * vht_enabled=0
  * ht_enabled=1
  * sec_channel_offset=0
  * channel_type=1
RATE[0] rate=10 flags=0x1
RATE[1] rate=20 flags=0x1
RATE[2] rate=55 flags=0x1
RATE[3] rate=110 flags=0x1
RATE[4] rate=60 flags=0x0
RATE[5] rate=90 flags=0x0
RATE[6] rate=120 flags=0x0
RATE[7] rate=180 flags=0x0
RATE[8] rate=240 flags=0x0
RATE[9] rate=360 flags=0x0
RATE[10] rate=480 flags=0x0
RATE[11] rate=540 flags=0x0
hostapd_setup_bss(hapd=0x145d250 (wlan0), first=1)
wlan0: Flushing old station entries
nl80211: flush -> DEL_STATION wlan0 (all)
wlan0: Deauthenticate all stations
nl80211: sta_remove -> DEL_STATION wlan0 ff:ff:ff:ff:ff:ff --> -22 (Invalid argument)
wpa_driver_nl80211_set_key: ifindex=6 (wlan0) alg=0 addr=(nil) key_idx=0 set_tx=0 seq_len=0 key_len=0
wpa_driver_nl80211_set_key: ifindex=6 (wlan0) alg=0 addr=(nil) key_idx=1 set_tx=0 seq_len=0 key_len=0
wpa_driver_nl80211_set_key: ifindex=6 (wlan0) alg=0 addr=(nil) key_idx=2 set_tx=0 seq_len=0 key_len=0
wpa_driver_nl80211_set_key: ifindex=6 (wlan0) alg=0 addr=(nil) key_idx=3 set_tx=0 seq_len=0 key_len=0
Using interface wlan0 with hwaddr 14:6b:9c:08:f7:df and ssid "carwifi"
Deriving WPA PSK based on passphrase
SSID - hexdump_ascii(len=7):
     63 61 72 77 69 66 69                              carwifi         
PSK (ASCII passphrase) - hexdump_ascii(len=8): [REMOVED]
PSK (from passphrase) - hexdump(len=32): [REMOVED]
random: Got 11/20 bytes from /dev/random
random: Only 11/20 bytes of strong random data available from /dev/random
random: Not enough entropy pool available for secure operations
WPA: Not enough entropy in random pool for secure operations - update keys later when the first station connects
GMK - hexdump(len=32): [REMOVED]
Key Counter - hexdump(len=32): [REMOVED]
WPA: Delay group state machine start until Beacon frames have been configured
nl80211: Set beacon (beacon_set=0)
nl80211: Beacon head - hexdump(len=58): 80 00 00 00 ff ff ff ff ff ff 14 6b 9c 08 f7 df 14 6b 9c 08 f7 df 00 00 00 00 00 00 00 00 00 00 64 00 11 04 00 07 63 61 72 77 69 66 69 01 08 82 84 8b 96 0c 12 18 24 03 01 09
nl80211: Beacon tail - hexdump(len=109): 2a 01 04 32 04 30 48 60 6c 30 14 01 00 00 0f ac 04 01 00 00 0f ac 04 01 00 00 0f ac 02 0c 00 2d 1a 0c 00 1f ff 00 00 00 01 00 00 00 00 00 96 00 01 00 00 00 00 00 00 00 00 00 00 3d 16 09 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 dd 18 00 50 f2 02 01 01 00 00 03 a4 00 00 27 a4 00 00 42 43 5e 00 62 32 2f 00
nl80211: ifindex=6
nl80211: beacon_int=100
nl80211: dtim_period=2
nl80211: ssid - hexdump_ascii(len=7):
     63 61 72 77 69 66 69                              carwifi         
  * beacon_int=100
  * dtim_period=2
nl80211: hidden SSID not in use
nl80211: privacy=1
nl80211: auth_algs=0x3
nl80211: wpa_version=0x2
nl80211: key_mgmt_suites=0x2
nl80211: pairwise_ciphers=0x10
nl80211: group_cipher=0x10
nl80211: SMPS mode - off
[   10.510173] gpu cooling callback set freq limit 384
[   10.934272] RTL871X: assoc success
[   10.938114] IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready
WPA: Start group state machine to set initial keys
WPA: group s[   10.949233] RTL871X: set group key to hw: alg:4(WEP40-1 WEP104-5 TKIP-2 AES-4) keyid:1
tate machine entering state GTK_INIT (VLAN-ID 0)
GTK - hexdump(len=16): [REMOVED]
WPA: group state machine entering state SETKEYSDONE (VLAN-ID 0)
wpa_driver_nl80211_set_key: ifindex=6 (wlan0) alg=3 addr=0x64fc6 key_idx=1 set_tx=1 seq_len=0 key_len=16
nl80211: KEY_DATA - hexdump(len=16): [REMOVED]
   broadcast key
nl80211: Set wlan0 operstate 0->1 (UP)
netlink: Operstate: ifindex=6 linkmode=-1 (no change), operstate=6 (IF_OPER_UP)
Failed to set TX queue parameters for queue 0.
Failed to set TX queue parameters for queue 1.
Failed to set TX queue parameters for queue 2.
Failed to set TX queue parameters for queue 3.
wlan0: interface state UNINITIALIZED->ENABLED
wlan0: AP-ENABLED 
wlan0: Setup of interface done.
ctrl_iface not configured!
Internet Systems Consortium DHCP Server 4.1.1-P1
Copyright 2004-2010 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/
Wrote 0 leases to leases file.
Listening on LPF/wlan0/14:6b:9c:08:f7:df/192.168.1.0/24
Sending on   LPF/wlan0/14:6b:9c:08:f7:df/192.168.1.0/24
Sending on   Socket/fallback/fallback-net
[root@t3_p3 ~]# 
[root@t3_p3 ~]# 
[root@t3_p3 ~]# [   55.968303] RTL871X: set group key to hw: alg:4(WEP40-1 WEP104-5 TKIP-2 AES-4) keyid:1
[   55.971833] RTL871X: send eapol packet
[   65.982238] RTL871X: ap recv disassoc reason code(8) sta:f4:9f:f3:1d:cd:d0
[   65.990216] RTL871X: ap recv disassoc reason code(8) sta:f4:9f:f3:1d:cd:d0
[   66.001054] RTL871X: set pairwise key to hw: alg:0(WEP40-1 WEP104-5 TKIP-2 AES-4) camid:0
[  102.430195] RTL871X: set group key to hw: alg:4(WEP40-1 WEP104-5 TKIP-2 AES-4) keyid:1
[  102.433343] RTL871X: send eapol packet
[  102.452985] RTL871X: send eapol packet
[  102.470072] RTL871X: set pairwise key to hw: alg:4(WEP40-1 WEP104-5 TKIP-2 AES-4) camid:4

2018-06-07

深圳南山科技工业大厦

猜你喜欢

转载自www.cnblogs.com/tid-think/p/9154162.html