fbacker / broadlink-mqtt-bridge

Bridge Broadlink RM Devices with MQTT and API for e.g. OpenHAB
41 stars 14 forks source link

MQTT Error 5 #9

Closed OhNoItSJoe closed 5 years ago

OhNoItSJoe commented 5 years ago

Hello fbacker, I installed your MQTT bridge yesterday. Installation went fine, just had to change the port because grafana is using the port 3000, too.

I just have one problem, I keep getting this error in the gui:

MQTT Closed MQTT Error { "code": 5 }

my conf is like this:

{ "mqtt": { "host": "192.168.0.2", "port": 1883, "protocol": "mqtt", "subscribeBasePath": "broadlink", "user": "testeduser", "pwd": "testedpassword" }, "recording": { "timeout": { "ir": 30, "rf": 30 }, "path": null }, "gui": { "port": 3001 } }

Credentials were tested with mqtt fx, all other mqtt stuff is working. mqtt broker is running on the same pi, i tried it with 127.0.0.1 too. Is there anything I did wrong?

fbacker commented 5 years ago

I'm using https://www.npmjs.com/package/mqtt#client so looks like it should be username and password as key values. I think error code 5 is unauthorised.

OhNoItSJoe commented 5 years ago

Hello fbacker, what do you mean with "as key values"? Is my config file right? Sorry, I am not a pro in JS/JSON. What can I do to fix this error?

fbacker commented 5 years ago

Try to change your local.json file to

{
  "mqtt": {
    "host": "192.168.0.2",
    "port": 1883,
    "protocol": "mqtt",
    "subscribeBasePath": "broadlink",
    "username": "testeduser",
    "password": "testedpassword"
  },
  "gui": {
    "port": 3001
  }
}
OhNoItSJoe commented 5 years ago

Ok, will try as soon as I am home. Thank you in advance!