What kind of connection string do you mean?
#define TW_HOST "xxx.xx.xx.xx" //IP Adress of my thingworx server (I am able to ping the server from my client)
#define TW_URI "Thingworx/WS"
The Adress in the browser of my server is:
I wasn't able to connect with the OOTB source so I modified some values.
In the main.c I modified the thingName to the name of the created thing in my Thnigworx Composer.
I also modified the TW_HOST and the TW_APP_KEY.
In the twTls.c I modified the two variables like
tls->validateCert = FALSE;
tls->isEnabled = FALSE;
because I got SSL Connection errors. After this modification I don't get this SSL errors anymore.
In the twDefaultSettings.h I don't modified something. My TW_URI looks like:
Thank you for your response!
You don't want to go into the twTls.c or twDefaultSettings.h file and change anything right away. Let's start with a fresh copy of the OOTB C SDK and modify the following:
- char * thingName = "SteamSensor1"; <-- This should equal whatever the entity name you've created in ThingWorx as your RemoteThing
- #define TW_HOST "localhost" <-- If your server and C SDK are running on the same machine "localhost" will suffice
- #define TW_APP_KEY "1724be81-fa15-4485-a966-287bf8f6683c" <-- Obviously you'll need to fill in-between the quotation marks with your AppKey in your server
- In the beginning of the main function there is a port #if defined section. If you are using port 80 just put the line, #define NO_TLS, above that section in the main function
- The final part you'll want to add right around the top of the main function is twApi_DisableEncryption(); That will prevent you from having to go in and change those pointers in twTls.c
This should be all you need to do for proper communication to occur. If this still does not work let me know and post any error message you are seeing.
So I have done the steps you mentioned on a fresh copy of the OOTB C SDK:
1. char * thingName = "exampleApp";
2. #define TW_HOST "172.27.30.68" <-- my server is running on antother machine (WIN 7)
3. #define TW_APP_KEY "1724be81-fa15-4485-a966-287bf8f6683c" <-- change this value to my generated app key
- I am not using port 80, so I don't add the #define NO_TLS. I am using the port 8080
- I also tried it with changing the value below from 443 to 8080 in my previous trials
- I think I have to change it to 8080 or is the 443 the port of a intern proxy?
5. I've added the twApi_DisableEncryption(); before the twApi_Initialize(); in the main function
No I am getting the following output. It seems there's no possibilty to build the socket.
If I am changing the port from 443 to 8080 I am getting the SSL Error again. This failure I have solved with changing the pointers in twTls.c, because i read about that in another dissucsion. So now I am getting this error without changing the pointers.
I also deactivated all firewalls server - sided, where my thingworx composser is running.