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 true persistence_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 1883 allow_anonymous true |
Finally,Reboot it.
Reference from: