• Skip to main content
  • Skip to primary sidebar

RNTLab.com

The Ultimate Shortcut to Learn Electronics and Programming with Open Source Hardware and Software

  • Courses
  • Forum
    • Forum
    • Ask Question
  • Shop
  • Account
  • Blog
  • Login

Arduino/ESP32 SimpleTime.ino fails with fixed IP

Q&A Forum › Category: ESP32 › Arduino/ESP32 SimpleTime.ino fails with fixed IP
0 Vote Up Vote Down
Peter Poesel asked 2 years ago

NTP Client-Server: Get Date and Time works with DHCP and fails with fixed IP.
Does anybody know why?
Many thanks for your help
https://pastebin.com/nFddRD9k

Question Tags: NDP
5 Answers
0 Vote Up Vote Down
Sara Santos Staff answered 2 years ago

Hi.
 
That’s a known issue with time and static IP.
Unfortunately, I’m not sure exactly what is the solution.
 
I recommend taking a look at these discussions and checking if any of the suggestions work for you: https://forum.arduino.cc/t/esp32-cannot-connect-to-ntp-server-with-fixed-ip/591181/12
https://forum.arduino.cc/t/timentp_esp8266wifi-breaks-if-ip-address-is-fixed/667185/4
https://forum.arduino.cc/t/problem-using-static-ip/1067239/3
 
I hope this helps.
Regards,
Sara

0 Vote Up Vote Down
Peter Poesel answered 2 years ago

Hi Sara, many thanks for your fast reply.
Meanwhile I found out that it works with:

IPAddress primaryDNS(8, 8, 8, 8); //optional
IPAddress secondaryDNS(8, 8, 4, 4); //optional
 

WiFi.config(local_IP, gateway, subnet, primaryDNS, secondaryDNS)

 
Probably misfunction has something to do with timeout.
 
Kind regards from Peter

0 Vote Up Vote Down
Sara Santos Staff answered 2 years ago

Great.
Thanks for sharing the solution.
I’ll mark this issue as resolved. If you need further help, you just need to open a new question in our forum.
Regards,
Sara

0 Vote Up Vote Down
Peter Poesel answered 2 years ago

Hi Sara, a final remark to your book Build Webservers with ESP32 and ESP8266. I worked it through with great interest and want to congratulate you to the clearness of the presentation.
One short remark to page 572: 8. Then, you can go to the root (/) URL to access the new web server. This is false since the new firmware has changed the IP Adress. I worked with fixed IP’s which is OK

0 Vote Up Vote Down
Sara Santos Staff answered 2 years ago

Hi.
Thanks for pointing that out.
In my case, the same ESP32 always has the same IP address, even though I don’t set it as a fixed IP address.
I’ll add a note about that, stating that the IP address might change.
Regards,
Sara

Primary Sidebar

Login to Ask or Answer Questions

This Forum is private and it’s only available for members enrolled in our Courses.

Login »

Latest Course Updates

  • [eBook Updated] Learn Raspberry Pi Pico/Pico W with MicroPython eBook – Version 1.2 May 26, 2025
  • [New Edition] Build ESP32-CAM Projects eBook – 2nd Edition April 16, 2025

You must be logged in to view this content.

Contact Support - Refunds - Privacy - Terms - MakerAdvisor.com - Member Login

Copyright © 2013-2025 · RandomNerdTutorials.com · All Rights Reserved

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.