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

Setting date and time problem
#3

(08-09-2018, 20:07)Werk_AG Wrote:  Hi jarekh3,

.........
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.
......


Monitor:
Code:
21:36:08.713 -> OK
21:36:08.713 -> IP Address: 192.168.1.116
21:36:08.713 -> Broadcast IP: 192.168.1.255
21:36:08.713 -> Start tcp server OK
STATUS:2
21:36:08.821 -> Set tcp server timout 30 seconds
21:36:08.821 -> RTC current date: Mar 109 2018
21:36:08.857 -> RTC current time: 21:36:07
21:36:08.857 -> Sending NTP request to sync clock...
NTP replied
21:36:09.001 -> UTC time from NTP server: 19:36:08
21:36:09.001 -> RTC adjusted to local time: 20:36:08
WiFi connection is ON

Config_Options.H
Code:
// --------------------------------------------------------------------------------------
//   Define your Weather Station location. Use decimal format for Latitude and Longitude
// --------------------------------------------------------------------------------------
#define LATITUDE      52.475    // Put here your Station latitude in degrees North (always use 3 decimal places)
#define LONGITUDE     16.767    // Put here your Station longitude in degrees - minus for West (always use 3 decimal places)
#define ELEVATION     86       // Put here your Station height above sea level in Meters (no decimal places)


// --------------------------------------------------------------------------------------
//   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, 120};   //Portuguese Summer Time -  "UTC + 1" or GMT + 1
TimeChangeRule GMT = {"GMT", Last, Sun, Oct, 2, 60};    //Portuguese Winter Time -  "UTC + 0" or GMT
Timezone myTZ(PST, GMT);

Set with sketch from library:
Code:
2018/9/8 (Saturday) 20:50:0
21:50:01.782 ->  since midnight 1/1/1970 = 1536439800s = 17782d
21:50:01.836 ->  now + 7d + 30s: 2018/9/16 9:20:6
21:50:01.882 ->
2018/9/8 (Saturday) 20:50:3
21:50:04.847 ->  since midnight 1/1/1970 = 1536439803s = 17782d
21:50:04.894 ->  now + 7d + 30s: 2018/9/16 9:20:9
21:50:04.948 ->
2018/9/8 (Saturday) 20:50:6
21:50:07.904 ->  since midnight 1/1/1970 = 1536439806s = 17782d
21:50:07.957 ->  now + 7d + 30s: 2018/9/16 9:20:12
21:50:08.004 ->
2018/9/8 (Saturday) 20:50:9
21:50:10.973 ->  since midnight 1/1/1970 = 1536439809s = 17782d

Results:
Without NPT  date :  06-13-2018
With NPT  date: 109-03-2018
Time is ok.
I did all these steps yesterday ..... Huh
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)