PaulS:
while ((c = myFile.read()) > 0)
{
itoa(c, (char*)temp, 10);
output += temp;
This makes no sense. You read a character from the file, treated it as a number, and converted the numeric value to it's string representation, and sent that.
So what can I do instead?
PaulS:
So the webpage can have something like %e1%, which then should be replaced with what is read from eeprom address 1. To do so I figured I had to read one line at a time, process the line and replace if something needs replacing, then send the text to the client.
Sounds reasonable. You must start with reading a full record from the SD card, not just one character. Then, you need to determine if the record contains any pairs of %s. If so, you need to parse the value in between, and read from EEPROM.
You are not doing any of that, yet.
It is reading until it sees a line change, and then sends it. (as far as I know, and what I have been figuring out by looking at some serial debug I added)
That part seems to be working.
And no, I am not doing anything that replaces the parts I want yet, because it would not make any sense to add that, before it actually can read and store the content properly.
PaulS:
Start with reading a complete record from the SD card, and sending the complete record to the client, regardless of content.
When that works, determine whether the content needs to be altered, but do nothing about that,
Then, work on determining what the new content should be, again without actually getting the new content. Then, add in code to get the new content, but do nothing with it.
Next, change the code to send to the client to send the part before the first % to the client, then send the new content, then send the stuff after the second %.
Finally, deal with the situation where a record might contain more than one pair of %s.
As I said, it can read the entire thing, and send it. But when I make it store one line at a time, and sending it. I am getting numbers instead of letters.
What that other character could I use instead? I know I am using % for something else too, but as it is a webpage, almost all characters can occur. That is why it is %something% chances of that being there is very low.
I know how to replace what I want to replace, but the problem is to get it stored so it can look at it and determine what to do with it.