- This topic has 3 replies, 3 voices, and was last updated 2 years, 10 months ago by .
Viewing 4 posts - 1 through 4 (of 4 total)
Viewing 4 posts - 1 through 4 (of 4 total)
- You must be logged in to reply to this topic.
OpenSprinkler › Forums › OpenSprinkler Unified Firmware › Can multiple NTP servers be configured and used?
Tagged: Multiple NTP Servers
I just upgraded to 2.1.9(9), and its release notes lists one change as “Improves NTC sync by using multiple NTP servers and cycle through them if one is not available.”
How do you actually CONFIGURE those multiple NTP servers into OpenSprinkler so it can cycle through them? I can only see ONE spot for entering an NTP server. What am I missing?
Thank you,
Stephan.
Well, this is referring to pre-configured NTP servers:
https://github.com/OpenSprinkler/OpenSprinkler-Firmware/blob/master/opensprinkler_server.cpp#L2146
previously it’s using just one, now the firmware can cycle through an array of servers if one fails. The user-configured NTP server is still just one, because this option is rarely used. If you want to customize the NTP servers using your own, you can modify the firmware source code and compile a new firmware.
@ Ray
I have a question..
Looking at source code online from this link: https://github.com/OpenSprinkler/OpenSprinkler-Firmware/blob/master/opensprinkler_server.cpp#L2146
I see the following in the code:
uint16_t port = (uint16_t)(os.iopts[IOPT_HTTPPORT_1]<<8) + (uint16_t)os.iopts[IOPT_HTTPPORT_0];
port = (port==8000) ? 8888:8000; // use a different port than http port
UDP *udp = new EthernetUDP();
#define NTP_PACKET_SIZE 48
#define NTP_PORT 123
#define N_PUBLIC_SERVERS 5
static const char* public_ntp_servers[] = {
“time.google.com”,
“time.nist.gov”,
“time.windows.com”,
“time.cloudflare.com”,
“pool.ntp.org” };
static uint8_t sidx = 0;
static byte packetBuffer[NTP_PACKET_SIZE];
byte ntpip[4] = {
os.iopts[IOPT_NTP_IP1],
os.iopts[IOPT_NTP_IP2],
os.iopts[IOPT_NTP_IP3],
os.iopts[IOPT_NTP_IP4]};
Just wondering does this mean IF i DO NOT set up a static specific IP within the config, the firmware will by defualt cycle through the online sources listed?
Actually I may have answered my own question…
Just re-flashed my firmware to defaults and re-loaded config…
Removed any reference to NTP from GUI and YES it works!
OpenSprinkler › Forums › OpenSprinkler Unified Firmware › Can multiple NTP servers be configured and used?