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

Unable to download file from TWX-remoteRepository to edge-device with C-SDK using twFileManager_Get

Highlighted
Participant

Unable to download file from TWX-remoteRepository to edge-device with C-SDK using twFileManager_Get

Hi,
In our customer release, we need to download a file from Thingworx remote Repository to the system where C-SDK edge server is running.

We are trying the same with get file api in the below format, but its giving some errors and we are not able to achieve this.

twFileManager_GetFile("SystemRepository", "/", "test.txt", pConfigparam->m_ThingName, "twx", "\\test.txt", 0, TRUE, &tid);

1) we have tried transferring from SDK to TWX repository, that works with below format.
twFileManager_GetFile(pConfigparam->m_ThingName, "twx","test.txt", "SystemRepository", "\\", "test.txt", 60, TRUE, &tid);
2) When transferring from systemrepo (Thingworx) ,we get errors using the twFileManager_GetFile api.

Please suggest us how we can achieve this, provide us the steps/samples to do the same.

6 REPLIES 6

Re: Unable to download file from TWX-remoteRepository to edge-device with C-SDK using twFileManager

Could you invoke the copy command from the platform side to do the transfer?

Re: Unable to download file from TWX-remoteRepository to edge-device with C-SDK using twFileManager

@PaiChung Thanks for your reply.

 

I have tried with copy service also with the same params which i am using in the getfile TW-Cdsk api.

The copy service is able to download the file to the target directory successfully, but i am facing the  issue  with the file size --i.e.

1) if the file size is < 2-3 mb i am able to download it successfully.

2) if the file size  is greater than that in our case its 18+ mb, then its showing error.  The errors are different.  

a) sometimes it is saying thingname is not connected after some some minutes of calling the service may be(2-3 minutes) , however the edge server is always connected.

b) sometimes i am getting ThingworxApi timeout issues after some minutes of calling the service.

 

Please help us out how we can resolve these issues.

Also we want to know how we can achieve this with the C-SDK itself, i can share the related logs as well.

 

Regards,

 

Ayush

Re: Unable to download file from TWX-remoteRepository to edge-device with C-SDK using twFileManager

The Filetransfer subsystem in the Thingworx platform has some configuration, perhaps check those?

Re: Unable to download file from TWX-remoteRepository to edge-device with C-SDK using twFileManager

@PaiChung Thanks Pai for your suggestion.

 

I made it work somehow, it was not working with my Local server configuration. While using development server i was able to download the file of 18 mb using C-sdk edge server with same params as mentioned earlier.But it is taking around 30-40 minutes in downloading 18 mb (tar.gz extenstion) file .

my observation is:

1) its storing 8-8 kbs in staging directory and transferring one by one, there will be one intermediate dir also which will accumulate the data, that i didn't found.

2) After some time (35-40) minutes, i see the file transferred successfully at the target directory.

 

My question is

1) is there any way to optimize this process further, by which we can obtain faster data transfer.

2) does this highly dependent on network speed ? (p.s: i am connected to vpn so network is slow ).

 

Regards,

 

Ayush

Re: Unable to download file from TWX-remoteRepository to edge-device with C-SDK using twFileManager

The chunking is common.

Yes it will be dependent on your network speed

I am not too sure if there are ways to speed it up

Re: Unable to download file from TWX-remoteRepository to edge-device with C-SDK using twFileManager

Okay, Thanks for your inputs @PaiChung , it really helped.