PlatformIO Community

How can I make uploads try multiple times with espota


Frequently, when I upload on my ESP8266, the upload will fail, but go OK if I just retry once.
When using platformio with 6 different boards, all being set in the same project, I often have 3 out of 6 uploads fail randomly.
What I need is a way to try a few times to upload the code using espota before failing.

Any way to do that? Thanks

Since espota doesn’t have a ‘retry’ parameter, think your best bet is to implement a custom upload command, which itself simply retries a configurable number of times if espota returns an error. Between the example from the docs, and the code used by pio for the upload, it shouldn’t be too hard to throw something together.