Unfortunately with the new SDK there is no example which includes file transfer. I am able to successfully connect to the platform. I have included the full output from the program when run, as you can see it is able to connect the websocket, initialize the api and build the virtual filesystem.
[FORCE] 2017-11-02 17:10:14,714: Starting up...
[WARN ] 2017-11-02 17:10:14,714: SDK Version: 2.0.2
[WARN ] 2017-11-02 17:10:14,714: TLS Library: OpenSSL
[WARN ] 2017-11-02 17:10:14,715: TLS Library Version: 1.0.2l
[DEBUG] 2017-11-02 17:10:14,715: twWs_Create: Initializing Websocket Client for 188.8.131.52:80//Thingworx/WS
[DEBUG] 2017-11-02 17:10:14,715: twTlsClient_Create: Initializing TLS Client
[DEBUG] 2017-11-02 17:10:14,730: twApi_Initialize: Websocket Established after 0 tries
[DEBUG] 2017-11-02 17:10:14,730: subscribedPropsMgr_Initialize: Initializing subscribed properties manager
[DEBUG] 2017-11-02 17:10:14,731: API initialized
[DEBUG] 2017-11-02 17:10:14,731: added FileTransferExample to boundList
[DEBUG] 2017-11-02 17:10:14,731: twApi_BindThings: not currently connected, only binding things to api
[DEBUG] 2017-11-02 17:10:14,731: twMessage_Delete: Deleting BIND Message: 1
[DEBUG] 2017-11-02 17:10:14,731: Thing bound
[DEBUG] 2017-11-02 17:10:14,731: Virtual filesystem built
[DEBUG] 2017-11-02 17:10:14,732: twTlsClient_Reconnect: Re-establishing SSL context
[DEBUG] 2017-11-02 17:10:14,732: twTlsClient_Connect: Connecting to server
[DEBUG] 2017-11-02 17:10:15,801: ws_on_headers_complete: Websocket connected!
[INFO ] 2017-11-02 17:10:15,801: twWs_Connect: Websocket connected!
[DEBUG] 2017-11-02 17:10:15,802: twWs_SendMessage: Sent 60 bytes using 1 frames.
[DEBUG] 2017-11-02 17:10:15,896: twMessage_Delete: Deleting RESPONSE Message: 2
[DEBUG] 2017-11-02 17:10:15,896: twMessage_Delete: Deleting AUTH Message: 2
[DEBUG] 2017-11-02 17:10:15,896: twWs_SendMessage: Sent 38 bytes using 1 frames.
[DEBUG] 2017-11-02 17:10:16,43: twMessage_Delete: Deleting RESPONSE Message: 3
[DEBUG] 2017-11-02 17:10:16,43: twMessage_Delete: Deleting BIND Message: 3
[DEBUG] 2017-11-02 17:10:16,43: Connected to server
[DEBUG] 2017-11-02 17:10:16,43: Taking photo....
[DEBUG] 2017-11-02 17:10:17,118: Sending photo...
[DEBUG] 2017-11-02 17:10:17,118: getRealPath: Real path for FileTransferExample:out/outgoing.jpg = /transfer/outgoing/outgoing.jpg
[DEBUG] 2017-11-02 17:10:17,118: twWs_SendMessage: Sent 256 bytes using 1 frames.
[WARN ] 2017-11-02 17:10:47,152: api:sendMessageBlocking: Message 4 timed out
[INFO ] 2017-11-02 17:10:47,152: twMessageHandler_CleanupOldMessages: Message 4 timed out
[DEBUG] 2017-11-02 17:10:47,152: twMessage_Delete: Deleting REQUEST Message: 4
[ERROR] 2017-11-02 17:10:47,152: twFileManager_TransferFile: Error invoking Copy service on FileTransferSubsystem
[DEBUG] 2017-11-02 17:10:47,152: Photo Sent.
I've responded to your previous thread, there is an example suuplied with the new SDK. I'll copy here:
As of 2.0 there was a slight change in how the examples are provided. So, now there is a README_BUILDING.txt and CMakeLists.txt files , that along with the documentation, you may refer to to build your sample projects.The project SteamSensor will include all of the features enabled by default (again you may refer to the documentation to disable the ones you don't need)
In the new SDK under the SteamSensor example there is no mention of file transfer, or any example given of how to use it. The README_BUILDING.txt is just about how to run the example programs, which we already knew how to do in order to get this program running with the CSDK. We were not having any of these issues running on the old version 1.3 SDK, but we cannot find any examples or documentation about how to specifically use file transfer capabilities with the new version 2.0.2 SDK.
Thank you for your help!
Thank you for pointing that out. I attempted to run cmake with the flags in order to build the applications, but when I added that I got the same errors as before. I also noticed on the server side in the logs on the mashup I see this error:
ERROR - Error in invoking service Things_repositoryThing, LoadText, Things, repositoryThing, Services, LoadText. Error from the server: "File Does Not Exist"
I will be reaching out tomorrow regarding this. I took a look at the logs supplied here again, and I noticed this:
[DEBUG] 2017-11-02 17:10:47,152: Photo Sent.
It seems like despite the error the file still sent? Could you please verify?
Sushant Pandey correct me if I'm wrong, I believe you had some recent experience with a similar issue - any thoughts?
Polina Osipova Yeah I did come across this a while back and as far as I remember in my case the files were in fact getting copied but applicationLog was logging errors on invoking Copy service. There was a Jira filed for correcting the logging behaviour for that.
However, here you are right it will definitely be interesting to know whether or not files were copied. If not may be its also worth checking (not sure if already checked) whether or not user on RaspberryPi has required user access permissions on the folder structure where files in question are located.