WiSnap User Manual 2.21 04112011-JF
Page
31
of
66
Once the module is awake, you can open a TCP connection to a remote host in a number of ways
described below. The remote host can be set using the following commands:
set ip host <IP address>
OR
set dns name <string>
// sets up the IP address OR URL of host
set ip remote <port number>
// sets up the port number on which the
host is listening
save
// save settings in config file
reboot
// reboots the module so that the settings take effect
Method
Type
Description
Auto
connect
Internal
RTC Timer
Connect out to the host at specific time intervals based upon the
set sys autoconn <secs>
command
Open
Uart
In command mode, you can issue the
open
command
Connect on
UART data
Uart mode
2
This mode is designed for the HTML client feature. Use the
set
UART mode 2
command to automatically connect out to host on
UART data
GPIO 5
Alternative
GPIO
functions
Set the alternative functions for GPIO 4, 5 and 6 (Refer section
10.5.1). Set GPIO 5 HIGH to trigger TCP connection, LOW to
disconnect
10.1
System Timers and Auto Connect Timers
The WiSnap module uses the Real Time clock 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:
1.
Sleep Timer: Used to put the WiSnap module to sleep
2.
Wake Timer: Used to wake the WiSnap module from sleep
3.
Auto-connect Timer: Used to automatically open a TCP connection
4.
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 2 minutes you would set the timers as such: