Comments (17)
Great. Thank you so much. Not sure if this interesting to others, but I see that in most examples the time zone/daylight saving is hard coded. I have developed a lib that gets time zone offset/dst/lat/long/detailed address from google maps api. If interesting I can share it. Cheers.
from ntpclient.
What you can do is check that you are connected before calling NTP.begin()
. Included example does this when WiFiEvent
is received. See this
from ntpclient.
thanks. If I am connected (and begin has been called) and then it disconnects, what happens? does it break or block?
And if it reconnects later on, can it resume normal operations?
thanks
from ntpclient.
As far as I remember, if ntp sync is triggered while there is no connection, 'getTime()` returns 0 value. It means an error. Besides an event with error code may be triggered.
When something wrong happens (timeout, no connection) short period is used instead of normal one to get sync as soon as connectivity is recovered.
So it should keep working normally. Even, it is not required that there is a continuous Internet connection.
from ntpclient.
Is there an api to tell the lib to stop trying the sync and keep incrementino from last time acquired..?
from ntpclient.
Hava a look to header file
from ntpclient.
I see it now.
- Shall I assume that time continue to advance (calculated locally) after stop() has been called?
- what do i need to call to restart synchronization?
thanks again!
from ntpclient.
Maybe you should have a look at the code to see what it does. I'm sure that Germán doesn't have that information at the top of his head, and he would need to look through the code to find your answer.
Please remember that the code was made available for free, and that it doesn't mean that there is any obligation for support. Issues are meant for dealing with bugs. Not necessarily information requests.
from ntpclient.
Maybe you should also take into account that I have been collaborating with German on a number of issues and he asked me to test his code several times, which I did.
Your message is utterly out of place. It means "help yourself" which is the opposite of the concept of community. If German believes the question should not be answered he can just do so. None of your business.
from ntpclient.
There is always more to the story, on both sides. My apologizes if you have been making a meaningful contribution. I have seen some of your requests before.
from ntpclient.
Take it easy guys. 😄 I have no problem to answer questions.
@MarcFinns This lib only manages time sychronization. Time keeping is done in TimeLib that works independently of NTPClient. So time goes running after NTP.stop()
. To start syncing again you need to call NTP.begin()
as usual.
from ntpclient.
@MarcFinns Do you have it on a GitHub repository?
from ntpclient.
Yes. Code is not as clean as yours though, more of a prototype / proof of concept... I have actually two:
- Using google maps api. Very accurate but requires SSL and returns a large response so it often crashes with less than 20Kb free (https://github.com/MarcFinns/GoogleGeolocation)
- Using other APIs, works better (https://github.com/MarcFinns/TimeSpaceLib)
The second will be part of a larger project that I am building when I have time... hence not often.
if interested / improving it let me know!
from ntpclient.
Some weeks ago I needed same function for one project. I implemented geolocation to be used on ESP8266 and Arduino MKR1000. Maybe it helps.
from ntpclient.
That is interesting. What web services did you use?
I needed:
- coordinates
- timezone
- location name
from ntpclient.
Currently, I get location coordinates and accuracy only, using Google Geolocation API
You may use Google Time Zone API to get time offset after getting UTC time.
from ntpclient.
I tried but https kills it if you have less than 20k of ram. That's why I went for the simple http ones...
from ntpclient.
Related Issues (20)
- Problem in ESP32 HOT 2
- General dependency on ESP8266 library errors on ESP32 HOT 1
- Beta 3.0.2 version fails with ESP32 HOT 8
- ESPAsyncUDP dependency on esp32 HOT 3
- reference to 'map' is ambiguous HOT 3
- DST HOT 1
- Wrong time in NTPClientAvr example HOT 2
- ESP32 : memory leak ? HOT 6
- [idea] let the library wrap the SNTP SDK functions of ESP8266 and ESP32 HOT 4
- Please... is there any way to get the day of the week ? (Sunday, Monday etc.) Thanks HOT 2
- Getting error: "reference to 'byte' is ambiguous" with Arduino IDE1.8.15 HOT 11
- DST not working for USA default to EU Why? HOT 1
- Update PlatformIO Version HOT 1
- Hi, I know this is an old thread, but it annoys me.... And maybe it does not relate to you code, but any help would be appreciated. HOT 1
- _uptime definition error [Bug]
- The client and server's times differ by 136 years
- Arduino Library
- Failed DNS lookup leads to exception in ' void NTPClient::s_dnsFound ' HOT 1
- Dependency on Time lib 5.1; latest is 1.5 HOT 1
- Crash when in Async UDP library on ESP32 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ntpclient.