In my project the temperature and humidity was stored in sd card with the file name,test.txt.Now iam trying to download this file to the server using the ethernet sheild w5100.How to give the the path of this file in the html code.Anyone pls hlp me.
The first step is to run some kind of TCP/IP server on your Arduino. It can be a web (HTTP) server if you want to access the file with a web browser. See File->Examples->Ethernet->WebServer for a basic web server. You will need to modify it to return data from the text file on your SD card instead of the hard-coded text (all those client.println() calls). When that is working you can integrate your web server into your existing code as you would merge any two sketches.
johnwasser:
You will need to modify it to return data from the text file on your SD card instead of the hard-coded text (all those client.println() calls).
hi,
Actually i want to store data in sd card in every 1 minute ,but in server it should be displayed in every 20 sec.So the ethernet, sd card should read data separately.How to give the file path in htmlcode for ethernet.Hereby iam attaching the relevant part of code
Is it any solution for this thread? I see in last code no link (html link) generated to in browser to click and download the file, how to make an active link which works at click and download the desired files from SD card?
antonio1:
Is it any solution for this thread? I see in last code no link (html link) generated to in browser to click and download the file, how to make an active link which works at click and download the desired files from SD card?
The browser would send a request like below tor the HYPNO.JPG file. readString would be checked to see if it contained HYPNO.JPG, and if so, that file would be read from the SD card and sent back to the browser.
ok, let's try to implement it. First error is
while(myFile.available()) "cannot convert SDLib from type int to type bool". Did you test the code and it's working for you?
I erased available and it's working, but it's not I was expected. At the loading page the file is listed on the page, it is a text file in my case. Lots of chars on the page, but I need to save the file as it is on SD to my PC.
It worked back in 2012, but sometimes things change. The "cannot convert SDLib from type int to type bool" error code indicate you may be trying something different.
the error was normal, as I said I tried something different replacing this "while(myFile.available())" with this "while(myFile)".
But the result is not the desired one, because the file from SD, which is text in my case, it's filling the web page with no space between lines and chars. I want to have a popup with downloading the file from SD to the PC not showing in html.