B4R Question ESP8266 Download large files from an HTTP server

Toley

Active Member
Licensed User
Longtime User
Hi, I would like to download larges images from a HTTP server with an ESP8266. But I cannot get the entire image in 1 shot. I need to send a command to get a partial chunk of the image, save it to an external flash then request another part until I have it all.

Is someone know a way to do that? Thanks.
 

Toley

Active Member
Licensed User
Longtime User
Thanks Erel, actually not an SD card but an external flash memory. It takes up to 4 ms to write 256 bytes on that memory. I don't have enough Ram to store the entire file.
 
Upvote 0

Toley

Active Member
Licensed User
Longtime User
Thanks again Erel, but let me explain a little bit more the situation I have to live with. I'm working on a board that has already been designed (and produced) so unless there is no other solution, I cannot change the hardware. The Wifi Module is connected to an external MCU via it's UART port. The original goal of the design was to use AT-Commands. The flash memory is on the other MCU (a small STM32) on the SPI bus.

Now I'm thinking of reprogramming the ESP8266 with B4R since I don't think AT-Commands can do the job. Like I said the goal is to download larges images from an HTTP server, transfer them via UART to the other MCU and write them to the external flash. But since the write time to the flash is very slow, I cannot do that in real time.
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
But since the write time to the flash is very slow, I cannot do that in real time.
I'm not sure that this is true. You can add a delay in the NewData event. It is worth testing.

There is no way to get the image in chunks. You can make multiple calls and discard different parts of the data each time.
 
Upvote 0
Top