In /etc/mosquitto/mosquitto.conf
set allow_anonymous
to true
along with other config that is required including user setup etc
Setup a MQTT user
sudo mosquitto_passwd -c /etc/mosquitto/passwd <USERNAME>
And update the mosquitto.conf
listener 1883