with 256 k of available memory i was not going to worry about it. i originally thought to use the SD card, but decided that PROGMEM coding would be easier to code and control and faster with respect to I/O since the processor would not have to read a byte from SD card, store it locally, then send it to the Ethernet shield.

thanks for pointing that out. i made the upadtes to the code. have not gotten to changing the pictures in the post though

edit: added a link to the initialization sketch.

download this to the arduino, it will configure all the EEPROM. download the normal code to the arduino and the web-page default URL is static at 192.168.1.200you can then configure all the settings to your likings.

https://www.dropbox.com/s/we0tnxp3h0w90al/webserverinit.rar

edit:

i am adding more stuff to my code from here:http://arduino.cc/forum/index.php?topic=134868.0

to make the downloading of log files MUCH faster. i will post the new code soon

for anyone who is trying to use my code, there was a fairly large bug that was cause by my attempt to reduce the amount of RAM usage. this bug would make any page forms submitted to not process properly.

i have subsequently corrected the bug. the latest version of ALL code is in the link below, the libraries i use, the EEPROM initialize code, and the latest working code that i have.

i cannot really give a list other than what i did on the first page. all the enclosure supplies i either already had lying around the house and do not have part number for, or i got on e-bay by performing searches for what i wanted and combed through the results until i found what looked good. the case, the switches, the terminal blocks, the fuse blocks, i do not have part numbers for. the outlets are standard outlets you can get a home depot or something.

i do not have a diagram of how it is wired... i do all that from my head, but i feel it is fairly straightforward how the outlets should be wired to the relays. all the low voltage wiring for the sensors and the RTC are based on the respective device data sheets, and how the libraries require them to be wired.

no i do not. i thought that when a function is ended, any local variables used within the function were cleared.

From what others have discussed, that is the premis of Strings issue, that the last String memory location used in the function is not automatically cleared as expected, resulting in that memory location no longer being available for use. May or may not help.

Google forum search: Use Google Advanced Search and use Http://forum.arduino.cc/index in the "site or domain:" box.

no i do not. i thought that when a function is ended, any local variables used within the function were cleared.

From what others have discussed, that is the premis of Strings issue, that the last String memory location used in the function is not automatically cleared as expected, resulting in that memory location no longer being available for use. May or may not help.

i have read that as well.

i have added to my code the lines to set all used strings to "" before the function ends. so far the arduino has 14 hours of up time.

i am in the process of trying to remove all uses of strings within my code. the main area strings are used is in processing of the data submitted by a web-page form in the function "sendPage"

//page was received, need to determine if the page returned ay form data //if form data was was received we need to process it on a per page process //page 1 does not have any form data //page 2 have 17 form entries for different temperature settings. these settings need to be extracted from the requestcontent //variable. once the data is extracted it needs to be saved to the correct variables and then to EEPROM so the setting take effect //between power outages

