Arduino-FIrebase code restarts every minute

Hello,

I have the below code running fine on my ESP 8285 microcontroller. The function is that the microcontroller should activate the pins according to the value of the variables in the database. I created a mobile app that sends modifies those variables.
Essentially, I’m trying to switch on/off appliances over the internet.

Here’s the little problem: the code restarts every 57 seconds or so. By restarting, I mean that the ESP re-connects to the Wifi network and starts the program afresh - I got to know via the Serial Monitor. I don’t know why that happens.

[I’ve hidden my WiFi and Firebase details in the code below]

#include <ESP8266WiFi.h>
#include <FirebaseArduino.h>
#include <WiFiManager.h>

// Setting variable names.
#define FIREBASE_HOST "*********"
#define FIREBASE_AUTH "*********"
#define WIFI_SSID "*********"
#define WIFI_PASSWORD "*********"

const int Buzzer = 4;

void setup() {
  Serial.begin(9600);
  pinMode(13, OUTPUT);
  pinMode(12, OUTPUT);
  pinMode(14, OUTPUT);
  pinMode(2, OUTPUT);

  digitalWrite(13, HIGH);
  digitalWrite(12, HIGH);
  digitalWrite(14, HIGH);
  digitalWrite(2, HIGH);
  
  pinMode(Buzzer, OUTPUT);

  pinMode(Buzzer, LOW);

  // connect to wifi
  WiFi.hostname("ESP-host");
  WiFi.mode(WIFI_STA);
  WiFi.begin(WIFI_SSID, WIFI_PASSWORD);
  Serial.print("connecting");


  WiFiManager wifiManager;
  wifiManager.autoConnect("Smart Home");

  Serial.println();
  Serial.print("connected: ");
  Serial.println(WiFi.localIP());

  Firebase.begin(FIREBASE_HOST, FIREBASE_AUTH);
  Serial.println("Firebase: Connected");

  digitalWrite(Buzzer, HIGH);

}



void loop() {
  bool LED2 = Firebase.getBool("message2");
  bool LED1 = Firebase.getBool("message1");
  bool LED3 = Firebase.getBool("message3");
  bool LED4 = Firebase.getBool("message4");
  //FirebaseObject val = Firebase.get("truth");
  //bool pixel = val.getBool();

  // handle error
  if (Firebase.failed()) {
    Serial.print("setting /number failed:");
    Serial.println(Firebase.error());
    return;
  }

  //Compare value for ON/OFF LED2
  if (LED2 == true)
  {
    Serial.println("LED2 ON");
    digitalWrite(13, LOW);
  }
  else
  {
    Serial.println("LED2 OFF");
    digitalWrite(13, HIGH);
  }

  //Compare value for ON/OFF LED1
  if (LED1 == true)
  {
    Serial.println("LED1 ON");
    digitalWrite(12, LOW);
  }
  else
  {
    Serial.println("LED1 OFF");
    digitalWrite(12, HIGH);
  }


  //Compare value for ON/OFF LED3
  if (LED3 == true)
  {
    Serial.println("LED3 ON");
    digitalWrite(14, LOW);
  }
  else
  {
    Serial.println("LED3 OFF");
    digitalWrite(14, HIGH);
  }


  //Compare value for ON/OFF LED4
  if (LED4 == true)
  {
    Serial.println("LED4 ON");
    digitalWrite(2, LOW);
  }
  else
  {
    Serial.println("LED4 OFF");
    digitalWrite(2, HIGH);
  }
}