Digi International Inc XB3C1 Manuel D’Utilisation

Page de 146
Sleep modes
The sleep timer
Digi XBee3 Cellular LTE Cat 1 Smart Modem User Guide
85
Connected sleep mode draws 9 mA during sleep and 11 mA average over time (including periodically
waking up to maintain connection).
The sleep timer
If the device receives serial or RF data in Cyclic sleep mode and Cyclic sleep with pin wake up modes
(SM = 4 or SM = 5), it starts a sleep timer (time until sleep).
n
Use
to set the duration of the timer.
n
When the sleep timer expires the device returns to sleep.
MicroPython sleep behavior
When the XBee Smart Modem enters deep sleep mode, any MicroPython code currently executing is
suspended until the device comes out of sleep. When the XBee Smart Modem comes out of sleep
mode, MicroPython execution continues where it left off.
Upon entering deep sleep mode, the XBee Smart Modem closes any active UDP connections and turns
off the cellular component. As a result, any sockets that were opened in MicroPython prior to sleep
report as no longer being connected. This behavior appears the same as a typical socket
disconnection event will:
n
socket.send raises OSError: ENOTCONN
n
socket.sendto raises OSError: ENOTCONN
n
socket.recv returns the empty string, the traditional end-of-file return value
n
socket.recvfrom returns an empty message, for example:
(b'', (<address from connect()>, <port from connect()>) )
The underlying UDP socket resources have been released at this point.