Transfer txt file from SD card to cloud

Hi all!

I’m using SDFat to sucesssfully write a txt file to an SD card and append it as I collect data from my electron.

Can someone fill me in on a best practice to request and transfer the data on the SD card (txt file) and from a remote location.

THANKS!

There are several options that I can think of…

  • First one that comes to mind is an FTP transfer. FTP is will known and easy to use. The downside is security (or lack there of). I believe there is an FTP library floating around. I do not know if you can do SFTP because of the encryption keys. You could trigger the FTP send by using a pub/sub event.

  • You could do a direct TCP connection to a server in order to transfer the file. The server will have to be running some sort of service that listens for the data and stores it upon receipt. The service is up to you to code or source.

  • You could post your data to an HTTP endpoint using the HTTPClient library. Depending on the size of the file, you will have to chunk the data up and send in multiple posts. You will need some sort of server with HTTP service/app running on it.

  • Use a webhook to get your data to a 3rd party storage service such as Google Iot or Azure. Again, I think you have to chunk up your data and send in multiple posts/packets which you have to reassemble on the 3rd party site.

Several other topics that you can research:

If you are using a Photon, then @ninjatill recommendation of the ParticleFTPClient is the best.

If you are using an Electron, you will find FTP solution to be excruciatingly slow. In that case, a custom TCP connection would make more sense (speed-wise).

Thanks! We are looking into the TCP option now.