-->
Page 1 of 3

ESP8266 - NTP server request issue

PostPosted: Wed Oct 09, 2019 11:00 am
by Bebeno
Hi everybody.
I am new on this forum. I would like to ask you for help how solved my problem.
I am working on my another project and now it is first time when i use NTP for current time.
My problem is that ESP does not get data from server when is connected on home WIFI router. I can not find out what can be wrong with my router and settings because when I connected ESP8266 to my phone hotspot everything worked well. It means that problem is in my WIFI router which is running on TOMATO firmware.

Can somebody help me how to find out what is wrong and how to solved it?

Thanks a lot .

Re: ESP8266 - NTP server request issue

PostPosted: Fri Oct 11, 2019 3:21 am
by QuickFix
I think you'd better ask this question in the TOMATO community. :?

Re: ESP8266 - NTP server request issue

PostPosted: Fri Oct 11, 2019 6:12 am
by davydnorris
Can you post your code? Show us how you are trying to get the time

Re: ESP8266 - NTP server request issue

PostPosted: Fri Oct 11, 2019 8:07 am
by Bebeno
Hi guys.
Thanks for answer.
QuikFix - The reason why I asked for help on this form is that problem with time synchro has only ESP8266 . Windows computer does not have this problem and Android phone as well. Only ESP8266.

davydnorris - I am trying code what is as example in library.
Thisone.

Code: Select all#include <ESP8266WiFi.h>
#include <EasyNTPClient.h>
#include <WiFiUdp.h>

const char *ssid     = "Ivan Hotspot";
const char *password = "bebeno28";

WiFiUDP udp;
EasyNTPClient ntpClient(udp, "pool.ntp.org", ((2*60*60)+(30*60))); // IST = GMT + 5:30

void setup(){
  Serial.begin(115200);
  WiFi.begin(ssid, password);
  while (WiFi.status() != WL_CONNECTED) {
    delay(500);
    Serial.print(".");
  }
  if(WiFi.status() == WL_CONNECTED) Serial.println("Connected");
}

void loop() {
  Serial.println(ntpClient.getUnixTime()); 
  delay(5000); // wait for 5 seconds before refreshing.
}


And this is answer what I got throught serial port.

.......Connected
0
0
0
0


Thanks a lot for help.