Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MQTT with Bluemix MQTT iothub #21

Open
xapundel opened this issue Mar 6, 2017 · 3 comments
Open

MQTT with Bluemix MQTT iothub #21

xapundel opened this issue Mar 6, 2017 · 3 comments

Comments

@xapundel
Copy link

xapundel commented Mar 6, 2017

Hello Robin,

I am trying to use your MQTT module to connect my MQTT server in the bluemix. I got some initial problem with username and password. Why it should be less than 12 simbols ? I removed that limit but anyway have

[2017-03-07 01:09:58.106] [I] [core] [MQTT-12] Trying to reconnect (NaN)

Could you help me to solve the problem ? I created MQTT for your testing and sent all credential in the email.

@Edubits
Copy link
Owner

Edubits commented Mar 7, 2017

Why it should be less than 12 simbols ?

Good question! The MQTT 3.1 spec used by the MQTT client we're using (the only client known to me which is plain, non-websocket, JavaScript and therefor works within the limited JS of ZWay) recommends to keep the username and password within 12 chars, see: http://public.dhe.ibm.com/software/dw/webservices/ws-mqtt/mqtt-v3r1.html#connect

As there are quite some calculations going on while composing the messages I can imagine there are some that assume a username/password within 12 chars. Are you able to try the broker with a shorter password? If that works we can dive into this.

@xapundel
Copy link
Author

xapundel commented Mar 8, 2017

Based on spec is is not mandatory. I know a lot of project where MQTT pass is 256 symb. Unfortunately I have no option to change this password. Did you recieve my email with test credentials. I also tried another MQTT client and got good respons from MQTT server.

@Edubits
Copy link
Owner

Edubits commented Mar 8, 2017

Based on spec is is not mandatory.

I know, but as this MQTT client is a bit older and explicitly checks for the length, I'm afraid that somewhere they handle username/passwords longer than 12 chars incorrectly. Unfortunately the JS available to Zway apps is very limited, so this was the only MQTT client I could find that actually works.

Unfortunately I have no option to change this password. Did you recieve my email with test credentials. I also tried another MQTT client and got good respons from MQTT server

That's a pity. Yes I checked and confirmed it worked with another client. I didn't have the opportunity yet to test within Zway.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants