CyanogenDefy / android_device_motorola_jordan

Motorola Defy MB525 CM7 XDA (jordan)
http://forum.xda-developers.com/showthread.php?t=1065798
79 stars 60 forks source link

WiFi doesn't work in all nightlys after RC0 #7

Closed janekr closed 13 years ago

janekr commented 13 years ago

Fortunately I had browser opened and managed to dump entire page with old bugreport :)

Here's the stuff: http://duch.mimuw.edu.pl/~baggins/wifi/

charlie2alpha commented 13 years ago

Nice dump! So it continues from here on.

janekr commented 13 years ago

Since neither gingerbread nor froyo wpa_supplicant works, I suggest doing git bisect between last working revision from RC0 and first non-working NIGHTLY after. This way we should be able to isolate the problem to a single commit.

maniac103 commented 13 years ago

Unfortunately, we can't bisect. RC0 used a clone of the nadlabak/android_external_wpa_supplicant_6 repo, which was imported straight from a Moto source drop (hence there is no history. Now, we use the CyanogenMod/android_external_wpa_supplicant_6 repo, which has history, as it's cloned from the AOSP one.

Just to make sure nothing is wrong in my way of compilation, here's the supplicant built straight from the nadlabak repo: http://www.mediafire.com/?8uod564t4v99773

If that one doesn't work, something is weird. If it does work, I'll revert one moto patch after another until we either find the culprit or are back at froyo state.

janekr commented 13 years ago

Things are getting weirder. After installing 110621-1140 nightly I can sometimes connect. If wifi gets stuck or can't connect the cure is to 'forget' the network I try to connect and set it up anew (even if it's an open network), half of the time I also have to disable and enable wifi in between.

Same things happen with rc0 and nadlabak wpa_supplicant.

Here are dmesg and catlog from a successfull connect followed by fails (1140 nightly):

http://duch.mimuw.edu.pl/~baggins/wifi/2011-06-21-11-21-13-dmesg.txt http://duch.mimuw.edu.pl/~baggins/wifi/2011-06-21-11-21-13.txt

tpruvot commented 13 years ago

today's build use main repo stack, i forked CyanogenDefy repo to be sure things are correctly set

tpruvot commented 13 years ago

could i see your openwrt /etc/config/wireless config please ...

janekr commented 13 years ago

I'm at work, no openwrt here, just cisco APs with WPA Enterprise PAP/TTLS and open net. I'll test at home, and post wireless config then.

tpruvot commented 13 years ago

ok, i made more tests, and that only happens with psk-mixed config in openwrt which allow WPA/WPA2 - "psk" is fine (WPA)

janekr commented 13 years ago

Can't connect with 110621-1140 nightly to my openwrt AP, supplicant from RC0 works, nadlabak does not.

Here's /etc/config/wireless

config 'wifi-device' 'radio0' option 'type' 'mac80211' option 'channel' '11' option 'macaddr' '00:15:f2:6a:e4:a6' option 'disabled' '0' option 'hwmode' '11g'

config 'wifi-iface' option 'device' 'radio0' option 'ssid' 'XXXX' option 'network' 'lan' option 'mode' 'ap' option 'encryption' 'psk2' option 'key' 'xxxxxxxx'

sunoldman commented 13 years ago

I can confirm that psk work, psk2 doesn't So it's issue with opewrt router? May also concern cisco router, since they have some relations.

charlie2alpha commented 13 years ago

You can always change the mode of an AP under your control, but what if it isn't under your control? Like the WiFi of a workplace. I doubt it's an openwrt issue since the Ciscos' cause it too. And even if the Ciscos are buggy too, the ideal would be for the issue to be fix in our side, I wouldn't expect someone to just update those APs firmware...

tpruvot commented 13 years ago

Yea, WPA2 with TKIP seems to be the problem.... Only have that with the openwrt (2.6.37) router; ath9k based

That could maybe be corrected in wpa supplicant code like prefer WPA on WPA2 when mixed is set (WPA+WPA2)

janekr commented 13 years ago

Switching openwrt to WPA made 110621-1140 nightly work. But, that's only half of the problem, what about the hiccup I'm seeing with Cisco?

