Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

Debug output says wifi connected, but WiFi.status() keeps returning 7

Abierto
#9,060 10 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
25/100
Tipo de issue
Error
Claridad
Necesita aclaración
Estado de actividad
Estancado
Stack tecnológico
cpp

Línea de trabajo

Comienza con el sketch setup() y reproduce el comportamiento de red informado mientras comparas la salida interna “connected with CASAS” con WiFi.status(). Sigue las transiciones de los estados de conexión y DHCP que se muestran en el registro serie; se considera terminado cuando se haya identificado si el mensaje de depuración, el valor de estado o una desconexión inmediata es incoherente.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

This seems to happen randomly (but often) on some networks. I'm seeing this on a particular wifi network almost systematically (but not quite) while the same code on the same board had worked for ages on other networks.

This is my code (simplified):

void setup() {
  String client_ssid = "mySSID";
  String clien_password = "mypassword";

  WiFi.mode(WIFI_STA);
  WiFi.begin(client_ssid.c_str(), client_password.c_str());

  for (int i=0; i<20; i++) {
    Serial.println("Trying to connect to Wifi '%s' with password '%s'\n", client_ssid.c_str(), client_password.c_str());
    delay(1000)
    if (WiFi.status()==WL_CONNECTED) {
      Serial.println("...connected succesfully\n");
      // Here I would normally do stuff...

      return;
    }
  }
  Serial.println("Cannot connect to WiFi!\n");
  return;
}
fpm close 3 
mode : sta(80:7d:3a:3c:e2:1d)
add if0
Trying to connect to Wifi 'CASAS' with password '******'
Trying to connect to Wifi 'CASAS' with password '******'
Trying to connect to Wifi 'CASAS' with password '******'
scandone
state: 0 -> 2 (b0)
Trying to connect to Wifi 'CASAS' with password '******'
state: 2 -> 3 (0)
state: 3 -> 5 (10)
add 0
aid 17
cnt 

connected with CASAS, channel 6
dhcp client start...
Trying to connect to Wifi 'CASAS' with password '******'
Trying to connect to Wifi 'CASAS' with password '******'
Trying to connect to Wifi 'CASAS' with password '******'
Trying to connect to Wifi 'CASAS' with password '******'
Trying to connect to Wifi 'CASAS' with password '******'
Trying to connect to Wifi 'CASAS' with password '******'
Trying to connect to Wifi 'CASAS' with password '******'
Trying to connect to Wifi 'CASAS' with password '******'
Trying to connect to Wifi 'CASAS' with password '******'
pm open,type:2 0
Trying to connect to Wifi 'CASAS' with password '******'
Trying to connect to Wifi 'CASAS' with password '******'
Trying to connect to Wifi 'CASAS' with password '******'
Trying to connect to Wifi 'CASAS' with password '******'
Trying to connect to Wifi 'CASAS' with password '******'
Trying to connect to Wifi 'CASAS' with password '******'
Trying to connect to Wifi 'CASAS' with password '******'
Cannot connect to WiFi!

Note where it says "Connected to ... channel 6": that's not from my println()s, that's some internal output.

It was able to connect once or twice on the very same network, which is working fine and the password is correct, obviously.

I'm reporting it here because there's internal debug output that says "connected" and yet status() is returning WL_DISCONNECTED, so that's an inconsistency that is obviously in software. Either the debug output that says "connected" is bogus, or status() is returning the wrong value (or it connects and immediately loses connection, and there's no debug output for that which would be a bug too - but that seems pretty unlikely).

Lenguaje dominante
C++
Estrellas
16.7k
Forks
13.1k
Métricas de merge de PR
Sin PR fusionados en 30 d

Preparar el entorno

Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de esp8266/Arduino

Todos los issues de esp8266/Arduino

Issues similares

Más issues de C++

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.