{"action":"created","issue":{"url":"https://api.github.com/repos/esp8266/Arduino/issues/1961","repository_url":"https://api.github.com/repos/esp8266/Arduino","labels_url":"https://api.github.com/repos/esp8266/Arduino/issues/1961/labels{/name}","comments_url":"https://api.github.com/repos/esp8266/Arduino/issues/1961/comments","events_url":"https://api.github.com/repos/esp8266/Arduino/issues/1961/events","html_url":"https://github.com/esp8266/Arduino/issues/1961","id":150327704,"number":1961,"title":"analogRead and ESP.getVcc don't work when WiFi radio disabled ","user":{"login":"torntrousers","id":12925578,"avatar_url":"https://avatars.githubusercontent.com/u/12925578?v=3","gravatar_id":"","url":"https://api.github.com/users/torntrousers","html_url":"https://github.com/torntrousers","followers_url":"https://api.github.com/users/torntrousers/followers","following_url":"https://api.github.com/users/torntrousers/following{/other_user}","gists_url":"https://api.github.com/users/torntrousers/gists{/gist_id}","starred_url":"https://api.github.com/users/torntrousers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/torntrousers/subscriptions","organizations_url":"https://api.github.com/users/torntrousers/orgs","repos_url":"https://api.github.com/users/torntrousers/repos","events_url":"https://api.github.com/users/torntrousers/events{/privacy}","received_events_url":"https://api.github.com/users/torntrousers/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2016-04-22T10:01:39Z","updated_at":"2016-04-27T05:08:57Z","closed_at":null,"body":"The ESP.getVcc() always just returns 4094 and analogRead(A0) returns 1024 when the WiFi radio has been disabled (eg following ESP.deepSleep(1, RF_DISABLED).\r\n\r\nThis is with Arduine IDE 1.6.8 and ESP core 2.2.0.\r\n\r\nThis code demonstrates the problem (you can just touch the A0 pin with a finger to test the values change):\r\n```\r\nextern \"C\" {\r\n  #include \"user_interface.h\"\r\n}\r\n#include <ESP8266WiFi.h>\r\n\r\n//ADC_MODE(ADC_VCC); // enables reading the ESP8266 supply voltage\r\n\r\nbyte rtcStore[1] __attribute__((aligned(4))); \r\n\r\nvoid setup() {\r\n  Serial.begin(115200); Serial.println();\r\n  system_rtc_mem_read(64, rtcStore, 1);\r\n  if (rtcStore[0] != 125) {\r\n    rtcStore[0] = 125;\r\n    system_rtc_mem_write(64, rtcStore, 1);\r\n    ESP.deepSleep(1, RF_DISABLED);\r\n//    ESP.deepSleep(1, RF_DEFAULT);\r\n  }\r\n}\r\n\r\nvoid loop() {\r\n//   Serial.println(ESP.getVcc());\r\n   Serial.println(analogRead(A0));\r\n   delay(1000);\r\n}\r\n```\r\n "},"comment":{"url":"https://api.github.com/repos/esp8266/Arduino/issues/comments/214971215","html_url":"https://github.com/esp8266/Arduino/issues/1961#issuecomment-214971215","issue_url":"https://api.github.com/repos/esp8266/Arduino/issues/1961","id":214971215,"user":{"login":"petraq","id":17496027,"avatar_url":"https://avatars.githubusercontent.com/u/17496027?v=3","gravatar_id":"","url":"https://api.github.com/users/petraq","html_url":"https://github.com/petraq","followers_url":"https://api.github.com/users/petraq/followers","following_url":"https://api.github.com/users/petraq/following{/other_user}","gists_url":"https://api.github.com/users/petraq/gists{/gist_id}","starred_url":"https://api.github.com/users/petraq/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/petraq/subscriptions","organizations_url":"https://api.github.com/users/petraq/orgs","repos_url":"https://api.github.com/users/petraq/repos","events_url":"https://api.github.com/users/petraq/events{/privacy}","received_events_url":"https://api.github.com/users/petraq/received_events","type":"User","site_admin":false},"created_at":"2016-04-27T05:08:57Z","updated_at":"2016-04-27T05:08:57Z","body":"I have same issue ... ESP.getVcc() always return 4094 with same version of Arduino IDE (1.6.8) and ESP core (2.2.0) for this sketch: https://github.com/tzapu/DeepSleepDHT22"}}