Here's example config of the Cisco at orkplace.

maniac103 commented 13 years ago

So is the OpenWrt 'psk2' mode proto WPA2 and cipher TKIP or is it WPA2/CCMP?

maniac103 commented 13 years ago

Forgot to say: Personally, I'm using WPA/WPA2 mixed (WPA2 + TKIP/CCMP) without any problem, so there must be something special in the way OpenWrt handles it. Can anyone of you please post the iwlist output for a failing AP?

tpruvot commented 13 years ago

The problem is when Cipher = TKIP in WPA2

Working config with "iwlist scan" (on recent DDWRT)

IE : 802.11i/WPA2 Version 1 Group Cipher : CCMP Pairwise Cipher (1) : CCMP Auth. suites : PSK

+

E : WPA Version 1 Group Cipher : CCMP Pairwise Cipher (1) : CCMP Auth. suites : PSK

Connected in WPA2 mode

maniac103 commented 13 years ago

Yes, but how does the failing one look like?

tpruvot commented 13 years ago

in fact, look like the same now... but i dont have wifi crashes, just dont want to connect... (im on 179 now)

Bad one : Cell 04 - Address: 00:21:91:EF:B6:14 ESSID:"MimoGigabit" Protocol:IEEE 802.11 BG Mode:Managed Frequency:2.462 GHz Signal level=-59 dBm
Encryption key:on Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 11 Mb/s; 6 Mb/s 9 Mb/s; 12 Mb/s; 18 Mb/s; 24 Mb/s; 36 Mb/s 48 Mb/s; 54 Mb/s; 6.5 Mb/s; 13 Mb/s; 19.5 Mb/s 26 Mb/s; 39 Mb/s; 52 Mb/s; 58.5 Mb/s; 65 Mb/s Extra:Bcn int = 100 ms IE: Unknown: 000B4D696D6F47696761626974 IE: Unknown: 010882848B960C121824 IE: Unknown: 03010B IE: Unknown: 0706465220010D14 IE: Unknown: 2A0104 IE: Unknown: 32043048606C IE: IEEE 802.11i/WPA2 Version 1 Group Cipher : CCMP Pairwise Ciphers (1) : CCMP Authentication Suites (1) : PSK IE: Unknown: 2D1A4C101BFFFF000000000000000000000100000000000000000000 IE: Unknown: 3D160B000000000000000000000000000000000000000000 IE: Unknown: DD180050F2020101000003A4000027A4000042435E0062322F00

Good one : Cell 02 - Address: C0:3F:0E:E1:72:CA ESSID:"Mimo300" Protocol:IEEE 802.11 BG Mode:Managed Frequency:2.412 GHz Signal level=-77 dBm
Encryption key:on Bit Rates:5.5 Mb/s; 11 Mb/s; 6 Mb/s; 9 Mb/s; 12 Mb/s 18 Mb/s; 24 Mb/s; 36 Mb/s; 48 Mb/s; 54 Mb/s 6.5 Mb/s; 13 Mb/s; 19.5 Mb/s; 26 Mb/s; 39 Mb/s 52 Mb/s; 58.5 Mb/s; 65 Mb/s Extra:Bcn int = 100 ms IE: Unknown: 00074D696D6F333030 IE: Unknown: 01088B9618243048606C IE: Unknown: 030101 IE: Unknown: 2A0100 IE: Unknown: 2F0100 IE: IEEE 802.11i/WPA2 Version 1 Group Cipher : CCMP Pairwise Ciphers (1) : CCMP Authentication Suites (1) : PSK IE: Unknown: 32020C12 IE: Unknown: 2D1A7C181BFFFF000000000000000000000000000000000000000000 IE: Unknown: 3D1601001300000000000000000000000000000000000000 IE: Unknown: DD090010180201F0280000 IE: WPA Version 1 Group Cipher : CCMP Pairwise Ciphers (1) : CCMP Authentication Suites (1) : PSK

tpruvot commented 13 years ago

