OTA flash failure

Unable to OTA flash an esp8266 using ~50% storage with blynk air. The most i can get out of the web page is “download failure” - see attached screenshot. Any ideas what’s wrong?

Using platformio, pulling the bin from my project’s folder:
.pio\build\d1_mini_lite\firmware.bin (466kB).

Running the BlynkEdgent simple test with a few sensors. Longest blocking code is in loop for 1 second in the main loop.

#include <Arduino.h>
#include <ESP8266WiFi.h>
#define BLYNK_FIRMWARE_VERSION        "0.1.0"
#define BLYNK_PRINT Serial
#define APP_DEBUG

#define BLYNK_TEMPLATE_ID "..."
#define BLYNK_DEVICE_NAME "..."
#include "BlynkEdgent.h"

void setup() {
  Serial.begin(9600);
  BlynkEdgent.begin();
}
void loop() {

  BlynkEdgent.run();
  Blynk.virtualWrite(V10,ipToString(WiFi.localIP()));
  ....
  blocking code 1 second
}

You should probably read this…

http://help.blynk.cc/en/articles/2091699-keep-your-void-loop-clean

You may also want to increase…

to a number that’s higher than what’s already running on your board.

Pete.

Pete,

This project has been running for about 2 years on blynk legacy. Are there new timing requirements for blynk 2.0? What are the timing requirements? I do not see this on the ‘newbies guide’

On Blynk Air I did set it to ‘Apply update if the device has: Another build date’ Is this feature not working? Must the version be different?

>[11280] 
    ___  __          __
   / _ )/ /_ _____  / /__
  / _  / / // / _ \/  '_/
 /____/_/\_, /_//_/_/\_\ 
        /___/ v1.0.0 on ESP8266

[11317] --------------------------
[11355] Product:  House
[11381] Firmware: 0.1.0 (build Jun 27 2021 13:50:45)
[11437] Token:    ...NZrc
[11465] Device:   ESP8266 @ 80MHz
[11502] MAC:      3C:71:BF:3A:DC:63
[11540] Flash:    4096K
[11566] ESP core: 2.7.4
[11592] ESP SDK:  2.2.2-dev(38a443e)
[11632] Boot Ver: 31
[11655] Boot Mode:1
[11677] FW info:  503904/454656, MD5:e15b2312864d4c06af990a281599a44f
[11912] Free mem: 29656
[11912] --------------------------
[11912] INIT => CONNECTING_NET
Ready
IP address: 192.168.1.237
[12137] Connecting to WiFi: *******
[12263] Using Dynamic IP: 192.168.1.237
[12263] CONNECTING_NET => CONNECTING_CLOUD
[49394] Current time: Mon Jun 28 16:52:00 2021
[49394] Connecting to blynk.cloud:443
[50475] Ready (ping: 12ms).
[50588] CONNECTING_CLOUD => RUNNING

Just throwing some pointers out there to hopefully help you overcome your problem.
If you don’t want to take them onboard or investigate these possible solutions then that’s fine with me.

Pete.

I’m trying to figure out the new issues that popped up when switcing to 2.0. Are there no timing requirements other than ‘do it fast’?

I would also suggest setting the default datastream min/max to not be active by default, or not be a range of 0 to 1.

Looking at a datastream int and float on web dashboard ‘label’ - displays VERY large numbers, but same datastream is fine on the ‘value display’ widget on android app.

Occasionally the app seems to get wrong datastreams pushed to it or there’s randomly scaling introduced? Maybe there’s an issue with many (8) Blynk.virtualWrite(V…,…) getting called all at once every 1 sec while BlynkEdgent.run() is called every 150msec.

LogEvents - can’t find these in the web gui - maybe i got kicked off the pro features? Who knows.

The esp8266 blynk Edgent example has the onboard LED set to Pin4 which is the SDA pin… Which is why my I2C sensors were going crazy. I would suggest changing that to pin0 which is the ESP module onboard LED and isn’t a I2C/SPI/UART pin.

I think you might want to change your topic title to something like “All the things failure” :grin:

Already changed on GitHub

#if defined(USE_NODE_MCU_BOARD) || defined(USE_WEMOS_D1_MINI)

  #define BOARD_BUTTON_PIN            0
  #define BOARD_BUTTON_ACTIVE_LOW     true

  #define BOARD_LED_PIN               2
  #define BOARD_LED_INVERSE           true
  #define BOARD_LED_BRIGHTNESS        255

You can download the pre-release version of the library here:

Pete.

For OTA uploads, the size of the compiled (old sketch + new sketch) should not exceed the flash size.

Due to this, large sketches (more than 500KB with 1MB flash) cannot be OTA uploaded directly if the sketch size exceeds half of the flash size.

However, this restriction can be circumvented by first uploading a sketch only with OTA features as given below:


#include <ESP8266WiFi.h> #include <ESP8266mDNS.h> #include <WiFiUdp.h> #include <ArduinoOTA.h>

char ssid[] = “xxxxxxxx”; //WiFI user id char pass[] = “yyyyyy”; //WiFi password

#define OTA_Host_Name “ESP01S-EMPTY-OTA”

void setup() { WiFi.mode(WIFI_STA); WiFi.begin(ssid, pass);

while (WiFi.waitForConnectResult() != WL_CONNECTED) { delay(5000); ESP.restart(); } ArduinoOTA.setHostname(OTA_Host_Name); ArduinoOTA.begin(); }

void loop() { ArduinoOTA.handle(); }


This script will compile to around 300KB. Once this script is uploaded in flash, a script with upto 700KB can be uploaded through OTA to a 1MB flash!

Upload this script first. Then restart the controller and choose “ESP01S-EMPTY-OTA” as the port and upload the new updated script that you wish to upload!

IMPORTANT: Firewall must be turned OFF during OTA uploads.

This was actually a Blynk.Air question rather than Arduino OTA question, and the issue was that the BLYNK_FIRMWARE_VERSION value hadn’t been incremented.

Arduino OTA and Blynk.Air aren’t interchangeable.

Pete.

Yes. I fully agree with you Pete.

I had posted a solution for users who use ESP01/EDP01S who have difficulty in uploading large scripts through OTA - though I agree that it is not the question posted.