Go Down

Topic: How to use SD and WiFi at the same time ? (Read 1 time) previous topic - next topic

SurferTim

Quote
If I do the SD and then do the WiFi in a separate method (like I had it with connectToNetwork, then it fails still.

Fails how? Doesn't print the mac? Doesn't connect? What is the last thing displayed before the fail?

Anonymouslemming


Fails how? Doesn't print the mac? Doesn't connect? What is the last thing displayed before the fail?



After uploading the sketch, all I get is
Code: [Select]
Arduino in

If I then press the reset button on the arduino, I then see
Code: [Select]

I?Arduino in 
Arduino in 

SurferTim

Maybe running out of SRAM? Try using the F() function to keep the static strings in program memory like this.
Code: [Select]
  Serial.println(F("Arduino in setup()"));

Do the rest to all the other static strings. See if that helps.

Anonymouslemming


Maybe running out of SRAM? Try using the F() function to keep the static strings in program memory like this.
Code: [Select]
  Serial.println(F("Arduino in setup()"));

Do the rest to all the other static strings. See if that helps.



That seems to have done the trick - I wasn't aware that my use of static strings like this could hurt me in the long run. I've now added this to all of them. Now to just look up the F function and see what cost this magic comes at :)

Thanks loads for your help!

SurferTim

I haven't noticed much overhead. I think it just sets them as a PROGMEM data type instead of copying them into SRAM.

Go Up