-
Notifications
You must be signed in to change notification settings - Fork 3k
ESP8266: Add built-in hostname resolution handling (disabled by default) #12234
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ESP8266: Add built-in hostname resolution handling (disabled by default) #12234
Conversation
@michalpasztamobica, thank you for your changes. |
AT+CIPDOMAIN works but I still get -3009 error
|
a33d397
to
f032274
Compare
I just pushed an astyle error fix. Still waiting for feedback from @zhiyong80 , in the issue report there is hope that his will work. |
Fine as long as it's off by default. We did at some point use the built-in resolver, but stopped doing so because (at least in the firmware at the time) it failed to cope with some responses containing long names from some Amazon cloud servers. |
@kjbracey-arm , yep, I have also found the Espressif forum topic on this 64B response limitation... This feature is added with minimum effort (no cache'ing, no async operation) to address a very specific usecase reported by @zhiyong80 . It will be kept off by default. |
Just tested the commit a33d397 . When buil-in-dns is turned on, modified mbed-http-example with added ntp works just fine. When built-in-dns is turned off, the same old problem happens again. So as far as the DNS problem is concerned, I believe the referenced commit solves the problem. Unfortunately, the out of memory problem when -3009 error is thrown creeped back again. I thought I figured out, but no. Test code:
Stdio output with ESP8266 in debug mode, and built-in-dns turned on:
Stdio output when built-in-dns is turned off:
|
@zhiyong80 , just to make sure I got it right... @AnttiKauppila , @SeppoTakalo , @VeijoPesonen , may I ask for a code review, please? |
Yes, the -3009 error only shows up when built-in-dns equals to false. The would be confirmed by:
|
CI started |
Test run: SUCCESSSummary: 11 of 11 test jobs passed |
Summary of changes
Fixes #11982 (some routers fail to work with the UDPSocket-approach, but are proved to work when ESP uses its embedded hostname resolution AT command).
The feature is disabled by default and can be enabled in mbed_app.json with
"esp8266.built-in-dns": true
. When enabled then the synchronous hostname resolution will use the ESP'sCIPDOMAIN
AT command, but asynchronous resolution will keep on using the UDPSockets as before (no point rewriting the nsapi_dns). Also caching does not work.I tested with the netsocket-dns testsuite. Obviously caching tests often fail, but if lucky I can get 15/16 passes.
@zhiyong80, please verify if this works with your router.
Impact of changes
None, until user enables the
esp8266.built-in-dns
option.Migration actions required
None.
Documentation
"help" section added to mbed_lib.json.
Pull request type
Test results
Reviewers
@AnttiKauppila
@VeijoPesonen
@SeppoTakalo
@zhiyong80