Hi,
excellent program, but found a problem that took me a while to track down. My timezone is AEST-10, which I set in the source code
define NTP_DEFAULT_TZ "AEST-10"
and also set using the web interface.
The wierd behaviour was that on first boot after SPIFFS format, timezone would be set correctly and time displayed correctly.
Setting the timezone by the web interface would also correctly set the timezone, but if you then restart the ESP, or 3 days expires, the
timezone would revert to -11 hours, not -10.
The issue is caused by code in ntp_setup.
When _tz is read form the file, there is a trailing carriage return (0x0d) in _tz. This seems to confuse the ESP timezone code when it is passed to configTzTime().
The fix is to add
_tz.trim();
after reading the timezone from the file:
Hi, excellent program, but found a problem that took me a while to track down. My timezone is AEST-10, which I set in the source code
define NTP_DEFAULT_TZ "AEST-10"
and also set using the web interface. The wierd behaviour was that on first boot after SPIFFS format, timezone would be set correctly and time displayed correctly. Setting the timezone by the web interface would also correctly set the timezone, but if you then restart the ESP, or 3 days expires, the timezone would revert to -11 hours, not -10.
The issue is caused by code in ntp_setup. When _tz is read form the file, there is a trailing carriage return (0x0d) in _tz. This seems to confuse the ESP timezone code when it is passed to configTzTime(). The fix is to add _tz.trim(); after reading the timezone from the file: