-
Notifications
You must be signed in to change notification settings - Fork 13.3k
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
[2.4.0] Communication issue between ArduinoOTA and espota.py #4283
Comments
There have been fixes merged since 2.4 release that might be relevant. Please test with latest git. |
Hey, latest git works. Thank you @devyte |
Closing as already fixed. |
@devyte I don't believe this issue has been fixed... all the recent issues with OTA seems to be caused by the changes @d-a-v made to the espota.py OTA script in the IDE, not the ESP8266 OTA code itself. https://github.com/esp8266/Arduino/blob/master/tools/espota.py#L163 assumes it will always be more than 1000 bytes of data received/written (reads 4 bytes of numerical characters) when the device responds with the length after each packet, however in practice this is not always the case. Even if all the chunks of data of an upload are > 1000 bytes (usually 1460 depending on MTU), there is no guarantee the last chunk would be, that depends on the total size of the binary being uploaded. If this last chunk is say 900 bytes, L163 will still read 4 bytes, first 3 would be "900" and the fourth would be "O" from the "OK" that https://github.com/esp8266/Arduino/blob/master/tools/espota.py#L180 is waiting for. |
@washcroft what is your proposal? If you have one, please make a PR, explain the bug, how your proposal fixes it, and how you tested it. We can then discuss further in the PR. |
@devyte I have no PR, I’m not a python developer - but I can understand the logic and I am merely pointing out why so many people are having issues with OTA uploads. Take it or leave it. |
@washcroft did you actually run into the issue ? |
@d-a-v yes, that’s how I ended up investigating the cause ;) thanks for correcting your bug with the new PR |
Thanks for that! |
Basic Infos
I'm not a python developer and also new to all this here so please have mercy.
While migrating my project from 2.3.0 to 2.4.0 I experienced the OTA to behave different.
espota.py is not closed like it was in 2.3.0
Hardware
Hardware: ESP-07
Core Version: 2.4.0
Description
ArduinoOTA
espota.py is waiting for an "OK" from ArduinoOTA library after upload was successful but only receives "K", thus not closing connection.
The "O" seems to get lost somewhere.
With 2.3.0 version of espota.py this was not an issue since espota.py closed anyway.
#4053 introduced this new handling
Hack
By trial and error I just added a leading character to the char array ArduinoOTA returns and it was working:
Fix?
Next try was then to provide a String instead of char*
Settings in IDE
Module: Generic ESP8266 Module
Flash Size: 1 MB
CPU Frequency: 80Mhz
Flash Mode: qio
Flash Frequency: 40Mhz
Upload Using: OTA
Reset Method: ck
Sketch
basicOTA.ino
Debug
espota.py 2.3.0 - prints error "K" but flashed successful
espota 2.4.0 - hangs there forever but sketch is updated and ESP restarts fine (I canclled execution some minutes after)
espota 2.4.0 + ArduioOTA hack - nice and smooth
espota 2.4.0 + ArduioOTA fix? - nice and smooth
The text was updated successfully, but these errors were encountered: