MQTT#Connection is refuesd solution

access the configuration file by this command: /etc/mosquitto View the configuration file cat mosquitto.conf  # 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 truepersistence_location /var/lib/mosquitto/ log_dest file /var/log/mosquitto/mosquitto.log include_dir /etc/mosquitto/conf.d use nano to edit the file, insert these 2 lines. sudo nano mosquitto.conf listener 1883allow_anonymous true Finally,Reboot it. Reference from: https://github.com/eclipse/mosquitto/issues/1985