8 Replies Latest reply on Aug 28, 2017 8:33 AM by supandey RSS
    sshrivastava 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

      • Re: Not able to Connect C sdk
        supandey Collaborator

        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.

          • Re: Not able to Connect C sdk
            sshrivastava Newbie

            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

              • Re: Not able to Connect C sdk
                supandey Collaborator

                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

                  • Re: Not able to Connect C sdk
                    sshrivastava Newbie

                    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.

                      • Re: Not able to Connect C sdk
                        supandey Collaborator

                        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.