if (nUriIndex == 1){//page 2 //convert the request content variable from an array into a string

for (byte x=0; x < 129; x++){ datastring.concat(requestContent[x]); } if (datastring.substring(0,2)=="1="){ //tests if the page has had a form submitted with data or not for (byte x = 1; x<18; x++){ //page 2 contains 17 data entry text boxes, so we want to run through all of them String temp1 = ""; //initilize temp variables to clear any previous data String temp2 = ""; //the format for the submitetd form data is: //1=entry1&2=entry2&3=entry3 ect... //we want to use the sub string command, so we need to know the index locations for where the desired data entry index is //along with the data entry index of the next entry. temp1.concat(x); temp1.concat("="); temp2.concat(x+1); temp2.concat("="); //we need to see if the current entry is below 10. if the entry is below 10, we only need to skip 2 entries, one for the entry number //and another for the equals sign. however if the entry is above 10, we need to skip 3 entries becuase of the two digits for the entry //and another entry for the equals sign if (x<10){ char valueArray[datastring.substring(datastring.indexOf(temp1) + 2,datastring.indexOf(temp2) -1).length() + 1]; datastring.substring(datastring.indexOf(temp1) + 2,datastring.indexOf(temp2) -1).toCharArray(valueArray, sizeof(valueArray)); if (x == 1){ //if the currently processing entry is entry 1 if (atoi(valueArray)>= min_temp_setting && atoi(valueArray) <= max_temp_setting){ //is the entred entry within the allowable bounds? INCSGDTON = atoi(valueArray); //converts the string value of the entred data into a interger if (EEPROM.read(INCSGDTONEEPROMADDR)!=INCSGDTON){ //if the user has not changed the entry from what is already in memory, then we do not want to save to EEPROM again as the EEPROM has a shorter life time EEPROM.write(INCSGDTONEEPROMADDR, INCSGDTON); //since the user has entered a new number, we now need to save this to memory INCSGDTON_incorrect = false; //because a valid entry was entered, we do not want the web-page to display "Invalid Entry!" } }else{ INCSGDTON_incorrect = true;//if the user did enter an invalid value then we want the web-page to display "invalid entry!" when the substitution function runs } }else if (x == 2){ if (atoi(valueArray)>= min_temp_setting && atoi(valueArray) <= max_temp_setting){ CSGDTOFF = atoi(valueArray); if (EEPROM.read(CSGDTOFFEEPROMADDR)!=CSGDTOFF){ EEPROM.write(CSGDTOFFEEPROMADDR, CSGDTOFF); CSGDTOFF_incorrect = false; } }else{ CSGDTOFF_incorrect = true; } }else if (x == 3){ if (atoi(valueArray)>= min_temp_setting && atoi(valueArray) <= max_temp_setting){ MSGDTON = atoi(valueArray); if (EEPROM.read(MSGDTONEEPROMADDR)!=MSGDTON){ EEPROM.write(MSGDTONEEPROMADDR, MSGDTON); MSGDTON_incorrect = false; } }else{ MSGDTON_incorrect = true; } }else if (x == 4){ if (atoi(valueArray)>= min_temp_setting && atoi(valueArray) <= max_temp_setting){ MSGDTOFF = atoi(valueArray); if (EEPROM.read(MSGDTOFFEEPROMADDR)!=MSGDTOFF){ EEPROM.write(MSGDTOFFEEPROMADDR, MSGDTOFF); MSGDTOFF_incorrect = false; } }else{ MSGDTOFF_incorrect = true; } }else if (x == 5){

//"pch-4" is required because pch indicates where the "%" sign is with the first character starting at 1. however the char array starts at 0. in addition we do not care about the "&17=" part of the ending. //the length of the "5" itself is removed because of the offset from starting point 1 to starting point 0 //the "-4" is so the code ignores the "&18=" characters for (byte x=0;x<= pch-4;x++){ if (strncmp((char *)str[x],"=",1)==0){ beginning = x+1; //starting character position of actual data entry }else if (strncmp((char *)str[x],"&",1)==0){ ending=x-1;//ending character position of actual data entry counter++;//increment counter so we can see if this is the data entry we care about } if (counter==index){//have we found the data antry we care about? counter = 0; for (byte i=0; i<=(ending-beginning);i++){//copy the data entry so we can use it output[i] = str[beginning + i]; break; } } }

Check in the playground for memory usage. There are a couple of routines there that can tell you how much you have left at any given time. I use them extensively to keep away from running out of memory. You can put them in temporarily to measure what you have left and isolate a problem area then fix whatever is needed.

In a couple of hard cases, I put them in the loop() and automatically rebooted the board to clean things out when free memory reached a low number. This was a stop gap measure I used while I tried to figure out what the heck was going on. These days, I try desperately to avoid using Strings and use the old reliable strcat, strcmp, etc. instead.

i do already have a free memory routine that displays the amount of memory on one f the web-pages. i have never seen it go below 4200 bytes. i will have to post the exact routine i am using later, in case it is displaying the wrong result

You probably need to sprinkle them around more places. I've had to go so far as to put them before the return of many routines to get a clue what was happening. Sometimes when you're recursing, the level of recursion can get so deep that you run out of memory. If it returns, the memory unwinds back to a good level. This can happen when some routine allocates and then calls something else as well.

You can get lost and not have any idea what the heck happened until you really start to dissect it.

But then, you could also just be running past the end of some buffer somewhere and clobbering yourself. These problems can be tough to find. Been there, done that...sigh.