Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[mosquitto-dev] Spotty connection to remote bridge causes local broker to fail

I have configured the mosquitto broker on the local machine to bridge some topics to a remote broker.  The connection to the remote broker is over UMTS (interface ppp0), so connection is not always that great and often comes and goes.  I've noticed that when the connection to the remote broker is lost, it also causes some problems with the local broker as well.  For example, I have a C++ application publishing data to the local broker (localhost) and when the UMTS connection gets dropped, my app gets a disconnection from remote broker first, then several seconds later the connection to localhost is lost.  


When this happens, if I open up a terminal and type in "mosquitto_sub -t '$SYS/broker/#' -v", nothing happens - there is no connection refused message, it just sits there like it's waiting on something to happen.


I've set up the metrics in each interface so that the wifi1 interface is metric 0, and ppp0 is metric 20, thinking that perhaps UMTS is taking precedence over wifi but it did not change anything.


If I disable the bridge in the .config file, this problem does not occur.


Here is my mosquitto.conf file:


root@ubuntu:~# cat /etc/mosquitto/mosquitto.conf
pid_file /var/run/mosquitto.pid

persistence false
persistence_location /var/lib/mosquitto/

log_dest file /var/log/mosquitto/mosquitto.log
log_facility 5

include_dir /etc/mosquitto/conf.d

listener 1883

connection br-to-cloud-12345
address <removed>.com:1883
remote_username blah
remote_password blah
topic out/topic out 2 "" ""
topic in/topic/# in "" ""


Back to the top