I have an ESP32-based device connected to the Internet using WiFi. Sometimes it needs to download a "large" file (200-300 MB) but it does not need to store it. Instead, it needs to send it via SPI to another device. So, my idea is:
- Open a "stream" channel with the remote server
- Download the file in chunks
- When a chunk is downloaded send it over SPI
- Continue until the whole file is downloaded and transmitted
- Download and send the MD5 to the external device as well in order to check the integrity of the received file
I'm not expecting more than 10 devices downloading the same file at the same time. And no more than 30 devices downloading any file at the same time.
As a rough estimation, the SPI communication has a bandwith of less than 1 Mbit/s.
Ideally, it should also offer resume/progress features to easily restart from a specific byte if the connection drops.
Is there a ready-to-use protocol for this purpose or do I have to write a server application by myself? It will be a commercial device: I'm afraid SSL is mandatory here to provide enough protection, isnt'it?