Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Kura » Emulated Simple Artemis MQTT Broker localhost Configuration (Local client constantly disconnected by built-in broker)
Emulated Simple Artemis MQTT Broker localhost Configuration [message #1780752] Fri, 26 January 2018 15:33 Go to next message
Mir Quintilianus is currently offline Mir QuintilianusFriend
Messages: 8
Registered: December 2017
Junior Member
Hello everybody,

I need some help with the configuration of the built-in Simple Artemis MQTT Broker in the Kura Lunix Emulator.

I am trying to control a Broadlink MP1 device. To this purpose I use the Eclipse python Paho client library along with a python client config reader and a python module for controlling Broadlink MP1 devices.

https://github.com/eclipse/paho.mqtt.python
https://github.com/eschava/broadlink-mqtt
https://github.com/mjg59/python-broadlink

For the emulated broker configuration I followed the instruction from the Kura documentation using '0.0.0.0' for the MQTT address field and '1883' for MQTT port, no user name, and no password.
https://eclipse.github.io/kura/builtin/simple-artemis-mqtt-broker-service.html

Now, using the python Broadlink client, I try to connect to the localhost broker on the Kura emulator but the clients gets constantly disconnected with the following logs.

[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

Reportedly, the disconnection code 1 should stand for Connection refused - incorrect protocol version. However, I doubt this is the real issue because mqtt-spy does connect to the same broker instance with the same protocol version, etc. settings.


Since I tested the same setup with the public MQTT broker at iot.eclipse.org, and it worked OK, I begin to think there could be only two options why the built-in simple broker service in the emulator fails to do so.

One, somehow the built-in service is unreachable for the Broadlink client, which is outside the Kura emualtor. (But then how does mqtt-spy manage to connect to the same broker instance anyway and even track specific queues???)

Two, and by far the more likely option, I am doing something wrong with the configuration of the built-in service, in which case I would very much appreciate any hint/guess/hunch that you might have to spare?

Thank you in advance!
Re: Emulated Simple Artemis MQTT Broker localhost Configuration [message #1780753 is a reply to message #1780752] Fri, 26 January 2018 15:52 Go to previous messageGo to next message
Matteo Maiero is currently offline Matteo MaieroFriend
Messages: 423
Registered: July 2015
Location: Italy
Senior Member
Hi,
did you try setting a password and seeing if something changes?
If you have done some tests with Mqtt-spy it could be that you are falling into issue https://github.com/eclipse/kura/issues/1644

Best regards,
Matteo
Re: Emulated Simple Artemis MQTT Broker localhost Configuration [message #1780785 is a reply to message #1780753] Sat, 27 January 2018 07:38 Go to previous message
Mir Quintilianus is currently offline Mir QuintilianusFriend
Messages: 8
Registered: December 2017
Junior Member
Thank you Matteo,

I didn't believe it since it doesn't make much sense, but setting a username and a pass did INDEED solve the problem.

Just for the record, I also tried using an empty client ID, as advised here:
https://issues.apache.org/jira/browse/ARTEMIS-1218
In my case, it was just the user and pass, though.

This has been nagging me for quite while now.
A million thanks!
Previous Topic:REST Api
Next Topic:I2c bus
Goto Forum:
  


Current Time: Thu Apr 18 18:16:58 GMT 2024

Powered by FUDForum. Page generated in 0.01689 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top