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

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
User avatar
By Mmiscool
#64028 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
User avatar
By jimg
#64035
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?