Esp 01 does not connect using ESP core version 2.4 or higher and Blynk 0.5.4

When I use ESP8266 Board version 2.3.0 with Blynk 0.5.3, my Blynk app connects with the ESP-01 without issues.
When I use a higher version of Esp8266 and Blynk 2.4 It compiles, but the connection wont establish.

Does anyone else experience this issue and can it be resolved?

Are you referring to the ESP Arduino Core versions here? I am successfully running all my ESP8266 based Blynk devices (ESP-01, Wemos D1 Mini, NodeMCU) with Core 2.4.2

I am also using latest Blynk Library 0.5.4

Ok nice!
Yes I mean ESP Arduino Core.
I am using Arduino IDE 1.8.7. a Samsung Galaxy Edge S7, Blynk app 2.27.1.
You have seen the code I am using, did you notice something that might affect the performance negatively?
I think for example a library name changed in a previous version of Blynk like:
#include <BlynkSimpleEsp8266.h>

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

   long myWiFiTimeout = 5000;
   long myServerTimeout =5000;

    char ssid[] = "XXXX";
    char pass[] = "XXXX";

    // Blynk
    char server[] = "blynk-cloud.com";
    char auth[]   = "XXXX";

    void setup() {
      // put your setup code here, to run once:
      WiFi.mode(WIFI_STA);
      WiFi.begin(ssid, pass);
      ArduinoOTA.begin();
      checkBlynk();
      
      unsigned long startWiFi = millis();
      while (WiFi.status() != WL_CONNECTED)
      {
        delay(500);
        if(millis() > startWiFi + myWiFiTimeout)
        {
          break;
        }       
      }
      Blynk.config(auth, server);
    }

    void loop() {
      // put your main code here, to run repeatedly:
    ArduinoOTA.handle();
    checkBlynk();
    if (Blynk.connected()) 
    {
      Blynk.run();
    }
    }

    void checkBlynk() 
    {
      if (WiFi.status() == WL_CONNECTED)  
      {
        unsigned long startConnecting = millis();    
        while(!Blynk.connected())
        {
          Blynk.connect();  
          if(millis() > startConnecting + myServerTimeout)
          {
            break;
          }
        }
      }
    }

@Hannes_Sapiens your sketch will not work with any version of the Arduino IDE, Blynk libraries or ESP8266 core.

You are missing the definition of two global long variables:

long myWiFiTimeout = 5000;
long myServerTimeout =5000;

oh crap, you are right, I forgot to put these lines in. Even with these lines it works with previous versions and it does not work with higher versions.

@Hannes_Sapiens worked for me with IDE 1.8.8, Blynk 0.5.4 and Core 2.5.0beta2.

Maybe you are using a bad auth token.

I just tried with the IDE 1.8.9 hourly build, Blynk 0.5.4 and Core 2.5.0beta2 on my Desktop.
It compiles and uploads just fine, but it just wont make a connection to the app.
When I upload the same sketch with Arduino IDE 1.8.7, Core 2.3.0, Blynk 0.5.3 it connects without issues.
So the Auth token works just fine.
Maybe the problem lies in the Generic ESP8266 Module upload settings?
On the Desktop with the latest version I use:

@Hannes_Sapiens most ESP01’s don’t have 4MB flash.

I soldered a 4 MB chip on it.
On the laptop with the older versions I use:

@Hannes_Sapiens from your sketch I am guessing you are working “blind” without Serial Monitor. Get yourself sorted out with Serial Monitor with mods to the sketch and a USB2TTL adaptor. You will then know what your problem is.

I have a USB2TTL adaptor.
I tried adding the Serial.begin line in Void Setup() and this line:
#define BLYNK_PRINT Serial
Like the Blynk example for Esp8266 devices has, but all I get is garbage in the monitor even though the Baud rates match.
If you have any suggestions, I would love a sketch for debugging or a link.

This is working fine on a decent ESP8266 (WeMos).

/*
 * OTAtest.ino 
 */

#define BLYNK_PRINT Serial    /* Comment this out to disable prints and save space */
#include <ESP8266mDNS.h>
#include <WiFiUdp.h>
#include <ArduinoOTA.h>
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>

char ssid[] = "xx";
char pass[] = "xx";

long myWiFiTimeout = 5000; // 5s timeout
long myServerTimeout = 5000; // 5s timeout

// Blynk
char server[] = "xx";
char auth[]   = "xx";

