-->
Page 1 of 1

need help sending upd to nist

PostPosted: Mon Mar 20, 2017 1:41 pm
by jimg
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

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

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

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

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

wprint "waiting for message<br>"
wait

[msgin]
wprint "got message<br>"

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

udpstop  ' release port
return

[quit]
end


Any help will be appreciated.

edit: fixed misspelling of udpremote

Re: need help sending upd to nist

PostPosted: Mon Mar 20, 2017 9:54 pm
by Mmiscool
There is a built in time function that handles day light saving time.

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

Re: need help sending upd to nist

PostPosted: Tue Mar 21, 2017 1:19 am
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?

Re: need help sending upd to nist

PostPosted: Wed Mar 22, 2017 1:09 pm
by jimg
Gee, I sure wish I had spelled udp properly in the title of this topic. Anyway the moderator can fix it so it makes more sense?