8000 WDT reset when enabling OTA (only with lwIP v2) · Issue #4028 · esp8266/Arduino · GitHub
[go: up one dir, main page]

Skip to content
WDT reset when enabling OTA (only with lwIP v2) #4028
Closed
@NdK73

Description

@NdK73

Hardware: ESP-12
Core Version: GIT

Description

I have a sketch where calling ArduinoOTA.begin() triggers a WDT reset if I compile with lwIP v2. The same sketch (I only change "lwIP variant" option) works when compiling with "lwIP v1.4 (prebuilt GCC)".

That sketch seems to work when loaded on a Wemos D1 mini (but changes quite a lot of the surrounding HW). Loaded on another ESP12 (on the same HW) gives the same problem. Is it possible it's related to some GPIO state? I don't think so...

I could trace the issue to ESP8266mDNS.cpp, function _listen(), line 198: igmp_joingroup(IP_ADDR_ANY, &multicast_addr) seems not to return (at least not for the time needed to trigger WDT). But I couldn't find igmp_joingroup under lwip2 tree to dig deeper :(

The failing (minimal) sketch is:

#include <ArduinoOTA.h>
#include <ESP8266WiFi.h>
const char* ssid = "MySSID";
const char* password = "MySecurePassword";
const char* host = "dispenc-01";

void setup() {
  WiFi.persistent(false); // Avoid wear-out
  WiFi.mode(WIFI_STA);
  WiFi.hostname(host);
  WiFi.begin(ssid, password);

  Serial.begin(115200);
  ArduinoOTA.setHostname(host);
}

long now, lastact;

void loop() {
  static bool otaStarted=false;
  static long last=0;

  now=millis();

  if(now!=last && 0==now%1000) { // Ignore rollover, ATM
    Serial.println(now/1000);
    last=now;
  }
  if(otaStarted) {
    // Handle updates
    ArduinoOTA.handle();
  } else {
    if(WiFi.status() == WL_CONNECTED) {
      /* setup the OTA server once we're connected and have obtained an IP */
      Serial.println(WiFi.localIP());
      ArduinoOTA.begin();
      Serial.println("begun");
      otaStarted=true;
    }
  }

}

It prints the IP but does not print "begun". Then, after 7-8s, wdt triggers :(

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    0