WiSnap User Manual 2.21 04112011-JF
Page
32
of
66
set wlan ssid my_net
set wlan passphrase my_pass
set sys sleep 30
set sys wake 90
save
reboot
The above diagram shows the transitions between the Sleep state and Awake state based on the
sleep and wake timers.
10.1.1
UDP Sleep and Connection Timers
In UDP-only protocol mode (set ip proto 1), the autoconn timer is used as an auto-sleep timer.
Upon the start of transmission of the first UDP data packet this timer will count down, after which the
module will go to sleep.
set sys autosleep <value>
// UDP Only mode: sets the auto-sleep timer. Setting value=0
disables autosleep timer
The UDP auto-sleep timer is set using two variables. The timer interval is a product of the autosleep
value and the comm flush timer (in milli seconds). The timer is decremented every “product”
milliseconds.
For example, if you need a UDP sleep timer of 40 milli seconds, you need to set the following
variables:
set sys autosleep 4
// Sets the autosleep value to 4
set comm timer 10
// Sets the comm timer to 10 ms (default value)
The resulting UDP sleep timer will be 4*10 ms = 40 ms. You can also use a combination of autosleep
= 2 and comm timer = 20 ms to achieve the same effect.
Using a minimum value of 2 (when the default flushtime=10 ms) is recommended to ensure that the
UDP packet gets transmitted. For larger packets the value should be increased.