-
Notifications
You must be signed in to change notification settings - Fork 7.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Information obtained by WPS cannot distinguish between 2.4GHz AP and 5GHz AP (IDFGH-8238) #9726
Comments
Hi @sakamoto330 , we take care of this by saving all the credentials and then try to connect to them one by one. This is already handled in wps example code and you can take reference from that. |
Thanks! @kapilkedawat
Above we can get two information of 5GHz AP and 2.4GHz AP, but we can get only SSID and passphrase. |
Hi @sakamoto330 |
Thanks! @kapilkedawat
Is there a way to get channels with WPS?
Does it mean that channel information cannot be got correctly due to the behavior of the router (AP)? |
Hi @sakamoto330 , As I said, the channel Information may or may not present and it may not be correct even when it is present. Do you see any issues when you use the current logic to connect? |
Thanks! @kapilkedawat
However, I was looking for a good way to identify the 5GHz AP before calling esp_wifi_connect() in step 1 and failing. |
Hi @sakamoto330 , there is actually no good way to find out to which band credentials belong to. However after getting the wpa done event, you can issue a scan and then issue_connect to the SSID to which station is able to scan. |
Thanks! @kapilkedawat I understood. Also, thanks for the scan suggestion. |
Hi, @kapilkedawat @sakamoto330 diff --git a/components/wpa_supplicant/src/wps/wps_enrollee.c b/components/wpa_supplicant/src/wps/wps_enrollee.c
index a124713e45..cfcf96d442 100644
--- a/components/wpa_supplicant/src/wps/wps_enrollee.c
+++ b/components/wpa_supplicant/src/wps/wps_enrollee.c
@@ -672,6 +672,19 @@ static int wps_process_cred_e(struct wps_data *wps, const u8 *cred,
goto _out;
}
+ //Check RF Bands
+ if(attr->rf_bands!=NULL)
+ {
+ u8 rf_bands = *attr->rf_bands;
+ if((rf_bands & 0x01)==0) // 0x01(Bit0) means 2.4GHz
+ {
+ wpa_printf(MSG_INFO, "WPS: Reject Credential "
+ "due to unsupported RF Bands.");
+ ret = -2;
+ goto _out;
+ }
+ }
+
if (os_memcmp(wps->cred.mac_addr, wps->wps->dev.mac_addr, ETH_ALEN) !=
0) {
wpa_printf(MSG_DEBUG, "WPS: MAC Address in the Credential (" |
Thats a shame. |
Thanks! @kneko715 #9726 (comment) Dear, @kapilkedawat |
Since its not a mandatory attribute, we believe it may cause unnecessary interoperability issue with some AP which can fill this randomly. Therefore we won't be making this change and keep it similar to upstream wpa_supplicant. |
Thanks for reporting, feel free to reopen. |
Answers checklist.
General issue report
Environment
Problem Description
Information obtained by WPS cannot distinguish between 2.4GHz AP and 5GHz AP.
Issue
The following information can be obtained by executing WPS with reference to the sample code.
esp32S3 doesn't support WiFi 5GHz, but some routers can get 5GHz AP information as well as 2.4GHz AP.
Is there a way to distinguish this 2.4GHz AP from a 5GHz AP?
The text was updated successfully, but these errors were encountered: