0

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
Mohsen Haydari
  • 550
  • 5
  • 20
  • "that's not work" - what does this mean? (error, not working as expected?). Based upon the mosquitto log the connection is being established (assuming the redacted address is the external address of whatever you are attempting to connect from). Please provide more info with regards to the other device you are trying to connect with (ideally test with `mosquitto_sub` over the internet or try an MQTT app on your phone). – Brits Jan 15 '23 at 21:27
  • when i use ```VPN```, MQTT work but without VPN, I got device connected but I don't get any message and i can't publish any message, I checked on ```mqtt.paho``` python plugin , windows terminal with ```mosquitto``` and android device but everywhere has the same problem – Mohsen Haydari Jan 16 '23 at 02:43
  • 1
    This sounds like a networking issue. Try enabling short MQTT kaapalives (e.g. `-k 1` with `mosquitto_sub`). Unfortunately it's going to be difficult to help without more info about the route from the internet to your mosquitto unit. Again what does "can't publish" mean? be specific (and edit the question rather than adding detail in the comments). – Brits Jan 16 '23 at 18:39

1 Answers1

0

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

Mohsen Haydari
  • 550
  • 5
  • 20