www.rovingnetworks.com
Version 1.0r 9/21/2012
49
RN -W IFLYCR -U M
For example, if you want a UDP sleep timer of 40 ms, use the following commands:
set sys autosleep 4
// Set the auto-sleep value to 4
set comm timer 10
// Set the 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.
TCP Connection Timers
The TCP connection timers control when the module opens or closes a socket.
Opening a TCP Connection
In TCP client mode, the auto-conn timer controls the establishment of a socket connection. 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.
NOTE:
You must specify the remote host’s IP address and port number in the module’s configuration file for the
auto-connect timer to work.
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.
WAKE ON SENSOR INPUT
Four sensor inputs (0 to 3) wake the module from sleep. These pins have a small current 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, pulling 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 module using sensor pin 2, use
set sys trig 4
. Setting the trigger value to
0 disables all sensor pins.
Table 21 describes the values to wake the module using individual sensor inputs.