SD card write very random, mostly not working

PaulS:

In addition to PaulS, you must disable the w5100 SPI

Hey. No, wait. You don't have to disable me!

LOL :slight_smile:

TatankaWilly:
I'm using both the W5100 and the SD card SPI, do I need to explicitly activate/deactivate each system before and after using it?

You must disable all SPI devices before starting any of them, or you will have problems. Try adding my mods to your code. Once they are started, the library functions will control the slave selects, but until you have them all running, you must disable them before calling any begin functions.

I did not disable the SD card (D4) because you are going to immediately start it, and that will leave that slave select disabled after the SD.begin(4) call.