I've had a go with this approach and it seems to work in a simple case, but I still have a problem with the actual program I'm writing (rather than a simple exercise to try to identify what is going on). The symptom I get is that shortly after doing an EthernetServer.begin() I get what appears to be a reboot: in the middle of a Serial.println() just after the begin() call, the 'printing' is interrupted and my setup() restarts.
I'm working on producing something simple that consistently reproduces the problem, but in the mean time, can someone more knowledgeable than me advise...
- exactly how the ethernet library knows which are MOSI, MISO, SCK and SS ... because it seems to use the system defaults for MOSI, MISO and SCK, but always pin 10 for SS
- if it is possible that both the SD library and the Ethernet library can be grabbing MOSI, etc, at the same time 'behind the scenes'... or do they only operate when I specifically call them, in which case I can make sure the other one is disabled
- which way round is SS enable/disable: enable=LOW, disable=HIGH ?
- why pin 53 (the default SS on the Mega) should be set to OUTPUT even if it isn't connected to anything (mentioned in a different thread) and whether it matters if it is set to HIGH of LOW
- how the xmit() function, copying from SD file to Enet client, works at all (and it does, trust me) unless the two libraries are careful about selecting the SPI bus at the byte by byte level
And, of course, finally, where (if?) there is some comprehensive documentation so I don't have to clutter this thread with dumb questions.