Makuna / Rtc

Arduino Library for RTCs, Ds1302, Ds1307, Ds3231, Ds3232, Ds3234 and Pcf8563/BM8563 with deep support. Please refer to the Wiki for more details. Please use the Github Discussions to ask questions as the GitHub Issues feature is used for bug tracking.
GNU Lesser General Public License v3.0
368 stars 126 forks source link

ESP8266, No DS3231 connected at all, GetIsRunning() and IsDateTimeValid() both return True. #110

Closed OfferLa closed 4 years ago

OfferLa commented 4 years ago

NOTE: If you are seeking help or have questions, this is NOT the place to do it. For questions and support, jump on Gitter and ask away.
Gitter

Describe the bug I've just tested now a code on an NodeMCU board. At last it supposed to be connected to a DS3231 module, but now it's not connected to anything. Nevertheless - println(Rtc.IsDateTimeValid()) and println(Rtc.GetIsRunning()) prints "1".

To Reproduce Steps to reproduce the behavior: I think I mentioned it: If you run the Arduino without the module exist - it will return true for both functions mentioned above.

Expected behavior I think when there is no Rtc module present - both functions should return "false", Because clock is not running, and time is not reliable.

Development environment (please complete the following information):

Minimal Sketch that reproduced the problem:

Serial.println("");
Serial.println("Starting RtcInitByCompile");

RtcDateTime compiled = RtcDateTime(__DATE__, __TIME__);

Serial.print("Compiled at: ");
Serial.println(compiled);

Serial.print("Rtc.IsDateTimeValid: ");
Serial.println(Rtc.IsDateTimeValid());

Serial.print("Rtc.GetIsRunning: ");
Serial.println(Rtc.GetIsRunning());

Additional context Add any other context about the problem here.

Makuna commented 4 years ago

https://github.com/Makuna/Rtc/pull/113 has been merged in.

Please pull the latest master and give this a try.

Makuna commented 4 years ago

Please provide feedback if the fixes solve the issue for you.

OfferLa commented 4 years ago

Really sorry for my delay. Will test it (try to re-produce my original bug) again, and update soon.

Makuna commented 4 years ago

new release includes the change