D/dalvikvm( 3928): GC_CONCURRENT freed 348K, 50% free 3107K/6151K, external 998K/1510K, paused 2ms+5ms I/TelephonyRegistry( 2164): notifyDataConnection: state=2 isDataConnectivityPossible=true reason=apnSwitched interfaceName=rmnet0 networkType=2 D/Tethering( 2164): MasterInitialState.processMessage what=3 D/ConnectBot.ConnectivityManager( 3717): onReceived() called; noConnectivity? false; isFailover? true I/MediaUploader( 2364): No need to wake up D/CMStats ( 3563): CONNECTIVITY_ACTION: noConnectivity = false D/CMStats ( 3563): CONNECTIVITY_ACTION: starting service D/CMStats ( 3563): User has not opted in -- skipping reporting. D/dalvikvm( 2380): GC_CONCURRENT freed 261K, 49% free 3043K/5959K, external 0K/0K, paused 2ms+3ms I/wpa_supplicant( 2219): Trying to associate with 00:21:91:ef:b6:14 (SSID='MimoGigabit' freq=2462 MHz) I/wpa_supplicant( 2219): CTRL-EVENT-STATE-CHANGE id=-1 state=3 BSSID=00:21:91:ef:b6:14 V/WifiMonitor( 2164): Event [Trying to associate with 00:21:91:ef:b6:14 (SSID='MimoGigabit' freq=2462 MHz)] V/WifiMonitor( 2164): Event [CTRL-EVENT-STATE-CHANGE id=-1 state=3 BSSID=00:21:91:ef:b6:14] V/WifiStateTracker( 2164): Changing supplicant state: SCANNING ==> ASSOCIATING W/WifiService( 2164): misformatted scan result for: 2e:ef:b7:54:7c:71 2462 174 [WPA2-PSK-CCMP] W/WifiService( 2164): misformatted scan result for: 56:5c:fc:46:8f:d5 2412 162 [WPA2-PSK-CCMP] W/WifiService( 2164): misformatted scan result for: 06:0b:0d:1f:8a:b2 2437 158 [WPA2-PSK-CCMP] W/WifiService( 2164): misformatted scan result for: 02:74:58:1c:d9:d8 2447 156 [WPA2-PSK-CCMP] W/WifiService( 2164): misformatted scan result for: 2e:ef:b7:54:7c:71 2462 174 [WPA2-PSK-CCMP] W/WifiService( 2164): misformatted scan result for: 56:5c:fc:46:8f:d5 2412 162 [WPA2-PSK-CCMP] W/WifiService( 2164): misformatted scan result for: 06:0b:0d:1f:8a:b2 2437 158 [WPA2-PSK-CCMP] W/WifiService( 2164): misformatted scan result for: 02:74:58:1c:d9:d8 2447 156 [WPA2-PSK-CCMP] W/WifiService( 2164): misformatted scan result for: 2e:ef:b7:54:7c:71 2462 174 [WPA2-PSK-CCMP] W/WifiService( 2164): misformatted scan result for: 56:5c:fc:46:8f:d5 2412 162 [WPA2-PSK-CCMP] W/WifiService( 2164): misformatted scan result for: 06:0b:0d:1f:8a:b2 2437 158 [WPA2-PSK-CCMP] W/WifiService( 2164): misformatted scan result for: 02:74:58:1c:d9:d8 2447 156 [WPA2-PSK-CCMP] I/wpa_supplicant( 2219): CTRL-EVENT-STATE-CHANGE id=0 state=4 BSSID=00:21:91:ef:b6:14 V/WifiMonitor( 2164): Event [CTRL-EVENT-STATE-CHANGE id=0 state=4 BSSID=00:21:91:ef:b6:14] V/WifiStateTracker( 2164): Changing supplicant state: ASSOCIATING ==> ASSOCIATED I/wpa_supplicant( 2219): Associated with 00:21:91:ef:b6:14 V/WifiMonitor( 2164): Event [Associated with 00:21:91:ef:b6:14] I/wpa_supplicant( 2219): CTRL-EVENT-STATE-CHANGE id=0 state=5 BSSID=00:00:00:00:00:00 V/WifiMonitor( 2164): Event [CTRL-EVENT-STATE-CHANGE id=0 state=5 BSSID=00:00:00:00:00:00] V/WifiStateTracker( 2164): Changing supplicant state: ASSOCIATED ==> FOUR_WAY_HANDSHAKE I/wpa_supplicant( 2219): WPA: 4-Way Handshake failed - pre-shared key may be incorrect V/WifiMonitor( 2164): Event [WPA: 4-Way Handshake failed - pre-shared key may be incorrect] I/wpa_supplicant( 2219): CTRL-EVENT-DISCONNECTED - Disconnect event - remove keys V/WifiMonitor( 2164): Event [CTRL-EVENT-DISCONNECTED - Disconnect event - remove keys] V/WifiStateTracker( 2164): New network state is DISCONNECTED I/wpa_supplicant( 2219): CTRL-EVENT-STATE-CHANGE id=0 state=0 BSSID=00:00:00:00:00:00 V/WifiMonitor( 2164): Event [CTRL-EVENT-STATE-CHANGE id=0 state=0 BSSID=00:00:00:00:00:00] V/WifiStateTracker( 2164): Changing supplicant state: FOUR_WAY_HANDSHAKE ==> DISCONNECTED D/WifiStateTracker( 2164): Failed to authenticate, disabling network 0 I/wpa_supplicant( 2219): CTRL-EVENT-STATE-CHANGE id=0 state=0 BSSID=00:00:00:00:00:00 V/WifiMonitor( 2164): Event [CTRL-EVENT-STATE-CHANGE id=0 state=0 BSSID=00:00:00:00:00:00] V/WifiStateTracker( 2164): Disabled network: 0 V/WifiStateTracker( 2164): Changing supplicant state: DISCONNECTED ==> DISCONNECTED I/wpa_supplicant( 2219): CTRL-EVENT-STATE-CHANGE id=-1 state=1 BSSID=00:00:00:00:00:00 V/WifiMonitor( 2164): Event [CTRL-EVENT-STATE-CHANGE id=-1 state=1 BSSID=00:00:00:00:00:00] V/WifiStateTracker( 2164): Changing supplicant state: DISCONNECTED ==> INACTIVE D/dalvikvm( 3928): GC_CONCURRENT freed 454K, 51% free 3055K/6151K, external 905K/1417K, paused 2ms+2ms D/WifiStateTracker( 2164): Reset connections and stopping DHCP D/dalvikvm( 2313): GC_CONCURRENT freed 351K, 47% free 3572K/6663K, external 0K/512K, paused 7ms+3ms D/dalvikvm( 2164): GC_EXTERNAL_ALLOC freed 856K, 37% free 6981K/11079K, external 2232K/2241K, paused 71ms I/wpa_supplicant( 2219): CTRL-EVENT-STATE-CHANGE id=-1 state=2 BSSID=00:00:00:00:00:00 V/WifiMonitor( 2164): Event [CTRL-EVENT-STATE-CHANGE id=-1 state=2 BSSID=00:00:00:00:00:00] D/WifiStateTracker( 2164): Disabling interface

