Expanding memory of uno using remote server

This is just a thought that just came to my mind and before trying to implement it in near future decide to ask if someone has done it before or if this is a working thing.

Im almost getting to the limit of unos memory using too much const strings. Like http headers html body that are constant in my case and are not changing. One way is to hookup sd card reader or some external memory and solve the problem.

But looking at softwareserial example its getting data from software serial and right away outputting to hardware and visa versa without any need to save in memory. Isnt it possible to write lines of text each line representing portion of the code that can be output without saving in variable just using 64kb hardware buffer?

Lets say uno is connected to esp and esp is acting like a web server so i have to sent all that http static data from arduino to esp for it to send to the browser. Instead of that im asking for that line of text from remote source and while getting it same time im outputting to esp which is gathering and sending to the requested browser.

Very soon i will be stucked with memory limit but dont want to jump to bigger memory board want to solve the problem without hardware changes.

Thanks.

Only way I could think of is to load the data directly to the register and send it. I'm not sure how to do it though.

Thats what I was trying to explain or parsing into a char variable and writing it write away to esp in my case which will be sitting and waiting for \r\n to send to browser. if the text line will be something like this:
1:HTTP 200 OK\r\n
2:hello world\r\n
etc.

then by defining
#define http 1
#define html_body 2
etc.

its possible to make a structure and keep control of data flow without need to save all these data in flash.

same code will be needed to get any static data from remote just by changing request to the lines.

Which memory are you running out of? Flash or RAM?

No experience with network related stuff in relation to Arduino so I do not know if you e.g. can e.g. run a webserver and an ftp client at the same time.

But it does not quite make sense to fetch a webpage from one server and next serve it from your webserver.

Running out of flash. All static http related stuff is read from progmem.

I dont mean reading webpage from remote storage but reading text and outputing directly to the other browser which needs that to interpret webpage correctly. If i will find time this weekend will try to make an example concept. That way will be easier to get the idea.

Robin2 posted this one Is it possible to initialize PROGMEM from a file? - Programming Questions - Arduino Forum

This is same idea except instead of reading from file which requires hardware changes i want to read from remote storage.

No need for 2 services ftp and http I can get text “code” via http by making small function which will start outputing to esp when it will read portion within tokens. So there will be needed only for a parser and no need to keep that static const data in progmem. If code is short then yes this is meaningless but if code is big with 10 and more pages then this would be best approach if my logic of implementing this is right.

OP, you seem to be going to a lot of trouble just to avoid buying a processor with more resources. The ESP8266 that you’re using as essentially a simple modem has more memory (RAM / Flash) and more processing power than the UNO. Write your application directly in there. It also has SPIFFS that allows you to save your .html as a complete file that can be served up on demand. There’s also the added bonus of allowing you to stop using buggy SoftwareSerial.

Need more resources / power? Get an ESP32.

Then when i will reach to the limit of esp32 then change the hardware again? My point is to use remote storage to eliminate that memory problem in future if its doable.

surepic:
Then when i will reach to the limit of esp32

Unlikely. Working within the confines of an Uno will constrain you before that.