1

I am trying to use mqtt protocol in this websocket api address wss://meri.digitraffic.fi:61619/mqtt .

It has username and password userName:digitraffic

password:digitrafficPassword.

plus (ssl needs to be enable) and i need to subscribe the message vessels/# from that websocket api address .

I have found some links MQTT over websocket in python.

I have also followed documentation of this one https://pypi.org/project/paho-mqtt/ and it works if i put the exact address given in the documentation but fails when I put my above address with username and password.

How can i use my websocket address in that paho-mqtt. Can this achieve using simple websocket library ? I am new in this stuff and any kind of help would be helpful.

user96564
  • 1,578
  • 5
  • 24
  • 42
  • 1
    can you share the codes here ? You can refer to the following example. It looks more straight forward answer for your case http://www.steves-internet-guide.com/mqtt-websockets/ – Santosh Balaji Selvaraj Apr 02 '19 at 02:33
  • I fixed this by using paho-mqtt libs. For someone who has faced same problem like me needs to use `on_connect`, `on_message` function from paho-mqtt. Also transport should be websockets. For eg. `myclient = pahoClient.Client(clientId, transport='websockets')` – user96564 Apr 05 '19 at 10:18

0 Answers0