esp8266 / Arduino

ESP8266 core for Arduino
GNU Lesser General Public License v2.1
15.98k stars 13.33k forks source link

Smartconfig fails to retrieve WiFi credentials #8691

Open BarrMan opened 1 year ago

BarrMan commented 1 year ago

Basic Infos

Platform

Settings in IDE

Problem Description

I’m trying to use esp8266 smart config but it fails to connect. There’s no error message shown and after inspecting the smart config app UDP message using WireShark, I see that the UDP messages are sent correctly.

MCVE Sketch


#include <Arduino.h>
#include <ESP8266WiFi.h>
#include <WiFiUdp.h>
#include "smartconfig.h"

void setup() {
  // put your setup code here, to run once:
  Serial.begin(9600);
  Serial.setDebugOutput(true);
  WiFi.mode(WIFI_STA);
  delay(500);
  esptouch_set_timeout(20);

  // timeout
  WiFi.beginSmartConfig();
  while (WiFi.status() != WL_CONNECTED) {
    delay(500);
    Serial.print(".");
    Serial.println(WiFi.smartConfigDone());
  }
  Serial.println("WiFi connected");  
  Serial.println(WiFi.localIP());

}

Debug Messages

Wireshark logs:

I’ve tried adding some more logs in _smartConfigCallback to find out what actually happens and it looks like it’s trying to find a channel.

Also, I saw that my smartconfig version is v2.5.4 and in other posts, I see that people are using version 2.9.0. Tried looking for a way to upgrade the version but found no resources on that as well.

Is it an issue with the version of smartconfig that I’m using? Is there a way to view more debugging logs so I could figure out what the exact issue is?

Thanks a lot!

Pontifex42 commented 1 year ago

Same issue on my ESP8266-12E / -12F. additionaly tested on a D1 mini, too. SmartConfig does not work on any of my ESP8266, while other ways of connecting to WiFi work well there. I tried same SmartConfig-Connect code on an ESP32 dev module and there, it works. So I am sure the problem is not my App nor my Android device. I tried ESP8266 board managers V3.02, V3.1.0 and 3.1.1. Environment is Arduino IDE V2.0 and the VisualStudio-Plugin "VisualMicro" (which has other issues with V3.1 board manager). Firmware always prompts "ets Jan 8 2013". I'm pretty sure there is something rotten in the state of denmark... and in the WiFi lib of the board manager. Any help somewhere?

muzhiyun commented 3 months ago

It seems that this problem still occurs. Does anyone have any updates or ideas?