Web Sever Will not respond When I add 1 line of Println code

//controlling led via checkbox

// this line will provides the radiobuttons that provide the input

client.println(" LED1 ON
LED1 OFF

SD9 VERT ANT ON
G5RV ANT ON

LED3 ON
LED3 OFF

PWR ON
PWR OFF

");

// button functions --test area TEST

client.println("");
client.println(“PWR On”);
client.println(“PWR Off”);

//client.println(“SD9 ANT”); // server will not respond
client.println("
“);
client.println(”


");

PROBLEM:

  1. The code above works as long as i do not add the line indicated above.
  2. If i delete one of the other button inputs and add the offending line it works?? Any idea what is the problem?
  3. Also, i would like to break up the first set of form buttons into separate code lines but have not been able to get the correct syntax tax

Thanks
running ide 1
Joe

The code above works as long as i do not add the line indicated above.

Or, you can add that line, after deleting another one. That says exactly one thing. You are using every bit of available memory. Adding any more, and you are out of space.

Look at the code that you are generating. Ask your self whether you really need to control the height and width of the buttons. Ask yourself if the name radio is required, or, since the form is pretty small, would a shorter name work as well.

Anything you do to shorten the strings you are storing in SRAM will allow you to store more of them.

If you can not fit the strings in the available SRAM, then, you need to change where you store them. PROGMEM and SD cards are the usual choices when SRAM is not sufficient.

Try something simple like
client.println(F(""));
first. This moves the string storage from SRAM to flash (PROGMEM).

Also, i would like to break up the first set of form buttons into separate code lines but have not been able to get the correct syntax tax

Break it up however you want. The client.print() function should be used to output all the lines except the last one.

client.print("<form method=get name=LED>");
client.print(" <input type='radio' name='L' value='1'>LED1 ON
");
client.print("<input type='radio' name='L' value='0'>LED1 OFF

");
client.print("<input type='radio' name='H' value='1'>SD9 VERT ANT ON
");
client.print("<input type='radio' name='H' value='0'>G5RV ANT ON

");
client.print("<input type='radio' name='A' value='1'>LED3 ON
");
client.print("<input type='radio' name='A' value='0'>LED3 OFF

");
client.print("<input type='radio' name='F' value='1'>PWR ON
");
client.print("<input type='radio' name='F' value='0'>PWR OFF

");
client.println("<input type=submit value=submit></form>");

would be one way.

PaulS,

Thanks for the pointers and code breakdown, it sure looks better, however If i try it , the buttons do not respond

I have been piecing a web server with code from various sketches and adding my own
I am learning day by day but need some experts to keep me on the right track

Its crude but works, minus some things i want to clean up

I would appreciate it If you or anyone interested would have a look at the complete code and suggest changes to make it better.

  1. I would like the button layout you suggest to work but so far no go.
  2. Any other change to clean it up would be also very much appreciated.

I plan on posting the code for all to use, once things are cleaned up …

I have Attached the sketch
Thanks
Joe

webservergreen27FORUMPOST.ino (9.26 KB)

Thanks for the pointers and code breakdown, it sure looks better, however If i try it , the buttons do not respond

Use your original code. When the form loads, use the contextual menu to view the page source.

Then, load the modified sketch, and try again. The resulting page source should be identical, with the possible exception of irrelevant white space.

If not, post both.

  1. I would like the button layout you suggest to work but so far no go.

This is like saying "that didn't work". You need to describe/show what actually appeared/happened, and explain how that differs from what you wanted/expected.

White space/packet size has nothing to do with whether a submit button causes appropriate action, or not. If the submit button (or any other button) fails to perform an intended function, you need to determine if the failure was on the PC end or the Arduino end.

I recoded every line that i could using the :

client.println(F(""));

Bingo!! - The server is now working well, quick and reliable responses.

I had been pointed in that direction before but I did not go far enough…

NOW:

I am able to add the input buttons as suggested and more…

I think the low memory was creeping in at various times and throwing me off.

Is there a method or a place to look to see what the arduino memory level is?

I have now learned the hard way that it can get you when you least expect it, so i would like to be able to keep an eye on it.

Thanks for taking the time to help me along.

Arduino Forum sure is a great resource!!

Joe

Thanks

Arduino Forum sure is a great resource!!

Try using the whole site, it’s even better. Typing ‘memory available’ in the search box on the home page gave http://arduino.cc/playground/Code/AvailableMemory as the first result.

Thanks,

I guess i was searching for to much criteria - memory worked fine

Joe