-->
Page 1 of 1

DNS and EXTERNAL ACCESS ISSUE with SDK

PostPosted: Fri Jan 15, 2016 7:10 am
by scargill
I wonder if someone can help me...

We are using the SDK (1.51 - bang up to date) and pretty normal C code for accessing the router. We are using Richard Burton's RBOOT for OTA (that isn't the issue - just painting a picture).

The issue is we've been testing the OTA - giving it the IP address of a server to use to grab a new ROM file for OTA. Works a treat.

But when we tested an external address that did not work - so issue one - does anyone have a C function in which you can pass an address string (ie google.co.uk) and get back an IP string.

And that brings me to the second problem - having realised that actual names would not work we tried the external IP address. That too failed - even though using a browser on that address on a PC would return the ROM file - which could then be copied into a local server - point the OTA address on the ESP to it - bingo.

So the second question is - how do I tell on an ESP (C code - SDK) what it thinks is the gateway. I realised that by letting the ESP get an address automatically from the router, I have NO idea if it is actually successfully picking up a DNS gateway... and I'm not even sure if that is essential for getting an external IP address (as against a name which then requires external lookup).

If this is something you've come across could you please share your expertise on this - I'm at a dead end at this point with those two questions. Thanks in advance for any help.

Re: DNS and EXTERNAL ACCESS ISSUE with SDK

PostPosted: Fri Jan 15, 2016 9:46 am
by martinayotte
I don't know for RBoot platform, but on Arduino, there is the WiFi.getHostByName() function, and it been used in almost any other functions such Wifi.connect(), so no issue about connecting any external host.
Under the hood of WiFi.getHostByName() function, the SDK function dns_gethostbyname() is been called.