sunoldman commented 13 years ago

OpenWrt wpa mode detail information can be found here: http://wiki.openwrt.org/doc/uci/wireless#wpa.modes I find the problem occurs when WPA2 or mixed mode enabled no matter the cipher is CCMP/TKIP

three test: only psk work, but all three modes work with RC0's wpa_supplicant

psk

tiwlan0 Scan completed : Cell 01 - Address: E0:05:C5:5F:34:8C ESSID:"OpenWrt" Protocol:IEEE 802.11 BG Mode:Managed Frequency:2.412 GHz Signal level=-76 dBm Encryption key:on Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 11 Mb/s; 6 Mb/s 9 Mb/s; 12 Mb/s; 18 Mb/s; 24 Mb/s; 36 Mb/s 48 Mb/s; 54 Mb/s; 6.5 Mb/s; 13 Mb/s; 19.5 Mb/s 26 Mb/s; 39 Mb/s; 52 Mb/s; 58.5 Mb/s; 65 Mb/s Extra:Bcn int = 100 ms IE: Unknown: 00074F70656E577274 IE: Unknown: 010882848B960C121824 IE: Unknown: 030101 IE: Unknown: 2A0104 IE: Unknown: 32043048606C IE: WPA Version 1 Group Cipher : TKIP Pairwise Ciphers (2) : CCMP TKIP Authentication Suites (1) : PSK IE: Unknown: 2D1AEE111BFFFF000000000000000000000100000000000000000000 IE: Unknown: 3D1601050400000000000000000000000000000000000000 IE: Unknown: DD180050F2020101000003A4000027A4000042435E0062322F00

