How to restart/reset a esp2866 connected to a RTC

Hi I'm using an esp2866 but in Arduino the board says it's a nodeMCU?? Does that mean it's a nodeMCU not a esp2866? But the board says it's a esp2866.

Anyway currently I'm doing a project with an RTC but the readings are wrong, it comes out as 45:165:85 165/165/2165 165* I'm using the sample code from the RTC library. And I suspect to fix it would be to restart/reset the devices via code before the RTC code is activated, it did work once but the 2nd time the code went back to the error is there anyone that knows how to reset/restart the code at the first part while the rest of the code is about the RTC & etc.?

And I suspect to fix it would be to restart/reset the devices via code before the RTC code is activated

Restart/reset what devices?

How to restart/reset a esp2866 connected to a RTC

I think you have that backwards. The RTC is connected to, and read by, the esp8266, not the other way around.

Do you suppose that your code might be important? A schematic? Some mention of whether or not there is a battery in the RTC?

Is this the same project as in this thread? If so, why start another thread?

PaulS:
Restart/reset what devices?
I think you have that backwards. The RTC is connected to, and read by, the esp8266, not the other way around.

Do you suppose that your code might be important? A schematic? Some mention of whether or not there is a battery in the RTC?

Reset/restart the RTC, yes there is a battery attached to the RTC, I’m using a grove v1.2 with lithum 1220 battery.

#include <Wire.h>
#include "DS1307.h"

DS1307 clock;//define a object of DS1307 class
void setup()
{
 Serial.begin(9600);
 clock.begin();
 clock.fillByYMD(2013,1,19);//Jan 19,2013
 clock.fillByHMS(15,28,30);//15:28 30"
 clock.fillDayOfWeek(SAT);//Saturday
 clock.setTime();//write time to the RTC chip
}
void loop()
{
 printTime();
}
/*Function: Display time on the serial monitor*/
void printTime()
{
 clock.getTime();
 Serial.print(clock.hour, DEC);
 Serial.print(":");
 Serial.print(clock.minute, DEC);
 Serial.print(":");
 Serial.print(clock.second, DEC);
 Serial.print(" ");
 Serial.print(clock.month, DEC);
 Serial.print("/");
 Serial.print(clock.dayOfMonth, DEC);
 Serial.print("/");
 Serial.print(clock.year+2000, DEC);
 Serial.print(" ");
 Serial.print(clock.dayOfMonth);
 Serial.print("*");
 switch (clock.dayOfWeek)// Friendly printout the weekday
 {
 case MON:
  Serial.print("MON");
  break;
 case TUE:
  Serial.print("TUE");
  break;
 case WED:
  Serial.print("WED");
  break;
 case THU:
  Serial.print("THU");
  break;
 case FRI:
  Serial.print("FRI");
  break;
 case SAT:
  Serial.print("SAT");
  break;
 case SUN:
  Serial.print("SUN");
  break;
 }
 Serial.println(" ");
}

groundFungus:
Is this the same project as in this thread? If so, why start another thread?

Cause it’s a different method? I didn’t really think much when starting out the topic except I need help a.s.a.p. as I’m doing it for as a final year project sorry