logo elektroda
logo elektroda
X
logo elektroda

NTP time server in ASCII via HTML - I am looking for a simple solution

Duch__ 2460 10
ADVERTISEMENT
Treść została przetłumaczona polish » english Zobacz oryginalną wersję tematu
  • #1 15590908
    Duch__
    Level 31  
    I'm looking for an NTP time server that displays the current time in text form via html after entering a web address. We exclude watch pages of the type http://www.timeanddate.com/worldclock/poland/warsaw because the microprocessor chip in which it is to work cannot handle such a page.
  • ADVERTISEMENT
  • #2 15590953
    A.Gieronimo
    Level 35  
    The servers are 99% synchronised with NTP anyway.
    So you just need to find one that can be read from html.
    Or make your own.
    Code: Javascript
    Log in, to see the code
  • #3 15591249
    Anonymous
    Anonymous  
  • ADVERTISEMENT
  • #4 15591590
    Samuraj
    Level 35  
    And isn't it easier to implement the classic NTP.
    If you're going to have the answer in a string, you're probably going to trim it and convert it to inty anyway.
  • ADVERTISEMENT
  • #5 15591625
    Anonymous
    Anonymous  
  • #6 15591682
    Samuraj
    Level 35  
    But NTP is not that difficult. Since you have sending/receiving frames it's downhill from there.

    You send a frame
    Code: C / C++
    Log in, to see the code


    The server sends you a frame from which you have to extract
    Code: C / C++
    Log in, to see the code

    The rest is just splitting.
  • #7 15591742
    JacekCz
    Level 42  
    NTP as the name suggests :) , is a standalone protocol, and in a formal sense there is no NTP in ASCII. It is a very old protocol, from the days when resources were conserved, and among other things includes the concept of compensating for packet "time of flight" in networks of the time.

    My guess is that use in the "native" version gives a much smaller need than HTTP for RAM/CPU so with puncet times .... (unless the software already has a relationship with HTTP)
  • #8 15596807
    tomson5
    Level 16  
    I use the firmware with NTP in my ESP plugged into the AVR
    I retrieve the time using the AT+CIPNTP command
    in response I get Time: 22:48:25 01/15/2016 GMT+01
    All I need to do now is parse this into a struct
  • #9 15596833
    Samuraj
    Level 35  
    Is it possible to know which firmware this is?
    Are there any sources for it?
  • #10 15596916
    michalko12
    MCUs specialist
    There is NTP, there is also SNTP. The latter protocol is simpler to implement and I suspect there are plenty of examples of how to decode data from this protocol.
  • ADVERTISEMENT
  • #11 15597323
    tomson5
    Level 16  
    I don't remember the source. Probably github.com. Type in google "esp8266 firmware ntp" you will find for sure. I'm happy to help if you have any questions.
ADVERTISEMENT