-
Notifications
You must be signed in to change notification settings - Fork 13.3k
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
Unable to connect to esp8266 when esp work in AP_STA mode and AP have hidden SSID. #4519
Comments
Is this still open for Arduino Core 2.6.3? |
@sezeryalcin Are you using the WiFi multi? Which version of this repository are you using? @devyte Correct: I implemented hidden SSID's for Multi WiFi. I used the following improved WiFi scan test sketch: #include <ESP8266WiFi.h>
// Connect to (hidden) STA
#define WIFI_SSID ""
#define WIFI_PASS ""
void runWiFiScan()
{
String ssid;
int32_t rssi;
uint8_t encryptionType;
uint8_t* bssid;
int32_t channel;
bool hidden;
int scanResult;
Serial.println(F("Starting WiFi scan..."));
scanResult = WiFi.scanNetworks(/*async=*/false, /*hidden=*/true);
Serial.printf(PSTR("%d networks found:\n"), scanResult);
// Print unsorted scan results
for (int8_t i = 0; i < scanResult; i++) {
WiFi.getNetworkInfo(i, ssid, encryptionType, rssi, bssid, channel, hidden);
Serial.printf(PSTR(" %d: [CH %02d] [%02X:%02X:%02X:%02X:%02X:%02X] %ddBm %c %c %s\n"),
i,
channel,
bssid[0], bssid[1], bssid[2],
bssid[3], bssid[4], bssid[5],
rssi,
(encryptionType == ENC_TYPE_NONE) ? ' ' : '*',
hidden ? 'H' : 'V',
ssid.c_str());
delay(0);
}
}
void connectWiFi()
{
Serial.printf(PSTR("Connecting to %s"), WIFI_SSID);
WiFi.begin(WIFI_SSID, WIFI_PASS);
while (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.print(F("."));
}
Serial.println("");
Serial.println(F("WiFi connected. IP address: "));
Serial.println(WiFi.localIP());
}
void setup()
{
Serial.begin(115200);
Serial.println(F("\nESP8266 hidden WiFi test\n"));
Serial.println(system_get_sdk_version());
// Set in station mode
WiFi.mode(WIFI_STA);
// Run WiFi scan
runWiFiScan();
// Connect to (hidden) WiFi
connectWiFi();
}
void loop() {
} My output is:
The H indicates a hidden WiFi network. Please note that the WiFi access point must be 2.4GHz and accept unknown MAC addresses. Can you run this sketch and post the output here? Do you want me to create MR for this improved sketch? |
@Erriez I believe the point here would be to set up an esp in AP mode with a hidden ssid, then on a different esp try your above improved sketch. |
@devyte I am not able to connect from my Android cellphone to an ESP8266 with SoftAP Example: WiFi.softAP(ssid, password, /*hidden=*/ true); |
Continue for issue #3625
The same trouble in SDK version 2.2.1(cfd48f3).
Unable to connect to esp8266 when esp work in AP_STA mode and AP have hidden SSID.
The text was updated successfully, but these errors were encountered: