Integrating weather, camera, xbee, and SD shields together fails, works seperate

I’m building a remote environment monitor that can take measurements and photos on demand.

I tested each shield by itself, then modified each shield to avoid conflicts - I had to cut and re-route one trace. Pin 8 is the SD Chip Select for the SD Shield, and an status indicator output on the weather shield. I just cut and jumped it over to pin 9.

When I initially integrated all the parts into one file (below) I could log data and photos to the SD card. The only problem I seemed to have was getting the photos over the xbee link - and that seemed to be my fault. As in not splitting out the data from my status messages properly.

So I focused on that, and when I thought I had it working I was surprised to find my image viewer (Irfanview) still said DCT 11 (or 10) was bogus.

I powered off the UNO R3 and pulled out the u-SD chip, put it into a USB adapter, and all the JPG files are zero-bytes!

Then I noticed that my data logger command was getting an error too.

This is when I loaded back the SD data logger by itself, which worked fine. Then the Photo taker by itself, also fine.

So I commented out the line(s) that echo the data over the serial link. Still zero-byte photos. I put back some code I had removed (sending periodic dots during the save) in case this is some weird timing issue. No change.

I’m stumped. I’m still trying to think of what I can try next, but I would appreciate any insight others might have on this issue.

I do all of my messages through send_msg() instead of Serial.print() so I can switch the communications over to the xbee on its on serial port (2,3). I have not gotten that far. I have been doing all my testing from my control program in Python, and Serial Monitor.

wow_demo.ino (12.1 KB)

I re-built my program one shield at a time.

I discovered the errors started after importing the wire library - without even using it.

Some more research around "library conflicts" and I discovered I had most likely run out of SRAM!

As per the memory tutorial, I surrounded all my static (message) strings with F(), and all my problems vanished!

The UNO is a lovely device, but you have to remember its not a desktop PC with near-infinite resources....

void loop()
  while(1) {
    if (Serial.available() > 0) {

Why are you running an infinite loop inside an infinite loop()?