-->
Page 1 of 1

Two Way UDP Connection with static IP but still get NTP Time

PostPosted: Sat Dec 30, 2017 4:52 pm
by garfiled88
Hi everybody,

first of all thank you for your help!
I'm having a problem that i just can't solve.
I have two ESP8266 (ESP12-f). ESP1 is reading a Temp/Humid. sensor and sends these values over UDP (local Network) to ESP2. ESP2 then stores these values on a sd card with a timestamp.
To get the time I want to use the <TimeLib.h> library from here LINK
I found out that as soon as i use a static ip for the Wifi.config, i am unable to get the ntp time from any server.
I've tried:
    Resetting the Wifi connection and reenable DHCP
    Enter a manual NTP IP Adress
    to create a UDP connection without static ip's on ESP1 & ESP2 (wasn't able to figure that one out)

None of these were succesful. The only thing that worked, was to put the wifi.config() after the first getNTPTime(), so i could sync the time at the beginning and still get the udp packets from ESP1...
I uploaded my example code (Arduino IDE).

Did anyone face a similiar problem and got a solution for me?
Or am I thinking in a wrong direction?
Thanks in advance!