Hey, I have raspberry pi running mosquitto,. I did setup it like this:
- buy a domain, setup ddns pointing to my router
- port forwad 1883 to my raspberry pi with a static ip address
- download mosquitto
- add a user/password
This is my config file:
# Place your local configuration in /etc/mosquitto/conf.d/
#
# A full description of the configuration file is at
# /usr/share/doc/mosquitto/examples/mosquitto.conf.example
pid_file /run/mosquitto/mosquitto.pid
persistence true
persistence_location /var/lib/mosquitto/
log_dest file /var/log/mosquitto/mosquitto.log
#listener 8883
listener 1883 0.0.0.0
allow_anonymous false
include_dir /etc/mosquitto/conf.d
password_file /etc/mosquitto/passwords_mosquitto
netstat -tln | grep 1883 outputs:
tcp 0 0 0.0.0.0:1883 0.0.0.0:* LISTEN
Its allowing connections from my mqtt dashboard running on my phone, but only when I am pointing the raspberry pi directly with its IP-address, instead using the domain-method.
It seems like mosquitto doesnt allow outside network connections...
Could anyone help me fixing this?
Thanks!