Skip to content
Max Prokhorov edited this page Feb 4, 2020 · 15 revisions

NTP

Configuration

Configuration key Build flag Description
ntpServer NTP_SERVER (default: pool.ntp.org)
ntpTZ NTP_TIMEZONE (default: TZ_Etc_UTC, definition value from TZ.h that translates to PSTR("UTC0"))
ntpStartDelay NTP_START_DELAY (seconds) (default: 3 seconds) NTP initial update delay after network connection
ntpUpdateIntvl NTP_UPDATE_INTERVAL (default: 1800 seconds, 30 minutes) NTP update interval after an initial sync
NTP_WAIT_FOR_SYNC (default: 1, enabled)
Normally, ESPurna will wait for NTP to sync over wifi before enabling the scheduler. This is so it ensures that the schedules will never run outside their specified times, even if that means they don't run at all. If, instead, you want them to always run, even if the time is not correct, you can set this build flag to 0, which will cause ESPurna to act as if the time is correct when it boots up. That way, schedules will run even if NTP has not synced (but obviously at potentially the wrong times). If the network becomes available at some point, NTP will sync and resume running at the correct times.

Legacy options

These only apply to Core version 2.3.0 (current release .bin and custom build with platformio.ini with default settings):

Configuration key Build flag Description
ntpTimeout NTP_TIMEOUT (default: 2000 ms) How long to wait for NTP server response
ntpOffset NTP_TIME_OFFSET (default: 60 minutes, UTC+1)
ntpDst NTP_DAY_LIGHT (defaut: 1) Enable DST based on the current region
ntpRegion NTP_DST_REGION (default: 0, Europe)
Set to 1 for USA (Constants defined by the NtpClientLib)
NTP_SYNC_INTERVAL (defaut: 60 seconds) Initial NTP sync interval

Home
Change log

Getting started

Supported hardware and options

Configuration

Integrations

Network

Developers

More around ESPurna

Clone this wiki locally