Why is my XBee receiving so many bogus digital I/O signal edges ?

I have a remote switch operating as a “sensor” over a pair of XBee Pro:s. The remote end has a pull-down resistor, so the input is not “floating” midway. Otherwise it works as expected, but I receive a lot of transient spikes going up and back down in fractions of a second. What could be the cause and fix of this ?

You are most likely using samples before transmit instead of change detect. For this type of application, change detect would be better of being used.