Skip to content

WiFiMulti not working with hidden SSID #3325

Closed
@trlafleur

Description

@trlafleur

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) *

Activity

lbernstone

lbernstone commented on Oct 6, 2019

@lbernstone
Contributor

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

trlafleur

trlafleur commented on Oct 6, 2019

@trlafleur
Author

No...

atanisoft

atanisoft commented on Oct 6, 2019

@atanisoft
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

trlafleur commented on Oct 6, 2019

@trlafleur
Author
stale

stale commented on Dec 5, 2019

@stale

[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 commented on Dec 20, 2019

@stale

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

BararDiHoumes

BararDiHoumes commented on Nov 14, 2021

@BararDiHoumes

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

lucasssvaz

lucasssvaz commented on Feb 1, 2024

@lucasssvaz
Collaborator

Fixed by #9202

8 remaining items

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status

    Done

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      WiFiMulti not working with hidden SSID · Issue #3325 · espressif/arduino-esp32