Home/Support/Support Forum/XBee WiFi S6B Pin Sleep not sleeping when connecting to a remote port

XBee WiFi S6B Pin Sleep not sleeping when connecting to a remote port

0 votes
I have an application that wakes up the XBee every 15 seconds and attempts to connect (via API frame) to a remote server. When the remote server is up this is fine and the sleep pin is set high and the XBee goes back to sleep.
However if the remote server is not running then the XBee does not enter the sleep mode when the sleep pin is set high. I have set the timeout (TM) to 1 (x100ms) but this has no effect.
Please help as this is killing the batteries.
The firmware is 2024.
asked Apr 24, 2015 in IEEE 802.11 (Wi-Fi) by mike.mccusker New to the Community (9 points)

Please log in or register to answer this question.

5 Answers

0 votes
What sleep state are you working with? Have you tried using Cyclic sleep?
answered May 13, 2015 by mvut Veteran of the Digi Community (13,333 points)
Pin sleep - and I need to have control over when it sleeps so dont want to use cyclic sleep.
How about using the SO option bit to remain associated.
Because I need to maximise battery life and associated sleep takes more power than non-associated sleep.
I tested what you are saying and when I have the port disabled or not running, I am able to get the radio to sleep without an issue.
I confirmed whether the XBee WIFI enter sleep as follows.
The consumption current of XBee WIFI is about 100mA, and ON_nSLEEP keeps high.
I recognize that such is awake and not sleep.
I set  XBee WIFI to AP "2"(API-enable w/escaped) and BD "7"(115200) used X-CTU. All others keep default setting. And all work properly, except for sleep.
What is problem?
I have also have almost the same trouble condition as you.
My XBee WIFI do not enter into the Pin Sleep. The ON_nSLEEP(Pin13) keeps hith(3.3V).
I set SM "1"(->Pin sleep) and the SLEEP_RQ (Pin9) to high(3.3V) but the XBee keeps awake, does not enter to Pin Sleep.
I recognize that the XBee WIFI pin sleep only needs SM "1" and SLEEP_RQ high, or is any other condition necessary?
0 votes
It sounds like it is your application that may be keeping it awake.

A simple test is to use the X-CTU terminal to manually send simple data packets to the server. Send every 1-2 seconds using the Send Sequence (bottom right hand corner).

While the module is sending to the server, close the server socket and immediately assert the sleep pin on the module.

The module will immediately sleep.

I use Hercules 3.2.8 for my TCP server and X-CTU 6.1.3 for the client side.
answered May 15, 2015 by Rocker1446 Seasoned Professional (227 points)
I am checking the sleep state by measuring the current draw and when a connection to the server cannot be established I see the sleep pin being set high but no reduction in current draw. This happens every time a connection cannot be made. Its as if the module is timing out a connect.
0 votes
Providing that the radio has finished sending data, you should be able to drive D8 (Sleep Request) high and the radio will cycle to a sleep state. That is providing that the SM command is set to pin sleep.
answered May 22, 2015 by mvut Veteran of the Digi Community (13,333 points)
This is the issue there is no data to send because it never connected.
It has to associate before it can sleep.
I tried that I use both my software and X-CTU to set SM to "1". But XBee WIFI does not enter sleep if I put high(3.3V) to SLEEP_RQ pin when XBee WIFI has finished sending all data.
I cannot make the XBee WIFI work not only Pin Sleep but also Cyclic Sleep. The condition of Cyclic Sleep is the same as that of Pin Sleep, the consumption of current does not decrease and the ON_nSLEEP pin keeps high(awake).
In order to set XBee WIFI to Cyclic Sleep, I set SO"100", SP"1F4", ST"1388", WH"100" and SM"4", keep all setting default except for SM,  when XBee WIFI and host microprocessor finish communicating tx/rx data.
I watch ON_nSLEEP pin and confirm that it keeps high and never change to low. It means that XBee WIFI do not enter Sleep.
I can make XBee the WIFI enter neither Pin Sleep nor Cyclic Sleep.
For Sleep, some other requirements seem to be necessary. What are they?
I tried the same as your suggestion.
I set SM to "1" and put the SLEEP_RQ pin to high. But the ON_nSLEEP pin does not change to low, keeps high. It means that XBee WIFI keeps awake, does not enter Pin Sleep.
I measured the current of XBee WIFI at that time and it is near 100mA. It must not be Sleep.
In order to enter sleep, XBee WIFI must require more. Please give me those information.
0 votes
No it does not require more to cycle to a sleep state. What firmware version are you working with?
answered May 29, 2015 by mvut Veteran of the Digi Community (13,333 points)
Just updated to 2026 and problem still persists. Just to restate the issue. I can see the association is successful I then try to send a frame to a server that is not running so the port is closed. After a few seconds I set the pin sleep pin high (it is configured for pin sleep) and a see the current draw remain at 100mA so it is not sleeping.
This is going to kill the project because it means if a server ever goes down the batteries will drain very quickly.
Then I would suggest you contact Digi Technical Services.
0 votes
I had a similar problem using XBee S6B firmware: 2021 connected to a microcontroller through SPI and with communication through API frames.

Whenever my microcontroller sends an API frame, it starts its own timer. If the timer expires before a response is received, it tries to resend the message, but it will only follow this process up to 5 more times before giving up. If all attempts were unsuccessful, then an ATFR packet is sent (this forces a software reset) and pin sleep is asserted. The xbee enters sleep immediately after being reset.
answered Aug 25, 2015 by draked2 New to the Community (1 point)
...