{"action":"created","issue":{"url":"https://api.github.com/repos/nodemcu/nodemcu-firmware/issues/2144","repository_url":"https://api.github.com/repos/nodemcu/nodemcu-firmware","labels_url":"https://api.github.com/repos/nodemcu/nodemcu-firmware/issues/2144/labels{/name}","comments_url":"https://api.github.com/repos/nodemcu/nodemcu-firmware/issues/2144/comments","events_url":"https://api.github.com/repos/nodemcu/nodemcu-firmware/issues/2144/events","html_url":"https://github.com/nodemcu/nodemcu-firmware/issues/2144","id":266985526,"number":2144,"title":"rtc time not kept through deep sleep","user":{"login":"mkresse","id":2129350,"avatar_url":"https://avatars3.githubusercontent.com/u/2129350?v=4","gravatar_id":"","url":"https://api.github.com/users/mkresse","html_url":"https://github.com/mkresse","followers_url":"https://api.github.com/users/mkresse/followers","following_url":"https://api.github.com/users/mkresse/following{/other_user}","gists_url":"https://api.github.com/users/mkresse/gists{/gist_id}","starred_url":"https://api.github.com/users/mkresse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mkresse/subscriptions","organizations_url":"https://api.github.com/users/mkresse/orgs","repos_url":"https://api.github.com/users/mkresse/repos","events_url":"https://api.github.com/users/mkresse/events{/privacy}","received_events_url":"https://api.github.com/users/mkresse/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2017-10-19T20:53:49Z","updated_at":"2017-10-20T22:56:53Z","closed_at":null,"author_association":"NONE","body":"### Expected behavior\r\n\r\nSetting the rtc time using `rtctime.set(0,0)` enables the realtime clock so that after a deep sleep, a call to `rtctime.get()` returns the curren (up-) time. This works on a version build from master on 2017-06-17. \r\nThe example code outputs \"phase 1\", goes to deepsleep and then prints \"phase 2\".\r\n\r\n### Actual behavior\r\n\r\nUsing a current master build (2017-10-12), reading the time using `rtctime.get()` always returns 0.\r\nThe example code outputs \"phase 1\" in an endless loop. I suppose that the changes of commit d93465c have something to do with the changed behaviour?\r\n\r\n### Test code\r\n```Lua\r\n    local sec, usec = rtctime.get()\r\n    if (sec == 0) then\r\n        print(\"phase 1, initializing time + sleeping 2s\");\r\n        rtctime.set(0, 0)\r\n\r\n        tmr.create():alarm(100, tmr.ALARM_SINGLE, function()\r\n            rtctime.dsleep(2 * 1000 * 1000)\r\n        end)\r\n        \r\n    else\r\n        print(string.format(\"phase 2, uptime: %ds\", sec));\r\n    end\r\n```\r\n### NodeMCU version\r\n\r\nWorking version:\r\n````\r\nNodeMCU custom build by frightanic.com\r\n\tbranch: master\r\n\tcommit: c8ac5cfb912ff206b03dd7c60ffbb2dafb83fe5e\r\n\tSSL: false\r\n\tmodules: adc,bit,cron,file,gpio,mqtt,net,node,rtcmem,rtctime,sntp,tmr,uart,wifi,ws2812\r\n build \tbuilt on: 2017-06-17 20:54\r\n powered by Lua 5.1.4 on SDK 2.1.0(116b762)\r\n````\r\n\r\nBroken version:\r\n```\r\nNodeMCU custom build by frightanic.com\r\n\tbranch: master\r\n\tcommit: 2e67ff5a639a13260fd4fb3c3b627ccdc2845616\r\n\tSSL: false\r\n\tmodules: adc,bit,cron,ds18b20,file,gpio,mqtt,net,node,rtcmem,rtctime,sntp,tmr,uart,wifi,ws2812\r\n build \tbuilt on: 2017-10-12 19:32\r\n powered by Lua 5.1.4 on SDK 2.1.0(116b762)\r\n\r\n```\r\n\r\n### Hardware\r\n\r\nESP8266 ESP-12F on custom adapter board (http://www.mikrocontroller-elektronik.de/esp12e-tutorial-einstieg-mit-dem-esp8266-modul/)\r\n"},"comment":{"url":"https://api.github.com/repos/nodemcu/nodemcu-firmware/issues/comments/338340816","html_url":"https://github.com/nodemcu/nodemcu-firmware/issues/2144#issuecomment-338340816","issue_url":"https://api.github.com/repos/nodemcu/nodemcu-firmware/issues/2144","id":338340816,"user":{"login":"pjsg","id":1508813,"avatar_url":"https://avatars0.githubusercontent.com/u/1508813?v=4","gravatar_id":"","url":"https://api.github.com/users/pjsg","html_url":"https://github.com/pjsg","followers_url":"https://api.github.com/users/pjsg/followers","following_url":"https://api.github.com/users/pjsg/following{/other_user}","gists_url":"https://api.github.com/users/pjsg/gists{/gist_id}","starred_url":"https://api.github.com/users/pjsg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pjsg/subscriptions","organizations_url":"https://api.github.com/users/pjsg/orgs","repos_url":"https://api.github.com/users/pjsg/repos","events_url":"https://api.github.com/users/pjsg/events{/privacy}","received_events_url":"https://api.github.com/users/pjsg/received_events","type":"User","site_admin":false},"created_at":"2017-10-20T22:56:53Z","updated_at":"2017-10-20T22:56:53Z","author_association":"COLLABORATOR","body":"I'll take a look at the code.... On Oct 20, 2017 16:38, Martin Kresse <notifications@github.com> wrote:@pjsg Thanks for looking into it. I just tried to set it to a different value - same behaviour.\r\n\r\n—You are receiving this because you were mentioned.Reply to this email directly, view it on GitHub, or mute the thread."}}
{"actor":{"display_login":"pjsg"}}