15 Replies Latest reply on Sep 30, 2016 4:25 AM by vprakash RSS
    vprakash Explorer

    Thingworx connection failed with error - 110

    I am trying to connect server 52.197.80.207 through c-sdk but getting 110 error. as below

    [ERROR] 2016-09-20 07:40:24,230: Error intializing socket connection. Err = 110

    [ERROR] 2016-09-20 07:40:24,230: twWs_Connect: Error restarting socket. Error 110


    tried to ping the server but it got timed out.

     

    Any suggestions please.

      • Re: Thingworx connection failed with error - 110
        ttielebein Collaborator

        Are you sure the app key has been configured properly?

        • Re: Thingworx connection failed with error - 110
          vprakash Explorer

          Well i am able to launch the foundation server using host and app_key combination. So i think app_key is configured properly. I am not even able to ping the server.

          • Re: Thingworx connection failed with error - 110
            Ravi Upadhyay Communicator

            Hi VED PRAKASH

            You can solved the SSL - Error with the following change in twTls.c:

             

            default:

            line 43/44:

            tls->validateCert = TRUE;

            tls->isEnabled = TRUE;

             

            changing it to :

             

            ls->validateCert = FALSE;

            tls->isEnabled = FALSE;

             

            has solved SSL Error .

             

             

            Please let me know if it helps else we can explore other options what might be protecting you to establish a SSL connection.

             

            I would also suggest going through the below link :

             

            Sending Data from C - Files or XML - Files from Client to specific Thingworx Server

              • Re: Thingworx connection failed with error - 110
                vprakash Explorer

                Hi ravi,

                 

                I am able to connect but now I am trying to create a thing and register it to API but I am getting error as below

                2016-09-29 13:04:54,601:SDK-Log: twWs_SendMessage: Sent 167 bytes using 1 frames.

                2016-09-29 13:05:00,334:SDK-Log: twMessage_Delete:  Deleting RESPONSE Message: 2

                2016-09-29 13:05:00,340:SDK-Log: twMessage_Delete:  Deleting REQUEST Message: 2

                Sep 29 11:52:16: InvokeService RegisterConnection. failed Return value =  1110

                Sep 29 11:52:16: InvokeService RegisterConnection.  Return value =  101

                Sep 29 11:52:16: twApi thing *0A:75:04:AB:2D registeration failed with error 101

                 

                I am using below caode to register the Thing with API.

                 

                int TW_controller::Register()

                {

                   twDataShape *ds = NULL;

                   twInfoTableRow *row = NULL;

                 

                 

                   twInfoTable *values = NULL;

                   twInfoTable *result = NULL;

                   twDataShapeEntry *dsthingEntry = NULL;

                   twDataShapeEntry *dsappkeyEntry = NULL;

                 

                 

                   /*Initilizing with some random value as retun values to this var is "0" or positive integer*/

                   int res = -1;

                   int finalResult = -1;

                   int err,err1,err2,err3;

                   dsthingEntry = twDataShapeEntry_Create(STR_REGISTER_THING_NAME, NULL, TW_STRING);

                   if(dsthingEntry)

                   {

                     twLog(TW_Debug,"Register: DataShapeEntry for Thing is Created");

                  ds = twDataShape_Create(dsthingEntry);

                  if(ds)

                  {

                  twLog(TW_Debug,"Register: DataShape Created");

                  }

                  else

                  {

                  twLog(TW_Error,"Register: DataShape Created");

                  }

                   }

                   else

                   {

                    twLog(TW_Error,"Register: DataShapeEntry for Thing is not Created");

                   }

                  

                   dsappkeyEntry = twDataShapeEntry_Create(STR_REGISTER_APPKEY, NULL, TW_STRING);

                   if(dsappkeyEntry)

                   {

                     twLog(TW_Debug,"Register: DataShapeEntry for Appkey is Created");

                   }

                   else

                   {

                    twLog(TW_Error,"Register: DataShapeEntry for Appkey is not Created");

                   }

                  

                   err3 = twDataShape_AddEntry(ds, dsappkeyEntry);

                   if(err3 == TW_OK)

                   {

                     twLog(TW_Debug,"Register: twDataShape_AddEntry succcess");

                   }

                   else

                   {

                    twLog(TW_Error,"Register: twDataShape_AddEntry failed with error %d",err3);

                   }

                  

                   values = twInfoTable_Create(ds);

                 

                 

                   if (!values)

                   {

                        twLog(TW_Error,"Register: Error creating infotable");

                        twDataShape_Delete(ds);

                        return TWX_INTERNAL_SERVER_ERROR;

                   }

                 

                 

                   row = twInfoTableRow_Create(twPrimitive_CreateFromString(this->thing, TRUE));

                   if(row)

                   {

                  twLog(TW_Debug,"Register: Row Created");

                   err1 = twInfoTableRow_AddEntry(row, twPrimitive_CreateFromString(this->app_key, TRUE));

                   if(err1 == TW_OK)

                   {

                   twLog(TW_Debug,"Register: twInfoTableRow_AddEntry success");

                   }

                   else

                   {

                   twLog(TW_Error,"Register: twInfoTableRow_AddEntry Failed withh error %d",err1);

                   }

                   err2 = twInfoTable_AddRow(values, row);

                   if(err2 == TW_OK)

                   {

                   twLog(TW_Debug,"Register: twInfoTable_AddRow success");

                   }

                   else

                   {

                   twLog(TW_Error,"Register: twInfoTable_AddRow Failed withh error %d",err2);

                   }

                   }

                 

                 

                   res = twApi_InvokeService(TW_THING, GLOBAL_THING_NAME, REGISTER_SERVICE_NAME, values,&result, -1, FALSE);

                   if(res == TW_OK)

                   {

                   twLog(TW_Debug,"InvokeService %s.  success",REGISTER_SERVICE_NAME);

                   }

                   else

                   {

                  twLog(TW_Error,"InvokeService %s. failed Return value =  %d",REGISTER_SERVICE_NAME, res);  

                   }

                 

                 

                   err = twInfoTable_GetInteger(result, "result", 0, &finalResult);

                   if(err == TW_OK)

                   {

                   twLog(TW_Debug,"InvokeService %s.  Return value =  %d",REGISTER_SERVICE_NAME, finalResult);

                   }

                   else

                   {

                  twLog(TW_Error,"InvokeService %s.  Return value =  %d",REGISTER_SERVICE_NAME, err);  

                   }

                 

                 

                   /*Cleaning up the temporary DataShapes/infoTables*/

                   /*twDataShape_Delete(ds);*/

                   twInfoTable_Delete(values);

                   twInfoTable_Delete(result);

                 

                 

                   return err;

                 

                 

                }

                 

                Please suggest me. What to do or I need to do some setup as server. FYI I am using 30 days trial version provided by PTC.

              • Re: Thingworx connection failed with error - 110
                Ravi Upadhyay Communicator

                101 TW_INVALID_PARAM

                The parameter value is not allowed. Typically indicative of a NULL pointer being passed in where a

                NULL pointer is not allowed.

                  • Re: Thingworx connection failed with error - 110
                    vprakash Explorer

                    But the error 1110 suggest as intenal server error. If i am not wrong request for thing registereration sent but server threw OxA0 error. I tried to work on flow but coudn't get anything wrong with flow so only i looked at community. As per my logs my code is working fine before twApi_invokeservice . So i am not able to find what could be Null at this point. And moreover i am not able to find which piece of code in library is throwing TWX_INTERNAL_SERVER_ERROR  1110. please suggest me if you are aware of this.

                  • Re: Thingworx connection failed with error - 110
                    Ravi Upadhyay Communicator

                    I am not sure which piece of code in library is throwing TWX_INTERNAL_SERVER_ERROR  1110. However what I can tell you is there is something wrong at Server side and an error occurred on the ThingWorx Platform while processing this request.

                     

                    Can you bounce the server and try again.

                    • Re: Thingworx connection failed with error - 110
                      Ravi Upadhyay Communicator

                      Benno Haunert If you can Please check the correct answer works for you or not .

                       

                      Let me know if you find it useful.

                        • Re: Thingworx connection failed with error - 110
                          vprakash Explorer

                          I tried it rebouncing the server but it failed again at same point..

                          Sep 30 06:31:58: twApi connected with host 52.197.80.207

                          Sep 30 06:31:58: twApi thing CAT000000A_75_04_AB_2D is Created

                          Sep 30 06:31:58: Register: DataShapeEntry for Thing is Created

                          Sep 30 06:31:58: Register: DataShape Created

                          Sep 30 06:31:58: Register: Row Created

                          Sep 30 06:31:58: Register: twInfoTable_AddRow success

                          2016-09-30 06:31:58,920:SDK-Log: twWs_SendMessage: Sent 124 bytes using 1 frames.

                          2016-09-30 06:32:01,448:SDK-Log: twMessage_Delete:  Deleting RESPONSE Message: 2

                          2016-09-30 06:32:01,455:SDK-Log: twMessage_Delete:  Deleting REQUEST Message: 2

                          Sep 30 06:32:01: InvokeService RegisterConnection. failed Return value =  1110

                          Sep 30 06:32:01: InvokeService RegisterConnection.  Return value =  101

                          Sep 30 06:32:01: twApi thing CAT000000A_75_04_AB_2D registeration failed with error 1110

                           

                          Is there something we need to do some setting for Things like we generate app key from security bar in server.