Page 1 of 2

ESP32 - Arduino - Connecting to a local server

Posted: Tue Mar 21, 2017 12:51 pm
by BluesBoyDje
Hi,

I hope I'm posting this at the correct place, anyhow.
The ESP32 so far has been great using the Arduino IDE.
The Wifi HTTP get example works great, for online server though.
So Google and Example.com work great, the thing is though, I've got a NodeJS server running on a Raspberry Pi.
And I've got both IP and domain name working (pi.local) in my browser, but I can't seem to get the ESP32 to connect to it.
Could any of you help me? :)

Re: ESP32 - Arduino - Connecting to a local server

Posted: Wed Mar 22, 2017 6:52 pm
by martinayotte
Are you using "pi.local" or it's actual IP address ?
(because mdns doesn't mean you DNS of your network can resolve it)

Re: ESP32 - Arduino - Connecting to a local server

Posted: Wed Mar 22, 2017 7:57 pm
by BluesBoyDje
I have actually tried both

Re: ESP32 - Arduino - Connecting to a local server

Posted: Thu Mar 23, 2017 2:23 pm
by martinayotte
I don't see any reason why using IP of this RPi you would have issue connecting to it.
There must be an error in the code, either on ESP side or RPi side.

Re: ESP32 - Arduino - Connecting to a local server

Posted: Thu Mar 23, 2017 2:58 pm
by kolban
I think Martin had it spotted earlier. Domain names that are "xxx.local" are "special". Let us assume that you are trying to resolve the domain name a.b.com. Your ESP32 will connect to the DNS server you have defined and will ask it "Please get me the IP address for a.b.com". The DNS server will then return the IP address. All is well.

On your ESP32 if you try and resolve "a.local", exactly the same thing will happen ... your ESP32 will contact the DNS server and ask for the IP address of "a.local" but this time the DNS server will respond with "Sorry ... no idea about that resolution".

The reason it "appears" to work in your browser is that the implementation of the browser looks at the URL/address and explicitly says to itself "Does the domain name end in '.local'?". If it does NOT, then the name is sent to DNS for resolution ... if it DOES end in ".local", then the browser uses mDNS to attempt to look up the IP address of the resolution.

It is likely (opinion) that in your code when you try and resolve a domain name, it is exclusively attempting to go against DNS and the logic (either that which you have written or the library that you are using) isn't coded to examine the domain name for mDNS local names.

Re: ESP32 - Arduino - Connecting to a local server

Posted: Fri Mar 24, 2017 4:49 pm
by BluesBoyDje
Thank you both for your help, it was indeed the library that had trouble with local ip adresses. I now got it working with another one :)

Re: ESP32 - Arduino - Connecting to a local server

Posted: Sat Aug 19, 2017 11:36 pm
by niddaas
BluesBoyDje wrote:Thank you both for your help, it was indeed the library that had trouble with local ip adresses. I now got it working with another one :)
Could you please explain the method to solve the issue?
Because I've experienced the same issue.

For all esp 32 expert,

I can't browse esp32.local in my web browser.

I'm using this code for my ESP32
https://github.com/espressif/arduino-es ... Server.ino

In my arduino serial monitor only show:

rst:0x10 (RTCWDT_RTC_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:1
load:0x3fff0010,len:4
load:0x3fff0014,len:588
load:0x40078000,len:0
load:0x40078000,len:10472
entry 0x40078a28

...
Connected to B520
IP address: 192.168.1.3
mDNS responder started
TCP server started


I'm using windows 7 and have installed bonjour with enable firewall.

Previously I have set my esp32 as server and client with no problem. When I try to set multicastDNS to autodetect my ip of esp32, the problem was occured.

Thank you,

Saaddin

Re: ESP32 - Arduino - Connecting to a local server

Posted: Sun Aug 20, 2017 12:11 am
by niddaas
I just realize that the error is came from my windows 7. Because I can open the page in my ubuntu and have ping too. Here I attach the relevant screenshot.

Is there any other idea to playing mdns well in windows 7?

Thank you,

Saaddin Nur

Re: ESP32 - Arduino - Connecting to a local server

Posted: Wed Jan 31, 2018 9:13 pm
by ZsLaci
I have the same problem with ESPmDNS. The example sketch compiled without any error, but the name resolution does not work.
The web server was working and I could access it by IP address in my Firefox browser. But if I used "http://esp32.local" it does not work.
I suppose, some additional parameter (IP address in suitable form) is missing from MDNS.begin("esp32",???...).
How should I bind the IPAddress to the <name>?
Can somebody help me?

Re: ESP32 - Arduino - Connecting to a local server

Posted: Sun Aug 04, 2019 3:04 am
by rsssrinivas
niddaas wrote:
Sat Aug 19, 2017 11:36 pm
BluesBoyDje wrote:Thank you both for your help, it was indeed the library that had trouble with local ip adresses. I now got it working with another one :)
pls tell me how did you slove the issue