-->
Page 1 of 1

HttpUpdate Error [-100] Too Less Space - only on second try

PostPosted: Mon Mar 05, 2018 12:02 pm
by karbo
Can't find the specific error in search. Using esphttpupdate to pull a .bin file compiled in Arduino from my server.

Board: Adafruit Huzza E12S - 4MB (3M SPIFFS)
Bin file size: 239k

1st upload: Works perfectly.
2nd upload: Fails with: Error [-100] Too Less Space - even with the exact same sketch/bin file.

If I then re-flash (same sketch) via COM/USB, it uploads fine.
Now, a new OTA from server -> works perfectly but 2nd attempt gives same error.

Update code - I return OK + binary file if update is needed...

Code: Select allvoid checkForUpdate()
{
  t_httpUpdate_return ret = ESPhttpUpdate.update("192.168.1.101", 80, "/UpdateESP8266OTA?softwareVersion=" + softwareVersion + "&deviceFamily=ESP8266PIR");

  switch (ret) {
    case HTTP_UPDATE_FAILED:
      Serial.println("Update failed.");
      Serial.printf("Error (%d): %s\n", ESPhttpUpdate.getLastError(), ESPhttpUpdate.getLastErrorString().c_str());
      break;
    case HTTP_UPDATE_NO_UPDATES:
      Serial.println("No update needed.");
      break;
    case HTTP_UPDATE_OK:
      Serial.println("Update ok.");
      break;
  }
}


Thanks

Re: HttpUpdate Error [-100] Too Less Space - only on second

PostPosted: Fri Mar 30, 2018 7:59 pm
by karbo
Since there were no replies, I'll update with what I think the issue was...

I think it is possible that I had compiled as generic ESP-8266 in Arduino which assumes the smaller amount of memory (less than OTA requires). Even though the 12E had the memory, it wasn't compiled as such. When the OTA update code executed, the -100 error was generated at update time.

Though I had caught this and changed build options to ESP 12E, it appears the Arduino IDE was aggressively caching the compiled sketch - That doesn't make sense since the build options would have changed but once I restarted the IDE and cleared the cache, it then compiled and now works.

This also doesn't explain why it would previously update the first attempt, but not second attempt, because when this was occurring, it was the exact same compiled bits for the first working and second failing OTA updates. I don't know the underlying APIs that well so this is the best I could come up with. :shock: