User`s guide
RN-WIFLYCR-UG
www.rovingnetworks.com Version 1.2r 4/30/13 page 72
4.1.1 UDP Auto Pairing
With the UDP auto-pairing feature, the module temporarily stores the host IP address
of the first remote device that sends a UDP packet to the module. This host IP address
is stored in the module’s RAM, which is cleared when the module sleeps or power
cycles. This feature allows the module to echo to any client that sends a UDP packet.
EXAMPLE 4-3: TURN ON AUTO PAIRING
4.1.2 UDP Retry
This feature adds a level of reliability to the UDP protocol without adding the complete
overhead of TCP protocol. When enabled, the module waits for a response on every
UDP packet that is sent (any UDP packet coming back in). If the module does not
receive the response packet by approximately 250 ms, the same UDP packet is sent
out. This process continues until either:
• A UDP response is seen
• A new UDP packet is sent from the module and is acknowledged
Refer to “set ip flags <mask>” on page 17 for which bit to set to enable this feature.
4.1.3 UDP Broadcast
You can set up the module to generate UDP broadcast packets automatically, which is
useful for the following reasons:
• Some access points disconnect devices that are idle. UDP broadcast informs the
access point that the module is alive and wants to stay associated.
• Applications can use this feature to automatically discover and configure the mod-
ule. If an application is listening for the UDP broadcast, a number of useful param-
eters are present in the package that can be used for auto-discovery. For
example, the module’s IP address and port number are part of the packet, thus an
application can connect to the module and remotely configure it.
• The associated access point’s MAC address, channel, and RSSI value are also
available in this packet, enabling a simple location and tracking function.
By default, the module sends out a UDP broadcast to 255.255.255.255 on port 55555
at a programmable interval. You set the broadcast address, port, and interval using the
set broadcast commands.
set ip host 0.0.0.0 // Set the host to 0.0.0.0
set ip flags 0x40
Note: You can send the module’s sensor data out via UDP broadcast. The ana-
log-to-digital convertor is 14 bits on a 400 mV signal, which translates to
about 24 microvolts (0x61A80 in hex). When you use the show q com-
mand in command mode, the module displays the raw readings. However,
for HTTP web posting and UDP broadcast packets, the module shifts the
reading by 4 bits (which is a divide by 16) resulting in a 16-bit number.
Therefore, if you want the actual voltage sampled, you must take the 16-bit
number and shift it left by 4 bits to get the number of microvolts. If you the
value in millivolts (and do not need high accuracy), right shift by another 6
bits, which is the same as dividing by about 1K.