MK1888:
Sorry, I wasn't thinking clearly last night. I interpreted the IF blocks as WHILE loops.Which line are you removing to make it work?
Also, showing your circuit might be useful.
Removing this section makes it work:
if (!SD.begin(chipSelect)) {
Serial.println("Card failed, or not present");
// don't do anything more:
return;
}
Obviously I changed the printing to the file to printing to the serial monitor as well, making the sketch ignore the SD card entirely.
The circuit is pretty trivial; It's an Arduino UNO with the Ethernet and Motion shields stacked on top (in that order). As I said in the OP, I have very little practical electronics experience, so please forgive me if that's a stupid thing to do!