WiSnap User Manual 4.41 05282015-ML
Page 29
10.1 System Timers and Auto Connect Timers
The WiSnap module uses the Real Time clock (RTC) to generate timers. The RTC is active even when the WiSnap module is
asleep. This makes it possible to put the module to sleep and wake up from sleep based on timer intervals using timers.
The WiSnap module has the following timers available:
Sleep Timer:
Used to put the WiSnap module to sleep
Wake Timer:
Used to wake the WiSnap module from sleep
Auto-connect Timer:
Used to automatically open a TCP connection
Idle Timer:
Used to automatically close a TCP connection
There are 2 timers that can be used to put the module to sleep, and perform a wake up. If the sleep timer is enabled, the
module will automatically go into deep sleep low power mode once the timer counts down to 0. The sleep timer is disabled if
the module has an IP connection, or the module is in COMMAND mode.
The sleep timer (which is the time the WiSnap is awake) is a 32 bit number of seconds so it can be as high as 1.19 million hours.
The wake timer (which is the time the WiSnap is asleep) is a 22 bit number of seconds so the maximum sleeping time is 1165
hours.
The sleep timer is set with:
set sys sleep <time> -
time = decimal in seconds. The wake timer will bring the module out of deep
sleep.
The wake timer is set with:
set sys wake <time> -
time = decimal in seconds.
For example, if you wanted the module to wake up, join a network and be available to accept TCP connections for 30 seconds
every two minutes you would set the timers as such:
1)
set wlan ssid my_net
2)
set wlan passphrase my_pass set sys sleep 30
3)
set sys wake 90 save
4)
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.