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

Community Tip - You can Bookmark boards, posts or articles that you'd like to access again easily! X

Not able to Connect C sdk

sshrivastava
1-Newbie

Not able to Connect C sdk

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

8 REPLIES 8

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.

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

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

HI Sushant

Thanks for replying, I am running thingworx on windows and c sdk on raspian environment as i am using raspberry pi and i am not able to reach thingworx server url from the same.

Shruti, interesting, most likely this is why you are not able to connect. what's the error code when you try to access the URL? have you tried pinging the IP of the Windows machine from raspberry pi, it'd be worth pinging vice versa. Are both machines on same network?

If the ping itself fails you might have to configure the firewall to allow connections to and fro from the Windows machine to Raspberry pi.

Hey,

Thanks for Ur reply

I am using office system and the windows firewall is customized and i am not able to disable tht firewall I think because of that i am not able to connect,

Otherwise I am using same network for both the machine. I think the issue is regarding the Firewall

You don't necessarily have to disable the firewall, if you can add the exception for raspberry pi or add the connection to incoming and outgoing rule, it should work as well. If you unsure or lacking the rights you can reach out to your network administrator or IT to help you with this.

supandey
19-Tanzanite
(To:supandey)

BTW, are you able to ping the raspberry pi IP from your windows machine?

Top Tags