Francesco De Santis
Francesco De Santis

Reputation: 183

unable to connect rapberry to pc through mosquitto

i'm trying to check if my raspberry is able to connect to my pc through mosquitto. I opened a shell on my pc and i entered this line in the prompt in order to do the subscription:

mosquitto_sub -h raspberry pi -t test

I get this error:

Unable to connect (Lookup error.).

I tried to reinstall mosquitto both in the raspberry and pc but i get the same result.

Upvotes: 0

Views: 240

Answers (1)

hardillb
hardillb

Reputation: 59791

Firstly raspberry pi is not a valid hostname as it contains a space.

You probably mean raspberrypi.local which is the default mDNS/Avahi/Bonjour hostname for a raspberry pi.

Otherwise if you know the IP address (e.g. 192.168.1.5) of the raspberry pi you can use the following:

mosquitto_sub -h 192.168.1.5 -t test

Upvotes: 1

Related Questions