ESP32S2-mini Web server Problem with the library

I was creating a simple Web Server for ESP32s2, I compile and upload it, but the board didn't run the code. I suposse that the library isn't well defined or I'm doing something wrong.

#include <WiFi.h>
#include <ESPAsyncWebServer.h>
#define LED_PIN 15

// Configurar WiFi
const char *ssid = "TU_SSID";
const char *password = "TU_PASSWORD";

// Crear servidor en el puerto 80
AsyncWebServer server(80);

void setup() {
  pinMode(LED_PIN, OUTPUT);
  Serial.begin(115200);

  // Conectar a WiFi
  WiFi.begin(ssid, password);
  Serial.print("Conectando a WiFi");
  while (WiFi.status() != WL_CONNECTED) {
    delay(500);
    Serial.print(".");
  }
  Serial.println();
  Serial.print("Conectado! IP: ");
  Serial.println(WiFi.localIP());

  // Ruta raĆ­z "/"
  server.on("/", HTTP_GET, [](AsyncWebServerRequest *request){
    request->send(200, "text/plain", "Hola desde ESP32-S2 Mini!");
  });

  // Iniciar servidor
  server.begin();
  Serial.println("Servidor iniciado.");
}

void loop() {
  digitalWrite(LED_PIN, HIGH);
  delay(1000);
  digitalWrite(LED_PIN, LOW);
  delay(1000);
}

How do you know that?

As a beginner, you can safely assume you did something wrong and the library is ok.

What does that mean?
Post the serial log output in code tags.
Also show us the screen you see when you goto the ip created.

The wifi signal didn't appear and the light of the board didn't turn on. Searching about it, the library is not compatible at all with the ESP32s2 mini, so i think that it can be something related with the dependences

How do you know that?

Are you expecting the ESP to appear as a new access point? ESP can do that, but your code does not set this up.

It could be stuck trying to connect to your router. Serial monitor will show this. If so, check the SSID and password is correct.

Did you check the library.properties for the library?

That does not sound correct. Perhaps you misinterpreted what you read. Please post a link to that page.

There are many flavors and ports of the "ESP Async" family. Recommend you make sure to use the one that's actively supported:
https://github.com/ESP32Async/ESPAsyncWebServer/wiki

How do you know this? If the Serial monitor doesn't work goto Tools | USB CDC On Boot | Enabled.

Then recompile and reload the code.

The built-in led is a separate issue.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.