Access Stored Data in Ethernet Shield

Hello all.

I am doing some readings with my Arduino and logging the results in the SD card on my Ethernet Shield in .csv file format.

How is it possible to view the SD data space and access an individual file from it? Ultimately I would like from a desktop application to be able to remotely access the SD card, and also read the contents of a file that I select.

Could someone suggest a good way to accomplish this?

Many thanks,

S.

See "DumpFile" in the SD library examples. "Listfiles" may be of use too if you won't know the exact name of the file and want to see what is there.

I am just confused how to access the data. Can I have remote access to Arduino?
Or do I have to create a server that provides this information as an SQL list?
What would be the most preferable way to do this?

As I said before, I want to store the data, and then have access to the files from a phone or computer for further processing (statistical analysis, visualization, etc).

HI, im just in the same process, the same project, but im just some steps behind, could you help me with this, and let me explain.
Im making a project that use an Arduino ethernet shield to send measurements with sensors and a 3G usb and a router to somehow send data to a server, but im just in the beginning of it, i just have the sensors working and a LCD to see the result, the Ethernet shield working in the same local network with the computer, but thats it, now i dont know what to do, any suggestions would be awesome, and in the way use the SD card will be necessary to save readings and one every amount of time send like a package all the info recollected to the server, at this point i dont know what to do.

Well perhaps you should check the sketch from Examples/Ethernet/WebServer
I also am not sure how to proceed, either set up a webpage with a json/XML file that I access from the other devices? But I would prefer to have a solution just locally, so that is why I am wondering to create this on the Arduino.

Here is a visual example to what I want to do:

Here is a visual example to what I want to do:

You might search the forum for data logger.

louisbourdon:
Here is a visual example to what I want to do:

madmattd has already given the simplest solution - DumpFile. A serial connection to RealTerm will suffice or you can send the data direct to Excel using PLX-DAQ. The only reason to have the Ethernet shield is that it is probably where the SD slot is.

Actually, I want to read the data back through the network, that is why I have the Ethernet card. In my example above, the orange lines from the computer to the ethernet represent the network, not a serial connection.

Cheers

Here is a way to send the contents of a file from the Ethernet shield SD card.

//zoomkat 12/26/12
//SD server test code
//open serial monitor to see what the arduino receives
//address will look like http://192.168.1.102:84 when submited
//for use with W5100 based ethernet shields

#include <SD.h>
#include <SPI.h>
#include <Ethernet.h>

byte mac[] = { 
  0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED }; //physical mac address
byte ip[] = { 
  192, 168, 1, 102 }; // ip in lan
byte gateway[] = { 
  192, 168, 1, 1 }; // internet access via router
byte subnet[] = { 
  255, 255, 255, 0 }; //subnet mask
EthernetServer server(84); //server port
String readString; 

//////////////////////

void setup(){

  Serial.begin(9600);

  // disable w5100 while setting up SD
  pinMode(10,OUTPUT);
  digitalWrite(10,HIGH);
  Serial.print("Starting SD..");
  if(!SD.begin(4)) Serial.println("failed");
  else Serial.println("ok");

  Ethernet.begin(mac, ip, gateway, gateway, subnet);
  //delay(2000);
  server.begin();
  Serial.println("Ready");
}

void loop(){
  // Create a client connection
  EthernetClient client = server.available();
  if (client) {
    while (client.connected()) {
      if (client.available()) {
        char c = client.read();

        //read char by char HTTP request
        if (readString.length() < 100) {
          //store characters to string 
          readString += c; 
          //Serial.print(c);
        } 
        //if HTTP request has ended
        if (c == '\n') {

          ///////////////
          Serial.println(readString); //print to serial monitor for debuging 

            client.println("HTTP/1.1 200 OK"); //send new page
          //client.println("Content-Type: text/html");
          client.println("Content-Type: image/jpeg");
          //client.println("Content-Type: image/gif");
          //client.println("Content-Type: application/x-javascript");
          //client.println("Content-Type: text");

          client.println();

          //File myFile = SD.open("boom.htm");
          File myFile = SD.open("HYPNO.JPG");
          //File myFile = SD.open("BLUEH_SL.GIF");
          //File myFile = SD.open("SERVOSLD.HTM");

          if (myFile) {

            byte clientBuf[64];
            int clientCount = 0;

            while(myFile.available())
            {
              clientBuf[clientCount] = myFile.read();
              clientCount++;

              if(clientCount > 63)
              {
                // Serial.println("Packet");
                client.write(clientBuf,64);
                clientCount = 0;
              }
            }
            //final <64 byte cleanup packet
            if(clientCount > 0) client.write(clientBuf,clientCount);            
            // close the file:
            myFile.close();
          }
          delay(1);
          //stopping client
          client.stop();
          readString="";
        }
      }
    }
  } 
}