I am trying to program an ESP8266 E12 module with another ESP8266 module OTA. I got everything working fine and there is just a minor problem. Once in a while the response from the ESP for the FLASH_DOWNLOAD_DATA packet return with error flag and the error code (7) similar to this:
(I recorded this in a serial monitor)
192 1 3 2 0 7 7 18 32 1 7 192
and in hexadecimal format:
0xc0 0x01 0x03 0x02 0x00 0x07 0x07 0x12 0x20 0x01 0x07 0xc0
I tried to fix this error code by detecting whenever the ESP sent an error response I emitted a FLASH_DOWNLOAD_DATA packet with the same content replacing the error one. But once I tried this, the ESP produces a different error packet with a different error code (5)
192 1 3 2 0 7 7 18 32 1 5 192
0xc0 0x01 0x03 0x02 0x00 0x07 0x07 0x12 0x20 0x01 0x05 0xc0
Although the official released esptool.py did address the returned values in there routines, they only throw an error exception and stop the uploading process and I want to be able to recover from the error.
So I want to know if there is any way to recover the programming process after the ESP hits an error like that.
I also wonder if there is a list of error code explaining the meaning of each error code as well. I have searched in the source code, on github and on the forum for this list but failed to find any relevant information.