2 step solution for web update OTA"Update error: ERROR[4]: Not Enough Space"

Post Reply
elmaya
Posts: 812
Joined: Wed Jun 27, 2018 5:48 pm
Location: Sevilla

Fri May 08, 2020 6:20 pm

2 step solution for web update OTA "Update error: ERROR[4]: Not Enough Space"

It is a .bin file reduced to a minimum "less than 250KB"so that it allows us to make an OTA without "Update error: ERROR[4]: Not Enough Space"
We will use it as a bridge between the firmwares.
We access the OTA page and update with the file "ap_update_DOUT_8Mbit.bin".
After loading ESP8266 creates a WiFi AP (ap update) to which we connect.
Open the browser at ip 192.168.4.1 to access web update and now we can load the firmware that previously gave us "Update error: ERROR[4]: Not Enough Space"

Code: Select all

#include <ESP8266WiFi.h> // ---------- core 2.3.0 --------------------
#include <WiFiClient.h>
#include <ESP8266WebServer.h>
#include <DNSServer.h>
#include <ESP8266HTTPUpdateServer.h>

const byte DNS_PORT = 53;
IPAddress apIP(192, 168, 4, 1);
DNSServer dnsServer;

ESP8266WebServer httpServer(80);
ESP8266HTTPUpdateServer httpUpdater;

void setup(void) {

  WiFi.mode(WIFI_AP);
  WiFi.softAPConfig(apIP, apIP, IPAddress(255, 255, 255, 0));
  WiFi.softAP("ap update");

  dnsServer.start(DNS_PORT, "*", apIP);
  httpUpdater.setup(&httpServer, "/");

  httpServer.begin();

}

void loop(void) {
  dnsServer.processNextRequest();  
  httpServer.handleClient();
}
ap_update_DOUT_8Mbit.rar
(173.64 KiB) Downloaded 6 times
Post Reply