ezieragabriel / arduino

Automatically exported from code.google.com/p/arduino
Other
0 stars 0 forks source link

Ethernet library crashes when you use symbol += in println #922

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Using EthernetClient println to show a String that contain += inside program 
crash. You don't need execute this part of code only add a line with += and 
program doesn't run (IDE doesn't show any error compiling or uploading code) 

For example:

This line

client.println("        textStatus += 
\"<table><th><td>Port</td><td>Value</td></th>\";");

doesn't work

But this other 

client.println("        textStatus = 
\"<table><th><td>Port</td><td>Value</td></th>\";");

does

Original issue reported on code.google.com by cubi...@gmail.com on 27 May 2012 at 12:40

GoogleCodeExporter commented 9 years ago
Sorry for the mistake, but the problem isn't with the symbol += is with the 
length of the string and the part of the program that you put de string.

I attached a file with examples using "aaa....." string (about line 189)

Original comment by cubi...@gmail.com on 27 May 2012 at 2:01

Attachments:

GoogleCodeExporter commented 9 years ago
It sounds like you're running out of RAM.  You should try wrapping your 
constant strings with F(), e.g. :

client.println(F("      ctrl.innerHTML = textStatus;"));

That will put them only in your program memory, but not in RAM.

Original comment by dmel...@gmail.com on 27 May 2012 at 11:04