I am learning about mqtt and for the first step, I tried connection between two files.
Then I tried them with credential options, but one file keeps on reconnecting.
It successfully denies access when the password is wrong, but there is no difference between two file's connecting code.
const client = mqtt.connect('mqtt://127.0.0.1:1883',{username:'controller',password: 'pass'});
const client = mqtt.connect('mqtt://127.0.0.1:1883', {username:'garage1',password: 'pass'});
and the credential file has these informations on it.
One with the username controller works fine, but the other one keeps on reconnecting.
I am learning about mqtt and for the first step, I tried connection between two files. Then I tried them with credential options, but one file keeps on reconnecting. It successfully denies access when the password is wrong, but there is no difference between two file's connecting code. const client = mqtt.connect('mqtt://127.0.0.1:1883',{username:'controller',password: 'pass'}); const client = mqtt.connect('mqtt://127.0.0.1:1883', {username:'garage1',password: 'pass'});
and the credential file has these informations on it.
One with the username controller works fine, but the other one keeps on reconnecting.