Closed mapedraza closed 4 years ago
Solved adding DNS Server configurations
ip_addr_t dnsserver;
ESP_LOGI(TAG, "SYSTEM_EVENT_STA_GOT_IP");
inet_pton(AF_INET, "8.8.8.8", &dnsserver);
dns_setserver(0, &dnsserver);
inet_pton(AF_INET, "8.8.4.4", &dnsserver);
dns_setserver(1, &dnsserver);
Reopened again
If compiled without debug output, system cannot resolve DNS name (adding CONFIG_PPP_DEBUG_ON=n to sdkconfig file)
I just had the same problem you originally had. You can either solve it by setting DNS servers manually like you did, or you retrieve them via PPP from your peer by calling ppp_set_usepeerdns(ppp, 1);
before pppapi_connect(ppp, 0)
, i.e. above this line: https://github.com/espressif/esp-idf/blob/master/examples/protocols/pppos_client/main/pppos_client_main.c#L276
About your other problem: I have no idea, I had PPP debugging off the whole time without issues. I just turned it on to see what happens and everything seems to work.
@mapedraza
Hi, I just had the same problem you originally had.
I'm using the same code in different place. one issue happened just like following link:
details please see at: espressif/esp-aliyun#81
another one works well without DNS fail issue.
is there some bugs in lwip lib?
Solved adding DNS Server configurations
ip_addr_t dnsserver; ESP_LOGI(TAG, "SYSTEM_EVENT_STA_GOT_IP"); inet_pton(AF_INET, "8.8.8.8", &dnsserver); dns_setserver(0, &dnsserver); inet_pton(AF_INET, "8.8.4.4", &dnsserver); dns_setserver(1, &dnsserver);
Thanks. Saved my a lot of time
Thanks for the update. To my best knowledge there's no longer any DNS issue in IDF PPPoS client as we set ppp_set_usepeerdns()
before starting the ppp netif in lwip, so closing this for now. Feel free to reopen or raise a new one, preferably in IDF repo. Thanks
I just tested Loboris PPPoS example and it works fine: https://github.com/loboris/ESP32-PPPOS-EXAMPLE
But, trying to make a cleaner version of PPPoS test, i use the esp-idf example of PPPoS client: https://github.com/espressif/esp-idf/tree/master/examples/protocols/pppos_client
No problems, the module configure the modem and finally i get an IP. The problem come when i try to get some data from internet. I just adapt the http_get_task used in http-request ESP-IDF example
When compile and run I obtain the same issue
E (55346) example: DNS lookup failed err=202 res=0x0
That means thegetaddrinfo
function doesn't work properly as a result of error code (202, EAI_FAIL)I also tried to put the IP address of webserver and it works, so, the system has network from PPPoS (no Wifi or another interface enabled) and if possible to open a socked and send information (HTTP request) through it.
If I try to port the loboris example, i get the same issue, so i think it is something related with esp-idf v3 lwip stack (the major differences between codes)