Can Not Wake Up XBee
SEL
Posts: 80
Here is just snippet of my test code:
XB.AT_Config(string("ATSM 1")) <-- put XBee to sleep
Waitcnt(clkfreq * 10 + cnt)
XB.AT_Config(string("ATSM 0")) <--wakeup XBee
The module will go to sleep but will not wake up.
If I use a SIP board all is well, but if I use an Adapter board the module will not wake up!
I need to use the Adapter Board for my projects.
All parts were purchased from Parallax.
I would appreciate any help in this matter
Thank you,
Stan
XB.AT_Config(string("ATSM 1")) <-- put XBee to sleep
Waitcnt(clkfreq * 10 + cnt)
XB.AT_Config(string("ATSM 0")) <--wakeup XBee
The module will go to sleep but will not wake up.
If I use a SIP board all is well, but if I use an Adapter board the module will not wake up!
I need to use the Adapter Board for my projects.
All parts were purchased from Parallax.
I would appreciate any help in this matter
Thank you,
Stan
Comments
The reason the XBee goes to sleep when it hears the ATSM 1 command is probably because it has the pull-up to Vdd enabled on SLEEP_RQ. (Pull-ups are enabled using the ATPR command, and by factory default, all pullups are on). Again, to wake it up, you have to bring XBee pin 9 low, and to put it back to sleep, let the pin go back high or force it high. The ATSM 0 command does not wake it up, but once it is awake, you might use that command to tell the XBee to ignore further sleep requests for a while.
On both Parallax boards, USB and Adapter, I use Gnd, Vcc, Din, Dout. The SIP board will accept the command: XB.AT_Config(string("ATSM 0")) and wake the XBee.
Whereas the Adapter Board will accept the command: XB.AT_Config(string("ATSM 1")) and put to sleep the XBee, but will not accept XB.AT_Config(string("ATSM 0")) to wake it up.
Now as I understand it: The XBee, out of the box, will accept SM 1, but will not accept SM 0. This makes no sense. However your analyze seems spot on!
So: The Base Node can send an AT command to make the remote sleep, and will have to send something like this to awake the Remote:
XB.Tx("W") and the remote will need:
DataIn := XB.Rx
If DataIn == "W"
outa[Pin9] := 0 '' this pin from XBee wired to the processor
Am I correct in my assumption here?
Tracy I appreciate you help in this matter, and any other thoughts you might have.
Thank you, very much!
Stan
On the SIP board, the sleep_rq pin 9 is not brought out to the 5-pin SIP header, but it is available on the 5 pin sip socket, and the pin is labeled "SLP". If you haven't changed the XBee's pullup settings in XCTU or using the ATPU command, that pin will have a pullup resistor enabled, so the XBee should go to sleep as soon as your program gives the ATSM1. It is not surprising that it does not wake up with ATSM0, because the XBee does not listen for commands when it is asleep. Pin 9 has to go low to wake it up first. You have to tie that SLP pin over to a pin on your Stamp or Prop.
I see the SLP connection on the SIP.
We do not want to use SIP boards. We want to use Adapter Boards.
On the bread board with the Adapter Board I have connected a 1 K resistor from Pin 9 to an I/O pin on the Propeller.
I have not tested this yet. when I do I will post my results. My instinct is that the new modification will work.
Thank you so very much!
Stan
On the Adapter Board Pin 13 is the Sleep pin and Pin 9 is something else.
Here is is the code I have been testing with:
' Set pins and Baud rate for XBee comms
XB_Rx = 0 ' XBee DOUT
XB_Tx = 1 ' XBee DIN
XB_Baud = 9600 ' XBee Baud Rate
LED20 = 20 ' LED pin (ack sleep mode)
HBPin = 2 ' Propeller pin connected to Pin 13 on the Adapter Board.
OBJ
XB : "SEL_XBee_Object_v1.0" 'Object renamed to protect original.
PUB Main | DataIn
XB.start(XB_Rx, XB_Tx, 0, XB_Baud) ' Initialize comms for XBee
XB.AT_Init ' Enable XBee for fast configuration changes
dira[LED20]~~
outa[LED20]~
dira[HBPin]~~
repeat
XB.RxFlush ' Flush Rx buffer
DataIn := 0 ' Clear Data Input
DataIn := XB.Rx ' Accept incoming byte
If DataIn == "!" ' If start delimiter
case (DataIn := XB.RxTime(50)) ' Get LED state w/timeout
"3":
XB.RxFlush
!outa[LED20] ' <--- LED is just a visual aid
XB.AT_Init
XB.AT_Config(string("ATSM 1"))
waitcnt(clkfreq * 5 + cnt) ' DELAY FOR TEST PURPOSES ONLY
!outa[LED20]
outa[HBPin] := 0 'Pull SLP pin 13 low
XB.Delay(100)
outa[HBPin]~
XB.Delay(100)
AFTER THIS CODE EXECUTES THE REMOTE NODE STILL WILL NOT ACCEPT DATA
FROM THE BASE NODE.
Where am I going wrong here???
I would appreciate any help!
Thank you,
Stan
Does anyone know what the problem is with Stan's code? Is it because his code is for the base unit, and the remote unit will not turn on because once it is asleep, it does not RX or TX? Does anyone have sample code (for base and remote units), using xbee's 802.15.4, demonstrating the sleep function? Thanks for any and all responses. Have a good one.
Renee
The process is simple. Enable command mode with the "ATSM 1", and from then on pin 9 becomes the SLEEP_RQ input. Upon bringing it high, the XBee completes any transactions in progress and then enters low power sleep mode until that pin goes back low. It will neither respond to local commands nor to radio signals when it is asleep.
Thanks for the help. I should be able to get my xbee's working based on your help (when they arrive). Thanks again.
Renee
Tracy, Jlocke,
Got my xbee's (pro, 802.15.4) 3 days ago. They work exactly as you described. I only wish I had bought the xbee pro with external ant. I need to mount the remote xbee in a plastic box with the antenna sticking out of it. I think if I don't do this, the box will provide some attenuation. Oh well, they are only $32. I also need to buy the xbee adapter board. I purchased the USB and 5B to 3V adapter boards and noticed they have several LED's on them. I need to make the project very power efficient, since it will operate on batteries. The xbee adapter board is only a few bucks. Guess I will be placing another order soon. Once again, Thanks for your assistance. Have a great weekend.
Renee
Sorry, the first post got geeked-up