Skip to main content
1-Visitor
August 24, 2017
Question

Not able to Connect C sdk

  • August 24, 2017
  • 1 reply
  • 4251 views

Hey

I am not able to connect my C Sdk with the Thingworx Server

[FORCE] 2017-08-24 16:26:45,977: Starting up

[DEBUG] 2017-08-24 16:26:45,977: twWs_Create: Initializing Websocket Client for localhost:443//Thingworx/WS

[DEBUG] 2017-08-24 16:26:45,977: twTlsClient_Create: Initializing TLS Client

[DEBUG] 2017-08-24 16:26:45,979: twApi_Initialize: Websocket Established after 0 tries

[DEBUG] 2017-08-24 16:26:45,980: subscribedPropsMgr_Initialize: Initializing subscribed properties manager

[TRACE] 2017-08-24 16:26:45,980: All property subscriptions have been received from the server. Subscribed properties can now be updated.

[DEBUG] 2017-08-24 16:26:45,980: added SteamSensor1 to boundList

[DEBUG] 2017-08-24 16:26:45,980: twApi_BindThings: not currently connected, only binding things to api

[DEBUG] 2017-08-24 16:26:45,980: twMessage_Delete:  Deleting BIND Message: 1

[TRACE] 2017-08-24 16:26:45,980: twApi_Connect: Delaying 1 milliseconds before connecting

[DEBUG] 2017-08-24 16:26:45,981: twTlsClient_Reconnect: Re-establishing SSL context

[DEBUG] 2017-08-24 16:26:45,982: twTlsClient_Connect: Connecting to server

[ERROR] 2017-08-24 16:26:45,982: Error intializing socket connection.  Err = 111

[ERROR] 2017-08-24 16:26:45,982: twWs_Connect: Error restarting socket.  Error 111

[DEBUG] 2017-08-24 16:26:50,983: twTlsClient_Reconnect: Re-establishing SSL context

[DEBUG] 2017-08-24 16:26:50,984: twTlsClient_Connect: Connecting to server

[ERROR] 2017-08-24 16:26:50,984: Error intializing socket connection.  Err = 111

[ERROR] 2017-08-24 16:26:50,985: twWs_Connect: Error restarting socket.  Error 111

[DEBUG] 2017-08-24 16:26:55,985: twTlsClient_Reconnect: Re-establishing SSL context

[DEBUG] 2017-08-24 16:26:55,986: twTlsClient_Connect: Connecting to server

[ERROR] 2017-08-24 16:26:55,986: Error intializing socket connection.  Err = 111

[ERROR] 2017-08-24 16:26:55,986: twWs_Connect: Error restarting socket.  Error 111

[ERROR] 2017-08-24 16:27:00,986: twApi_Connect: Max number of connect retries: 3, has been reached

Everytime I am getting connection refused

1 reply

5-Regular Member
August 24, 2017

Hi Shruti, just to confirm are you configuring SSL connectivity with ThingWorx platform? Because the issue seems to be related to that, if ThingWorx is not configured for SSL connectivity please make sure it is. If in case you are not using SSL then make sure to disable it in the configuration file for CSDK.

1-Visitor
August 24, 2017

Hi Sushant

I have disabled the SSL by modifying the twConfig.h  and twTls.h in c SDK file and I tried with the stream sensor example but the error is same and I have done the SSL setting with this  link No SSL certification in C SDK

5-Regular Member
August 24, 2017

Shruti, would it be possible for you to share just the configuration part of your setup? One more thing, is the device running CSDK and ThingWorx are they both on different machines? If yes, are you able to reach ThingWorx URL from the device running CSDK? May be you could try pinging via the IP / or fully qualified domain name of the machine? Not sure if by any chance it's firewall somehow interfering with your connection