Best Method? - Download Large Files to SD using Photon

My goal is to download a couple 4DSystem LCD display firmware files from an online server using the Photon and save those files to a SD card using the SDFAT library.

I’ve tried FTP but it’s slow and unreliable.

From what I have read the other options are TCP or HPPT transfer methods which I know nothing about other than there are some libraries available for those methods but the examples do not have anything resembling downloading files to an SD card.

I saw @rickkas7 saying he was seeing 300Kb per second download speeds and up to 900Kb download speeds using 3 connections.

I’m trying to figure out if this is easily possible or if downloading larger 100MB - up to 1Gig files to an SD card is feasible using the Photon or not. I feel like it should be possible with a solid library but I have not seen many others do from what I have seen in my searches so far.

Any advice is appreciated :slight_smile:

I would use HTTP, but for that file size I’d probably want a restartable HTTP client so if the transfer was interrupted you wouldn’t have to start all over from the beginning. It would be an interesting project and definitely feasible. I’ve transferred 1 GB in the other direction (off the Photon to a server) and it’s much faster, but it should also work to the Photon.

1 Like

Great, So it’s nice to know HPPT Is the recommended path to success with this.

Restartable HTTP downloads for sure makes a lot of sense.

I’m sure an HTTP library setup to download to an SD card could be useable for many different applications. I can see a few more personal uses for this also.

@rickkas7 I looked at your Github page and see you were recently working on downloading image files from the web for your Nextion displays so we’re kinda doing the same thing.

I’m kinda stuck on my PCB design trying to figure out if I can find a reliable way to do these larger firmware downloads reliably or not.

If this is something you think you could take on I can throw $200 your way for a working HTTP to SD library we could share with the community. This would allow me to move forward with my project the way I want it to work at least.

Or if you know of any working libraries that do the HTTP to SD even without the restartable HTTP client that would work for now.

I wish I could help more in creating a library like this but my coding and HTTP knowledge is not anywhere near what you other guys are capable of :slight_smile:

This library looks like exactly what I'm trying to accomplish but it was written years ago before the Photon.

I tried to load the library in Particle DEV but get 16 compile errors, it's not using the new SD fat library with DMA either so I'm sure there is room for improvements.

Posting this here in case it's helpful in some way.

Hi @RWB, do you have any update regarding this topic. I am interested in downloading mp3 files to sdcard too.

Curious if anyone has developed an HTTP client for downloading files? I need it in chunks so I can update another onboard processor, say 1kB chunks.