diff --git a/adafruit_fruitjam/network.py b/adafruit_fruitjam/network.py index f54c189..fc349ac 100644 --- a/adafruit_fruitjam/network.py +++ b/adafruit_fruitjam/network.py @@ -1,5 +1,6 @@ # SPDX-FileCopyrightText: 2020 Melissa LeBlanc-Williams, written for Adafruit Industries # SPDX-FileCopyrightText: 2025 Tim Cocks, written for Adafruit Industries +# SPDX-FileCopyrightText: 2025 Mikey Sklar, written for Adafruit Industries # # SPDX-License-Identifier: Unlicense """ @@ -324,7 +325,6 @@ def _combined_tz_offset(base_default): def _ntp_get_datetime(ntp, connect_cb, retries, delay_s, debug=False): """Fetch ntp.datetime with limited retries on timeout; re-connect between tries.""" - last_exc = None for i in range(retries): last_exc = None try: diff --git a/examples/fruitjam_ntp_settings.toml b/examples/fruitjam_ntp_settings.toml index fe9c23a..4cd2313 100644 --- a/examples/fruitjam_ntp_settings.toml +++ b/examples/fruitjam_ntp_settings.toml @@ -1,4 +1,4 @@ -# SPDX-FileCopyrightText: Copyright (c) 2025 Tim Cocks for Adafruit Industries +# SPDX-FileCopyrightText: Copyright (c) 2025 Mikey Sklar for Adafruit Industries # # SPDX-License-Identifier: MIT # Wi-Fi credentials @@ -24,10 +24,10 @@ NTP_DST = 1 # daylight saving (0=no, 1=yes) NTP_INTERVAL = 3600 # re-sync interval (seconds) # Optional tuning -NTP_TIMEOUT = 5 # socket timeout in seconds +NTP_TIMEOUT = "1.0" # socket timeout in seconds NTP_CACHE_SECONDS = 0 # cache results (0 = always fetch) NTP_REQUIRE_YEAR = 2022 # sanity check minimum year # Retries -NTP_RETRIES = 8 # number of NTP fetch attempts -NTP_DELAY_S = 1.0 # delay between attempts (seconds) +NTP_RETRIES = 8 # number of NTP fetch attempts +NTP_DELAY_S = "1.5" # delay between attempts (seconds) diff --git a/examples/fruitjam_time_sync.py b/examples/fruitjam_time_sync.py index 1ddb57e..08a6af5 100644 --- a/examples/fruitjam_time_sync.py +++ b/examples/fruitjam_time_sync.py @@ -1,4 +1,4 @@ -# SPDX-FileCopyrightText: Copyright (c) 2025 Tim Cocks for Adafruit Industries +# SPDX-FileCopyrightText: Copyright (c) 2025 Mikey Sklar for Adafruit Industries # # SPDX-License-Identifier: MIT import time