Skip to content

ESP is not Responsive in AP_STA mode while STA is still connecting with OTA Enabled #5915

Closed
@Lan-Hekary

Description

@Lan-Hekary

-### Basic Infos

  • [ X] This issue complies with the issue POLICY doc.
  • [X ] I have read the documentation at readthedocs and the issue is not addressed there.
  • [X ] I have tested that the issue is present in current master branch (aka latest git).
  • [X ] I have searched the issue tracker for a similar issue.
  • [X ] If there is a stack dump, I have decoded it.
  • [ X] I have filled out all fields below.

Platform

  • Hardware: [ESP-12E(NodeMCU)]
  • Core Version: [7a2e935]
  • Development Env: [Platformio]
  • Operating System: [Windows]

Settings in IDE

  • Module: [Nodemcu]
  • Flash Mode: [qio]
  • Flash Size: [4MB]
  • lwip Variant: [v2 Lower Memory]
  • Reset Method: [nodemcu]
  • Flash Frequency: [80Mhz]
  • CPU Frequency: [160MHz]
  • Upload Using: [SERIAL]
  • Upload Speed: [921600] (serial upload only)

Problem Description

The ESP in AP_STA mode does not respond to pings or webserver requests while STA is not Connected ( AP not found or Temporary Disconnect from the router )

This happens while the OTA is Enabled only .. It works normally if I turned the OTA off ..

I think it's related to the mDNS Module ..
and I think it's related to this issue as well #5866
the problem appeared after the last repo update I made ..

MCVE Sketch

#include <Arduino.h>
#include <ESP8266WiFi.h>
#include <ESP8266mDNS.h>
#include <WiFiUdp.h>
#include <ArduinoOTA.h>
#include <ESP8266WebServer.h>

#ifndef STASSID
#define STASSID "STA"
#define STAPSK "12345678"
#endif

ESP8266WebServer server(80);

IPAddress apIP(192, 168, 4, 1);
const char* ssid = "AP";
const char* password = "12345678";

void handleRoot() {
  server.send(200, "text/html", "<h1>You are connected</h1>");
}

void setup() {
Serial.begin(115200);
Serial.println("Booting");

WiFi.mode(WIFI_AP_STA);
WiFi.softAPConfig(apIP, apIP, IPAddress(255, 255, 255, 0));
WiFi.softAP(ssid, password);

WiFi.begin(STASSID,STAPSK);

ArduinoOTA.begin();

server.on("/", handleRoot);
server.begin();

Serial.println("Ready");
Serial.print("IP address: ");
Serial.println(WiFi.localIP());
Serial.println("HTTP server started");

}

void loop() {
ArduinoOTA.handle();
server.handleClient();
}

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions