ESP32-S3 wifi scan finds SSID but won't connect to it.
Posted: Mon Feb 13, 2023 6:18 pm
Running on Unexpected Maker Feather-S3, the code below finds my AP SSID. But when I go to join that SSID,
it only returns the WL_NO_SSID_AVAIL error. This code works (connects to the designated SSID on EVERY other ESP32 card I have in my shop (many).
Why would it not run on this card?
Note that the SSID does have "/0" at the end of it but again, this code works for every other ESP32 card I have.
Note: I have also tried all three power WiFi Output Levels.
Any ideas? (big time sink this...)
Thanks!
it only returns the WL_NO_SSID_AVAIL error. This code works (connects to the designated SSID on EVERY other ESP32 card I have in my shop (many).
Why would it not run on this card?
Note that the SSID does have "/0" at the end of it but again, this code works for every other ESP32 card I have.
Note: I have also tried all three power WiFi Output Levels.
Any ideas? (big time sink this...)
Thanks!
- #include <Arduino.h>
- #include "WiFi.h"
- //****** WIFI OUTPUT LEVELS***PICK ONE ************
- // #define WIFI_POWER WIFI_POWER_MINUS_1dBm // Set WiFi RF power output to lowest level
- #define WIFI_POWER WIFI_POWER_11dBm // Set WiFi RF power output to middle level
- // #define WIFI_POWER WIFI_POWER_19_5dBm // Set WiFi RF power output to highest level
- //*************************************************
- // WiFi AP SSID
- #define WIFI_SSID "C12345678890/0" // note that the "/0" IS part of the SSID
- // WiFi password
- #define WIFI_PASSWORD "PassyPassPass"
- void wifi_scan()
- {
- char buff[512];
- Serial.println("Scan Network");
- WiFi.mode(WIFI_STA);
- WiFi.disconnect();
- delay(100);
- int16_t n = WiFi.scanNetworks();
- if (n == 0)
- {
- Serial.println("no networks found");
- }
- else
- {
- Serial.printf("Found %d net\n", n);
- for (int i = 0; i < n; ++i)
- {
- sprintf(buff,
- "[%d]:%s(%d)",
- i + 1,
- WiFi.SSID(i).c_str(),
- WiFi.RSSI(i));
- Serial.println(buff);
- }
- }
- WiFi.mode(WIFI_OFF);
- }
- void setup()
- {
- Serial.begin(115200);
- while (!Serial)
- delay(2000); // allow enough time for PlatformIO serial monitor to become active
- ; /// wait for serial to start
- Serial.println("Start");
- wifi_scan(); // This finds the SSID listed above as WIFI_SSID
- delay(2000);
- // Setup wifi
- WiFi.mode(WIFI_STA);
- WiFi.setTxPower(WIFI_POWER);
- WiFi.begin(WIFI_SSID, WIFI_PASSWORD);
- Serial.println("Connecting to Wi-Fi");
- while (int WFStatus = WiFi.status() != WL_CONNECTED)
- {
- Serial.println(WFStatus); // prints "1" which is "WL_NO_SSID_AVAIL"
- delay(300);
- }
- Serial.println();
- Serial.print("Connected with IP: ");
- Serial.println(WiFi.localIP());
- Serial.println();
- }
- void loop()
- {
- // nothing to do here
- }