Skip to content

[Updater.cpp] Increasing stream timeout to avoid read timeout during OTA flash write #1886

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

Closed
wants to merge 1 commit into from

Conversation

cyberman54
Copy link
Contributor

@cyberman54 cyberman54 commented Sep 22, 2018

If using a nginx webserver to feed a https OTA write flash stream with ~1,5MB binary data, i'm getting reproducely _error #6 (stream read timeout) on a ESP32 Pycom LoPy with CPU revision 0.

I was able to stable fix this by applying a patch to Updater.cpp, following a hint for ESP 8266 Update.cpp, found at the end of this issue:

esp8266/Arduino#1157

This PR is a quick&dirty fix. Problem should be further analysed and then solved at the root cause. Eventually this is a TCP related issue.

If using nginx webserver to feed the OTA stream with the binary, i'm getting reproducely _error #6 (stream read timeout) on a ESP32 Pycom LoPy with CPU revision 0.
This error does not occur with some other ESP32 boards with same setup and server, don't know why.

But i could fix the issue with the LoPy following a hint for ESP 8266 Update.cpp, found in this issue:
esp8266/Arduino#1157

This PR is a quick&dirty fix. Problem should be further analysed and then solved at the root cause.
@cyberman54 cyberman54 changed the title Increasing stream timeout to avoid read timeout [Updater.cpp] Increasing stream timeout to avoid read timeout during OTA flash write Sep 22, 2018
@Jeroen88
Copy link
Contributor

I am not in favor of this PR. It would be better to use setTimeout on the Stream before you pass it into ::writeStream, outside of UpdateClass. This PR would always set the timeout to 10,000 ms without any possibility to change it.

@cyberman54
Copy link
Contributor Author

@Jeroen88 is right. I close this.

@cyberman54 cyberman54 closed this Nov 4, 2018
@cyberman54
Copy link
Contributor Author

I reopen this, because i did not find a working solution to set the timeout for the stream of class WifiClient before calling Update.writeStream(), see my corresponding issue here

@cyberman54 cyberman54 reopened this Nov 5, 2018
@cyberman54
Copy link
Contributor Author

Closing this again, since the problem should be solved with pending PR #1979

@cyberman54 cyberman54 closed this Nov 5, 2018
@haimiko
Copy link

haimiko commented Nov 11, 2018

Tested this "fix". Doesn't help. Still getting "ERROR[6]: Stream Read Timeout". Even up'ped the timeout to 60 seconds with no change. This issue is more prevalent on larger bins.

BTW. This fix seems to help on local networks but if you're trying to update over the internet you'll still experience the same issue.

@Jeroen88
Copy link
Contributor

@haimiko Maybe you could try my PR #1979? If you look at my comments in that PR you can see that there are several timeout issues in the current libraries that should be solved with that PR.

@cyberman54 cyberman54 deleted the patch-1 branch December 1, 2018 20:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants