{"action":"created","issue":{"url":"https://api.github.com/repos/esp8266/Arduino/issues/1660","repository_url":"https://api.github.com/repos/esp8266/Arduino","labels_url":"https://api.github.com/repos/esp8266/Arduino/issues/1660/labels{/name}","comments_url":"https://api.github.com/repos/esp8266/Arduino/issues/1660/comments","events_url":"https://api.github.com/repos/esp8266/Arduino/issues/1660/events","html_url":"https://github.com/esp8266/Arduino/issues/1660","id":135248306,"number":1660,"title":"ADC read is disturbed while WIFI is disabled.","user":{"login":"amrlsayed","id":17357286,"avatar_url":"https://avatars.githubusercontent.com/u/17357286?v=3","gravatar_id":"","url":"https://api.github.com/users/amrlsayed","html_url":"https://github.com/amrlsayed","followers_url":"https://api.github.com/users/amrlsayed/followers","following_url":"https://api.github.com/users/amrlsayed/following{/other_user}","gists_url":"https://api.github.com/users/amrlsayed/gists{/gist_id}","starred_url":"https://api.github.com/users/amrlsayed/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amrlsayed/subscriptions","organizations_url":"https://api.github.com/users/amrlsayed/orgs","repos_url":"https://api.github.com/users/amrlsayed/repos","events_url":"https://api.github.com/users/amrlsayed/events{/privacy}","received_events_url":"https://api.github.com/users/amrlsayed/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-02-21T19:40:12Z","updated_at":"2016-04-07T12:37:15Z","closed_at":null,"body":"Hi , I need to declare an issue regarding using ADC when WIFI is disabled. \r\nI disable WIFI by calling \r\n`ESP.deepSleep(1, WAKE_RF_DISABLED); `\r\non wake up I get samples from ADC every minute , **however the reading is always 1024**,\r\nbut If I tried to read analog samples while WIFI is Enabled , I get it correct with no errors. \r\nthe problem starts to happen when I disable WIFI. \r\n**here's my code for Reading ADC**\r\n`int reading  = analogRead(A0);`\r\n ` delay(3);`\r\n ` Serial.println(\"Light Sensor Reading \");`\r\n ` Serial.println(reading/4,DEC); // print light sensor level.`\r\nI made a workaround that's by software I restart the ESP after the wake up from deep sleep \r\nby calling ESP.reset();\r\n**By this way the ADC read problem is solved while disabling WIFI but this introduced another issue**\r\nthat is on calling ESP.reset(); ,\r\n1- the board try to reset then hang \r\n2- and then the wdt reset is introduced \r\n3- then start the program .\r\nthis wdt reset issue makes problems on the connected items to the ESP on my project , I don't want to disturb you with the details.\r\nI also think that ESP.reset() is working okay when WIFI is enabled, but on disabling WIFI, wdt reset is introduced . \r\n**Serial messages captured on the reset after calling ESP.reset() are**\r\n> ets Jan  8 2013,rst cause:2, boot mode:(3,7)\r\n\r\n>load 0x4010f000, len 1264, room 16 \r\n>tail 0\r\n>chksum 0x42\r\n>csum 0x42\r\n>~ld\r\n>\r\n> ets Jan  8 2013,rst cause:4, boot mode:(3,7)\r\n>\r\n>wdt reset\r\n>load 0x4010f000, len 1264, room 16 \r\n>tail 0\r\n>chksum 0x42\r\n>csum 0x42\r\n>~ld\r\n\r\n**My hardware connection is**\r\nGPIO0 --- HIGH \r\nGPIO2 --- HIGH \r\nGPIO15 ---LOW\r\n\r\n**My code for software reset is**\r\n`wifimode = wifi.getEEPROMString(WIFI_STATE_ADDRESS,2);`\r\n`if (wifimode == \"d\") { // disabled.`\r\n`   debug_print(\"WiFi just Disabled\");`\r\n`    wifi.setEEPROMString(WIFI_STATE_ADDRESS, 2, \"r\");`\r\n`    delay(200);`\r\n`    delay(200);`\r\n`    delay(200);`\r\n`    delay(200);`\r\n`    yield();`\r\n`    ESP.reset();`\r\n`    yield();`\r\n`    delay(5000);`\r\n`  }`\r\nSo I need help to resolve those Issues \r\n - either a way to read ADC on WIFI disable (this is the main problem )\r\n - or a way to reset ESP correctly.\r\n\r\nI also tried  to solve the ADC read problem by adding this macro after all the included libraries\r\n`ADC_MODE(ADC_TOUT) `\r\nI did so because I think the problem is that it reads the vcc instead of the analog value,but it didn't resolve the problem .\r\nalso Tried calling\r\n`ESP.wdtDisable();`on setup() and also on loop()  to solve WDT problem but with no help , I know it's hardware wdt not a software one but I gave it a try.\r\nMy hardware is this board [http://tronixlabs.com.au/news/new-product-esp8266-esp12-full-evaluation-board/](url)\r\nI installed ESP8266 2.0.0 package from the board manger and I use Arduino IDE version 1.6.5. \r\nI don't know if I am doing something wrong , please Let me know If you need further information.\r\nThanks a lot.\r\nAmr."},"comment":{"url":"https://api.github.com/repos/esp8266/Arduino/issues/comments/206864169","html_url":"https://github.com/esp8266/Arduino/issues/1660#issuecomment-206864169","issue_url":"https://api.github.com/repos/esp8266/Arduino/issues/1660","id":206864169,"user":{"login":"lrmoreno007","id":7408539,"avatar_url":"https://avatars.githubusercontent.com/u/7408539?v=3","gravatar_id":"","url":"https://api.github.com/users/lrmoreno007","html_url":"https://github.com/lrmoreno007","followers_url":"https://api.github.com/users/lrmoreno007/followers","following_url":"https://api.github.com/users/lrmoreno007/following{/other_user}","gists_url":"https://api.github.com/users/lrmoreno007/gists{/gist_id}","starred_url":"https://api.github.com/users/lrmoreno007/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lrmoreno007/subscriptions","organizations_url":"https://api.github.com/users/lrmoreno007/orgs","repos_url":"https://api.github.com/users/lrmoreno007/repos","events_url":"https://api.github.com/users/lrmoreno007/events{/privacy}","received_events_url":"https://api.github.com/users/lrmoreno007/received_events","type":"User","site_admin":false},"created_at":"2016-04-07T12:37:15Z","updated_at":"2016-04-07T12:37:15Z","body":"It's a ESP8266 core restriction:  ---> http://bbs.espressif.com/viewtopic.php?t=827\r\n- TOUT must be floating\r\n- The 107th byte in esp_init_data_default.bin(0～127byte) must be 0xFF\r\n- RF must be enabled"}}