I am writing an IoT sketch on the Yun that uses HttpClient to makes calls to various web API URLs.
I am running into memory issues, but from what I have read about using PROGMEM, it seams like it is best for working with data in a byte-by-byte (or word) manner.
Since client.get(string) requires a single complete string, is there any way to use flash memory to save ram space?
I might have an incorrect assumptions about how this works, but I thought that building a new string out of characters fetched from flash memory and then using that string for the http call would not help any
thanks for any advice
RAM issues, start with using the F() macro to get your constant prints into flash.
You don't have to assemble a complete string to send data through serial. As long as they go in order, you can send in pieces, even single chars.
Print from flash without a buffer:
byte printFlash( PGM_P FM )
byte fb; // flash byte
c = 0;
fb = pgm_read_byte( FM++ );
if ( fb ) Serial.print(( char ) fb );
while ( fb );
You can match serial input chars to text in flash, no-buffer character by character though that's more involved. I have an example sketch with C++ class to show matching one word, the same class can be used to match many different words. It's not beginner code but then beginners use Serial which is way more complicated!
I have an example sketch to try and teach how it's done,