0

I use "Raspbian jessie" on my raspberry, and I have configure it to connect to my wi-fi, but the strange thing is when I try to send data with Mqtt, I have this error :

MqttException (0) - java.net.NoRouteToHostException: No route to host

So I have try to use ping to try my connection, and here is the strange result :

ping test.mosquitto.org
PING test.mosquitto.org (37.187.106.16) 56(84) bytes of data.
From 192.168.137.2 icmp_seq=1 Destination Host Unreachable
From 192.168.137.2 icmp_seq=2 Destination Host Unreachable
From 192.168.137.2 icmp_seq=3 Destination Host Unreachable
From 192.168.137.2 icmp_seq=4 Destination Host Unreachable

What I saw from this result, is that It can resolve the host, but It can't connect to them, the ip address

192.168.137.2

Is the standard ip of my raspberry, infact everytimes I log into raspbbery I have this default screen : Default screen

But now, with the wi-fi connection, the ip address of my raspberry(I use this one to connect from putty) is

192.168.43.67

PS: I use thetering of my telephone, my pc and my raspberry are connected to its. What I have to do to resolve this problem?

1

After some hours I have found the solution to my project! in the /etc/network/interfaces file, I have change the configuration in this way:

auto eth0
iface eth0 inet static
address 192.168.0.105
netmask 255.255.255.0
network 192.168.0.0
broadcast 192.168.0.255
#gateway 192.168.0.1 ---> I have comment this line
dns-nameservers 8.8.8.8 --> I have add this line.
0

Try ping after restarting the broker service where it is hosted,and tally from other PC whether ping is working or not then try in raspberry pi.If you resolved the issue kindly avoid this.

  • As I wrote, I already found the solution and is not what you have suggested. – Liz Lamperouge Jul 28 '17 at 7:05
-1

I have this problem periodically, usually when I've been rebooting the pi a lot to test out something. On my desktop machine 'arp -a' give a list of machines, some of which are marked 'incomplete'. So the desktop sometimes becomes confused and can't find the pi.

If I reboot the desktop machine, all is well when it comes back up. I hate to use the standard Windows solution to a problem, but there it is (at least for me).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.