Yesterday have tried OTA. I had huge issues to make it work.

Yesterday have tried OTA.
I had huge issues to make it work.
my setup

  • Esp8266
  • latest arduino IDE
  • lastest librairies for esp8266
  • Mac Os X
    I manage to set it up with a simple code (even if i have to restart arduinio IDE everytime for the OTA to appear)
    but when loading something a bit larger (<40% of the flash size). I come ito troubles it seems that the OTA upload process does not like the fact that I have SPIFFS on with some data in it. Indeed when reuplaoding the same sketch via USB => the SPIFFs does not work anymore. I reuplod the SPIFFS files and it works
    Any idea ?

What’s your SPIFFS flash size setting? The basic requirement of OTA to run properly is that the sketch size should be equal or less than the flash size (excluding SPIFFS).

Let’s say you have 4 MBytes esp8266 module, with 1 MBytes for SPIFFS (which means 3 MBytes left for the actual program). The maximum sketch you can flash via OTA is half of 3 MBytes (i.e. 1.5 MBytes).

So I think that’s the root of your problem. When you try to upload sketch larger than 40% of the flash size (more than 1.6 MBytes) then the SPIFFS codespace is overwritten.

For more details:
http://esp8266.github.io/Arduino/versions/2.0.0/doc/ota_updates/ota_updates.html

Hope this helps mate.

@Rosmianto_Aji_Saputr thank you your answer and the link. my sketch is 349035 bytes I am on a setup 1m+3M(for spiffs). I don’t think this is my issue. But I will try to recompile with inverting the size.
Any other ideas ?
Thx

@Yves_BAZIN For your flash size setting, I think it’s too much for SPIFFS. As the link stated:

“too much memory declared for SPIFFS so new sketch will not fit between existing sketch and SPIFFS”.

@Rosmianto_Aji_Saputr I will do the change. I have just tried to recompile the sketch changing the ratio, but I still see the same amount of 1Mb for the sketch and not 3. I am using Arduino. Would you know why ?