Community Tip - When posting, your subject should be specific and summarize your question. Here are some additional tips on asking a great question. X
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.
Solved! Go to Solution.
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
Are you sure the app key has been configured properly?
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.
Ved, the errors you noted would usually mean that the connection was never successfully initialized. Do you have a firewall by any chance? Can you try adding outbound port rules or temporarily turning off the firewall and retrying? Are you trying to connect over http or ssl?
I am trying to connect through my Linux ECM. I am using http. I am capturing log. I am getting that twApi_initialized successfully.
If you can't ping that server from your Linux machine, either you don't have an outbound packet flow or that server is not accepting incoming connections. Since you mentioned http, have you disabled certificate validation?
I am able to ping other servers and its success. Same thingworx server I tried to ping from window too but it got timed out.
Right, so that would mean that this server has something blocking incoming connections. Can you try allowing connections through port 80 (or 8080) and 443 (or 8443) depending on how you've set it up?
I have defines both ports 80 and 443. My app is trying to connect through 443.
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
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.
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.
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.
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.
Benno Haunert If you can Please check the correct answer works for you or not .
Let me know if you find it useful.
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.