Комментарии:
Thank you! A lot of useful information. Some comments:
time() function, if the initial connection to NTP server is successful, provides the correct result even Internet is not accessible. In other words- looks like the GetTimeReducedTraffic() idea is implemented INSIDE this function and therefore GetTimeReducedTraffic function() is useless. Another conclusion- time() cannot be used as an indicator of Internet presence
Does the time keep counting internally after synchronization? I tested this and it shows the time when the request to the ntp server was made and it keeps showing the same time, until new data is received form ntp server, basically only shows the time that the ntp server sends. If the network goes down, there is no more time update, meaning, the clock keeps showing the same value. I thought this would receive the time from ntp server and then keep counting the time internally and periodically sync the time with the ntp server, like a computer does.
ОтветитьHas esp8266 in title. Doesnt work with esp8266.
ОтветитьNTP=MAD TIME REALLY MAD,....IT SHOWS DIFFRENT TIME EACH TIME
ОтветитьFor your comments on the start of the week. Only the western modern world starts on monday. All the arabic world starts on sunday ! With a very significant part of world not being western, nor christian - normal becomes some what relative ! ;)
ОтветитьGreat video!!
But how do i make the antenna??
Hello. Do you have a schematic for the antenna connection with the ESP32 please ?
ОтветитьAs I watch this, I'm refactoring the code produced by two days of manic hacking about half a year ago. It was written with beer also.
ОтветитьHi, can you help me out please with some info about the antenna? I see the link to the ferrite rod but the link is broken and I guess I need not just the rod but a few turns of copper too. Thanks in advance!
ОтветитьIt was both useful and interesting, as always! I did want to point out that up to 3 NTP time servers can be specified in the "configTime" function, separated by commas.
ОтветитьThanks for the video. One question.... why are you using time.h instead of TimeLab.h (which is Arduino's time module)
ОтветитьNice video, many thanks. May be I haven't understood the main reason for using NTP server with ESP32 for time. So please allow me to ask: Why you didn't choose to use DCF77 directly? You don't have to worry about summer and winter time correction or the number of time you send request to NTP. With DCF77 you always have the right date and time. Is the main reason for your selecting the NTPserver is the ease of adapting the NTP structure and available ESP32 functions in the sketch? Please comment. Thanks
ОтветитьMichael Graff is quite correct. Use UTC time across the system, this avoids data logging complications when local clocks go back an hour. Then adjust the time when presenting to users at the point of consumption. Thus the locale of the source device can usually be inferred by user context. (The user can say in which timezone the data should be presented for any given device.)
ОтветитьJajajajajajaja, the sketch on the aknik/ESP32 is not in spanish, that's english and italian language with just comments on Spanish. My language is spanish but... i recognize that Spanish and Italian sound similar to the ears of a non-Latin speaker jejeje. Greetings from Venezuela (I am Uruguayan) and thanks for the video!!!
int ArrayImpulsi[60];
int ContaImpulsiParziale = 0;
int Ore,Minuti,Secondi,Giorno,Mese,Anno,DayOfW;
thats is Italian jeje
LOL "you never know with the British" :)
ОтветитьHow is the ferrite rod antenna connected to the ESP32? any circuitry required? I have one from a DCF77 receiver and it has a capacitor between the 2 wires, I read this is called a tuned antenna. Do I just connect the 2 wires to the ESP32? Thank you
Ответить"You never know with the British", sorry Mate I think you confusing us with the French.
ОтветитьGuten Abend Andreas, Interessantes Video, habe gerade Gefunden! Welche Distanz ist Überbrückbar mit den DCF Sender mit der Ferrit Antenne als Sendeantenne ? Grüße aus Wien
ОтветитьGreat video again. Just one remark. Update NTP is only with configtime function. getlocaltime_r() in getNTPtime example code does not update ntp in my test. Did 24h test with example code clock was 2min behind. Restart updated time correct again. So update is done only when configtime is run and you have wifi of course. found nice extra (esp32)configTzTime(TZ_INFO,NTP_SERVER,NTP_SERVER2,NTP_SERVER3);//this updates via ntp and posix is integrated.
ОтветитьHow can I built the antenna for this project?
ОтветитьMicrocontrollers and LSD! This is the best fucking channel ever!
ОтветитьHow to add decimal places for the seconds for much more accurate timestamping
ОтветитьGreat Video ! Thank You. Can I know whether it is possible to store time when the ESP32 goes to deep sleep and retrieve it without getting NTP time ?
ОтветитьWARNING: You should only poll a NTP server every 64 seconds at most frequent, backing off to hourly once you're happy with local clock stability
Polling every second is classified as abuse and can get you filtered
You should also run a NTP server in your local network and sync everything inside to that instead of the pool servers
Can you please send me an email to contact you?
Ответитьyou are my favourite teacher
ОтветитьUseful and interesting, great video on handling time on an ESP. Thanks for sharing
Ответитьwhich Time.h library have you used ?
ОтветитьHello I have a very good explanation regarding Sunday being Zero, as it was the Jesuits to change the time system of God. It is also them that are behind making Sunday a Zero. Because they also want for Sunday is a day of no work! Therefore it is logical for "their diabolic mind" to have it as a 'Zero'. The correct way is to have Sunday as 1 and the count should be 1 to 7 as God has put in place, which makes the 7th day the day of the Lord! They have been planning things for centuries, it is now they are coming to full light for people to discover the evil behind them!.......... if u are part of a SS, it is time to leave very soon! not accusing, but just in case. Kind Regards, joe
ОтветитьAndreas, no beer or drugs were involved with "struct tm". The ISO 8601 standard that establishes Monday as the first day of the week was first published in 1988 almost two decades after "struct tm" was defined. In the United States, where the code was written, Sunday is considered the first day of the week (again pre- ISO 8601). As you are aware, the C programming language uses zero-based arrays thus the tm_mon and tm_wday can be (are) used to index arrays for converting to character (string) representation as in strftime(). January and Sunday therefore have zero values in tm_mon and tm_wday respectively.
Ответитьhello the code works , but if i want to change the code with fixed ip address , then the ntp doesnt work anymore
this line breakes everything then
WiFi.config(ip, dns, gateway, subnet); (on esp32 wroom)
Thanks for the helpful tutorial!
One question, how can I properly add milliseconds after the UNIX timestamp (i.e., the variable "now")?
Say 1537422385 -> 1537422385"321"
Now I have figure out how to obtain the milliseconds:
struct timeval tv;
gettimeofday(&tv, NULL);
int64_t milliseconds = tv.tv_sec * 1000LL + tv.tv_usec / 1000LL;
But don't have an idea how to derive the desired output.
I thank you very much in advance!!
Got my first radio controlled watch. Got my esp32, now wondering can I use just wire as an antenna if I wrap it around my watch?
ОтветитьGotta question? Maybe someone out there done this. I just found out how to set the time on a DS1307 RTC(Real Time Clock) and it works, but I have issues with it.. To set the time using the example they give, requires perfect timing at the time of upload to get the RTC to the correct time. My best effort gets me 12 seconds from true time. I was thinking of trying to use NTP to sync the RTC to the NTP server, but that also requires adjusting for network delays..
I am shooting for 1 sec accuracy, because I don't know if 1uS is possible. I was thinking of using the millis() function to get offsets of both time sources, then use the difference of the offsets to adjust the RTC to true NTP time.
Has anyone else solved this problem. I want to try to get both time readings to match..
Andreas, your script on wemos d1 mini don't work correct! I copied your sketch, changed only the credentials, but time is 8 hours in the future! I'm from munich and have the same timezone as you! any suggestions?
ОтветитьThank
ОтветитьThank you , it's very helpful
ОтветитьYou mentioned video with actual build of transmitter but I cannot find link to it. Can you post a link?
ОтветитьI got my own in Iceland running now! \o/
Finding and sorting out the hardware problems took some effort without an oscilloscope and the resistor values are different, when your coil has 198millihenry... ;)
What modification is needed for WWVB.
ОтветитьGreat Video as always Andreas. Is there any documentation for esp commands "configTime" and time()?
ОтветитьDon't worry about the British inventing a new time zone. Think what the initials in GMT mean, and why longitude 0 is at the Greenwich observatory. Hint: GMT is based on astronomical time which is not as accurate as atomic clocks which is why its replaced with UTC.
ОтветитьI just went through the same exercise for an ESP8266 project, and eventually came up with pretty much the same solution as presented here, but with one minor difference: after the setenv(...) call, the examples I referenced included a call to tzset(). I'm not sure what this does, or if it is needed, but it hasn't hurt my code...
Ответить