void setup() 
{
  Serial.begin(115200);
  WiFi.mode(WIFI_STA);
  WiFi.begin(ssid, pass);
  ArduinoOTA.begin();
  checkBlynk();
  
  unsigned long startWiFi = millis();
  while (WiFi.status() != WL_CONNECTED)
  {
    delay(500);
    if(millis() > startWiFi + myWiFiTimeout)
    {
      break;
    }       
  }
  Blynk.config(auth, server);
  Serial.print(F("\nLAN IP address: "));
  Serial.print(WiFi.localIP()); 
}

void loop() 
{
  ArduinoOTA.handle();
  checkBlynk();
  if (Blynk.connected()) 
  {
    Blynk.run();
  }
}

void checkBlynk() 
{
  if (WiFi.status() == WL_CONNECTED)  
  {
    unsigned long startConnecting = millis();    
    while(!Blynk.connected())
    {
      Blynk.connect();  
      if(millis() > startConnecting + myServerTimeout)
      {
        break;
      }
    }
  }
}

ESP-01, Arduino IDE 1.8.7, ESP Core 2.1.0, Blynk 0.5.3 this code works as expected:

#include <ESP8266mDNS.h>
#include <WiFiUdp.h>
#include <ArduinoOTA.h>
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
    
char ssid[] = "Hannes";
char pass[] = "19811981";
char ssidOTA[] = "Ziggo7D69ADC";
char passOTA[] = "cpkessj8jbeK";

// Blynk
char auth[]   = "09be2b05000c462f81f0cc85d2a4d3e7";

#define buttonPin 0
boolean OTA = 1;

void setup()
{
  delay(2000);
  // Debug console
  pinMode(buttonPin, INPUT_PULLUP);
  int buttonState = digitalRead(buttonPin);
  if (buttonState == HIGH)
  {
    OTA = 0;
  }
  delay(3000);
  if (OTA == 0)
  {
    // Blynk.begin(auth, ssid, pass, "blynk-cloud.com", 80);
    Blynk.begin(auth, ssid, pass);
  } else if (OTA == 1)
  {
    WiFi.mode(WIFI_STA);
    WiFi.begin(ssidOTA, passOTA);
    ArduinoOTA.begin();
  }
}

void loop()
{
  if (OTA == 0)
  {
    Blynk.run();
  }  else if (OTA == 1)
  {
    ArduinoOTA.handle();
  }
}

Updated through the managers to ESP core 2.5.0beta2, Blynk 0.5.4 and the code compiles and uploads, but I cant connect to the mobile hotspot or use OTA.
Uploaded using these settings:
Laptop
Also tried Flash frequency 80 Mhz, still no go.

Why should how you flash the code to the device affect how OTA works?

And what is with this convoluted if()… just leave your OTA command in the loop() running as fast as it can so as to be able to do its job.

PS works fine on ESP Core 2.4.2 for me

Thanks for the tip!
Did you use an ESP-01 and try to connect it to your phone with blynk?
ESP32 works fine, but ESP-01 does not connect to the hotspot and Blynk or wifi for OTA with ESP core 2.4.0 and Blynk 0.5.4.

I included:
#define BLYNK_PRINT Serial // This prints to Serial Monitor //#define BLYNK_DEBUG

serial monitor shows nothing

Of course, full phone and OTA functionality… otherwise connecting it via a USB-Serial adapter is a pain… although I leave that option open to add one in, in case I do something silly like overload the ESP-01 with Neopixel routines and Image Gallery fan rotation experiments (not shown, but lower in the project window) that can interfere with OTA, if I am not careful… due the hogging of processor time :blush:

It is a bit of a test bench project… but missing the DHT-11 in this picture.

You keep mixing up your numbers… there is no such thing as ESP core 4.2.0 (and what is Blynk 2.4 in your title?) Makes it hard for us to track what you are actually doing :wink:

Sorry about that. I corrected it, its 2.4.0. I am trying different ESP cores.
Your setup looks good. I love RGB leds and am working on LED hoops and other ws2812b based led projects.
Your Blynk app design looks great.
I dont understand why you can connect the ESP to your phone and why mine keeps failing.
It also fails to connect to Blynk on my iphone 4s.
Also thank you for helping me out.

I don’t know it it will help… but this is he settings I use when flashing my ESP-01…

I use QIQ flash mode… I don’t entirely understand all the differences, but I do recall that some ESP8266 chipsets (like on my sonoffs) get persnickety if set incorrectly.

You said you have added memory to yours, so adjust accordingly.

Thank you for sharing. I will try your settings and report back.