Cannot connect to Cloud HiveMQ using paho/python client

I have a free account and the CLI works perfectly from my machine.

When I run paho python client - with their example code (and now many iterations of their different examples) I cannot connect from the same machine as the CLI.

Logging for subscriber returns ==

Sending CONNECT (u1, p1, wr0, wq0, wf0, c1, k60) client_id=b’’
Sending CONNECT (u1, p1, wr0, wq0, wf0, c1, k60) client_id=b’’
Sending CONNECT (u1, p1, wr0, wq0, wf0, c1, k60) client_id=b’’

Logging for publisher returns ==
Sending CONNECT (u1, p1, wr0, wq0, wf0, c1, k60) client_id=b’’
connack = 0
Sending PUBLISH (d0, q0, r0, m987), ‘b’mytopic/test’’, … (37 bytes)
Sending PUBLISH (d0, q0, r0, m988), ‘b’mytopic/test’’, … (3 bytes)
publish mid: 987
publish mid: 988
Sending DISCONNECT

I have tried pretty much every combination of client ID and every other parameter…

Thanks for any help.

Hi @freshwuzhere,

Glad to see your interest in HiveMQ Cloud.
We have a getting started section in HiveMQ Cloud. You can reach it from your console.


It contains a guid for Paho Python.

Kind regards,
Florian

2 Likes

Thanks Florian!

As I anticipated the

client.tls_set(tls_version=mqtt.ssl.PROTOCOL_TLS)

was missing and what I required.

Your help is much appreciated!

1 Like