WiSnap User Manual 2.21 04112011-JF
Page
41
of
66
11.3
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 sent, (any UDP
packet coming back in). If the response packet is not received by approximately 250 ms, the same
UDP packet is sent out.
This continues until either
• A UDP response is seen, or
• A new UDP packet is sent from the module and is acknowledged
To enable this feature, use
set ip flags <value>
11.4
Using the UDP Broadcast function
The WiSnap module can be setup to automatically generate UDP broadcast packets. This is useful
for a number of reasons:
-
Some Access Points will disconnect devices that sit idle and don’t send any packets after a
time. Using the UDP broadcast informs the AP that WiSnap is alive and wants to stay
associated.
-
This feature can be used by application programs to auto-discover and auto configure the
WiSnap 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 IP address and port number of the WiSnap are both part of the packet, and thus the
WiSnap can be connected to and configured remotely with this information.
-
The MAC address of the associated AP, channel, and RSSI value are available in this packet,
thus enabling a simple location and tracking based function.
By default
the WiSnap module now sends out a UDP broadcast to 255.255.255.255 on port 55555 at
a programmable interval. The broadcast address, port and interval are set using the
“set
broadcast
” commands.
The format of the packet is: 110 bytes of data:
AP MAC
address
Chan
RSSI
Local
TCP port
Real
Time
Clock
Battery
Voltage
GPIO pins
time of
day
Version and
datecode
User
DEVICEID
Boot
time
SENSOR
pins
Bytes Size
0-5
6
MAC adddress of AP that we are Associated with (for location )
6
1
Channel we are on.
7
1
RSSI
8
2
local TCP port# (for connecting into the WiSnap device )
10
4
RTC value (MSB first to LSB last)
14
2
Battery Voltage on Pin 20 in millivolts (2755 for example )
16
2
value of the GPIO pins
18
13
ASCII time
32
26
Version string with date code
60
32
Programmable Device ID string ( set option deviceid <string>)
92 2 Boot time in milliseconds.
94
16 Voltage readings of Sensors 0 thru 7 (enabled with “set opt format <mask>” )