Git Product home page Git Product logo

Comments (17)

MarcFinns avatar MarcFinns commented on July 17, 2024 1

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.

gmag11 avatar gmag11 commented on July 17, 2024

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.

MarcFinns avatar MarcFinns commented on July 17, 2024

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.

gmag11 avatar gmag11 commented on July 17, 2024

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.

MarcFinns avatar MarcFinns commented on July 17, 2024

Is there an api to tell the lib to stop trying the sync and keep incrementino from last time acquired..?

from ntpclient.

gmag11 avatar gmag11 commented on July 17, 2024

Hava a look to header file

from ntpclient.

MarcFinns avatar MarcFinns commented on July 17, 2024

I see it now.

  1. Shall I assume that time continue to advance (calculated locally) after stop() has been called?
  2. what do i need to call to restart synchronization?
    thanks again!

from ntpclient.

RudyFiero avatar RudyFiero commented on July 17, 2024

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.

MarcFinns avatar MarcFinns commented on July 17, 2024

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.

RudyFiero avatar RudyFiero commented on July 17, 2024

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.

gmag11 avatar gmag11 commented on July 17, 2024

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.

gmag11 avatar gmag11 commented on July 17, 2024

@MarcFinns Do you have it on a GitHub repository?

from ntpclient.

MarcFinns avatar MarcFinns commented on July 17, 2024

Yes. Code is not as clean as yours though, more of a prototype / proof of concept... I have actually two:

  1. 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)
  2. 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.

gmag11 avatar gmag11 commented on July 17, 2024

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.

MarcFinns avatar MarcFinns commented on July 17, 2024

That is interesting. What web services did you use?
I needed:

  • coordinates
  • timezone
  • location name

from ntpclient.

gmag11 avatar gmag11 commented on July 17, 2024

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.

MarcFinns avatar MarcFinns commented on July 17, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.