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

The test demo on README #24

Open
xiaowenlong100 opened this issue Apr 24, 2017 · 5 comments
Open

The test demo on README #24

xiaowenlong100 opened this issue Apr 24, 2017 · 5 comments

Comments

@xiaowenlong100
Copy link

I can't run it well when "ret = client.connect(version=4)" .
"ret = client.connect(version=3)" will be OK.

@gbour
Copy link
Collaborator

gbour commented Apr 24, 2017

version=4 enable mqtt 3.1.1 (latest protocol version), while version=3 stick to past 3.1 version.
Which broker are you testing the demo with ? does it support mqtt v3.1.1 ?

@xiaowenlong100
Copy link
Author

Thank you .I got a 'emqttd-windows10-v2.1.2.zip' that I download from http://www.emqtt.io/ 。It could support mqtt 3.1.1 since version emqttd-v0.3.1.

@gbour
Copy link
Collaborator

gbour commented Apr 26, 2017

yes, Emqtt is supporting Mqtt v3.1.1
Could you try with mosquitto tools (mosquitto_pub & mosquitto_sub) with option --protocol-version mqttv311

Could you also take & send a network trace when using nyamyk demo ?

@tronar
Copy link

tronar commented Jul 14, 2018

I bumped in the same issue, seems a bug on the packet length that assumes version 3 ID (3.1, MQIsdp), which is longer than version 4 (3.1.1, MQTT). Solved by toast-uz by changing at line 123 of nyamuk/mqtt_pkt.py from:
self.remaining_length = 12 + payload_len
to:
self.remaining_length = 6 + payload_len + len(getattr(NC, 'PROTOCOL_NAME_{0}'.format(version)))

@elegentFrog
Copy link

hello!excuse me,{
connection failed
2019-03-01 17:55:31,601 - test_nyamuk - INFO - Connecting to server ....192.168.8.7
2019-03-01 17:55:31,609 - test_nyamuk - INFO - CONNACK reveived
error: Client([email protected]:38106): Username 'undefined' login failed for password_undefined
},how do you solve this problem?

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

4 participants