incorrect date/time in Mega version

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
manjh
Normal user
Posts: 516
Joined: 08 Feb 2016, 11:22

incorrect date/time in Mega version

#1 Post by manjh » 21 Jul 2018, 12:36

I am using ESPEasy Mega build mega-20180710.
Switched on the "use NTP" field, left the host name field empty (as suggested).
After a while I notice the date/time is 2036-02-07 07:12:37....

Did I configure it wrong, or have we invented a time machine? :D :D :D

Shardan
Normal user
Posts: 1156
Joined: 03 Sep 2016, 23:27
Location: Bielefeld / Germany

Re: incorrect date/time in Mega version

#2 Post by Shardan » 21 Jul 2018, 16:18

Does it work if you enter the IP address of the NTP server you use?

If not there is a problem with Mega.

Does your device use DHCP (no IP for the device set within the config)?
If so, check that your DHCP server gives a valid address for NTP.
Regards
Shardan

manjh
Normal user
Posts: 516
Joined: 08 Feb 2016, 11:22

Re: incorrect date/time in Mega version

#3 Post by manjh » 21 Jul 2018, 20:18

Shardan wrote: 21 Jul 2018, 16:18 Does it work if you enter the IP address of the NTP server you use?

If not there is a problem with Mega.

Does your device use DHCP (no IP for the device set within the config)?
If so, check that your DHCP server gives a valid address for NTP.
I use a static IP address, with 20+ ESP units there is no way around this.
As for the NTP server, I can enter a value there but since the recommendation is to leave it blank...
But OK I will try.

User avatar
grovkillen
Core team member
Posts: 3621
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: incorrect date/time in Mega version

#4 Post by grovkillen » 21 Jul 2018, 20:47

ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you :idea: :idea: :idea:

Shardan
Normal user
Posts: 1156
Joined: 03 Sep 2016, 23:27
Location: Bielefeld / Germany

Re: incorrect date/time in Mega version

#5 Post by Shardan » 21 Jul 2018, 23:45

manjh wrote: 21 Jul 2018, 20:18
Shardan wrote: 21 Jul 2018, 16:18 Does it work if you enter the IP address of the NTP server you use?

If not there is a problem with Mega.

Does your device use DHCP (no IP for the device set within the config)?
If so, check that your DHCP server gives a valid address for NTP.
I use a static IP address, with 20+ ESP units there is no way around this.
As for the NTP server, I can enter a value there but since the recommendation is to leave it blank...
But OK I will try.
I'm not sure if this is still an issue.

If you use a static IP address ESPEasy does not use the DHCP.
So if the NTP server field is left blank and DHCP is not used,
the NTP server field just won't get any valid address or name

BTW: You can use DHCP and fixed address. It's what I'm doing here.
I've reserved specific IP adresses for all devices with my DHCP server.

Regards
Shardan
Regards
Shardan

manjh
Normal user
Posts: 516
Joined: 08 Feb 2016, 11:22

Re: incorrect date/time in Mega version

#6 Post by manjh » 22 Jul 2018, 14:59

Shardan wrote: 21 Jul 2018, 23:45
manjh wrote: 21 Jul 2018, 20:18
Shardan wrote: 21 Jul 2018, 16:18 Does it work if you enter the IP address of the NTP server you use?

If not there is a problem with Mega.

Does your device use DHCP (no IP for the device set within the config)?
If so, check that your DHCP server gives a valid address for NTP.
I use a static IP address, with 20+ ESP units there is no way around this.
As for the NTP server, I can enter a value there but since the recommendation is to leave it blank...
But OK I will try.
I'm not sure if this is still an issue.

If you use a static IP address ESPEasy does not use the DHCP.
So if the NTP server field is left blank and DHCP is not used,
the NTP server field just won't get any valid address or name

BTW: You can use DHCP and fixed address. It's what I'm doing here.
I've reserved specific IP adresses for all devices with my DHCP server.

Regards
Shardan
I've entered the URL 0.pool.ntp.org, but that does not help.
As for static versus dynamic: I am aware that I can limit the address range, but that does not make it 100% sure that an ESP unit gets the same IP address every time. Since I want to be able to log on via a browser, and also because I send http commands , I need to be sure if the IP.

Shardan
Normal user
Posts: 1156
Joined: 03 Sep 2016, 23:27
Location: Bielefeld / Germany

Re: incorrect date/time in Mega version

#7 Post by Shardan » 22 Jul 2018, 15:38

Please try to enter an IP address so we can see if the ntp or the DNS resolving is the point.
Make sure that your router passes NTP requests to the internet.

You can find valid ntp addresses with nslookup:
- open a shell (Linux) or a CMD windows (Windows).
- enter

Code: Select all

nslookup de.pool.ntp.org
You'll get some IP addresses from the ntp pool in Germany. May swap to other countries by
changing "de" to "nl" for example.

