Your new topic does not fit any of the above??? Check first. Then post here. Thanks.

Moderator: igrr

User avatar
By Domingo
#80077 Hi, I'm trying to do an OTA update of my ESP8266 generic module (12F) by downloading the BIN from my local web server but it fails due to "Not enough space" as stated by my serial debug:


Code: Select all  t_httpUpdate_return ret = ESPhttpUpdate.update("192.168.1.53", 80, "/", "1.0.0");
 
  switch(ret) {
      case HTTP_UPDATE_FAILED:
          Serial.printf("HTTP_UPDATE_FAILD Error (%d): %s", ESPhttpUpdate.getLastError(), ESPhttpUpdate.getLastErrorString().c_str());
          break;
      case HTTP_UPDATE_NO_UPDATES:
          Serial.println("[update] Update no Update.");
          break;
      case HTTP_UPDATE_OK:
          Serial.println("[update] Update ok."); // may not called we reboot the ESP
          break;
  }


This outputs:

HTTP_UPDATE_FAILD Error (-100): Not Enough space[HTTP]


My ESP supposedly have 4Mb of flash storage and my BIN is around 400K, and in fact this is confirmed by the HTTP header sent to my HTTP server:

'x-esp8266-free-space': '69632',
'x-esp8266-sketch-size': '430336',
'x-esp8266-sketch-md5': '87b87905f3d5c46975cee3b15e751166',
'x-esp8266-chip-size': '4194304',
'x-esp8266-sdk-version': '3.0.0-dev(c0f7b44)',
'x-esp8266-mode': 'sketch'


What is weird to me is that chip size is 4Mb, sketch size is 430Kb but the free space is just 69Kb... What I'm missing?
User avatar
By sfranzyshen
#80098 Did you setup your arduino IDE to create the correct size SPIFFS? not sure what it should be or how the Arduino OTA stores files or swaps the new firmware in ... but looks like you either already allocated all your flash to something else or you didn't allocate enough ...
User avatar
By btidey
#80107 OTA needs available program flash at least double the size of the code /sketch. This is because it downloads the new version alongside the running previus version before it is replaced.

SPIFFs will use flash memory according to the IDE set up. So a 1M/3M will allocate 3M to SPIFFS and leave 1M to program.

I would have thought that 1M would have been OK for your sketch but it might be getting marginal. Try it with a 2M/2M or 3M/1M split to see if that fixes the problem.