Lilypad Breakout Board and Xbee Problems

I just encountered a problem with my S2 Xbee's and Lilypad Xbee breakout boards. Only a couple of days ago everything was working fine and now something's up.

The Lilypad breakout board on the sending side used to just turn on (i.e. the red 'on' light) and stay on. When the board made a connection with the receiving side, the RSSI green light would go on and also stay on until it lost the connection.

Now, when the sending board gets power, the red 'on' light will turn on and then off after a few seconds and continue to blink like that. As soon as it makes the connection with receiving board, it drops the connection and blinks rapidly while the receiving side still has power. When the receive has no power, the sending board stops the rapid blinking and goes back to the slow on and off blinking.

I initially thought it was the Xbee's, so I reconfigured them and switched the function set around. When I put them on the boards and powered everything up, I still got the same results. I even tried switching the breakout boards around, but the same thing keeps happening.

Help!

I think I've found the problem, but I was hoping someone could verify it for me.

I've just tried running other communication code and found that they both worked. No rapid blinking and no connection dropout. These codes had a smaller binary sketch size (under 4000 bytes) than the code that results in the rapid blinking (over 4000). My theory is that the Lilypad main board (I'm using a 328) has a maximum which could be why the over 4000 byte code isn't working.

If this is the case, could someone please tell me the maximum byte size that can be uploaded to the board?

Cheers.

One thing to keep in mind when troubleshooting issues like this is that the Arduino/Lilypad has 3 different kinds of memory - flash, SRAM, and EEPROM.

EEPROM is typically not used. The sketch size reported is the amount of flash memory used. Some data, like constant strings, are stored in SRAM. SRAM is also used to stack processing.

You can easily run out of SRAM with even a relatively small sketch, if you use a lot of strings or do any kind of recursive function calls.

Since SRAM is dynamic, it is not possible for the compiler to tell how much SRAM is going to be used.