User`s guide

RN-WIFLYCR-UG
www.rovingnetworks.com Version 1.2r 4/30/13 page 58
For example, if you want a UDP sleep timer of 40 ms, use the following commands:
set sys autosleep 4 // Set auto-sleep value to 4
set comm timer 10 // Set comm timer to 10 ms (default value)
The resulting UDP sleep timer is 4 x 10 ms or 40 ms. You could also set autosleep = 2
and comm timer = 20 ms to achieve the same effect.
Roving Networks recommends using a minimum value of 2 (when the default flush time
is 10 ms) to ensure that the UDP packet is transmitted. For larger packets, you should
increase the value.
3.4.2 TCP Connection Timers
The TCP connection timers control when the module opens or closes a socket.
3.4.2.1 OPENING A TCP CONNECTION
In TCP client mode, the auto-conn timer controls the establishment of a socket connec-
tion. When set, the device periodically attempts to establish a connection when the
timer expires.
The set sys autoconn <value> command causes the module to connect to the host
periodically. The timer <value> determines how often to connect to the stored remote
host. If set to 1, the module makes one attempt to auto connect upon power up. If set
to 2 or higher, auto connect re-opens the connection after the connection is closed. The
default, 0, disables the timer.
3.4.2.2 CLOSING THE TCP CONNECTION
The module supports a disconnect timer in both TCP client and server mode (default
mode). You can use this timer to close a TCP connection automatically after a specified
number of seconds of no transmit or receive data. To set the disconnect timer, use the
set comm idle <value> command, where <value> is the number of seconds. The
default comm idle timer value is 0, which means the module never disconnects when
idle.
For example, to close the TCP connection after 5 seconds of inactivity, use the set
comm idle 5 command.
3.5 WAKE ON SENSOR INPUT
Four sensor inputs (0 to 3) wake the module from sleep. These pins have a small cur-
rent source that is activated in sleep mode. This source is approximately 100 nA, and
causes the input to float up to about 1.2-V DC. If, for example, SENSE1 is enabled, pull-
ing the SENSE1 pin to ground wakes the device.
To enable the sensors to wake the module, use the command set sys trigger <mask>,
where <mask> is a bit-mapped setting of each sensor. For example, to wake the mod-
ule using sensor pin 2, use set sys trig 4. Setting the trigger value to 0 disables all sen-
sor pins.
Note: You must specify the remote host’s IP address and port number in the mod-
ule’s configuration file for the auto-connect timer to work.