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 ?
Does the topic name has to be correct to get a least a connection to the MQTT server ?
But nevertheless, I did a check on the topic name (seems alright) but problem still exists.
I delete and created the thing several times from scratch but with the same results: Unable to connect to MQTT in [MQTT Test] : MqttException
Just a test that could help you:
Could you try to had the JAVA_OPTS=”-Duser.dir=/tmp” in the setenv.sh or catalina.sh file depending of your configuration.
I suppose the JAVA_OPTS already exist so just append ”-Duser.dir=/tmp” to it.
Of course /tmp is a folder where user gets all permissions and you can choose whatever folder you want.
After adding this line verify that variable have been correctly exported by setting an echo $JAVA_OPTS.
You need to restart your tomcat server after such modification.
Please let me know if this answer help you.
I would assume that the MQTT broker port cannot be reached from the Vuforia Studio Thingworx instance, I guess outbound connections are locked down.
I would recommend that you use the Thingworx Federation concept, so connect to MQTT from a Thingworx instance that can access the broker and then subscribe to the properties of the connected thing from the Vuforia instance via Federation. The two Thingworx instances in Federationa are communicating using the TWX edge protocol on https port which should be open even in the hosted pilot setup.
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.
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.