{"action":"created","issue":{"url":"https://api.github.com/repos/espressif/arduino-esp32/issues/1114","repository_url":"https://api.github.com/repos/espressif/arduino-esp32","labels_url":"https://api.github.com/repos/espressif/arduino-esp32/issues/1114/labels{/name}","comments_url":"https://api.github.com/repos/espressif/arduino-esp32/issues/1114/comments","events_url":"https://api.github.com/repos/espressif/arduino-esp32/issues/1114/events","html_url":"https://github.com/espressif/arduino-esp32/issues/1114","id":297199019,"number":1114,"title":"How to set SNTP refresh rate?","user":{"login":"CelliesProjects","id":24290108,"avatar_url":"https://avatars2.githubusercontent.com/u/24290108?v=4","gravatar_id":"","url":"https://api.github.com/users/CelliesProjects","html_url":"https://github.com/CelliesProjects","followers_url":"https://api.github.com/users/CelliesProjects/followers","following_url":"https://api.github.com/users/CelliesProjects/following{/other_user}","gists_url":"https://api.github.com/users/CelliesProjects/gists{/gist_id}","starred_url":"https://api.github.com/users/CelliesProjects/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CelliesProjects/subscriptions","organizations_url":"https://api.github.com/users/CelliesProjects/orgs","repos_url":"https://api.github.com/users/CelliesProjects/repos","events_url":"https://api.github.com/users/CelliesProjects/events{/privacy}","received_events_url":"https://api.github.com/users/CelliesProjects/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":26,"created_at":"2018-02-14T18:29:03Z","updated_at":"2018-03-08T17:15:05Z","closed_at":null,"author_association":"NONE","body":"I have 2 ESP32s running as led controllers.\r\nBoth run the same code, and use SNTP to sync the RTC.\r\n\r\nToday after running for 10 days there is a time difference between the 2 devices of about 1 minute.\r\n\r\nI suspect the SNTP code does not update the time after I set it with the following code:\r\n\r\n````cpp\r\n...\r\n...\r\n  configTzTime( \"CET-1CEST,M3.5.0/2,M10.5.0/3\", \"nl.pool.ntp.org\" );\r\n...\r\n...\r\n````\r\nHow do I check/set the NTP refresh rate?"},"comment":{"url":"https://api.github.com/repos/espressif/arduino-esp32/issues/comments/371556445","html_url":"https://github.com/espressif/arduino-esp32/issues/1114#issuecomment-371556445","issue_url":"https://api.github.com/repos/espressif/arduino-esp32/issues/1114","id":371556445,"user":{"login":"tferrin","id":14932821,"avatar_url":"https://avatars3.githubusercontent.com/u/14932821?v=4","gravatar_id":"","url":"https://api.github.com/users/tferrin","html_url":"https://github.com/tferrin","followers_url":"https://api.github.com/users/tferrin/followers","following_url":"https://api.github.com/users/tferrin/following{/other_user}","gists_url":"https://api.github.com/users/tferrin/gists{/gist_id}","starred_url":"https://api.github.com/users/tferrin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tferrin/subscriptions","organizations_url":"https://api.github.com/users/tferrin/orgs","repos_url":"https://api.github.com/users/tferrin/repos","events_url":"https://api.github.com/users/tferrin/events{/privacy}","received_events_url":"https://api.github.com/users/tferrin/received_events","type":"User","site_admin":false},"created_at":"2018-03-08T17:15:05Z","updated_at":"2018-03-08T17:15:05Z","author_association":"CONTRIBUTOR","body":"In the above code, the NTPpoolAdress array is on the stack, so once the ntpTask() function returns its value is no longer valid. But configTzTime() passed a pointer to this array to sntp(), which subsequently tries to use the invalid array data. This is the primary cause of your problem.\r\nBut secondly, the call to vTaskDelete( NULL ) deletes the ntpTask and means that the heap space previously allocated to it is freed. I'm not sure, but sntp() may be using this space for its stack. I'd fix the first problem and if you still have issues then dig deeper into the possible second problem."}}
{"actor":{"display_login":"tferrin"}}