Blynk connects and then drops connection

Hi All,





#include <ESP8266_Lib.h>
#include <BlynkSimpleShieldEsp8266.h>
#define EspSerial Serial
#include <SoftwareSerial.h>
#define ESP8266_BAUD 9600

char auth[] = "b1e93fcd7117492a866NOPEda";
char ssid[] = "Dan's iPhone";
char pass[] = "######";

SoftwareSerial debugSerial(10, 11); // RX, TX
WidgetTerminal terminal(V0);
ESP8266 wifi(&EspSerial);

void setup()
{
  // Debug console
  debugSerial.begin(9600);
  debugSerial.println("test");

  delay(10);

  // Set ESP8266 baud rate
  EspSerial.begin(ESP8266_BAUD);
  delay(10);
  debugSerial.println("before connect");
  Blynk.begin(auth, wifi, ssid, pass, "#######", 8080);
  debugSerial.println("after connect");
  terminal.println("Terminal print");
  terminal.flush();
}

BLYNK_WRITE(V1)
{
  terminal.println("PRESSED");
  terminal.flush();
}

void loop()
{
  Blynk.run();
}


Now, it connects to my local Blynk server just fine and I can see the terminal print and if I press V1 quick enough, I can see “PRESSED”, but then it just disconnects for absolutely no reason and never connects again.

I slapped the expansion board onto an Arduino Mega just for the fun of it and everything is working perfectly fine, but as soon as I revert back to the UNO above behavior starts happening again.

Would you guys have an idea why that might be?

Cheers,
Dan

Figured it out. It was a memory issue; anything above 67% SRAM caused these issues to happen. 67% or below was working fine.

Cheers,
Dan

Hello Dan,
I am using a Mega and DFRobot WiFi_IoT_Module_SKU_TEL0126. This wifi comes with its own library. #include “DFRobot_WiFi_IoT_Module.h” Can this work versus #include <ESP8266_Lib.h>?

I am using #include <BlynkSimpleWifi.h> (new library) or must I use #include <BlynkSimpleShieldEsp8266.h> to get it to work?

I can get connected to wifi but connection drop straight after (trying to connect to Blynk)?

Appreciate and thanks

@SL145585 Many things have changed since this was posted 4 years ago. I’d suggest that you start a new “need help with my project” topic, and provide as much details as possible.