Domotic bedroom

hello guys, recently, i have made my domotic bedroom, but I have some problem, in the room, there are a relay shield and a lm35cz. I have problem with a relay shield. i control the relay shield by button and menu widget, when use menù blynk some times the device goes offline this is the sketch:

#define BLYNK_PRINT Serial
#define potPin  A0
#include <SPI.h>
#include <Ethernet.h>
#include <BlynkSimpleEthernet.h>

 const int ledPin1 =  9;// lUME
 const int ledPin2 =  8;//  lUCE
 const int ledPin3 =  7;//  PIANTANA
 const int ledPin4 =  5;//  LAMPADA

char auth[] = "000000000000000000000000000000";

#define W5100_CS  10
#define SDCARD_CS 4
BlynkTimer timer;
WidgetLCD lcd(V1);


  BLYNK_WRITE(V0) {
  switch (param.asInt())
  {
    case 1: // Manuale
     
        break;
    
    case 2: // Off
     
      digitalWrite(ledPin1, HIGH);
      digitalWrite(ledPin2, LOW);// Relè collegato al contrario
      digitalWrite(ledPin3, HIGH);
      digitalWrite(ledPin4, HIGH);
      break;
      case 3: // SERA
     
      digitalWrite(ledPin1, LOW);
      digitalWrite(ledPin3, LOW);
      digitalWrite(ledPin4, LOW);
      digitalWrite(ledPin2, LOW);// Relè collegato al contrario
      break;
       case 4: // SERATA
      digitalWrite(ledPin4, LOW);
      digitalWrite(ledPin1, LOW);
      digitalWrite(ledPin2, LOW);// Relè collegato al contrario
      digitalWrite(ledPin3, HIGH);
     
      break;
       case 5: // OSPITI
      
      digitalWrite(ledPin1, LOW);
    digitalWrite(ledPin2, HIGH);// Relè collegato al contrario
      digitalWrite(ledPin3, LOW);
      digitalWrite(ledPin4, LOW);
      break;
       case 6: // BUONANOTTE 
       digitalWrite(ledPin1, HIGH);
      digitalWrite(ledPin2, LOW);// Relè collegato al contrario
      digitalWrite(ledPin3, HIGH);
      digitalWrite(ledPin4, HIGH);
     
      break;
    default:
      Serial.println("Unknown item selected");
  }
}
void myTimerEvent()
{
 
   int aRead = 0;
  aRead = analogRead(potPin);
  float tempC = aRead * 0.48875;
    lcd.print(1, 0, "Temperatura"); 
 
  lcd.print(3, 1, (tempC));
  lcd.print(12,1, "°C");
  Blynk.virtualWrite(V1, millis() / 1000);
}

void setup()
{
  // Debug console
  Serial.begin(9600);
digitalWrite(ledPin1, HIGH);
   digitalWrite(ledPin2,HIGH);
      digitalWrite(ledPin3, HIGH);
      digitalWrite(ledPin4, HIGH);
pinMode(ledPin1, OUTPUT);

pinMode(ledPin3, OUTPUT);
pinMode(ledPin4, OUTPUT);

  pinMode(SDCARD_CS, OUTPUT);
  digitalWrite(SDCARD_CS, HIGH); // Deselect the SD card

  Blynk.begin(auth);
  
    timer.setInterval(1000L, myTimerEvent);
 
}

void loop()
{
  Blynk.run();
   timer.run(); // I
}

do you have any advice?

Ps. thank you for your attencion, and sorry for my English!

Possibly just a flaky Ethernet shield. They are known to have connection issues.

You also seem to be missing the pinMode() for ledPin2

when i can try? the pin mode 2 is sudmitted