psk2

tiwlan0 Scan completed : Cell 01 - Address: E0:05:C5:5F:34:8C ESSID:"OpenWrt" Protocol:IEEE 802.11 BG Mode:Managed Frequency:2.412 GHz Signal level=-77 dBm Encryption key:on Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 11 Mb/s; 6 Mb/s 9 Mb/s; 12 Mb/s; 18 Mb/s; 24 Mb/s; 36 Mb/s 48 Mb/s; 54 Mb/s; 6.5 Mb/s; 13 Mb/s; 19.5 Mb/s 26 Mb/s; 39 Mb/s; 52 Mb/s; 58.5 Mb/s; 65 Mb/s Extra:Bcn int = 100 ms IE: Unknown: 00074F70656E577274 IE: Unknown: 010882848B960C121824 IE: Unknown: 030101 IE: Unknown: 2A0104 IE: Unknown: 32043048606C IE: IEEE 802.11i/WPA2 Version 1 Group Cipher : CCMP Pairwise Ciphers (1) : CCMP Authentication Suites (1) : PSK IE: Unknown: 2D1AEE111BFFFF000000000000000000000100000000000000000000 IE: Unknown: 3D1601050400000000000000000000000000000000000000 IE: Unknown: DD180050F2020101000003A4000027A4000042435E0062322F00

mixed-psk

tiwlan0 Scan completed : Cell 01 - Address: E0:05:C5:5F:34:8C ESSID:"OpenWrt" Protocol:IEEE 802.11 BG Mode:Managed Frequency:2.412 GHz Signal level=-74 dBm Encryption key:on Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 11 Mb/s; 6 Mb/s 9 Mb/s; 12 Mb/s; 18 Mb/s; 24 Mb/s; 36 Mb/s 48 Mb/s; 54 Mb/s; 6.5 Mb/s; 13 Mb/s; 19.5 Mb/s 26 Mb/s; 39 Mb/s; 52 Mb/s; 58.5 Mb/s; 65 Mb/s Extra:Bcn int = 100 ms IE: Unknown: 00074F70656E577274 IE: Unknown: 010882848B960C121824 IE: Unknown: 030101 IE: Unknown: 2A0104 IE: Unknown: 32043048606C IE: IEEE 802.11i/WPA2 Version 1 Group Cipher : TKIP Pairwise Ciphers (2) : CCMP TKIP Authentication Suites (1) : PSK IE: WPA Version 1 Group Cipher : TKIP Pairwise Ciphers (2) : CCMP TKIP Authentication Suites (1) : PSK IE: Unknown: 2D1AEE111BFFFF000000000000000000000100000000000000000000 IE: Unknown: 3D1601050400000000000000000000000000000000000000 IE: Unknown: DD180050F2020101000003A4000027A4000042435E0062322F00

tpruvot commented 13 years ago

did you try "psk2+aes" or "psk2+ccmp" ?

sunoldman commented 13 years ago

Both same with psk2, don't work. Same iwlist scan as well. Only work with RC0's

tpruvot commented 13 years ago

ok, found the solution, copy this file in /system/lib/modules (for RC1), its wifi driver version 6.1.0.0.144

https://github.com/CyanogenDefy/android_vendor_motorola_jordan/raw/gingerbread/lib/modules/234-134/tiwlan_drv.ko

sunoldman commented 13 years ago

ok,works why not include this module in RC1?

charlie2alpha commented 13 years ago

Please do not reopen! Also, in RC1 I assume they included only what is already tested well. The new module belongs to a new nightly, RC1 is more "official".

tpruvot commented 13 years ago

yea, and i prefer to keep 179 kernel modules with 179 kernel... its how that works ;)

janekr commented 13 years ago

Just to confirm, RC1 with wifi driver version 6.1.0.0.144 works for me with both wpa2/psk openwrt and wpa/enterprise cisco.