cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Visit the PTCooler (the community lounge) to get to know your fellow community members and check out some of Dale's Friday Humor posts! X

ThingWorx Azure IoT Hub Connector Not Starting Correctly

Laurak9
6-Contributor

ThingWorx Azure IoT Hub Connector Not Starting Correctly

Hi All,

 

I've been working on getting this Azure IoT Hub Connector started for a while now, and it finally seemed like it was going to work however, when I enter the 'azure-iot.bat' command there's no output in my command prompt but the connection server appears in my ThingWorx platform.  While the command prompt is open, the cxserver file grows rapidly.  Then, if the command prompt is closed the connection server disappears from ThingWorx.

 

Is this normal behavior for the connector? Everything I've read says it should start to process data after entering the 'azure-iot.bat' command but I get no output in command prompt.  The images contain the different errors I am getting in my cxserver file.

 

azure iot hub connector error.pngazure iot hub connector error 2.png

1 ACCEPTED SOLUTION

Accepted Solutions
slangley
23-Emerald II
(To:slangley)

Hi @Laurak9.

 

To answer your questions, when you execute the azure-iot.bat command, you are in fact starting the connector.  This window will need to remain open otherwise the connector shuts down.  This is by design.  This explains why you only see the connector in ThingWorx when the command prompt window is open.

 

In regard to the errors from the cxserver.log, are you still seeing the "entity does not exist error" or are you now seeing different errors?  If the former, please make sure you have followed the instructions from the ThingWorx Help Center for creating the thing.  The connector will not create the thing automatically--you will need to do so.

 

Regards.

 

--Sharon

View solution in original post

12 REPLIES 12
slangley
23-Emerald II
(To:Laurak9)

Hi @Laurak9.

 

The behavior you are seeing is not normal.

 

We would need the following to troubleshoot:

 

  • The configuration in Azure
  • The azure-iot.conf file
  • Also, when running azure-iot.bat if you could output to a file, that would be helpful:  azure-iot.bat > azure-iot.log

 

Regards.

 

--Sharon

Laurak9
6-Contributor
(To:slangley)

Hi Sharon,

 

I attached the azure-iot.conf file.  When I tried to output azure-iot.bat to a file, there is no output in the file.

 

Could you give some clarification on what you mean by configuration in Azure?

slangley
23-Emerald II
(To:Laurak9)

Hi @Laurak9.

 

Thank you for your follow-up.

 

Did you scrub the azure-iot.conf file before sending?  It's hard to tell if some of the fields were scrubbed or not.

 

I am attaching the .conf file from an installation I tested a few months ago.  It hasn't been scrubbed since the values are no longer valid.  You can use this to see what kind of information is needed.  Also, in case you're not aware, this page from the ThingWorx Help Center provides detailed set up instructions including the configuration needed on the Azure side.

 

Something to note, however, is that the instructions are incorrect regarding the consumerGroup.  Don't use $Default.  You will need to set up a consumerGroup in Azure specifically for this connection.

 

Also, in the .conf file, you have some other parms that I'm not familiar with, so I recommend doing a comparison to the .conf I'm providing.

 

Once you have reviewed the instructions and made the needed updates to your configuration, please let me know if you still have issues.

 

Regards.

 

--Sharon

Laurak9
6-Contributor
(To:slangley)

Hi, 

I compared the conf files and changed the consumer group, but I'm still getting the same error message.

 

The link you provided to the installation guide is what I have been using throughout this process to setup the connector, is there something specific in Azure that you think may need to be checked?

What version of Java are you using ? The latest builds of Java 8 are not compatible with the IoT hub JAR used by the ThingWorx Azure IoT Hub Connector

See https://www.ptc.com/en/support/article?n=CS300690

Laurak9
6-Contributor
(To:smainente)

I am using the newest version and those are the errors I'm seeing!  I installed 1.8.131 and those errors are gone thanks so much! 

But I now have the following in my cxserver file, in image attached, and no output in my command prompt.

slangley
23-Emerald II
(To:Laurak9)

Hi @Laurak9.

 

Have you read through this information on the ThingWorx Help Center?

 

If you're unable to determine the cause of the problem, we would need to see your updated azure-iot.conf file, logs, and screenshots of the configuration in Azure.

 

Regards.

 

--Sharon

Laurak9
6-Contributor
(To:slangley)

Hi @slangley 

I am looking through the information you provided, however, is it supposed to be completed before or after the connector is started?  If the ThingWorx components need to be completed before, maybe I'm misunderstanding the guide as to what the connector is supposed to do.

 

These issues are still present:

  • No data output after running the azure-iot.bat command
  • Command prompt keeps running - which increases the size of the cxserver.log file
  • Connector is only shown in ThingWorx while the command prompt is open
  • Along with the errors in the cxserver.log file

 

Again, would you be able to clarify what it is you would like to see from our Azure environment?

 

I just removed the extra lines I had commented out in the conf file, but I attached it again, along with the cxserver.log file.

 

Thanks.

slangley
23-Emerald II
(To:Laurak9)

Hi @Laurak9.

 

Within the ThingWorx Help Center documentation, look for Configuring the Azure IoT Hub Connector.

 

This page shows the information that needs to be captured from the Azure IoT Hub for configuring the Connector.  Keep in mind that step 8 regarding use of the $Default consumer group is incorrect.  You need to create a consumer group to be used only by the Azure IoT Hub to avoid issues.

 

Did you complete these steps from the online help:

 

 

If so, was your test successful?  Assuming it was, proceed to Interacting with Azure Edge Devices through ThingWorx section of the online help for additional details in setting up your environment.

 

Also, did you scrub the azure-iot config file before sending it?  If not, it's missing all the configuration settings from your Azure IoT Hub instance.

 

Please let me know if you have further questions

 

Regards.

 

--Sharon

Laurak9
6-Contributor
(To:slangley)

Okay, you meant the information needed for the configuration file for the connector, not just a configuration within our Azure environment. Thank you for clarifying.

 

Yes, I've gone through all these steps, they are successful up until starting the connector when I have the following issues: 

  • No data output after running the azure-iot.bat command
  • Command prompt keeps running - which increases the size of the cxserver.log file
  • Connector is only shown in ThingWorx while the command prompt is open
  • Along with the errors in the cxserver.log file

 

Yes, I had to scrub the conf file before posting here.

 

I'm still unsure if the issues I have mentioned are normal when starting the connector as they don't align with what I have read in the documentation.


slangley
23-Emerald II
(To:slangley)

Hi @Laurak9.

 

To answer your questions, when you execute the azure-iot.bat command, you are in fact starting the connector.  This window will need to remain open otherwise the connector shuts down.  This is by design.  This explains why you only see the connector in ThingWorx when the command prompt window is open.

 

In regard to the errors from the cxserver.log, are you still seeing the "entity does not exist error" or are you now seeing different errors?  If the former, please make sure you have followed the instructions from the ThingWorx Help Center for creating the thing.  The connector will not create the thing automatically--you will need to do so.

 

Regards.

 

--Sharon

slangley
23-Emerald II
(To:slangley)

Hi @Laurak9.

 

If one of the previous responses helped to resolve your issue, please mark the appropriate one as the Accepted Solution for the benefit of others with the same issue.

 

Regards.

 

--Sharon

Top Tags