{"action":"created","issue":{"url":"https://api.github.com/repos/esp8266/Arduino/issues/133","labels_url":"https://api.github.com/repos/esp8266/Arduino/issues/133/labels{/name}","comments_url":"https://api.github.com/repos/esp8266/Arduino/issues/133/comments","events_url":"https://api.github.com/repos/esp8266/Arduino/issues/133/events","html_url":"https://github.com/esp8266/Arduino/issues/133","id":71329182,"number":133,"title":"Implement interface to: system_rtc_mem_write","user":{"login":"linagee","id":636551,"avatar_url":"https://avatars.githubusercontent.com/u/636551?v=3","gravatar_id":"","url":"https://api.github.com/users/linagee","html_url":"https://github.com/linagee","followers_url":"https://api.github.com/users/linagee/followers","following_url":"https://api.github.com/users/linagee/following{/other_user}","gists_url":"https://api.github.com/users/linagee/gists{/gist_id}","starred_url":"https://api.github.com/users/linagee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/linagee/subscriptions","organizations_url":"https://api.github.com/users/linagee/orgs","repos_url":"https://api.github.com/users/linagee/repos","events_url":"https://api.github.com/users/linagee/events{/privacy}","received_events_url":"https://api.github.com/users/linagee/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-04-27T16:00:17Z","updated_at":"2015-06-25T13:48:40Z","closed_at":null,"body":"I propose making a \"ESP.rtcMemWrite\" that would pass things to \"system_rtc_mem_write\". Unless your program can start at any point and continue there (a routine like: wake, get temp, send to internet, deepsleep, repeat), you need to write data to the RTC before deep sleep or else you have no way of knowing what you were doing when the processor resets (wakes) after deep sleep.\r\n\r\nWrite data into RTC, see if the data exists when you boot back up (will also need: ESP.rtcMemRead/system_rtc_mem_read), then continue from there.\r\n\r\nThe first parameter, des_addr, needs to be between 64 and 128. (Block index, blocks are 4 bytes long, only bytes 256 to 512 are usable by the user.) I propose encapsulating all of this into something easy to use. (Maybe just pass in a byte/number from 0 to 256 and translate that into a \"RTC storage slot\" or something.)\r\n\r\nMaybe... even have just 256 bytes passed into ESP.deepSleep (as a third parameter pointer?), and provide some other function to access them after the restart. Maybe that's messy though, not sure."},"comment":{"url":"https://api.github.com/repos/esp8266/Arduino/issues/comments/115263413","html_url":"https://github.com/esp8266/Arduino/issues/133#issuecomment-115263413","issue_url":"https://api.github.com/repos/esp8266/Arduino/issues/133","id":115263413,"user":{"login":"hairyhenderson","id":2037086,"avatar_url":"https://avatars.githubusercontent.com/u/2037086?v=3","gravatar_id":"","url":"https://api.github.com/users/hairyhenderson","html_url":"https://github.com/hairyhenderson","followers_url":"https://api.github.com/users/hairyhenderson/followers","following_url":"https://api.github.com/users/hairyhenderson/following{/other_user}","gists_url":"https://api.github.com/users/hairyhenderson/gists{/gist_id}","starred_url":"https://api.github.com/users/hairyhenderson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hairyhenderson/subscriptions","organizations_url":"https://api.github.com/users/hairyhenderson/orgs","repos_url":"https://api.github.com/users/hairyhenderson/repos","events_url":"https://api.github.com/users/hairyhenderson/events{/privacy}","received_events_url":"https://api.github.com/users/hairyhenderson/received_events","type":"User","site_admin":false},"created_at":"2015-06-25T13:48:40Z","updated_at":"2015-06-25T13:48:40Z","body":":+1: - I'd like to use the RTC memory for short-term storage of data while the system is in deep sleep. In my application I'm using EEPROM for storing other stuff long-term and I'd rather not use it."}}