This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CCS: How to send around 4KB of data using Http.

Tool/software: Code Composer Studio

I need to send data of multiple files stored in SD card using http. 

All the files stored in SD card are of 4KB or more size.

I need to read the data of all the existing files stored during a particular interval of time and send using http protocol or if there is any other way to send the data.

  • Hi,

    The most straightforward option would be to combine the fatsd example and the httpget example from the SDK.

    With the fatsd example, you should be able to perform file read operations from the SD card, while the httpget example demonstrates how to perform HTTP requests to remote servers.

    I suggest you start with trying out both examples separetely, so that you can get the SD file read done on your hardware as well as perform the HTTP request to your remote server.

    Then, I suggest you take the httpget example as the base, and copy over the SD card code so that you have both required sets of functionality in one application.

    Let me know if you need more clarification or have further questions on sending your SD card data over HTTP.

    Regards,

    Michael

  • Hi Michael,

    I have already tried reading data from SD card and sending via HTTP. 

    I am able to send data through http but the problem comes when I try to send very large amount of data , because I have to read that much data from SD card and if some error comes in http the whole process gets halted and the board restarts.

    The data is stored in SD card when there is no connectivity if I take a case where there is no internet connectivity for about 10 minutes there will be a very large amount of data stored in SD card.

    I just want to know that how to send large chunks of data after reading from SD card and handle it properly even If I get error from http due to connectivity issue or any other reason , or if the board restarts.

    Is there any pre implemented method or any example that can handle the critical cases and scenarios while doing the above mentioned steps like- maintaining file offsets from where I can start reading the data and send after the board restarts or during an error.

    Regards,

    Saikat

  • Hi Saikat,

    The error behavior of the application in case of an HTTP error should  be modifiable according to your application needs. Perhaps you can implement an exception-catching mechanism where if an HTTP send encounters an error, the same chunk is repeated, without a whole board restart.

    There is unfortunately no SD card example or HTTP upload example which demonstrates how to perform file resume and maintaining file offsets. You could take a look at the cloud_ota example to see how you could perform HTTP-based data transfers, but given the complexity of that example you would most likely be better off making your own SD + HTTP upload and exception handling code.

    Regards,

    Michael