Go Down

Topic: Stackoverflow Bug? (Read 3509 times) previous topic - next topic

robtillaart

I tried the code on 1.0 and 0.22 (win7/64) both failed with the exception you got, so bug confirmed. The auto formatting crashes too. There is probably a buffer overrun intern in the IDE that cannot hold strings that are too long.

The cause is two long strings.  (two not one). if these two strings are removed from the code the application compiles perfectly (not tried to run it) .

Solutions:
1) Split the strings up in shorter ones, that are client.print()-ed seperately .
You will still have problems with the restricted memory of the UNO ==> to be solved with progmem / F()

2) Write these strings (all html content) to an SDcard and read it when needed to send over the internet.
imho the better solution.



Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

Tasty

#16
Apr 12, 2012, 12:50 pm Last Edit: Apr 12, 2012, 12:54 pm by Tasty Reason: 1
i will try the second one, but how do i deactivate the wiznet chip read the html file and then activate the wiznet and send it to the client?
i know how to read the html file, how to send it to the client, but how do i deactivate the chip and then activate it?

robtillaart


If the wiznet chip is connected to SPI you can add a few lines to set the CS lines of the ethernet and sdcard alternating high.

something like
Code: [Select]

digitalWrite(CC_ET, LOW);
digitalWrite(CC_SD, HIGH);
string = file.readstring();

digitalWrite(CC_SD, LOW);
digitalWrite(CC_ET, HIGH);
client.println(string);


allways do the low first before setting the next to high...

Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

Tasty

Hey,
I bought a new Arduino Board so i have now 128k Memory, but my new Problem is, when i try to compile/upload this code: http://pastebin.com/Cj5xmiiR
the IDE says: "sketch_apr18a.cpp: In function 'void setup()': sketch_apr18a.cpp:32:31: error: 'myfile' was not declared in this scope"

but myfile is declared?, why does it says it isn't?

Thanks guys,
Greetz

dxw00d

Case matters, myfile is not myFile.

Tasty

#20
Apr 18, 2012, 03:32 pm Last Edit: Apr 18, 2012, 04:58 pm by Tasty Reason: 1
oh thanks didnt know that, now its uploading fine, but when i browse the ip the browser says: "Fehler: Verbindung unterbrochen" / "Error: Connection lost" ? the sd-card is in the ethernet shield and it contains the index.html, whats wrong?

this is the html file i want to read in: http://pastebin.com/8yQnbQJH

Go Up