Hello,
Is there an ESP-IDF example for a webserver with a domain name in SoftAP mode?
The examples I found use the IP address to access the webserver.
Couldn't find any using a domain name as www.xxx.com.
I suppose I need a DNS server running on the SoftAP to do a redirect to the ESP32 IP address. But I haven't found the way to do it.
I am porting an existing system to ESP32, and the domain name is fixed (www.sensor.com) so I don't think I can use mDNS as it would need to be changed to xxx.local.
Any link to examples or directions on how to do this would be welcome.
Thanks,
Franck.
SoftAp with Domain Name
Re: SoftAp with Domain Name
Howdy Franck,
My loose understanding is that the domain name system is like a database which maps symbolic names (www.xxx.com) to their IP addresses. The registration of which name maps to which IP address is not performed by the device that has that IP address but is rather done by the network / DNS administrator.
If your target machine has a dynamic IP address (i.e. dynamically allocated) then DNS isn't an option because DNS maps names to static IP addresses (this is a loose statement ... in enterprises there may be special hardware and software that performs load balancing that sprays work for the same name/IP address to multiple back-end systems).
Where we have dynamic IPs, mDNS is then a candidate but that is usually very local.
Is your goal to have your ESP32 addressible over the "Internet" or have it resolved locally (for example just in your house or office)?
My loose understanding is that the domain name system is like a database which maps symbolic names (www.xxx.com) to their IP addresses. The registration of which name maps to which IP address is not performed by the device that has that IP address but is rather done by the network / DNS administrator.
If your target machine has a dynamic IP address (i.e. dynamically allocated) then DNS isn't an option because DNS maps names to static IP addresses (this is a loose statement ... in enterprises there may be special hardware and software that performs load balancing that sprays work for the same name/IP address to multiple back-end systems).
Where we have dynamic IPs, mDNS is then a candidate but that is usually very local.
Is your goal to have your ESP32 addressible over the "Internet" or have it resolved locally (for example just in your house or office)?
Free book on ESP32 available here: https://leanpub.com/kolban-ESP32
Re: SoftAp with Domain Name
Howdy Kolban,
The idea here is to have a webserver and a DNS server implemented on the same ESP32 SoftAP.
I think it works this way:
1- Client connects to the ESP32 SoftAP
2- Client web browser sends a DNS resolution request for www.xxx.com to the ESP32 (UDP port 53)
3- ESP32 resolve DNS request and returns its own IP address
4- Client web browser uses the received IP to get the ESP32 webserver page.
But I guess you already know this since my DNS understanding comes from your book !
Hi WiFive,
That's exactly what I am looking for.
I spent 2 days trying to find examples, I was only getting Arduino results...
I guess I am not using the right keyword.
Thanks!
The idea here is to have a webserver and a DNS server implemented on the same ESP32 SoftAP.
I think it works this way:
1- Client connects to the ESP32 SoftAP
2- Client web browser sends a DNS resolution request for www.xxx.com to the ESP32 (UDP port 53)
3- ESP32 resolve DNS request and returns its own IP address
4- Client web browser uses the received IP to get the ESP32 webserver page.
But I guess you already know this since my DNS understanding comes from your book !
Hi WiFive,
That's exactly what I am looking for.
I spent 2 days trying to find examples, I was only getting Arduino results...
I guess I am not using the right keyword.
Thanks!
Re: SoftAp with Domain Name
Is there a solution that uses mDNS component? Same scenario soft AP mode , serving web pages.
Re: SoftAp with Domain Name
Hi,
"Is your goal to have your ESP32 addressible over the "Internet" or have it resolved locally (for example just in your house or office) ?"
A: In my case i want in boths.
I am really lost at the moment.
What i want to do ?
A: I want to have several websockets secure server running in a local area network(home, enterprise, school.....). I am writing a app in android/ios to connect to theses servers. In the future i want to have a cloud server to communicate with app and with theses servers.
So.
I need to have a unique domain or subdomain inside each esp32 ?
If so, how to set a domain based on concatenated esp32 EFUSE BLK0 mac address in production ?
How i would associate a smartphone app with these local servers ?
How i would associate a cloud server with these local servers ?
Thank's.
"Is your goal to have your ESP32 addressible over the "Internet" or have it resolved locally (for example just in your house or office) ?"
A: In my case i want in boths.
I am really lost at the moment.
What i want to do ?
A: I want to have several websockets secure server running in a local area network(home, enterprise, school.....). I am writing a app in android/ios to connect to theses servers. In the future i want to have a cloud server to communicate with app and with theses servers.
So.
I need to have a unique domain or subdomain inside each esp32 ?
If so, how to set a domain based on concatenated esp32 EFUSE BLK0 mac address in production ?
How i would associate a smartphone app with these local servers ?
How i would associate a cloud server with these local servers ?
Thank's.
Who is online
Users browsing this forum: No registered users and 248 guests