Description
Hi everyone!
I'm working on a project which connects an ESP8266 to a Raspberry Pi, which is operating as a server. I want to make requests to the Raspberry from the ESP without knowing its IP address. The Raspberry host name is simply raspberrypi
, and I'm able to make requests using this hostname through Postman or any other browsers.
The strange thing is: if I use my own WiFi, and try http.begin("raspberrypi.local", 3000, "/test");
, I cannot access the server, I get an error. If I use raspberry's IP address, it works perfectly.
But what is really strange is that if I start a HotSpot with my Android phone, and connect the ESP8266 and the Raspberry, and try http.begin("raspberrypi.local", 3000, "/test");
, it WORKS!! The Raspberry is also running Avahi, but things don't work unless I'm on my Android hotspot (I tested other WiFi networks with no success).
I was told to use the mDNS library, but that does not seem to work. Is there anyway someone could help me out?
Thanks!