Skip to content

WiFiMulti not working with hidden SSID #3325

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

Closed
trlafleur opened this issue Oct 6, 2019 · 8 comments · Fixed by #9202
Closed

WiFiMulti not working with hidden SSID #3325

trlafleur opened this issue Oct 6, 2019 · 8 comments · Fixed by #9202
Labels
Area: WiFi Issue related to WiFi Type: Feature request Feature request for Arduino ESP32
Milestone

Comments

@trlafleur
Copy link

trlafleur commented Oct 6, 2019

In a quick test with the provided example for WiFiMulti, I was unable to connect to a hidden SSID...

If I use the standard WiFi.begin(nSSID, nPassword); version, all work fine and it can find the hidden SSID.

Arduino IDE 1.8.10
ESP32 Arduino 1.0.4

/*
 *  This sketch tries to Connect to the best AP based on a given list
 *
 */

#include <WiFi.h>
#include <WiFiMulti.h>

WiFiMulti wifiMulti;

void setup()
{
    Serial.begin(115200);
    delay(100);
    
    WiFi.disconnect(true);
    WiFi.mode(WIFI_STA);
    
    wifiMulti.addAP("hiddenssid", "12345");          // Hidden SSID, will not work
    wifiMulti.addAP("openssid", "12345");             // open SSID, work fine...

    Serial.println("Connecting Wifi...");
    if(wifiMulti.run() == WL_CONNECTED) {
        Serial.println("");
        Serial.println("WiFi connected");
        Serial.print("IP address: ");
        Serial.println(WiFi.localIP());
        Serial.print("SSID: ");
        Serial.println(WiFi.SSID());
        Serial.print("Channel: ");
        Serial.println(WiFi.channel());
    }
}

void loop()
{
    if(wifiMulti.run() != WL_CONNECTED) {
        Serial.print("WiFi not connected!  ");
        Serial.println(WiFi.status());
        delay(1000);
    }
}
[D][WiFiGeneric.cpp:337] _eventCallback(): Event: 0 - WIFI_READY
[D][WiFiGeneric.cpp:337] _eventCallback(): Event: 2 - STA_START
[I][WiFiMulti.cpp:84] addAP(): [WIFI][APlistAdd] add SSID: lafleur
[D][WiFiGeneric.cpp:337] _eventCallback(): Event: 1 - SCAN_DONE
[I][WiFiMulti.cpp:114] run(): [WIFI] scan done
[I][WiFiMulti.cpp:119] run(): [WIFI] 1 networks found
[D][WiFiMulti.cpp:151] run():        0: [1][82:2A:A8:D7:F3:34] RSF-Guest (-57) *
[E][WiFiMulti.cpp:191] run(): [WIFI] no matching wifi found!
[D][WiFiGeneric.cpp:337] _eventCallback(): Event: 1 - SCAN_DONE
[I][WiFiMulti.cpp:114] run(): [WIFI] scan done
[I][WiFiMulti.cpp:119] run(): [WIFI] 1 networks found
[D][WiFiMulti.cpp:151] run():        0: [1][82:2A:A8:D7:F3:34] RSF-Guest (-58) *
@lbernstone
Copy link
Contributor

lbernstone commented Oct 6, 2019

Does it work if the hidden ssid is the only one added to the list?

@trlafleur
Copy link
Author

No...

@atanisoft
Copy link
Collaborator

WiFi.scanNetworks() will not show hidden SSIDs by default, WiFiMulti doesn't pass the flag to enable hidden networks to be included. You can try changing this line to:

scanResult = WiFi.scanNetworks(false, true);

And see if it works.

@trlafleur
Copy link
Author

trlafleur commented Oct 6, 2019 via email

@stale
Copy link

stale bot commented Dec 5, 2019

[STALE_SET] This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. Thank you for your contributions.

@stale stale bot added the Status: Stale Issue is stale stage (outdated/stuck) label Dec 5, 2019
@stale
Copy link

stale bot commented Dec 20, 2019

[STALE_DEL] This stale issue has been automatically closed. Thank you for your contributions.

@BararDiHoumes
Copy link

I were expecting fix for this as well, and after all this time none work on it ? Really ?

@lucasssvaz
Copy link
Collaborator

Fixed by #9202

@lucasssvaz lucasssvaz reopened this Feb 1, 2024
@lucasssvaz lucasssvaz added Type: Feature request Feature request for Arduino ESP32 Area: WiFi Issue related to WiFi and removed Status: Stale Issue is stale stage (outdated/stuck) labels Feb 1, 2024
@VojtechBartoska VojtechBartoska moved this from Todo to In Review in Arduino ESP32 Core Project Roadmap Feb 2, 2024
@VojtechBartoska VojtechBartoska added this to the 3.0.0-RC1 milestone Feb 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: WiFi Issue related to WiFi Type: Feature request Feature request for Arduino ESP32
Projects
Development

Successfully merging a pull request may close this issue.

6 participants