Connecting errors


I do not know what happens that I lose connection so much, what can I do to find out what is happening … It never happened to me, I have been with blynk for 4 years and I never had problems.

She also left the code.

#define BLYNK_PRINT Serial

#define BLYNK_DEVICE_NAME "Arduino Mega";

#define BLYNK_FIRMWARE_VERSION        "1.2"

#include <SPI.h>
#include <Ethernet.h>
#include <BlynkSimpleEthernet.h>

BlynkTimer timer;

#define W5100_CS  10
#define SDCARD_CS 4

const int ReflectorPatio = 24;
const int Presurizadora = 26;
const int TimerPresurizadora = 34;

const int ReflectorPorton = 53;
const int ReflectorTerreno = 43;

int EstadoReflectorPatio = LOW;
int EstadoPresurizadora = LOW;
int EstadoReflectorPorton = LOW;
int EstadoReflectorTerreno = LOW;
int EstadoTimerPresurizadora = LOW;

void setup()
  // Debug console

  digitalWrite(SDCARD_CS, HIGH);

  pinMode(ReflectorPatio, OUTPUT);
  pinMode(Presurizadora, OUTPUT);
  pinMode(TimerPresurizadora, OUTPUT);

  pinMode(ReflectorPorton, OUTPUT);
  pinMode(ReflectorTerreno, OUTPUT);


  digitalWrite(ReflectorPatio, HIGH);
  digitalWrite(Presurizadora, HIGH);
  digitalWrite(ReflectorPorton, HIGH);
  digitalWrite(ReflectorTerreno, HIGH);


  EstadoReflectorPatio = param.asInt();
  digitalWrite(ReflectorPatio, EstadoReflectorPatio);
  Blynk.virtualWrite(V2, EstadoReflectorPatio);
  EstadoPresurizadora = param.asInt();
  digitalWrite(Presurizadora, EstadoPresurizadora);
  Blynk.virtualWrite(V3, EstadoPresurizadora);

  if (EstadoPresurizadora == 0) {
    Blynk.virtualWrite(V14, "Presurizada");
  else {
    Blynk.virtualWrite(V14, "Normal");


  EstadoTimerPresurizadora = param.asInt();
  digitalWrite(TimerPresurizadora, EstadoTimerPresurizadora);
  Blynk.virtualWrite(V4, EstadoTimerPresurizadora);

  EstadoReflectorPorton = param.asInt();
  digitalWrite(ReflectorPorton, EstadoReflectorPorton);
  Blynk.virtualWrite(V5, EstadoReflectorPorton);
  EstadoReflectorTerreno = param.asInt();
  digitalWrite(ReflectorTerreno, EstadoReflectorTerreno);
  Blynk.virtualWrite(V6, EstadoReflectorTerreno);

  EstadoTimerPresurizadora = param.asInt();
  digitalWrite(TimerPresurizadora, EstadoTimerPresurizadora);
  Blynk.virtualWrite(V7, EstadoTimerPresurizadora);

void loop()

any help there ? idk what happend i check cables , internet and all its fine…

Pin 53 is the SS (CS) pin that’s used by the Ethernet shield when attached to a Mega. It is connected via the ICSP connector in the middle of the board.

You have to avoid pins 50-53 when using an Ethernet shield on a Mega.


Hi Pete, thx.

my monitor show me this…

but app show me connection lost every 1 or 2 hours.

And what changes have you made to your code?


const int ReflectorPorton = 53;
const int ReflectorPorton = 48;

I keep receiving notifications from the blynk application that the notification was lost and is driving me crazy. But I don’t know if it really loses the connection because I could never “not use it” it is always available every time I need it.

@EscuderoKevin you can turn off “offline” notifs in the settings (left top menu item)

@Dmitriy But that’s not the solution, is it a bug?

@EscuderoKevin I don’t know. It’s hard to say. You need to experiment with your firmware. Start from the simplest possible sketch and move forward.

@Dmitriy is that I use the same code since I use blynk, I only updated it when v2 came out, but I never had problems, it began to pass from 1 day to the other as if it were simply disconnected but in reality the monitor does not show me what it is I disconnect …

I don’t think you’ve previously been successfully using the same code on the same hardware, as the code you originally posted used pin which clashed with the Mega/Ethernet connection.
This would have caused issues in any situation, not just with Blynk IoT.


I understand it, but as I told you, I have been using it for almost 2 years with the same code. Change when I upgrade to v2, but always use the same hard and code