Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5

Setting date and time problem
#2

Hi jarekh3,

In first place, try to enable the NTP debug options by uncommented the line as show below:


Code:
// --------------------------------------------------------------------------------------
//   Debug helper
// --------------------------------------------------------------------------------------
//#define PRINT_DEBUG_WIFI
#define PRINT_DEBUG_NTP_UPDATE      // Prints to serial monitor messages related to sync time with NTP server

What you get on the serial monitor?
You can also enable the PRINT_DEBUG_WIFI options to check if you are getting WiFi connection, otherwise the NTP will not work.


Next check your auto summer time settings, here:

Code:
// --------------------------------------------------------------------------------------
//   Define rules for Auto Summer Time Display, and clock adjustment
// --------------------------------------------------------------------------------------
// Example for Australia Eastern Time Zone (Sydney, Melbourne)
// TimeChangeRule aEDT = {"AEDT", First, Sun, Oct, 2, 660};    //UTC + 11 hours
// TimeChangeRule aEST = {"AEST", First, Sun, Apr, 3, 600};    //UTC + 10 hours
// Timezone myTZ(aEDT, aEST);

TimeChangeRule PST = {"PST", Last, Sun, Mar, 1, 60};   //Portuguese Summer Time -  "UTC + 1" or GMT + 1
TimeChangeRule GMT = {"GMT", Last, Sun, Oct, 2, 0};    //Portuguese Winter Time -  "UTC + 0" or GMT
Timezone myTZ(PST, GMT);


There is also another way you could try to force the clock to sync:
On the examples folder of the RTClib library, there is a sketch called ds3231.ino, compile it and upload to your Meduino. Your clock should be working correctly now.

Reply


Messages In This Thread
Setting date and time problem - by jarekh3 - 08-09-2018, 18:07
RE: Setting date and time problem - by werk_ag - 08-09-2018, 20:07
RE: Setting date and time problem - by jarekh3 - 08-09-2018, 20:57
RE: Setting date and time problem - by werk_ag - 09-09-2018, 22:08
RE: Setting date and time problem - by jarekh3 - 09-09-2018, 22:17
RE: Setting date and time problem - by werk_ag - 09-09-2018, 23:21
RE: Setting date and time problem - by jarekh3 - 09-09-2018, 23:38
RE: Setting date and time problem - by werk_ag - 10-09-2018, 00:03
RE: Setting date and time problem - by jarekh3 - 10-09-2018, 00:11
RE: Setting date and time problem - by werk_ag - 10-09-2018, 00:28
RE: Setting date and time problem - by jarekh3 - 10-09-2018, 00:56
RE: Setting date and time problem - by werk_ag - 10-09-2018, 01:45
RE: Setting date and time problem - by jarekh3 - 10-09-2018, 07:53
RE: Setting date and time problem - by jarekh3 - 10-09-2018, 16:58
RE: Setting date and time problem - by werk_ag - 10-09-2018, 22:46
RE: Setting date and time problem - by jarekh3 - 10-09-2018, 23:30
RE: Setting date and time problem - by jarekh3 - 10-09-2018, 23:40
RE: Setting date and time problem - by werk_ag - 11-09-2018, 00:17
RE: Setting date and time problem - by jarekh3 - 11-09-2018, 00:34
RE: Setting date and time problem - by jarekh3 - 17-09-2018, 09:18
RE: Setting date and time problem - by hornychz - 17-09-2018, 21:58
RE: Setting date and time problem - by werk_ag - 18-09-2018, 02:56
RE: Setting date and time problem - by jarekh3 - 18-09-2018, 22:14
RE: Setting date and time problem - by werk_ag - 19-09-2018, 01:17
RE: Setting date and time problem - by jarekh3 - 20-09-2018, 21:32
RE: Setting date and time problem - by werk_ag - 21-09-2018, 02:30
RE: Setting date and time problem - by jarekh3 - 24-09-2018, 20:18
RE: Setting date and time problem - by hornychz - 20-09-2018, 22:34
RE: Setting date and time problem - by uncle_bob - 20-09-2018, 22:52
RE: Setting date and time problem - by jarekh3 - 20-09-2018, 23:09



Users browsing this thread: 1 Guest(s)