I installed the Mosquitto MQTT on my Pi and I want to test it on my Windows via Putty.
What is my MQTT server IP address and port ?
I tried ifconfig but it shows:
inet addr : as hex like fe80::465d.... etc.
I installed the Mosquitto MQTT on my Pi and I want to test it on my Windows via Putty.
What is my MQTT server IP address and port ?
I tried ifconfig but it shows:
inet addr : as hex like fe80::465d.... etc.
According to the man page for Mosquitto
It is dominated by a Configuration file which is /etc/mosquitto/mosquitto.conf.
According to the man page for the mosquitto.conf:
bind_address address
Listen for incoming network connections on the specified IP address/hostname only. This is useful to restrict access to certain network interfaces. To restrict access to mosquitto to the local host only, use "bind_address localhost". This only applies to the default listener. Use the listener variable to control other listeners.
listener port [bind address/host]
Listen for incoming network connection on the specified port. A second optional argument allows the listener to be bound to a specific ip address/hostname. If this variable is used and neither the global bind_address nor port options are used then the default listener will not be started.
The bind address/host option allows this listener to be bound to a specific IP address by passing an IP address or hostname. For websockets listeners, it is only possible to pass an IP address here.
Hence your current IP address is the localhost IP address generally 127.0.0.1 for IPv4 and or ::1 for IPv6. This can be seen from ifconfig lo.
Default port number for mosquitto is 1883 according to the man page
fe80:: addresses are IPv6 Link-Local Addresses which exist for each IPv6 enabled device on your Pi.
It is recommended to change the IP address and port values in your mosquitto.conf for your desired functionality and restart mosquitto again:
/etc/init.d/mosquitto restart