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

Problem connecting C SDK to Thingworx composer

Re: Problem connecting C SDK to Thingworx composer

Sorry i somehow missed to reply, so what i wanted to reply yesterday to you is to ask you if you had tried without the secured websocket connection just to see if it works that way. i.e. by using 8080/80

Re: Problem connecting C SDK to Thingworx composer

No 80/8080 doesn't work. Just checked it. Error: "Error initialising SSL connection"

For using port 80 I used #define NO_TLS statement at the top of main.c code. For using 8080 I changed 80 to 8080 in if/else statement under main() function.


By the way just for clarification: The port no depends on http/https. Right? In this case the thingworx developer portal has HTTPS in the weblink

Re: Problem connecting C SDK to Thingworx composer

Hi Amit,

Can you please check whether your Application Key is not expired from the Application Key which you are using? Are you building the C SDK examples using CMake? After building the C SDK examples, just go to the main.c file for SteamSensor example.

Check the line which is in bold into your code of the main.c file for SteamSensor example and change it to 80 or 8080.

#if defined NO_TLS

#define TW_PORT 8080

#else

#define TW_PORT 443    //change it to 80 or 8080

#endif

Hope so it will work.

Thanks,

Aditya

Re: Problem connecting C SDK to Thingworx composer

Hi Aditya,

Yes I am building the C SDK example with CMake. My application key had expired. Thanks for pointing that out. But even after correcting it and modifying the main.c by replacing 443 with 80 or 8080 it doesn't work and gives the same error.

Re: Problem connecting C SDK to Thingworx composer

Amit you are right to understand with HTTPS you'll 443 as the standard port (this could change of course) and 80/8080 would normally be for the HTTP. These settings are configured in the server.xml file. In this case it's challenging for you because you don't have access to that file due to the hosted instance, I wanted to find out sometime to basically set it up exactly the same and do this test. I will check with the team about the correct ports for your hosted trial instance.

The other option for you could be to download the trial instance and install locally and then set this up. That way you'll have more control over the what ports to use as you will be able to configure them yourself in the server.xml file.

Re: Problem connecting C SDK to Thingworx composer

Can you please try it with TLS port as below:

#define TW_TLS_INCLUDE "twNoTls.h"

#define NO_TLS

#if defined NO_TLS

#define TW_PORT 443

#else

#define TW_PORT 443

#endif

Re: Problem connecting C SDK to Thingworx composer

It still doesn't work. However if you have used #define NO_TLS shouldn't the port no. be 80/8080 instead of 443?

In any case I tried both the port no. for the above mentioned code snippet and it still gives the same error. In both cases it tries to initialise TLS connection even though #define NO_TLS is used.

Highlighted

Re: Problem connecting C SDK to Thingworx composer

Same issue, tried different ports with or without SSL.

With SSL I get:

Error intializing SSL connection

Without SSL I get:

Error trying to connect

I'm using the .NET SDK: SteamSensor example

Would be nice to have a guide for hosted trial platforms.