float array causing ethernet problems

I am really stumped on on a problem I’m having. I have a sketch that receives data from an Xbee, and send the data to COSM.com using ERXPachube library and also sends out tweets using the twitter.h library. There is this one if() statement that is causing a problem with COSM, I keep getting a HTTP 401 error when trying to post to COSM. The statement is

if(poolData[P_WATER_FILL_COUNTDN] > 0 && waterFillCntDnFlag == false)

poolData is a float, P_WATER_FILL_COUNTDN = 11 and I initialize the array to 13. I have no problem printing the value of poolData[P_WATER_FILL_COUNTDN], which is zero most of the time. If I take this out of the if statement and use something like

if( 0 > 0 && waterFillCntDnFlag == false)

Everything works fine, except of course my if() statement isn’t the way I need it. I can post to COSM just fine. Just to see if making the poolData array bigger would help, I initialized it to 26. This caused the sketch to hang when trying to post to COSM. I am passing this array to some functions using a pointer. For example:

xbeeStat = ReadXBeeData(poolData, &xbeeID); 
if(SendDataToCOSM(poolData) == true)
{ gotNewData = false; } // Upload was successful, Reset new data flag

bool SendDataToCOSM(float *cosmData) 
{...}

bool ReadXBeeData(float *poolData, uint16_t *Tx_Id)
{...}

I have been messing with this for hours and can’t figure out what’s wrong. I’m using an UNO with IDE ver 1.0.1. The Ethernet shield is R3 version.

Attached is the entire sketch

PoolMon.ino (30.9 KB)

You've got an awful lot going on in that sketch. I'd suggest that you look for the FreeMemory() function, and see if you are running out of memory. I suspect that you are.

PaulS:
You've got an awful lot going on in that sketch. I'd suggest that you look for the FreeMemory() function, and see if you are running out of memory. I suspect that you are.

That's a good suggestion. I think I'll run it on my Arduino mega, if it works, then it's probably a memory issue.