duino-coin
duino-coin copied to clipboard
Seeed Studio Xiao esp32 s3 won't connect to wifi
I used the files on github and it uploaded with no errors, I couldn't find the "WiFiClientSecure" library but it didn't cause problems, i'm stuck on connecting to ****** .......... forever.
If the error 'WiFiClientSecure.h: No such file or directory' appears, there is only one problem: either you have not selected the right board, or you do not have the ESP32 Arduino IDE dependency installed. If both are OK, I will ask you to run the test code below.
#include "WiFi.h"
// Enter your WiFi credentials
const char* ssid = "YOUR_SSID";
const char* password = "YOUR_PASSWORD";
void setup() {
Serial.begin(115200);
while (!Serial); // Wait for Serial Monitor to open
Serial.println("\n--- Seeed XIAO ESP32-S3 WiFi Test ---");
// Set WiFi to station mode and disconnect if previously connected
WiFi.mode(WIFI_STA);
WiFi.disconnect();
delay(100);
Serial.println("Scanning for networks...");
int n = WiFi.scanNetworks();
if (n == 0) {
Serial.println("No networks found.");
} else {
Serial.printf("%d networks found:\n", n);
for (int i = 0; i < n; ++i) {
Serial.printf("%d: %s (%d dBm)\n", i + 1, WiFi.SSID(i).c_str(), WiFi.RSSI(i));
}
}
Serial.println("\nAttempting to connect to your WiFi...");
WiFi.begin(ssid, password);
// Attempt to connect for 10 seconds
int timeout = 0;
while (WiFi.status() != WL_CONNECTED && timeout < 20) {
delay(500);
Serial.print(".");
timeout++;
}
if (WiFi.status() == WL_CONNECTED) {
Serial.println("\nConnected successfully!");
Serial.print("IP Address: ");
Serial.println(WiFi.localIP());
Serial.print("Signal Strength (RSSI): ");
Serial.println(WiFi.RSSI());
} else {
Serial.println("\nConnection failed. Please check your SSID/Password.");
}
}
void loop() {
// Check if connection is still alive every 5 seconds
if (WiFi.status() == WL_CONNECTED) {
Serial.println("WiFi Status: Connected");
} else {
Serial.println("WiFi Status: Disconnected");
}
delay(5000);
}
This code is a demo test code if the code is connecting all right.
Replace "YOUR_SSID" and "YOUR_PASSWORD" with your actual network credentials.