Skip to main content
1-Visitor
August 23, 2016
Solved

unable to establish MQTT connection to external MQTT broker

  • August 23, 2016
  • 3 replies
  • 8905 views

Hi,

I try to establish a MQTT connection to an external mosquitto MQTT server.

I download the MQTT extension and set it up according the setup instructions.

Nevertheless I got everytime a error message in the application log: Unable to connect to MQTT in [EYMQTT_Testthing] : MqttException

I did a test with MQTT_spy and I got a successful connection.

I´m using thingworx 7.2 and also 6.5 with the latest MQTT extension, but both with no success

I really have no clue what I did wrong ?

Regards

Marco

Best answer by mliesegang

Hello, In the meantime we understood that the MQTT extension was giving problems under Linux. MQTT extension on Thingworx Server running on Windows does not have any problems.

PTC offered a new MQTT extension begin of October and now the MQTT issue on Linux based Thingworx server is solved.

Solution: Use the latest MQTT extension from the marketplace.

3 replies

5-Regular Member
August 23, 2016

Marco, just to confirm, if you connect to a public server, it connects fine?

1-Visitor
August 24, 2016

Hello Aanjan,

setup is the following:

a) Own thingworx server 6.0 (running on hosted server) try to connect to mosquitto MQTT broker on same server

b) Thingworx server 7.2 instance from the vuforia pilot program (running at PTC cloud) try to connect to mosquitto MQTT broker on public root server.

I did the installation of the MQTT extension as described in the support forum.

But in both cases I get the error in the application log: Unable to connect to MQTT in [MQTT_test] : MqttException

A test with MQTT_spy from my laptop to the mosquitto MQTT broker on public root server is working without issues.

Therefore I believe strongly it has something todo with my thingworx extension or thing template setup.

Could it be that there is something to do with the righs in thingworx composer to get the mqtt broker connected ?

Regards

Marco

1-Visitor
August 24, 2016

Hello Marco,

I have already tried this Mqtt part of Thingworx and it worked fine. Please check the Configurations of your created thing. I think some problem maybe there. Check the topic name if its same in both the places.

Regards

Anupriya

5-Regular Member
September 15, 2016

Is the broker secured or unsecured? If it is secured, then see this post: Securing the Mosquitto MQTT Broker for details about how to make sure the tomcat running Thingworx gets configured to allow for the connection to be made to a secured broker. Note that the post only covers encrypting the traffic to the broker, not the use of client certificates (require_certificate not set to true in the broker configuration). If you self-signed the broker SSL certificate, you won't be able to access the MQTT broker from the Vuforia pilot server as it requires editing the tomcat configuration. You must either use an unsecured or true CA-signed certificate for the Thingworx instance to be allowed to use the broker.

If it is not a secured instance, then can you access the mqtt broker from outside your corporate firewall? The other big issue is getting from the cloud to your mqtt broker port through your firewall. It's not likely to be permitted without help from your IT department.

mliesegang1-VisitorAuthorAnswer
1-Visitor
October 11, 2016

Hello, In the meantime we understood that the MQTT extension was giving problems under Linux. MQTT extension on Thingworx Server running on Windows does not have any problems.

PTC offered a new MQTT extension begin of October and now the MQTT issue on Linux based Thingworx server is solved.

Solution: Use the latest MQTT extension from the marketplace.