For the DHCP Range:
The range is more or less useless, right.
Very most routers are able to define a list of MAC addresses and assign a specific IP to every MAC.
This drives the DHCP server to assign the given IP to the device. The MAC address of a device is fixed
and does not change (Usually burned into the network chip).

You can obtain the MAC adress from a device as follows:
- Open a CMD windows
- ping the device with

Code: Select all

ping <IP Address>
- immediately after the ping type

Code: Select all

arp -a <IP Address>
This will show the MAC address of the device.
Now go to your router and define a fixed DHCP address.
As i don't know your router i can't say how this works, but even my stoneage old router (spare part in the shelf)
is able to handle that.
Regards
Shardan

manjh
Normal user
Posts: 516
Joined: 08 Feb 2016, 11:22

Re: incorrect date/time in Mega version

#8 Post by manjh » 22 Jul 2018, 15:52

OK, I entered an actual IP addres (85.255.214.66), and now it gets me the correct date/time.
So that means that working with a URL (nslookup nl.pool.ntp.org) does not work, but a resolved IP does.

As for your suggestion to use a MAC address: I understand, but I would prefer not to put too much dependency into the router.
Putting the unit number along with the IP address into the ESP is very convenient.

manjh
Normal user
Posts: 516
Joined: 08 Feb 2016, 11:22

Re: incorrect date/time in Mega version

#9 Post by manjh » 22 Jul 2018, 15:54

Now that I get time/date from the server, I notice that I still have to tick the DST box. Is this not done automatically?
In other words, does ESPEasy not "see" the beginning and end date of DST?

manjh
Normal user
Posts: 516
Joined: 08 Feb 2016, 11:22

Re: incorrect date/time in Mega version

#10 Post by manjh » 22 Jul 2018, 15:58

Hah.... I have one ESP running ESP Mega 20000, and that one works just fine with the unresolved URL!

TD-er
Core team member
Posts: 8750
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: incorrect date/time in Mega version

#11 Post by TD-er » 23 Jul 2018, 21:40

Are you using static IP on the ESP node?
Then make sure you have set the gateway and DNS too.

Currently you have to set DST yourself, but I guess we may change the default to checked.
My idea was to leave it unchecked so people see they also can set other parameters too.
DST has quite some country-specific settings, most people are unaware of.

manjh
Normal user
Posts: 516
Joined: 08 Feb 2016, 11:22

Re: incorrect date/time in Mega version

#12 Post by manjh » 24 Jul 2018, 00:20

TD-er wrote: 23 Jul 2018, 21:40 Are you using static IP on the ESP node?
Then make sure you have set the gateway and DNS too.

Currently you have to set DST yourself, but I guess we may change the default to checked.
My idea was to leave it unchecked so people see they also can set other parameters too.
DST has quite some country-specific settings, most people are unaware of.
GW and DNS are set.

As for DST: I notice all the parameters for the automatic DST mechanism are already there.... so when I tick the DST box, will it then switch over automatically?

TD-er
Core team member
Posts: 8750
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: incorrect date/time in Mega version

#13 Post by TD-er » 25 Jul 2018, 00:08

manjh wrote: 24 Jul 2018, 00:20
TD-er wrote: 23 Jul 2018, 21:40 Are you using static IP on the ESP node?
Then make sure you have set the gateway and DNS too.

Currently you have to set DST yourself, but I guess we may change the default to checked.
My idea was to leave it unchecked so people see they also can set other parameters too.
DST has quite some country-specific settings, most people are unaware of.
GW and DNS are set.

As for DST: I notice all the parameters for the automatic DST mechanism are already there.... so when I tick the DST box, will it then switch over automatically?
Those parameters are the rules for most countries on the northern hemisphere.
For me, in Holland, I just have to tick DST and set the timezone to +60 minutes. (GMT + 1 in winter, GMT + 2 during DST)

manjh
Normal user
Posts: 516
Joined: 08 Feb 2016, 11:22

Re: incorrect date/time in Mega version

#14 Post by manjh » 25 Jul 2018, 09:16

TD-er wrote: 25 Jul 2018, 00:08
manjh wrote: 24 Jul 2018, 00:20
TD-er wrote: 23 Jul 2018, 21:40 Are you using static IP on the ESP node?
Then make sure you have set the gateway and DNS too.

Currently you have to set DST yourself, but I guess we may change the default to checked.
My idea was to leave it unchecked so people see they also can set other parameters too.
DST has quite some country-specific settings, most people are unaware of.
GW and DNS are set.

As for DST: I notice all the parameters for the automatic DST mechanism are already there.... so when I tick the DST box, will it then switch over automatically?
Those parameters are the rules for most countries on the northern hemisphere.
For me, in Holland, I just have to tick DST and set the timezone to +60 minutes. (GMT + 1 in winter, GMT + 2 during DST)
OK, very good, that is exactly what I hoped for. :D

Post Reply

Who is online

Users browsing this forum: No registered users and 132 guests