ESP32-S3 wifi scan finds SSID but won't connect to it.

PeteDD
Posts: 46
Joined: Sat Sep 24, 2022 5:22 pm

ESP32-S3 wifi scan finds SSID but won't connect to it.

Postby PeteDD » 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!
  1.  
  2. #include <Arduino.h>
  3.  
  4. #include "WiFi.h"
  5.  
  6. //****** WIFI OUTPUT LEVELS***PICK ONE ************
  7. // #define WIFI_POWER WIFI_POWER_MINUS_1dBm // Set WiFi RF power output to lowest level
  8. #define WIFI_POWER WIFI_POWER_11dBm // Set WiFi RF power output to middle level
  9. // #define WIFI_POWER WIFI_POWER_19_5dBm // Set WiFi RF power output to highest level
  10. //*************************************************
  11.  
  12. // WiFi AP SSID
  13. #define WIFI_SSID "C12345678890/0"  // note that the "/0" IS part of the SSID
  14.  
  15. // WiFi password
  16. #define WIFI_PASSWORD "PassyPassPass"
  17.  
  18.  
  19. void wifi_scan()
  20. {
  21.   char buff[512];
  22.  
  23.   Serial.println("Scan Network");
  24.  
  25.   WiFi.mode(WIFI_STA);
  26.   WiFi.disconnect();
  27.   delay(100);
  28.  
  29.   int16_t n = WiFi.scanNetworks();
  30.  
  31.   if (n == 0)
  32.   {
  33.     Serial.println("no networks found");
  34.   }
  35.   else
  36.   {
  37.     Serial.printf("Found %d net\n", n);
  38.     for (int i = 0; i < n; ++i)
  39.     {
  40.       sprintf(buff,
  41.               "[%d]:%s(%d)",
  42.               i + 1,
  43.               WiFi.SSID(i).c_str(),
  44.               WiFi.RSSI(i));
  45.       Serial.println(buff);
  46.     }
  47.   }
  48.   WiFi.mode(WIFI_OFF);
  49. }
  50.  
  51. void setup()
  52. {
  53.   Serial.begin(115200);
  54.   while (!Serial)
  55.   delay(2000); // allow enough time for PlatformIO serial monitor to become active
  56.     ; /// wait for serial to start
  57.   Serial.println("Start");
  58.  
  59.   wifi_scan();  // This finds the SSID listed above as WIFI_SSID
  60.  
  61.   delay(2000);
  62.  
  63.   // Setup wifi
  64.   WiFi.mode(WIFI_STA);
  65.   WiFi.setTxPower(WIFI_POWER);
  66.  
  67.   WiFi.begin(WIFI_SSID, WIFI_PASSWORD);
  68.   Serial.println("Connecting to Wi-Fi");
  69.   while (int WFStatus = WiFi.status() != WL_CONNECTED)
  70.   {
  71.     Serial.println(WFStatus);  // prints "1" which is "WL_NO_SSID_AVAIL"
  72.     delay(300);
  73.   }
  74.   Serial.println();
  75.   Serial.print("Connected with IP: ");
  76.   Serial.println(WiFi.localIP());
  77.   Serial.println();
  78. }
  79.  
  80. void loop()
  81. {
  82.   // nothing to do here
  83. }

Vincent Jonathan
Posts: 2
Joined: Sat Sep 30, 2023 1:04 pm

Re: ESP32-S3 wifi scan finds SSID but won't connect to it.

Postby Vincent Jonathan » Sat Sep 30, 2023 1:10 pm

Same issue here with my custom board (based on s3fn8). Have you find the solution?

bidrohini
Posts: 202
Joined: Thu Oct 27, 2022 12:55 pm

Re: ESP32-S3 wifi scan finds SSID but won't connect to it.

Postby bidrohini » Tue Oct 03, 2023 5:46 pm

Here is a solution to a similar problem.
https://stackoverflow.com/questions/746 ... nect-to-my

Vincent Jonathan
Posts: 2
Joined: Sat Sep 30, 2023 1:04 pm

Re: ESP32-S3 wifi scan finds SSID but won't connect to it.

Postby Vincent Jonathan » Sat Oct 07, 2023 6:49 pm

The solution didn't work for me, i have same prebuild board and uploaded the same program and it just work.

migraineman
Posts: 1
Joined: Tue Apr 02, 2024 2:12 pm

Re: ESP32-S3 wifi scan finds SSID but won't connect to it.

Postby migraineman » Sat Apr 20, 2024 3:42 pm

tl;dr Executive Summary: The S3 appears to have sensitivity relative to the antenna placement. Operation dramatically improves if you move the antenna further from the ESP32-S3. The issue might be reflected power from an impedance mismatch, or just near-field radiative coupling. Don't have that last bit sorted yet.

We have been using the Seeed Studio XIAO ESP32-C3 pretty extensively recently, and migrated to the -S3 for an application that required some additional CPU grunt. Our first prototypes were designed around the -C3 and worked properly with the RF segment, but were dropping frames while processing WiFi network traffic. The -C3 seems pretty indifferent to which antenna is used and where it is placed ... many of our prototypes operated fine with the factory antenna still in the "pretzel" configuration from the original packaging. (note: this pic is of the -S3 module modeling the antenna placement; don't have a -C3 module handy to take a pic.)
20240420_094036.jpg
20240420_094036.jpg (1.23 MiB) Viewed 4212 times
This did not work with the -S3 module, and it took a while to distinguish between a code issue and an environmental one. Ultimately, we noticed that if you placed a finger on the antenna, you would generally connect to the WiFi AP and start functioning. Without applying the "magic finger," the unit would sit indefinitely trying to connect to the AP but failing. Displaying verbose error messages didn't help much - the most common response was something about credential failure. Sorry, didn't retain the exact text, but it was a red herring. To confuse matters further, the WiFi Scan example code seems to work, displaying the available WiFi APs in the area. This also appears to be a distraction, because it provides the false impression that the WiFi component is working. Educated guess - the scanner doesn't transmit much, if at all, because it's not trying to connect to an AP ... it's just listening to what's available.

When we un-pretzeled the factory-provided patch antenna, things improved greatly. Just about all of the units would connect and interpret WiFi traffic properly. However, the system was sensitive to objects in the vicinity especially if they contained metal.
20240420_093647.jpg
20240420_093647.jpg (1.33 MiB) Viewed 4212 times
Unfortunately, our application was designed around the antenna being inside a plastic enclosure which was in-proximity to some steel support structure. It would be completely inappropriate to have this paddle of a patch antenna sticking out of the unit flappin' in the breeze (just waiting to be violently, mechanically removed by a careless installer.) Ultimately, our solution was "get the antenna further away from the CPU." That worked well, and field deployments have been successful.

This antenna was the one we chose for production deployment:
20240420_094157.jpg
20240420_094157.jpg (1.26 MiB) Viewed 4212 times

kwcrawford
Posts: 1
Joined: Thu Sep 15, 2022 10:02 pm

Re: ESP32-S3 wifi scan finds SSID but won't connect to it.

Postby kwcrawford » Thu Oct 03, 2024 2:16 am

Would you mind sharing the make and model of that antenna. Is it available on Amazon, Mouser, Digikey? Thanks in advance

Who is online

Users browsing this forum: No registered users and 123 guests