waking xbee with pin-sleep sends data twice

I want my host to wake XBee (sometimes periodically sometimes not), send something and put XBee back to sleep. I’m using pin-sleep (ATSM1) and AT mode. Also, DIO7 is set to CTS flow control.
My idea is to put sleep pin low, wait CTS to go low, send something over serial and finnaly put sleep pin high; like this:

digitalWrite(SLEEP_PIN, LOW); 
digitalWrite(SLEEP_PIN, HIGH);

If i do this, let’s say every 5 seconds, everything is ok.
If i do this every 60 seconds, XBee sends the message properly the first time, but every other time it sends the message twice in a row.

What am I doing wrong? :slight_smile: Thank you for your help!


I think you have to wait applying sleep until the node receives the answer from the coordinator. You let the node sleep right after giving data. I guess it shuts off the remaining confirmation. So the node tries to send last data again before new one. If 2 received data was both new, it’s node side. If one old and one new, it’s coodinator side. All I guess…

Andy Oyamada

How cold is Croatia? I am having a similar delay problem that suppose to be caused by air temparature. I am guessing that it becomes harder to complete the radio connection as cold as it gets below ice point temparature. Then Xbee tries sending several times that are confirmed together later so they appear all together in one row. I am not sure but seems to be so.