www.rovingnetworks.com
Version 1.0r 9/21/2012
62
RN -W IFLYCR -U M
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: Turn on Auto Pairing
set ip host 0.0.0.0
// Set the host to 0.0.0.0
set ip flags 0x40
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 16 for which bit to set to enable this feature.
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 module. If an application is listening
for the UDP broadcast, a number of useful parameters 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.
NOTE:
You can send the module’s sensor data out via UDP broadcast. The analog-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
command 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.
The packet is 110 bytes of data as shown in Figure 12.