nsmf

Hi, I need help. I have an Arduino Uno R3 and the Ethernet shield as my setup. I tried this code that turn 7 individual LEDs on and off. That work fine.

So I played around with the code, basically just add few buttons, radio button and combo box in html. The initial load after I upload the sketch load quite fast. But once I pressed one of the submit button, it goes to a very long loading. After that happened I couldn't access the page from a different tab on my browser. I have to press the reset button on my Arduino Uno to be able access it again. Sometime I have to plug out the usb (power) and plug it back to view the page again.

May I know the cause of this issue?And is there a way to load external html source code?

char c = client.read(); // if we've gotten to the end of the line (received a newline // character) and the line is blank, the http request has ended, // so we can send a reply if (inString.length() < 100) { inString.concat(c); } if (c == '\n' && current_line_is_blank) {

client.println("</body></html>"); break; }//if end if (c == '\n') { // we're starting a new line current_line_is_blank = true; } else if (c != '\r') { // we've gotten a character on the current line current_line_is_blank = false; } }//if end }//while end // give the web browser time to receive the data delay(1);

First of all, you're using the String class, so sooner or later your code will crash. If you plan to run your sketch for more than the first few requests, get rid of that class and work with character arrays only.

The next problem and probably the cause of your slow downs is that you only read the header of the HTTP request and then you send the whole page, ignoring the rest of the request.

Fix these two issues and post again if the problem still occurs.

nsmf

I didn't change my string to char, because I don't know how to. But someone told me to try to use the client.println(F("text")); . Gladly it solve the slow load any all the unexpected characters displays.

About the 'HTTP request' I dont understand. But I am trying to find how can I not hard code my html in the Arduino codes. I want to put it as index.html and store it in the microSD card inside the slot on the ethernet shield, but I have not yet close to getting this.