Closed Bug 998892 Opened 6 years ago Closed 6 years ago

WPS PIN/PBC method doesn't work

Categories

(Firefox OS Graveyard :: Wifi, defect)

ARM
Gonk (Firefox OS)
defect
Not set

Tracking

(blocking-b2g:1.4+, firefox30 wontfix, firefox31 wontfix, firefox32 fixed, b2g-v1.4 fixed, b2g-v2.0 fixed)

RESOLVED FIXED
2.0 S1 (9may)
blocking-b2g 1.4+
Tracking Status
firefox30 --- wontfix
firefox31 --- wontfix
firefox32 --- fixed
b2g-v1.4 --- fixed
b2g-v2.0 --- fixed

People

(Reporter: vasanth, Assigned: hchang)

References

()

Details

(Keywords: regression, Whiteboard: [caf priority: p2][CR 647201][p=1])

Attachments

(1 file, 1 obsolete file)

STR
---
1.Go to settings -> wifi -> Connect with WPS -> Click (My Pin or AP Pin) button
2.Enter 4 digit pin in case of AP Pin method or note down shown pin in case of My Pin method
3.Enter the same PIN in the AP (LinkysE2500 used)
4.Press Register button on AP
5.Wait until it completes the process.
6.Before its complete, device shows WPS PIN connection failed

