0

This is the code I have written to connect my Xiao Seeed ESP32-S3 board to a mobile hotspot

#include <WiFi.h>

const char* ssid = "rrrr";
const char* password = "rrrrrrrr";

void setup() {
  Serial.begin(115200);
  delay(1000);

  Serial.println("Connecting to WiFi...");
  WiFi.begin(ssid, password);

  while (WiFi.status() != WL_CONNECTED) {
    delay(500);
    Serial.print(".");
    WiFi.disconnect();
    WiFi.begin(ssid, password);
  }

  Serial.println("");
  Serial.println("WiFi connected");
  Serial.print("IP address: ");
  Serial.println(WiFi.localIP());
}

void loop() {
  // Your main code here
}

This code keeps giving errors as follows in the serial monitor

.E (12930) wifi:sta is connecting, return error
.E (13431) wifi:sta is connecting, return error
.E (13932) wifi:sta is connecting, return error
.
.

These are the hotspot settings I am using-

https://raw.githubusercontent.com/CodingLife1024/image-storage/refs/heads/main/hotspot.jpg

1
  • don't repeat WiFi.begin. it restarts the connecting process. it takes more than 500 ms to connect Commented Feb 12 at 14:36

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.