Languages

Menu
Sites
Language
Cannot resolve hostname

I have a Raspberry Pi that is connected to my network and a Samsung Gear S that is connected to the same network. The Raspberry Pi is used as a server and the Gear S sends data to it. I currently need to insert the Raspberry Pi IP address manually in the Gear S app whenever I connect to another network. So everything works fine if I use this address: http://192.168.0.227:8080/appdata/post"I've found that you can use raspberrypi.local and that the raspberry pi will recognize this address as it owns. My problem is that when I try to post something to the address "http://raspberrypi.local:8080/appdata/post" using Javascript, the post doesn't come true. The problem is that raspberrypi.local cannot be resolved.

When I execute the javascript of the app on my laptop so with the address "http://raspberrypi.local:8080/appdata/post" it does come through. So I guess the problem lies with the Gear S itself. How can I overcome this? Thanks.

Responses

13 Replies
Nafisul Islam Kiron

Hello, this sounds like a DNS issue.

Please take a look at this link

http://raspberrypi.stackexchange.com/questions/7640/raspberry-pi-not-reachable-via-its-hostname-in-lan

Tim Deweert

Yes indeed but I can resolve the hostname with my laptop. If I for example ssh to raspberrpi.local this does work. Only the Gear S cannot resolve the hostname. So how exactly should I solve this?

Nafisul Islam Kiron

Okay, go to your "config.xml" in your project.

Go to the "Policy" tab.

Press the "Add" button.

Add your URL in "Network URL" and set "Allow subdomain" to true.

Build and run.

 

If this solves your problem, don't forget to mark it as right answer.

Tim Deweert

No it didn't help, I previously had already an entry that allowed all URL's. What else could it be?

Nafisul Islam Kiron

Please try to change your host name and try again with Gear S2.

For ".local" to work, you need to either have "avahi" running in your pi so that the name is resolved via mDNS or your router must be configured with host entries and a default local domain.

http://www.howtogeek.com/167195/how-to-change-your-raspberry-pi-or-other-linux-devices-hostname/

I understand that you can reach your pi with PC, but give it a shot anyway.

 

Tim Deweert

I have avahi running in my pi and I can connect to raspberrypi.local from any device except the Gear S. Also I don't have a Gear S2 and need to get it working with the Gear S. So I can't see that changing the hostname would solve anything.

Nafisul Islam Kiron

"Changing the host name"

It's like restarting your PC, no particular reason, just helps.

You don't have to do this if you don't want to.

I have a Gear S2, it works just fine here.

I guess it is a problem with your Gear S, if it is possible try another gear device (S or S2 or ).

Tim Deweert

Just in case I changed my hostname but it still can not be resolved. It will indeed probably be my device or the Gear S in general. Thanks!

Eduardo Pinheiro

Did you figure out what was the problem? I'm having exactly the same issue with a Samsung Tizen Smart Tv (UE32M5525). 

Armaan-Ul- Islam

The Original Poster /Questioner was struggling to connect Raspberry Pi with Samsung Gear S. Please describe your case.

Eduardo Pinheiro

My problem is exactly the same but using other devices.

My Webapp running on a Samsung Tizen Smart Tv cannot make an http request to a mdns name "test.local" . That mdns is settled by an ESP8266.

My computer, though, can successfully make the http request to "test.local" . They are all in the same network. 

A small note about mdns:

mdns is not resolved by nslookup in either cases but I'm able to make the request on my computer when accesssing it by an http request or even a ping. The reason why is explained in a web post. Since I cannot insert an external link in this forum I'm copying the post:

Why nslookup doesn't use mdns while ping do?

ping use glibc's name resolution system, called Name Service Switch. This uses the nsswitch.conf file to know where to look for in order to resolve a name to an IP. The hosts line in this file represents an order of preference for each service. For exemple, files represent the local hosts file, dns uses the resolv.conf file to contact a DNS server, and mdns uses mdns.

However, nslookup doesn't use it. It talks directly to the DNS server specified in resolv.conf and so can't use mdns.

Mert Aksoy

This issue still exists. Any ideas?

Mert Aksoy

In my case the endpoint (192.168.0.80) is reachable when gear s2 is connected with WIFI. So when i change the connection setting to WIFI auto, its not reachable. When i try to reach another network like (google.com) it works. Somehow the IP address can't be resolved when gear tries to reach it through bluetooth.