Gecko : 76bb0d325975cba44a3b61ffd7e21babfc706e4e
Gaia : 441c4bcd8ac4f8c01a9bc5a2f8d64eaa87844803
Device : QRD8x26
Do we know if this is happening on 1.3?
It was working for us in v1.3
blocking-b2g: 1.4? → 1.4+
(In reply to vasanth from comment #2)
> It was working for us in v1.3
Do you use the same HW platform and WPA supplicant for testing 1.3 and 1.4.
Flags: needinfo?(vasanth)
(In reply to Ken Chang[:ken] from comment #3)
> Do you use the same HW platform and WPA supplicant for testing 1.3 and 1.4.
HW platform - same for V1.3 and V1.4
wpa_supplicant - [1] supplicant in jb code base for v1.3 and [2] supplicant in kk code base for v1.4 

Also would like to know whether wps pin is working for you guys in V1.4?

[1] jb_3.2 branch https://www.codeaurora.org/cgit/quic/la/platform/external/wpa_supplicant_8/log/?h=jb_3.2
[2] LNX.LA.3.5.2.2 https://www.codeaurora.org/cgit/quic/la/platform/external/wpa_supplicant_8/log/?h=LNX.LA.3.5.2.2
Flags: needinfo?(vasanth)
Assignee: nobody → vchang
Henry is working on this.
Assignee: vchang → hchang
I tried 1.3/1.4/solely wpa_supplicant (by wpa_cli) and none of them worked. Could you please adb to the device and type the following command and upload the log? Thanks!

$ adb shell
$ wpa_cli
$ wps_pin any [YOUR_WPS_PIN_CODE]
(In reply to Henry Chang [:henry] from comment #6)
> I tried 1.3/1.4/solely wpa_supplicant (by wpa_cli) and none of them worked.
> Could you please adb to the device and type the following command and upload
> the log? Thanks!
> 
> $ adb shell
> $ wpa_cli
> $ wps_pin any [YOUR_WPS_PIN_CODE]

Just this returns "UNKNOWN COMMAND"

Same command with below changes works,

$ wpa_cli -i wlan0 -p /data/misc/wifi/sockets 
$ wps_pin any
Sorry. Even after |wpa_cli -i wlan0 -p /data/misc/wifi/sockets|, |wps_pin any| is only able to scan for wps APs but never able to establish connection with wps supported APs.

We suspect some change is missing in lower layers. will update the findings here.
According to comment 8, I reassign this bug to vasanth. If anything changed, please reassign.
Assignee: hchang → vasanth
Component: Wifi → Vendcom
Unblocking this for being a vendor bug.
blocking-b2g: 1.4+ → ---
Whiteboard: [CR 647201] → [CR 647201][POVB]
(In reply to vasanth from comment #8)
> Sorry. Even after |wpa_cli -i wlan0 -p /data/misc/wifi/sockets|, |wps_pin
> any| is only able to scan for wps APs but never able to establish connection
> with wps supported APs.
> 
> We suspect some change is missing in lower layers. will update the findings
> here.

I tried the same commands in equivalent android build, got same results. 
However from Android UI able to successfully connect to WPS_PBC/WPS_PIN APs
With FFOS, UI always shows WPS connection failed immediately.

I suspect something is changed in supplicant and gecko wifi is not adapted to that?
Please look into this and I will update if I find something.
Assignee: vasanth → hchang
blocking-b2g: --- → 1.4?
Whiteboard: [CR 647201][POVB] → [CR 647201]
Component: Vendcom → Wifi
Summary: WPS PIN method doesn't work → WPS PIN/PBC method doesn't work
Also for wps_pbc method, when I click "OK" in "Connect with WPS" window, I see following errors from supplicant

D/wpa_supplicant( 1330): wlan0: Control interface command 'WPS_PBC interface=wlan0'
D/wpa_supplicant( 1330): CTRL_IFACE WPS_PBC: invalid BSSID 'interface=wlan0'

Are you guys seeing this?
Flags: needinfo?(hchang)
(In reply to vasanth from comment #12)
> Also for wps_pbc method, when I click "OK" in "Connect with WPS" window, I
> see following errors from supplicant
> 
> D/wpa_supplicant( 1330): wlan0: Control interface command 'WPS_PBC
> interface=wlan0'
> D/wpa_supplicant( 1330): CTRL_IFACE WPS_PBC: invalid BSSID 'interface=wlan0'
> 
> Are you guys seeing this?

Do you see the same reply as using wpa_cli?
I am able to use both 1.3/1.4 to connect with WPS push button.
Flags: needinfo?(hchang)
(In reply to vasanth from comment #11)
> (In reply to vasanth from comment #8)
> > Sorry. Even after |wpa_cli -i wlan0 -p /data/misc/wifi/sockets|, |wps_pin
> > any| is only able to scan for wps APs but never able to establish connection
> > with wps supported APs.
> > 
> > We suspect some change is missing in lower layers. will update the findings
> > here.
> 
> I tried the same commands in equivalent android build, got same results. 
> However from Android UI able to successfully connect to WPS_PBC/WPS_PIN APs
> With FFOS, UI always shows WPS connection failed immediately.
> 
> I suspect something is changed in supplicant and gecko wifi is not adapted
> to that?
> Please look into this and I will update if I find something.

What kind of WPS_PIN did you refer here?
Android has only FFOS "My PIN" equivalent WPS PIN function (Enter PIN on AP side).
(In reply to Henry Chang [:henry] from comment #13)
> > D/wpa_supplicant( 1330): CTRL_IFACE WPS_PBC: invalid BSSID 'interface=wlan0'
> > 
> > Are you guys seeing this?
> 
> Do you see the same reply as using wpa_cli?
> I am able to use both 1.3/1.4 to connect with WPS push button.

Yes if I give "wps_pbc interface=wlan0" as command
I see wps_pbc can accept only one arg which is BSSID [1]
But here [2] we are passing "interface=wlan0" as arg
Are you using different supplicant?

[1] https://www.codeaurora.org/cgit/quic/la/platform/external/wpa_supplicant_8/tree/wpa_supplicant/wpa_cli.c?h=kk_3.5#n2600
[2] http://dxr.mozilla.org/mozilla-central/source/dom/wifi/WifiCommand.jsm#146


(In reply to Henry Chang [:henry] from comment #14)
> What kind of WPS_PIN did you refer here?
> Android has only FFOS "My PIN" equivalent WPS PIN function (Enter PIN on AP
> side).
We tried FFOS "MY PIN" equivalent in Android. It worked from Android GUI.
Flags: needinfo?(hchang)
(In reply to vasanth from comment #15)
> (In reply to Henry Chang [:henry] from comment #13)
> > > D/wpa_supplicant( 1330): CTRL_IFACE WPS_PBC: invalid BSSID 'interface=wlan0'
> > > 
> > > Are you guys seeing this?
> > 
> > Do you see the same reply as using wpa_cli?
> > I am able to use both 1.3/1.4 to connect with WPS push button.
> 
> Yes if I give "wps_pbc interface=wlan0" as command
> I see wps_pbc can accept only one arg which is BSSID [1]
> But here [2] we are passing "interface=wlan0" as arg
> Are you using different supplicant?

The supplicant you used seems to be KK and is different from what I tried before.
Maybe we need to use different version of WPS_PBC command for KK.

1.3/1.4 should work well with ICS/JB.

> 
> [1]
> https://www.codeaurora.org/cgit/quic/la/platform/external/wpa_supplicant_8/
> tree/wpa_supplicant/wpa_cli.c?h=kk_3.5#n2600
> [2]
> http://dxr.mozilla.org/mozilla-central/source/dom/wifi/WifiCommand.jsm#146
> 
> 
> (In reply to Henry Chang [:henry] from comment #14)
> > What kind of WPS_PIN did you refer here?
> > Android has only FFOS "My PIN" equivalent WPS PIN function (Enter PIN on AP
> > side).
> We tried FFOS "MY PIN" equivalent in Android. It worked from Android GUI.

I'll investigate this tmr if I am lucky to find a AP with WPS pin function!

Thanks!
Flags: needinfo?(hchang)
(In reply to Henry Chang [:henry] from comment #16)
> 1.3/1.4 should work well with ICS/JB.

We are using 1.4 with KK android base. So isn't it supposed to work in KK base supplicant?
Henry

What are the next steps here?

Do we need anything from partner here?
Flags: needinfo?(hchang)
(In reply to Preeti Raghunath(:Preeti) from comment #18)
> Henry
> 
> What are the next steps here?
> 
> Do we need anything from partner here?

Here's the current status:

      PBC   MY_PIN   AP_PIN
ICS    O      ?         X
     
JB     O      ?         X

KK     X      X         X


For AP_PIN, it never works so I exclude it first.
For PBC, what I am sure is PBC works with ICS/JB. The PBC supplicant command may need to modify for KK.
For MY_PIN, what I heart is someone verified it works with ICS before but
I haven't tried it due to the lack of compatible AP. What Vasanth reported is it doesn't work with KK.

To sum up, I will be trying to fix PBC on KK first. Once I get a MY_PIN compatible AP, I will also
try to verify MY_PIN on each AOSP base.

Vasanth, do you mind verifying if MY_PIN works on 1.3/1.4 with ICS/JB? Thanks!
Flags: needinfo?(hchang)
Attached patch Bug998892.patch (obsolete) — Splinter Review
Whiteboard: [CR 647201] → [CR 647201][p=1]
Attached patch Bug998892.patchSplinter Review
Attachment #8417851 - Attachment is obsolete: true
Hi Vasanth,

I also got the exact finding. wpa_supplicant on JB has the following hack:
http://androidxref.com/4.3_r2.1/xref/external/wpa_supplicant_8/wpa_supplicant/ctrl_iface_unix.c#172
to deal with "interface=XXX" as well as remove the additional argument. I attached a patch to
send different WPS PBC/PIN command according to AOSP version. Actually only on JB and wifi p2p should we need to add "interface=XXX" to the wpa_supplicant command.

I've tested with the patch applied on 1.4/KK and 1.4/ICS and their WPS PBC both works well.

I appreciate your effort of investigating this!

(In reply to vasanth from comment #21)
> (In reply to Henry Chang [:henry] from comment #19)
> > For PBC, what I am sure is PBC works with ICS/JB. The PBC supplicant command
> > may need to modify for KK.
> 
> Fyi, Seems in jb, WifiNative.java [1] used command of this form "WPS_PBC
> interface=x [BSSID]" and in kk it got changed to [2] "IFNAME=x WPS_PBC
> [BSSID]"
> Also WifiNative.java has just "WPS_PBC [BSSID]" (without interface) which is
> used for normal wps_pbc [3][4], "IFNAME=x WPS_PBC [BSSID]" is used only for
> p2p connections [5].
> 
> I will check MY_PIN in 1.3/JB
> 
> [1]
> https://www.codeaurora.org/cgit/quic/la/platform/frameworks/base/tree/wifi/
> java/android/net/wifi/WifiNative.java?h=jb_3.2#n399
> [2]
> https://www.codeaurora.org/cgit/quic/la/platform/frameworks/base/tree/wifi/
> java/android/net/wifi/WifiNative.java?h=kk_3.
> 5&id=c249c2cc6b601ed1ff063f1748ba4399b9270209#n415
> [3]
> https://www.codeaurora.org/cgit/quic/la/platform/frameworks/base/tree/wifi/
> java/android/net/wifi/WifiNative.java?h=kk_3.
> 5&id=c249c2cc6b601ed1ff063f1748ba4399b9270209#n407
> [4]
> https://www.codeaurora.org/cgit/quic/la/platform/frameworks/base/tree/wifi/
> java/android/net/wifi/WifiConfigStore.java?h=kk_3.
> 5&id=c249c2cc6b601ed1ff063f1748ba4399b9270209#n501
> [5]
> https://www.codeaurora.org/cgit/quic/la/platform/frameworks/base/tree/wifi/
> java/android/net/wifi/p2p/WifiP2pService.java?h=kk_3.
> 5&id=c249c2cc6b601ed1ff063f1748ba4399b9270209#n1736
Attachment #8417933 - Flags: review?(vchang)
blocking-b2g: 1.4? → 1.4+
Comment on attachment 8417933 [details] [diff] [review]
Bug998892.patch

Review of attachment 8417933 [details] [diff] [review]:
-----------------------------------------------------------------

::: dom/wifi/WifiWorker.js
@@ +2952,5 @@
>      const message = "WifiManager:wps:Return";
>      let self = this;
>      let detail = msg.data;
>      if (detail.method === "pbc") {
> +      WifiManager.wpsPbc(function(ok) {

Do we need to put interface name for Jelly bean ?
(In reply to Vincent Chang[:vchang] from comment #24)
> Comment on attachment 8417933 [details] [diff] [review]
> Bug998892.patch
> 
> Review of attachment 8417933 [details] [diff] [review]:
> -----------------------------------------------------------------
> 
> ::: dom/wifi/WifiWorker.js
> @@ +2952,5 @@
> >      const message = "WifiManager:wps:Return";
> >      let self = this;
> >      let detail = msg.data;
> >      if (detail.method === "pbc") {
> > +      WifiManager.wpsPbc(function(ok) {
> 
> Do we need to put interface name for Jelly bean ?

No. 
http://androidxref.com/4.2_r1/xref/frameworks/base/wifi/java/android/net/wifi/WifiConfigStore.java#483

The only occasion when we need specify the interface is using Wifi P2P WPS_PBC on JB:
http://androidxref.com/4.2_r1/xref/frameworks/base/wifi/java/android/net/wifi/p2p/WifiP2pService.java#1606
Comment on attachment 8417933 [details] [diff] [review]
Bug998892.patch

Review of attachment 8417933 [details] [diff] [review]:
-----------------------------------------------------------------

Thanks for your explanation. The patch looks good.
Attachment #8417933 - Flags: review?(vchang) → review+
Comment on attachment 8417933 [details] [diff] [review]
Bug998892.patch

NOTE: This flag is now for security issues only. Please see https://wiki.mozilla.org/Release_Management/B2G_Landing to better understand the B2G approval process and landings.

[Approval Request Comment]
Bug caused by (feature/regressing bug #): WPS PBC/PIN on KK 
User impact if declined: WPS PBC/PBC would fail on KK
Testing completed: Yes
Risk to taking this patch (and alternatives if risky): No 
String or UUID changes made by this patch: No
Attachment #8417933 - Flags: approval-mozilla-b2g30?
Keywords: checkin-needed
Comment on attachment 8417933 [details] [diff] [review]
Bug998892.patch

Review of attachment 8417933 [details] [diff] [review]:
-----------------------------------------------------------------

Fairly significant impact with WiFi protection.
Attachment #8417933 - Flags: approval-mozilla-b2g30? → approval-mozilla-b2g30+
Vasanth

Please verify patch.
Flags: needinfo?(vasanth)
https://hg.mozilla.org/mozilla-central/rev/b7475fd74c6a
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → 2.0 S1 (9may)
(In reply to Preeti Raghunath(:Preeti) from comment #29)
> Vasanth
> 
> Please verify patch.

wps_pbc works with this patch in kk base, but still wps_pin doesn't work.
Shall we reopen this bug or create a new one?
Flags: needinfo?(vasanth) → needinfo?(hchang)
Looks like wps_pin is also working. 
It was failing because of overlapping wps sessions. 
While we enter pin in AP, device was trying to connect to some other WPS APs in lab which induce the failure.
When there is single WPS AP in locality, it works fine.
Thanks Henry for your patch! Please merge it in V1.4 soon.
Flags: needinfo?(hchang)
Whiteboard: [CR 647201][p=1] → [caf priority: p2][CR 647201][p=1]
No test case found. Test case needs to be written for this issue.
QA Whiteboard: [QAnalyst-Triage?]
Flags: needinfo?(ktucker)
Flags: in-moztrap?(rmead)
Test case has been added in moztrap:

https://moztrap.mozilla.org/manage/case/14371/
QA Whiteboard: [QAnalyst-Triage?] → [QAnalyst-Triage+]
Flags: needinfo?(ktucker)
Flags: in-moztrap?(rmead)
Flags: in-moztrap+
You need to log in before you can comment on or make changes to this bug.