Shop OBEX P1 Docs P2 Docs Learn Events
Question about sleep mode for XBee with .BS2 — Parallax Forums

Question about sleep mode for XBee with .BS2

gpiersongpierson Posts: 23
edited 2014-08-24 11:34 in Accessories
A request for help...can someone tell me if I got this correct? I'm trying to put the XBee into sleep mode right before I put the board into sleep mode.

I've run it, and I know the stamp goes inot sleep mode becaue there are no LEDs lit on the stamp. But I'm not sure the Xbee is sleeping. It still has lights on the XBee adapter. How do I know it's sleeping?!

Does this code work for putting it to sleep?

Thanks for any advice!
....................

PAUSE 2000 ' Guard time for command sequence
SEROUT Tx, BaudXBEE, ["+++"] ' Enter command mode
PAUSE 2000 ' Guardtime for command sequence
SEROUT Tx,BaudXBEE, ["ATSM 1", CR]
SLEEP 600 ' Put the board in sleep mode

Comments

  • Tracy AllenTracy Allen Posts: 6,664
    edited 2014-08-23 21:55
    That code in and of itself does put the XBee to sleep. What it does is to enable a pin on the XBee to control wake and sleep, pin 9, SLEEP_RQ. Bringing that pin high will put the XBee to sleep, and bringing the pin low wakes it up. You only need send the ATSM1 command to the XBee once at the top of your program.
  • gpiersongpierson Posts: 23
    edited 2014-08-24 06:52
    Tracy...thanks, I knew I must be missing something.

    I inserted the High/Low commands to trigger sleep/wake. But now I still see leds on. I see Power (Blue solid) Sleep (Amber solid) and Assoc (green flashing) when it's in sleep mode - assuming I truly HAVE it in sleep mode. Should these be off? I assumed all the lights would be off except for "sleep" amber perhaps. Incidentally, I see these lights on even when it's NOT in sleep mode.

    I don't see Tx/Rx lights active...so that's promising.

    Thanks again....how do guys who program for a living have any hair left?! I feel like pulling mine out at times!!!
  • Tracy AllenTracy Allen Posts: 6,664
    edited 2014-08-24 11:34
    The LEDs do draw current, but they are on the breakout board, not on the XBee itself. Which XBee and breakout board do you have? If you can measure power supply current, that would be a good test for sleep and for the residual drawn by the LEDs.

    When the XBee is in sleep mode, it ignores data coming in either over the air or from the serial port, so the fact that you don't see an indication there is a good sign.


    -- tearing hair, oh yes, not much left!
Sign In or Register to comment.