Home » Eclipse Projects » Paho » Constant disconnect because of Connection refused - incorrect protocol version(paho client for a Broadlink MP1 device won't connect to MQTT broker)
Constant disconnect because of Connection refused - incorrect protocol version [message #1780133] |
Wed, 17 January 2018 15:21  |
Eclipse User |
|
|
|
Hello everybody,
I am using the python Paho client library along with a python client config reader and a python module for controlling Broadlink MP1 device.
https://github.com/mjg59/python-broadlink
https://github.com/eschava/broadlink-mqtt
These two, they seem to work OK since the Broadlink device is discovered.
However, when the client finally tries to connect to the MQTT broker, it keeps getting disconnected, reportedly because of an incorrect protocol version.
The MQTT broker is an ActiveMQ Artemis broker, which is part of an Eclipse Kura emulator set up on a Debian 9 machine.
I have tested the broker with mqtt-spy and it's up and running.
I have been trying quite a few things before posting this, but still no result whatsoever.
Below are the logs with as much info as I managed to get from the logger.
Already tried changing the protocol version between 3.1 and 3.1.1, and also tried setting back and forth the clean_session flag.
Any idea why I still keep getting this code 1: Connection refused - incorrect protocol version?
Anything is welcome!
[2018-01-14 16:35:44,012] DEBUG Connected to MP1 Broadlink device at ('192.168.1.151', 80)
[2018-01-14 16:35:44,012] DEBUG Protocol version is 4
[2018-01-14 16:37:31,194] DEBUG Connected to MP1 Broadlink device at ('192.168.1.151', 80)
[2018-01-14 16:37:31,195] DEBUG Protocol version is 4
[2018-01-14 16:37:31,196] DEBUG Sending CONNECT (u1, p1, wr0, wq0, wf1, c0, k60) client_id=broadlink_test_client
[2018-01-14 16:37:31,198] DEBUG Calling from main right after mqttc.connect()
[2018-01-14 16:37:31,200] DEBUG OOOOPS! Broadlink disconnects
[2018-01-14 16:37:31,201] DEBUG CONNACK received by on_disconnect with code: 1
[2018-01-14 16:37:42,211] DEBUG Sending CONNECT (u1, p1, wr0, wq0, wf1, c0, k60) client_id=broadlink_test_client
[2018-01-14 16:37:42,213] DEBUG OOOOPS! Broadlink disconnects
[2018-01-14 16:37:42,213] DEBUG CONNACK received by on_disconnect with code: 1
|
|
| | |
Re: Constant disconnect because of Connection refused - incorrect protocol version [message #1780444 is a reply to message #1780167] |
Mon, 22 January 2018 09:17   |
Eclipse User |
|
|
|
Meanwhile, I did some more research on mqtt implementations. It turned out that, depending on the broker version, there might be another viable option for the protocol version parameter mentioned above. That option is 5, which according to the documentation should stand for v5.0. Unfortunately, that didn't work either. Then just for the sake of it, I decided to try passing anything between 1 and 7. Same result as before.
All this makes me think, the incorrect protocol version message I get from the debugger doesn't have much to do with the reason for the disconnect. It looks like it's just masking something else which is wrong either with the emulated Kura implementation of the ActiveMQ broker service, or with the Paho client itself, or a glitch on the very edge between them.
I would very much appreciate any feed whatsoever!
|
|
| |
Goto Forum:
Current Time: Fri Jun 20 01:39:46 EDT 2025
Powered by FUDForum. Page generated in 0.03797 seconds
|