-
Notifications
You must be signed in to change notification settings - Fork 13.3k
ArduinoOTA not working when Serial speed is set to 9600 #6506
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
Comments
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 |
How could this be fixed? |
higher baud rate or less logging |
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 PRs are welcome |
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. |
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'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. |
@ruggi99 Does it break always, and not only with debug enabled ? |
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. |
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 |
Debug modes have always been modifying nominal behavior, and mDNS probably has now more debug messages since 2.5.2, to help chasing bugs. |
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 |
#7799 should fix the underlying cause here (too much UART chatter causing WDT). Nothing to document as it's working now. |
Basic Infos
Platform
Settings in IDE
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)
Debug Messages
Exception Decoder
I've decoded the stack with the Exception Decoder:
Can someone try?
EDIT: I've forgotten to say that I've enabled all debug from Arduino IDE's menu
The text was updated successfully, but these errors were encountered: