Can SD Card be used to store ip address/MAC configs?

Hi,

A couple of things I notice on initial read of your code.

Firstly, you are setting the Ethernet chip select pin as an output twice

         pinMode(ETH_CS, OUTPUT);        // set ethernet chip select as output:
         digitalWrite(ETH_CS, HIGH); <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< here as ETH_CD is declared as 10
         
         Serial.print("\nInitializing SD card...");
   // On the Ethernet Shield, CS is pin 4. It's set as an output by default.
   // Note that even if it's not used as the CS pin, the hardware SS pin 
  // (10 on most Arduino boards, 53 on the Mega) must be left as an output 
  // or the SD library functions will not work. 
  pinMode(10, OUTPUT);     // change this to 53 on a mega <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< and here remove this line

It appears the you are not getting the very first line that you are requesting to print to the serial console;

         Serial.print("\nInitializing SD card...");

Did you change this from when you copied the console output?

It appears the program has an issue with the following code or you have no files on your card as it does not list any;

  Serial.println("\nFiles found on the card (name, date and size in bytes): ");
   root.openRoot(volume);
   
  // list all files in the card with date and size
   root.ls(LS_R | LS_DATE | LS_SIZE);

Remove the space after the word open, it's a function, no space there;

	 file=SD.open ("params.txt") ;

You also need to put the SD.begin() statement in the order like I originally proposed, like thus;

void setup() {
    pinMode(4, OUTPUT);      // set SD card chip select as output:
    pinMode(10, OUTPUT);    // set Ethernet chip select as output:

    pinMode(10, HIGH);         // disable ethernet by pulling high its chip select:
    sdBegin():                         // initialise the SD card:
    readFile();                       // read parameters from SD card:

    delay(150);                      // allow some time for Ethernet processor to come out of reset on Arduino power up:
    Ethernet.begin(mac, ip);
}

And then remove the SD.begin() from the following point, it needs to be done as stated above;

	 File file;
	 SD.begin(SD_CS);
         Serial.println ("SD Start");

Also, see above, again you have a space in the Serial.println, get rid of it, it is not correct, though it does appear to function.
Check the rest of your code for these spaces you seem to want to put in before the '(...)'

Where yo declare your ip array, you declare it empty, with no default values, I would leave it how I proposed initially, by having something in there, like thus;

uint8_t	ip[]		= {192,168,1,10}; <<<<<<<<<<<<<<<<<<<<<<<<<< have some default values in case of SD problems or such like.

Unless you really need it, I would be inclined to remove all that code which reports information about the card, you can see that your SD interface is working already.
It only makes is a little harder to debug and takes up resources.

You could use more Serial.print("debug point: doing what ever here") type statements to help you know what your program is doing and where it does get to.

Try these things and repost your code and any output then.

Paul