-->
Page 1 of 2

How to send lot of raw data to computer?

PostPosted: Sat Jun 02, 2018 1:05 am
by Smajdalf
Hi,
in my project I am collecting data and saving them to an external flash memory in a raw format. Currently to retrieve the data I take the flash chip away and read it via Arduino. I would like to add ESP8266 to have access to the data wirelessly. I managed to configure the ESP8266 as a web server, sending hello word via server.send() command (in Arduino IDE) when accessed on WLAN. But this way I need to have the whole data prepared (in RAM?) at time of executing the send() command. I would like to send the web page in chunks - only a header, than read first page of the external flash, preprocess it to a better readable form and send it to the client and repeat until whole flash is read. How can I do this?
Thanks

Re: How to send lot of raw data to computer?

PostPosted: Sat Jun 02, 2018 2:06 pm
by McChubby007
One way is to recode the binary as text via base64 encode/decode. That way you are sure not to get any odd mis-interpretations it is what uuencode/decode does for mail transfer etc.

I actually use base91 which is a slightly more efficient form similar to base 64.

Re: How to send lot of raw data to computer?

PostPosted: Sat Jun 02, 2018 2:34 pm
by Smajdalf
I think this does not solve my problem: I have "a lot of data" - up to 4Mbit so I cannot read it whole to the RAM and then send it via server.send() and I think it is a poor way to copy the external flash to internal flash to send whole data server.streamFile().

Re: How to send lot of raw data to computer?

PostPosted: Sat Jun 02, 2018 9:55 pm
by gdsports
The ESP8266 Arduino package includes two examples that might help. FSBrowser is a web server file browser (upload, download, delete, etc.) for files stored in SPIFFS. SDWebServer is similar but for files stored on an SD card.