Stacking Wifi-Shield and Data Logging Shield(adafruit) on MEGA

I'm wondering if there was any method to work around the SPI pins for the Wifi shield and Data Logger, as they both use the same pins(correct me if I am wrong).

I need to be able to store data transmitted through Wifi in a SD card, and I'm wondering if there's any method to use the SD card slot in the Wifi shield to do that. From what I know, the Wifi shield cannot have both the HDG104 and SD option active at the same time. Does anyone have a method to work around that? I'm taking readings every half a second, would that affect anything?

I'm quite new to Arduino, my apologies if this issue has already been discussed in another thread. If so, could anyone post a link to the tread? I would greatly appreciate it.

It is true the HDG104/HDG204 and the SD cannot be active at the same time (both slave selects LOW simultaneously), they can be used together in the same sketch. Both libraries control the slave select pins for each device, so they will work together once the startups for both SPI devices are complete.

SurferTim:
It is true the HDG104/HDG204 and the SD cannot be active at the same time (both slave selects LOW simultaneously), they can be used together in the same sketch. Both libraries control the slave select pins for each device, so they will work together once the startups for both SPI devices are complete.

Sorry I'm a bit lost here, do you mean that this problem is already being taken care of by the libraries? So there's no need for any special modifications to use both functions, all I need to do is to have both the Wifi and SD library included in my code to work, is that right?

You are correct. I use this code with the WiFi shield and the SD card.

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

                    if(clientCount > 63) {
                      client.write((byte*)tBuf,64);
                      clientCount = 0;
                    }

                  }
                  if(clientCount > 0) {
                    client.write((byte*)tBuf,clientCount);
                  }
                }

But be aware the server functions in the WiFi shield firmware are unreliable when accessed by more than one client at a time. It has a tendency to send corrupt or incorrect files to the clients. :frowning:

Oh, thanks for the help!

Would it be easier to send/update variables over instead of files? Right now my project is working on using one Wifi Shield as a server, another one being a client. We're not using Xbee as we need to upload certain information onto an online server, hence the Wifi Shield. Would there be problems in recording the data using the Wifi shield that is being used as a server?