Failed to transfer a file from remote TW server to local Ubuntu PC using C SDK
Hi,
I'm trying to get the file from remote TW server's SystemRepository to local file system, after calling all necessary C SDK v2.2.1 API functions:
twApi_Initialize(hostname, port, (char*)TW_URI, myPasswordCallback, NULL, MESSAGE_CHUNK_SIZE, MESSAGE_CHUNK_SIZE, (char)TRUE);
twApi_SetSelfSignedOk();
twApi_DisableCertValidation();
twApi_BindThing(thingName);
twcfg.file_xfer_staging_dir= (char*) "/home/davmel/stagingdir";
twFileManager_Create();
twFileManager_AddVirtualDir(thingName, (char*) "incoming", (char*) "/home/davmel/stagingdir/transfer/incoming");
twApi_Connect(CONNECT_TIMEOUT, twcfg.connect_retries);
Here all above calls return 0 error code.
But when I try here to get the remote file, I'm getting 1114 TW_GATEWAY_TIMEOUT error code.
err = twFileManager_GetFile(systemRepo, "outgoing", sourceFile, thingName, "/incoming", targetFile, 40000, FALSE, &tid1);
The remote thing thingName is created as thing based on RemoteThingWithFileTransfer template. When I run my program I can see that this thing is connected. I have #define ENABLE_FILE_XFER 1 in my header file.
Please suggest what can be done to overcome this issue.

