alsm / freeboard-mqtt

MQTT and IBM IoT Foundation plugins for freeboard.io
Eclipse Public License 1.0
60 stars 26 forks source link

Added username and password while creating client #1

Closed TheAshwanik closed 9 years ago

TheAshwanik commented 9 years ago

Thank you for the plugin. The plugin worked well when you don't use Username and Password in Mosquitto. But If you use Username and Password, then the plugin would not instantiate without username and password. It only works when you You manually go to data-source settings every time and press save. Coz that triggers the function onSettingsChanged() where the Client reconnects with Username and Password. and it always worked when someone changes settings and saves. So, In order to make it working the very first time, I added username and password while instantiating Paho.MQTT.Client at the beginning. If the Broker allows client based on username/password or not. It will work in both cases. If you feel ok, feel free to merge the pull.

alsm commented 9 years ago

Hi, thanks for this, although it seems you've added the username and password properties to the Client constructor but they should be added to the connect() call, if you can change that, test and confirm it works I'd be happy to accept the changes.

TheAshwanik commented 9 years ago

Thanks I updated the code in my master branch and tested. Sent another Pull request. I am closing the old pull request. Apologies for the mishap.