A continuación te mostramos una lista de erroers comunes cuando conectes con mosquitto_sub. Las siguientes indicaciones usan la opción -d (–debug) para obtener una salida más detallada.
Considere las siguientes indicaciones.
- 
Firewall bloqueado. Si ejecuta run mosquitto_sub con la opción -d (–debug) y no obtiene una sola línea de salida como a continuación: >> mosquitto_sub -d -h node02.myqtthub.com -i myHubxxxxIdMosq -u myHubxxxxIdMosqUsr -P xxxx -t message/topic/to/subscribe -q 2 (comando enviado, esperando y sin mostrar salida)Entonces compruebe su conexión para ver si algún firewall está bloqueado el 1883/tcp o 8883/tcp. 
- 
Problema DNS. Si ejecuta mosquitto_sub con la opción -d (–debug) y hay un problema DNS o de rutado (puerta de enlace) por defecto, entonces obtendrás algo como: >> mosquitto_sub -d -h node02.myqtthub.com -i myHubxxxxIdMosq -u myHubxxxxIdMosqUsr -P xxxx -t message/topic/to/subscribe -q 2 Unable to connect (Lookup error.).
- 
Sin puerta de enlace (ruter por defecto). Si ejecuta your mosquitto_sub con la opción -d (–debug) y sin router por defecto, entonces obtendrá el siguiente error: >>> mosquitto_sub -d -h node02.myqtthub.com -i myHubxxxxxxIdMosq -u myHubxxxxxxIdMosqUsr -P xxxxx -t message/topic/to/subscribe -q 2 Error: Network is unreachable
- 
clientId, userName o password incorrectos. Si ejecuta mosquitto_sub con la opción -d (–debug) usando un clientId, userName or password incorrectos, entonces obtendrá: >> mosquitto_sub -d -h node02.myqtthub.com -i myHubxxxxxxIdMosq -u myHubxxxxxxIdMosqUsr -P test1234f -t message/topic/to/subscribe -q 2 Client myHubxxxxxxIdMosq sending CONNECT Client myHubxxxxxxIdMosq received CONNACK (3) Connection Refused: broker unavailable. Client myHubxxxxxxIdMosq sending DISCONNECT
- 
Salida esperada. Si ejecuta mosquitto_sub con la opción -d (–debug), debería obtener la siguiente salida si está conectando sin ningún error: >> mosquitto_sub -d -h node02.myqtthub.com -i myHubxxxxIdMosq -u myHubxxxxIdMosqUsr -P xxx -t message/topic/to/subscribe -q 2 Client myHubxxxxxxIdMosq sending CONNECT Client myHubxxxxxxIdMosq received CONNACK (0) Client myHubxxxxxxIdMosq sending SUBSCRIBE (Mid: 1, Topic: message/topic/to/subscribe, QoS: 2) Client myHubxxxxxxIdMosq received SUBACK Subscribed (mid: 1): 2 Client myHubxxxxxxIdMosq sending PINGREQ Client myHubxxxxxxIdMosq received PINGRESP Client myHubxxxxxxIdMosq sending PINGREQ Client myHubxxxxxxIdMosq received PINGRESP
