Ethernet Shield,display the results of a sensor in html file stored on SD Card

Hi,
I'm working on a project of web monitoring using arduino uno and ethernet shield.
the ethernet shield has SD Card slot, I'm using a 4GB sd card as a server.
I could read files from the sd card through the browser (html file, photo, ...)
my question is:
lets say I have a temperature sensor connected to the arduino, I want to create an html file and put it in the sd card(I DONT want to write the html coding inside the arduino), I want the arduino to send continuously the temperature readings to the sd card so when I open the html file on the browser, it will show me the readings.
for example; the html file has this sentence: "The Temperature Is: "
so I want the readings to appear in the empty space.

how that can be done? I searched a lot but still I'm not getting what I'm looking for..
any help is appreciated :slight_smile:
Thanks

What about https://www.thingspeak.com/
You would upload the temperature and that site shows graphs.
There are a few other websites that do the same.

You could store two parts of a HTML file and insert the data in between.
Send file that is the first part of the webpage.
Insert the text file with temperatures.
Send file that is the bottom part of the webpage.

Perhaps something with

 tag, and after that the temperatures.

You could skip the html by saving the data as a simple text file on the SD drive, then send that file to the browser for display. I use the below text file for test purposes with no included html.

http://web.comporium.net/~shb/arduino.txt

The ways I can see to do this:

  • Hard-code the HTML within the Arduino sketch and include the data in that when you print it out over the HTTP connection. I think you already said you don't like this approach.

  • Divide your HTML into two parts and store each part in separate files. To print your response you would print the first file, print your variable data, print the second file. This is the approach Erdin described. If you intended to use an HTML editor to maintain the HTML then you'd need to manually split/join the two halves of the file in between editing and saving it. That might be OK if you don't expect to change the HTML much.

  • You could include a token in your file which acted as a placeholder for the variable data. You would need to parse the HTML as you print it, recognise the placeholder, and replace it with the variable data. This would not be hard to do if you have any experience writing code to do parsing, but is going to need more complexity that the previous approaches.

  • You could be slightly more clever about the content of your HTML page and design it so that the variable data can be appended to the bottom of the page in a standard format. For example, most browsers will accept a second document in the same HTTP stream and evaluate it in the context of the same document object model as the first part of the response, and you can use that to update the document model to display your variable data e.g. by updating the content of a text element. If you are sufficiently familiar with HTML to follow the idea that would be fairly simple to implement - if you aren't, it won't.

Thanks to all of u guys :smiley: I'll try these methods and tell u wat I'll get.