Search code examples
mqttmosquitto

I can't get any data from my broker with mosquitto_sub over the internet


in localhost, my broker works great, but when I use broker IP on another device to connect over the internet that's not work, Websocket is fine

I use this command to subscribe on topic and get the retained messages

mosquitto_sub -h *.*.*.* -p 1883 -t mrt_connections/#

in localhost and when I used VPN I get current information, but when I use broker IP to use with another device over the internet I can't get any data

this log when I used Ip over the internet


1673794013: New connection from ****.****.***.**** on port 1883.
1673794013: New client connected from ****.****.***.**** as auto-48259EF8-9CF7-9CF5-3C2C-20FA8265C33A (p2, c1, k60).
1673794013: No will message specified.
1673794013: Sending CONNACK to auto-48259EF8-9CF7-9CF5-3C2C-20FA8265C33A (0, 0)
1673794017: New connection from *.*.*.* on port 1883.

I guessed that maybe port 1883 is blocked by ISP but another broker with the same port working, I test many IP but the problem is still alive, can anybody explain to me what is a problem thanks

I used version 2.0.15

config file

allow_anonymous true

listener 1883 *.*.*.*

log_type all
log_dest topic
log_dest stdout

Solution

  • Finally, I found the problem, the port was blocked by ISP and now MQTT works fine on port 443