Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ArduinoOTA not working when Serial speed is set to 9600 #6506

Closed
6 tasks done
ruggi99 opened this issue Sep 12, 2019 · 15 comments
Closed
6 tasks done

ArduinoOTA not working when Serial speed is set to 9600 #6506

ruggi99 opened this issue Sep 12, 2019 · 15 comments
Labels
component: documentation waiting for feedback Waiting on additional info. If it's not received, the issue may be closed.

Comments

@ruggi99
Copy link
Contributor

ruggi99 commented Sep 12, 2019

Basic Infos

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

Platform

  • Hardware: [ESP-12E]
  • Core Version: [latest git]
  • Development Env: [Arduino IDE]
  • Operating System: [Windows]

Settings in IDE

  • Module: [Nodemcu]
  • Flash Mode: [qio|dio|other] (Don't know)
  • Flash Size: [4MB]
  • lwip Variant: [v2 Lower Memory]
  • Reset Method: [ck|nodemcu] (Don't know)
  • Flash Frequency: [40Mhz]
  • CPU Frequency: [80Mhz]
  • Upload Using: [SERIAL]
  • Upload Speed: [115200]

Problem Description

I'm using latest git version and when I upload the example sketch BasicOta.ino from the ArduinoOTA library, the sketch works fine, I can update sketch Over The Air, ecc. The problem comes when I change the serial speed from 115200 (default in the example) to 9600. When I change it, ESP8266 runs always in stack errors. I've not tried with others serial speeds.

MCVE Sketch (BasicOTA.ino)

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

#ifndef STASSID
#define STASSID "your-ssid"
#define STAPSK  "your-password"
#endif

const char* ssid = STASSID;
const char* password = STAPSK;

void setup() {
  Serial.begin(9600);
  Serial.println("Booting");
  WiFi.mode(WIFI_STA);
  WiFi.begin(ssid, password);
  while (WiFi.waitForConnectResult() != WL_CONNECTED) {
    Serial.println("Connection Failed! Rebooting...");
    delay(5000);
    ESP.restart();
  }

  // Port defaults to 8266
  // ArduinoOTA.setPort(8266);

  // Hostname defaults to esp8266-[ChipID]
  // ArduinoOTA.setHostname("myesp8266");

  // No authentication by default
  // ArduinoOTA.setPassword("admin");

  // Password can be set with it's md5 value as well
  // MD5(admin) = 21232f297a57a5a743894a0e4a801fc3
  // ArduinoOTA.setPasswordHash("21232f297a57a5a743894a0e4a801fc3");

  ArduinoOTA.onStart([]() {
    String type;
    if (ArduinoOTA.getCommand() == U_FLASH) {
      type = "sketch";
    } else { // U_FS
      type = "filesystem";
    }

    // NOTE: if updating FS this would be the place to unmount FS using FS.end()
    Serial.println("Start updating " + type);
  });
  ArduinoOTA.onEnd([]() {
    Serial.println("\nEnd");
  });
  ArduinoOTA.onProgress([](unsigned int progress, unsigned int total) {
    Serial.printf("Progress: %u%%\r", (progress / (total / 100)));
  });
  ArduinoOTA.onError([](ota_error_t error) {
    Serial.printf("Error[%u]: ", error);
    if (error == OTA_AUTH_ERROR) {
      Serial.println("Auth Failed");
    } else if (error == OTA_BEGIN_ERROR) {
      Serial.println("Begin Failed");
    } else if (error == OTA_CONNECT_ERROR) {
      Serial.println("Connect Failed");
    } else if (error == OTA_RECEIVE_ERROR) {
      Serial.println("Receive Failed");
    } else if (error == OTA_END_ERROR) {
      Serial.println("End Failed");
    }
  });
  ArduinoOTA.begin();
  Serial.println("Ready");
  Serial.print("IP address: ");
  Serial.println(WiFi.localIP());
}

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

Debug Messages

scandone
state: 0 -> 2 (b0)
state: 2 -> 3 (0)
state: 3 -> 0 (4)
reconnect
wifi evt: 1
STA disconnect: 4
scandone
state: 0 -> 2 (b0)
state: 2 -> 3 (0)
state: 3 -> 5 (10)
add 0
aid 3
cnt 

connected with SSID, channel 11
dhcp client start...
wifi evt: 0
ip:192.168.1.101,mask:255.255.255.0,gw:192.168.1.1
wifi evt: 3
[MDNSResponder] default interface STA selected (none was specified)
[MDNSResponder] _allocUDPContext
[MDNSResponder] addService: Succeeded to add '-.arduino.tcp'!
OTA server at: esp8266-97aff5.local:8266
Ready
IP address: 192.168.1.101
[MDNSResponder] _updateProbeStatus: Starting host probing...
[MDNSResponder] _sendHostProbe (esp8266-97aff5, 10066)
[MDNSResponder] _sendMDNSMessage_Multicast: Will send to '224.0.0.251'.
[MDNSResponder] _prepareMDNSMessage
[MDNSResponder] _prepareMDNSMessage: ID:0 QR:0 OP:0 AA:0 TC:0 RD:0 RA:0 R:0 QD:1 AN:0 NS:1 AR:0
[MDNSResponder] _writeMDNSQuestion
[MDNSResponder] _writeMDNSAnswer_A (192.168.1.101)
[MDNSResponder] _updateProbeStatus: Did sent host probe

[MDNSResponder] _sendServiceProbe (esp8266-97aff5.arduino.tcp, 10351)
[MDNSResponder] _sendMDNSMessage_Multicast: Will send to '224.0.0.251'.
[MDNSResponder] _prepareMDNSMessage
[MDNSResponder] _prepareMDNSMessage: ID:0 QR:0 OP:0 AA:0 TC:0 RD:0 RA:0 R:0 QD:1 AN:0 NS:2 AR:2
[MDNSResponder] _writeMDNSQuestion
[MDNSResponder] _writeMDNSAnswer_PTR_NAME
[MDNSResponder] _writeMDNSAnswer_SRV
[MDNSResponder] _writeMDNSAnswer_TXT
[MDNSResponder] _writeMDNSAnswer_A (192.168.1.101)
[MDNSResponder] _updateProbeStatus: Did sent service probe (1)

:urn 47
[MDNSResponder] _callProcess (11054, triggered by: 192.168.1.10)
[MDNSResponder] _parseMessage (Time: 11056 ms, heap: 48312 bytes, from 192.168.1.10(5353), to 224.0.0.251(5353))
:urd 2, 47, 0
:urd 1, 47, 2
:urd 1, 47, 3
:urd 2, 47, 4
:urd 2, 47, 6
:urd 2, 47, 8
:urd 2, 47, 10
[MDNSResponder] _parseResponse: Received a response
:urd 1, 47, 12
:urd 13, 47, 13
:urd 1, 47, 26
:urd 5, 47, 27
:urd 1, 47, 32
:urd 2, 47, 33
:urd 2, 47, 35
:urd 4, 47, 37
:urd 2, 47, 41
:urd 4, 47, 43
[MDNSResponder] _readRRAnswer: Ruggero-Fisso.local Type:0x0001 Class:0x0001 TTL:10, RDLength:4 A IP:192.168.1.10
[MDNSResponder] _processAnswers: Processing answers...
[MDNSResponder] _parseMessage: Done (Succeeded after 560 ms, ate 0 bytes, remaining 48312)

:urch 71, 253
[MDNSResponder] _callProcess (11859, triggered by: 192.168.1.10)
[MDNSResponder] _parseMessage (Time: 11860 ms, heap: 48288 bytes, from 192.168.1.101(5353), to 224.0.0.251(5353))
:urd 2, 253, 0
:urd 1, 253, 2
:urd 1, 253, 3
:urd 2, 253, 4
:urd 2, 253, 6
:urd 2, 253, 8
:urd 2, 253, 10
[MDNSResponder] _readRRQuestion
:urd 1, 253, 12
:urd 14, 253, 13
:urd 1, 253, 27
:urd 8, 253, 28
:urd 1, 253, 36
:urd 4, 253, 37
:urd 1, 253, 41
:urd 5, 253, 42
:urd 1, 253, 47
:urd 2, 253, 48
:urd 2, 253, 50
[MDNSResponder] _readRRQuestion esp8266-97aff5._arduino._tcp.local Type:0x00FF Class:0x0001 Unicast
[MDNSResponder] _replyMaskForService(esp8266-97aff5.arduino.tcp): 0xC0
[MDNSResponder] _parseQuery: Possible race-condition for service domain esp8266-97aff5.arduino.tcp detected while probing.
[MDNSResponder] _parseQuery: Unicast response for 192.168.1.101!
:urd 1, 253, 52
:urd 8, 253, 53
:urd 1, 253, 61
:urd 4, 253, 62
:urd 1, 253, 66
:urd 5, 253, 67
:urd 1, 253, 72
:urd 2, 253, 73
:urd 2, 253, 75
:urd 4, 253, 77
:urd 2, 253, 81
:urd 1, 253, 83
:urd 14, 253, 84
:urd 1, 253, 98
:urd 8, 253, 99
:urd 1, 253, 107
:urd 4, 253, 108
:urd 1, 253, 112
:urd 5, 253, 113
:urd 1, 253, 118
[MDNSResponder] _readRRAnswer: _arduino._tcp.local Type:0x000C Class:0x0001 TTL:4500, RDLength:36 PTR esp8266-97aff5._arduino._tcp.local
[MDNSResponder] _replyMaskForService(esp8266-97aff5.arduino.tcp): 0x20
:urd 1, 253, 119
:urd 1, 253, 120
:urd 1, 253, 83
:urd 14, 253, 84
:urd 1, 253, 98
:urd 8, 253, 99
:urd 1, 253, 107
:urd 4, 253, 108
:urd 1, 253, 112
:urd 5, 253, 113
:urd 1, 253, 118
:urd 2, 253, 121
:urd 2, 253, 123
:urd 4, 253, 125
:urd 2, 253, 129
:urd 2, 253, 131
:urd 2, 253, 133
:urd 2, 253, 135
:urd 1, 253, 137
:urd 14, 253, 138
:urd 1, 253, 152
:urd 5, 253, 153
:urd 1, 253, 158
[MDNSResponder] _readRRAnswer: esp8266-97aff5._arduino._tcp.local Type:0x0021 Class:0x0001 TTL:4500, RDLength:28 SRV Port:8266 esp8266-97aff5.local
[MDNSResponder] _replyMaskForService(esp8266-97aff5.arduino.tcp): 0x80
[MDNSResponder] _parseQuery: Tiebreak (SRV) won (was an old message)!
:urd 1, 253, 159
:urd 1, 253, 160
:urd 1, 253, 83
:urd 14, 253, 84
:urd 1, 253, 98
:urd 8, 253, 99
:urd 1, 253, 107
:urd 4, 253, 108
:urd 1, 253, 112
:urd 5, 253, 113
:urd 1, 253, 118
:urd 2, 253, 161
:urd 2, 253, 163
:urd 4, 253, 165
:urd 2, 253, 169
[MDNSResponder] _readRRAnswerTXT: RDLength:66
:urd 66, 253, 171
[MDNSResponder] _readRRAnswerTXT: Item(14): auth_upload=no
[MDNSResponder] _readRRAnswerTXT: Item(23): board="ESP8266_NODEMCU"
[MDNSResponder] _readRRAnswerTXT: 
Soft WDT reset

>>>stack>>>

ctx: sys
sp: 3fffe6b0 end: 3fffffb0 offset: 01b0
3fffe860:  3fffe8ea 00000000 7449203a 40207025  
3fffe870:  3fffe8d3 00000044 3ffef86c 40100fac  
3fffe880:  402480ad 00000008 3ffef874 0000003a  
3fffe890:  3ffee7b4 00000008 3fffe8b0 40204258  
3fffe8a0:  00000003 00000012 00000000 4020488c  
3fffe8b0:  4e444d5b 73655253 646e6f70 205d7265  
3fffe8c0:  6165725f 41525264 6577736e 54585472  
3fffe8d0:  7449203a 31286d65 203a2933 5f687373  
3fffe8e0:  6f6c7075 6e3d6461 00000a6f 40206ad1  
3fffe8f0:  3fffe930 3fffe900 00000008 40215fca  
3fffe900:  0000001c 00000005 0000000d 3ffeedd8  
3fffe910:  3ffeede5 ff000000 3ffef7ec 4020aada  
3fffe920:  4024a4f8 3ffef7ec 3fffe900 3fffe930  
3fffe930:  00000042 3ffef7ec 00000005 3ffeedd8  
3fffe940:  00000042 3ffee7b4 00000001 4020c5b1  
3fffe950:  3ffefedc 0000000d 3ffefeb4 3ffeed64  
3fffe960:  3fff051c 00000005 3ffefef6 0000000d  
3fffe970:  3ffefec9 0000011c 3fff051c 4020b2c0  
3fffe980:  3ffee7b4 3ffeed64 3fff051c 3fff051c  
3fffe990:  3ffee7b4 3ffeed64 3fffed28 4020c810  
3fffe9a0:  7073650e 36363238 6137392d 08356666  
3fffe9b0:  6472615f 6f6e6975 63745f04 6f6c0570  
3fffe9c0:  006c6163 00000000 00000000 00000000  
3fffe9d0:  00000000 00000000 00000000 00000000  
3fffe9e0:  00000000 00000000 00000000 00000000  
3fffe9f0:  00000000 00000000 00000000 00000000  
3fffea00:  00000000 00000000 00000000 00000000  
3fffea10:  00000000 00000000 00000000 00000000  
3fffea20:  00000000 00000000 00000000 00000000  
3fffea30:  00000000 00000000 00000000 00000000  
3fffea40:  00000000 00000000 00000000 00000000  
3fffea50:  00000000 00000000 00000000 00000000  
3fffea60:  00000000 00000000 00000000 00000000  
3fffea70:  00000000 00000000 00000000 00000000  
3fffea80:  00000000 00000000 00000000 00000000  
3fffea90:  00000000 00000000 00000000 00000000  
3fffeaa0:  00100024 00000001 3ffee968 3ffeed64  
3fffeab0:  00000001 00001194 3fff0042 40100fac  
3fffeac0:  40249428 00000047 3fff051c 40215f5d  
3fffead0:  00000001 3ffee7b4 3fff051c 3ffeed64  
3fffeae0:  00000002 3ffee7b4 00000000 402089d0  
3fffeaf0:  3fffec20 00000004 3fffec20 4021460e  
3fffeb00:  7073650e 36363238 6137392d 05356666  
3fffeb10:  61636f6c 0000006c 00000000 00000000  
3fffeb20:  00000000 00000000 00000000 00000000  
3fffeb30:  00000000 00000000 00000000 00000000  
3fffeb40:  00000000 00000000 00000000 00000000  
3fffeb50:  00000000 00000000 00000000 00000000  
3fffeb60:  00000000 00000000 00000000 00000000  
3fffeb70:  00000000 00000000 00000000 00000000  
3fffeb80:  00000000 00000000 00000000 00000000  
3fffeb90:  00000000 00000000 00000000 00000000  
3fffeba0:  00000000 00000000 00000000 00000000  
3fffebb0:  00000000 00000000 00000000 00000000  
3fffebc0:  00000000 00000000 00000000 00000000  
3fffebd0:  00000000 00000000 00000000 00000000  
3fffebe0:  00000000 00000000 00000000 00000000  
3fffebf0:  00000000 00000000 00000000 00000000  
3fffec00:  00000016 00ff0024 3f010001 7073650e  
3fffec10:  36363238 6137392d 08356666 6472615f  
3fffec20:  6f6e6975 63745f04 6f6c0570 006c6163  
3fffec30:  00000000 00000000 00000000 00000000  
3fffec40:  00000000 00000000 00000000 00000000  
3fffec50:  00000000 00000000 00000000 00000000  
3fffec60:  00000000 00000000 00000000 00000000  
3fffec70:  00000000 00000000 00000000 00000000  
3fffec80:  00000000 00000000 00000000 00000000  
3fffec90:  00000000 00000000 00000000 00000000  
3fffeca0:  00000000 00000000 00000000 00000000  
3fffecb0:  00000000 00000000 00000000 00000000  
3fffecc0:  00000000 00000000 00000000 00000000  
3fffecd0:  00000000 00000000 00000000 00000000  
3fffece0:  00000000 00000000 00000000 00000000  
3fffecf0:  00000000 00000000 00000000 00000000  
3fffed00:  00000000 00000000 00000000 54280024  
3fffed10:  3a650000 00000000 00000000 00000100  
3fffed20:  00000000 00000000 3fff051c 6501a8c0  
3fffed30:  3ffee968 00000002 3ffeff3c 4020bf31  
3fffed40:  3fffeb00 00000001 00000004 3fffec0c  
3fffed50:  00000001 3ffeed64 3fffedba 3fffed28  
3fffed60:  3fffed00 3ffee7b4 3fffedb0 4020ca14  
3fffed70:  00000000 00000000 3ffeed64 00002e54  
3fffed80:  00000000 3ffee7b4 3ffeed64 40209c7b  
3fffed90:  00000000 00000000 00000000 00000000  
3fffeda0:  00000000 00000000 00000000 401007f5  
3fffedb0:  00000000 00000001 00020002 00000000  
3fffedc0:  00000000 3fffedd0 4020e518 fb0000e0  
3fffedd0:  4020e518 6501a8c0 3ffefad4 40100fac  
3fffede0:  0000bca0 3ffef7ec 00000001 40220340  
3fffedf0:  3ffe8a4a 00002e53 3fffee20 3ffeef08  
3fffee00:  3ffefeb4 3ffeed64 3ffeff3c 4020a265  
3fffee10:  3ffefeb4 00002e53 3ffeed64 4020a2be  
3fffee20:  00000000 00000000 3ffe8304 4020e518  
3fffee30:  0a01a8c0 3fffee40 00000004 40219e78  
3fffee40:  3ffee0f0 3fff03d4 3ffeff3c 4020e1f7  
3fffee50:  000014e9 3ffefaec 40228992 401000e1  
3fffee60:  3ffefeb4 3fff03d4 3ffeff3c 40203688  
3fffee70:  000014e9 3ffef874 3ffee968 3fff03d4  
3fffee80:  3fff0406 00000000 3ffeff94 3fff03d4  
3fffee90:  3fff0406 00000000 3ffeff94 4021a68c  
3fffeea0:  000014e9 3ffeee48 3ffeee48 3ffef564  
3fffeeb0:  00000000 40206ad1 00000144 3ffeeef8  
3fffeec0:  3ffeee48 3fff03f2 3fff03d4 4021f5c0  
3fffeed0:  00000014 3ffeee48 00000127 40220320  
3fffeee0:  00000000 0037be4e 3ffee968 3ffef564  
3fffeef0:  3fffdc80 3ffef4d4 3ffef80c 3ffef564  
3fffef00:  0000000⸮⸮)⸮⸮⸮⸮⸮⸮DHB⸮
SDK:2.2.2-dev(38a443e)/Core:unix-2.6.0-dev=-194000/lwIP:STABLE-2_1_2_RELEASE/glue:1.2-8-g7958710/BearSSL:89454af

Exception Decoder

I've decoded the stack with the Exception Decoder:


Decoding stack results
0x40207025: uart_write(uart_t*, char const*, size_t) at C:\Users\Ruggero\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.2\cores\esp8266\uart.cpp line 498
0x40100fac: free(void*) at C:\Users\Ruggero\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.2\cores\esp8266\umm_malloc\umm_malloc.cpp line 1930
0x40204258: HardwareSerial::write(unsigned char const*, unsigned int) at C:\Users\Ruggero\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.2\cores\esp8266/HardwareSerial.h line 158
0x4020488c: Print::printf_P(char const*, ...) at C:\Users\Ruggero\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.2\cores\esp8266\Print.cpp line 97
0x40206ad1: malloc(size_t) at C:\Users\Ruggero\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.2\cores\esp8266\heap.cpp line 95
0x40215fca: operator new(unsigned int) at /workdir/repo/gcc/libstdc++-v3/libsupc++/new_op.cc line 52
0x4020aada: esp8266::MDNSImplementation::MDNSResponder::stcMDNSServiceTxt::allocValue(unsigned int) at C:\Users\Ruggero\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.2\libraries\ESP8266mDNS\src\LEAmDNS_Structs.cpp line 164
0x4020c5b1: esp8266::MDNSImplementation::MDNSResponder::_readRRAnswerTXT(esp8266::MDNSImplementation::MDNSResponder::stcMDNS_RRAnswerTXT&, unsigned short) at C:\Users\Ruggero\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.2\libraries\ESP8266mDNS\src\LEAmDNS_Transfer.cpp line 564
0x4020b2c0: esp8266::MDNSImplementation::MDNSResponder::stcMDNS_RRAnswer::stcMDNS_RRAnswer(esp8266::MDNSImplementation::MDNSResponder::_enuAnswerType, esp8266::MDNSImplementation::MDNSResponder::stcMDNS_RRHeader const&, unsigned int) at C:\Users\Ruggero\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.2\libraries\ESP8266mDNS\src\LEAmDNS_Structs.cpp line 892
0x4020c810: esp8266::MDNSImplementation::MDNSResponder::_readRRAnswer(esp8266::MDNSImplementation::MDNSResponder::stcMDNS_RRAnswer*&) at C:\Users\Ruggero\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.2\libraries\ESP8266mDNS\src\LEAmDNS_Transfer.cpp line 435
0x40100fac: free(void*) at C:\Users\Ruggero\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.2\cores\esp8266\umm_malloc\umm_malloc.cpp line 1930
0x40215f5d: operator delete(void*) at /workdir/repo/gcc/libstdc++-v3/libsupc++/del_op.cc line 48
0x402089d0: esp8266::MDNSImplementation::MDNSResponder::_parseQuery(esp8266::MDNSImplementation::MDNSResponder::stcMDNS_MsgHeader const&) at C:\Users\Ruggero\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.2\libraries\ESP8266mDNS\src\LEAmDNS_Control.cpp line 282
0x4021460e: __ssputs_r at /home/earle/src/esp-quick-toolchain/repo/newlib/newlib/libc/stdio/nano-vfprintf.c line 233
0x4020bf31: esp8266::MDNSImplementation::MDNSResponder::_udpReadBuffer(unsigned char*, unsigned int) at C:\Users\Ruggero\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.2\libraries\ESP8266WiFi\src/include/UdpContext.h line 293
0x4020ca14: esp8266::MDNSImplementation::MDNSResponder::_readMDNSMsgHeader(esp8266::MDNSImplementation::MDNSResponder::stcMDNS_MsgHeader&) at C:\Users\Ruggero\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.2\libraries\ESP8266mDNS\src\LEAmDNS_Transfer.cpp line 1092
0x40209c7b: esp8266::MDNSImplementation::MDNSResponder::_parseMessage() at C:\Users\Ruggero\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.2\libraries\ESP8266mDNS\src\LEAmDNS_Control.cpp line 129
0x401007f5: _umm_free(void*) at C:\Users\Ruggero\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.2\cores\esp8266\umm_malloc\umm_malloc.cpp line 1380
0x40100fac: free(void*) at C:\Users\Ruggero\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.2\cores\esp8266\umm_malloc\umm_malloc.cpp line 1930
0x40220340: mem_free at core/mem.c line 237
0x4020a265: esp8266::MDNSImplementation::MDNSResponder::_process(bool) at C:\Users\Ruggero\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.2\libraries\ESP8266mDNS\src\LEAmDNS_Control.cpp line 76
0x4020a2be: esp8266::MDNSImplementation::MDNSResponder::_callProcess() at C:\Users\Ruggero\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.2\libraries\ESP8266mDNS\src\LEAmDNS_Helpers.cpp line 176
0x40219e78: pbuf_alloc_LWIP2 at core/pbuf.c line 284
0x4020e1f7: std::_Function_handler    (esp8266::MDNSImplementation::MDNSResponder*)> >::_M_invoke(std::_Any_data const&) at c:\users\ruggero\appdata\local\arduino15\packages\esp8266\tools\xtensa-lx106-elf-gcc\2.5.0-3-20ed2b9\xtensa-lx106-elf\include\c++\4.8.2/functional line 2073
0x401000e1: std::function ::operator()() const at c:\users\ruggero\appdata\local\arduino15\packages\esp8266\tools\xtensa-lx106-elf-gcc\2.5.0-3-20ed2b9\xtensa-lx106-elf\include\c++\4.8.2/functional line 2465
0x40203688: UdpContext::_s_recv(void*, udp_pcb*, pbuf*, ip4_addr const*, unsigned short) at C:\Users\Ruggero\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.2\libraries\ESP8266WiFi\src/include/UdpContext.h line 509
0x4021a68c: udp_input at core/udp.c line 404
0x40206ad1: malloc(size_t) at C:\Users\Ruggero\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.2\cores\esp8266\heap.cpp line 95
0x4021f5c0: ip4_input at core/ipv4/ip4.c line 1461
0x40220320: mem_malloc at core/mem.c line 210

Can someone try?

EDIT: I've forgotten to say that I've enabled all debug from Arduino IDE's menu

@JAndrassy
Copy link
Contributor

JAndrassy commented Sep 12, 2019

Serial.print blocks if there is no space in Serial TX buffer, so it slows down everything with all this debug prints if Serial send bytes so slow

@ruggi99
Copy link
Contributor Author

ruggi99 commented Sep 12, 2019

How could this be fixed?

@JAndrassy
Copy link
Contributor

How could this be fixed?

higher baud rate or less logging

@ruggi99
Copy link
Contributor Author

ruggi99 commented Sep 13, 2019

@d-a-v @devyte what do you think? What about opening a PR to reduce debug messages from UdpContext.h or mDNS library? Otherwise, why not advise of this inconvenience somewhere like readthedocs or other?

@d-a-v
Copy link
Collaborator

d-a-v commented Sep 13, 2019

We can add a mention in serial documentation that printing lots of data (all debug options enabled for example) at low speed like 9600bauds can have bad side effects because serial write is indeed blocking.

https://arduino-esp8266.readthedocs.io/en/latest/reference.html#serial
https://github.com/esp8266/Arduino/blob/master/doc/reference.rst#serial

PRs are welcome

@devyte
Copy link
Collaborator

devyte commented Sep 15, 2019

Core Version: [latest git]

but log shows 2.5.2. Which is it?

@ruggi99
Copy link
Contributor Author

ruggi99 commented Sep 15, 2019

but log shows 2.5.2. Which is it?

I've taken latest git from GitHub Desktop and overwritten 2.5.2 version files in AppData. That why you see 2.5.2 version in the log. Don't know how to switch faster from latest git to 2.5.2 and vice-versa in Arduino IDE.

@devyte
Copy link
Collaborator

devyte commented Sep 15, 2019

That's not a supported installation procedure. I don't know if the end result is correct, latest git pulls things from various places, and some of them have received stability fixes very recently. You could potentially have a Frankenstein build. At rhe very least, the logs are misleading.
I suggest you do a cleanup of your installation (delete everything), then install a fresh latest git core, then retest.

@devyte devyte added the waiting for feedback Waiting on additional info. If it's not received, the issue may be closed. label Sep 15, 2019
@ruggi99
Copy link
Contributor Author

ruggi99 commented Sep 16, 2019

I've done a cleanup of my installation and installed correctly using this instructions: https://arduino-esp8266.readthedocs.io/en/latest/installing.html#using-git-version.
Then I retried all and the problem is the same. When I select 9600 speed on the sketch, with 2.5.2 it runs without problems and with the very latest git it breaks in stack dumps.

@d-a-v
Copy link
Collaborator

d-a-v commented Sep 16, 2019

@ruggi99 Does it break always, and not only with debug enabled ?

@ruggi99
Copy link
Contributor Author

ruggi99 commented Sep 16, 2019

No, only with all debug enabled and serial speed 9600 and only with latest git. Otherwise it will run without problems. Like @JAndrassy said, it could be lots of debug made with a very slow speed. The major difference I've observed is that from 2.5.2 to latest git version there's much more debug in the ESP8266mDNS library.

@ruggi99
Copy link
Contributor Author

ruggi99 commented Sep 17, 2019

I've done some tests. If I remove debug only from ESP8266mDNS library, the sketch runs without problems and same if I remove debug only from UdpContext.h. The problem appears only when this two debug options (with the others) are active at the same time. I think it's only related to serial speed

@d-a-v
Copy link
Collaborator

d-a-v commented Sep 17, 2019

Debug modes have always been modifying nominal behavior, and mDNS probably has now more debug messages since 2.5.2, to help chasing bugs.
You actually found a situation where debug mode and low serial speed break expected behaviour.
Do you think it is fair only mentioning in documentation that low speed serial link in debug mode is not advised ?

@ruggi99
Copy link
Contributor Author

ruggi99 commented Sep 18, 2019

Yes, I think it would be enough. Because those who use debug mode and latest gits also know how to disable debug functions in each single library

@earlephilhower
Copy link
Collaborator

#7799 should fix the underlying cause here (too much UART chatter causing WDT). Nothing to document as it's working now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: documentation waiting for feedback Waiting on additional info. If it's not received, the issue may be closed.
Projects
None yet
Development

No branches or pull requests

5 participants