Go Down

Topic: wifi101 -- gettime does not work with static address (Read 1 time) previous topic - next topic

usdave

any reason we can't use a static address and gettime() together?

CORRECTION: gettime() always returns a zero if a WiFi.config(ip) is called prior to the WiFi.begin()

usdave

the answer is that the .config must also include the DNS.  I was using just the ip, but adding the DNS (I used 8.8.8.8) solved the problem.

usdave

I should also add that the gateway and subnet must also be specified on the .config() to make gettime() work even though the .config() documentation indicates that they are optional and have defaults. 

Go Up