esp8266 DNS failed

mikewang
Posts: 8
Joined: Sat Oct 25, 2014 10:20 am

esp8266 DNS failed

Postby mikewang » Thu Apr 30, 2015 1:37 pm

failure takes places when follow the steps as following:
1.disconnect router with internet
2.power up esp8266. firstly, it is gonna connect with router and then gets ip assigned by router, secondly esp8266 runs DNS request routine which is of course get failed
for the sake of router's disconnecting with internet .
3. reconnect router to internet , esp8266 still runs the routine of DNS requests again and again and prints logs as follows
user_esp_platform_dns_check_cb
get hosted name state = -5
user_esp_platform_dns_found NULL
user_esp_platform_dns_check_cb
get hosted name state = -5
user_esp_platform_dns_found NULL
user_esp_platform_dns_check_cb
get hosted name state = -5
user_esp_platform_dns_found NULL
user_esp_platform_dns_check_cb
get hosted name state = -5
user_esp_platform_dns_check_cb
get hosted name state = -1
user_esp_platform_dns_check_cb
get hosted name state = -1
user_esp_platform_dns_check_cb
get hosted name state = -1

get hosted name state = -1 means the return error code when get_hosted_name recalled
error code:
-1 = ESPCONN_MEM
-5 =ESPCONN_INPROGRESS
only when esp8066 get restarted can it request DNS successfully

ESP_Faye
Posts: 1646
Joined: Mon Oct 27, 2014 11:08 am

Re: esp8266 DNS failed

Postby ESP_Faye » Thu Apr 30, 2015 3:26 pm

Hi,

Here is an example of DNS function http://bbs.espressif.com/viewtopic.php?f=21&t=232

Please have a try , if it still has your problem, please offer your test code and we will help debugging it.

Thanks for your interest in ESP8266 !

Who is online

Users browsing this forum: No registered users and 35 guests