A Basic Interpreter written from scratch for the ESP8266

Moderator: Mmiscool

User avatar
By jimg
#64016 I'm attempting to get a message back from nist in daytime protocol. I don't really know if this is possible with the current system, but I thought I'd give it a try.

Using the following code, I never receive a response, so either I'm misunderstanding how to do udp or something else is incorrect.

Code: Select all' attempt to get daytime protocol string from nist

button "quit",[quit]
wprint "<br>"

wprint "setting port<br>"
udpbegin 13  ' port for upd daytime protocol

wprint "setting branch<br>"
udpbranch [msgin]

wprint "sending message<br>"
' attempt to get daytime protocol message from nist
udpwrite "time.nist.gov", 13, "?"

wprint "waiting for message<br>"

wprint "got message<br>"

wprint udpread() & " from " & udpremote()

udpstop  ' release port


Any help will be appreciated.

edit: fixed misspelling of udpremote
User avatar
By jimg
Mmiscool wrote:There is a built in time function that handles day light saving time.

Great. What is it? Time() always returns standard time for me no matter what I put in the second parameter of time.setup

Also look at this bit of documentation from nist.
https://www.nist.gov/pml/time-and-frequ ... nformation

I felt pretty confident that port 13 was always wide open, but I'll certainly take a look.

Edit: Yup. All ports are wide open. Does the code work for anyone?