WiSnap User Manual 4.41 05282015-ML
Page 16
set ip address
<addr>
-
sets the IP address of the WiSnap module, where <
address
> is an IP address in the form
<octet>.<octet>.<octet>.<octet>
with <
octet
> being a number between 0 and 255. If DHCP is turned on, the IP address is
assigned and overwritten during association with the access point.
Example:
set ip a
10.20.20.1
set ip backup
<addr>
-
sets a secondary host IP address. If the primary host IP is not reachable the module will try the
secondary IP address if set.
set ip dchp
<value>
-
enable/disable DHCP mode. If enabled, the IP address, gateway, netmask, and DNS server are requested
and set upon association with access point. Any current IP values are overwritten.
DHCP Cache mode can reduce the time it takes the module to wake from deep sleep thus saving power. In cache mode, the
lease time is checked and if not expired, the module uses the previous IP settings. If the lease has expired the module will
attempt to associated and use DHCP to get the IP settings. DHCP cached IP address does not survive a power cycle or reset.
Mode
Protocol
0
DHCP OFF, use stored static IP address
1
DHCP ON, get IP address and gateway from AP
2
Auto-IP, generally used with Ad hoc networks
3
DHCP cache mode, uses previous IP address if lease is not expired
(leave survives reboot)
4
Enables DHCP server in soft AP mode
set ip flags
<value>
-
sets TCP/IP advanced functions. Value is a bit mapped flag register. Default = 0x7.
Bit
Protocol
0
TCP connection status - see note below
1
Bypass Nagle algorithm and use TCP_NODELAY
2
TCP retry enabled (42 total)
3
UDP retry (attempts retry if no ACK from UDP)
4
DNS host address caching enabled
5
ARP table caching enabled
6
UDP auto pairing enabled
7
Add 8 byte timestamp to UDP or TCP packets
NOTE:
When the link to an associated to an access point is lost while a TCP connection is active, the TCP connection
can be left in a hung/inconsistent state. In some cases, the TCP connection will not recover. In version 2.20 and later,
if the link to the access point is regained within 60 seconds, the TCP connection will survive.
With version 2.20 we have changed the operation of bit0 in the “ip flags” register. Previously this bit specified the TCP
copy function, but controls the TCP socket function while associated on a network.
If bit 0 is set (default) TCP connections are kept open when the connection to the access point is lost.
If bit 0 is cleared (by setting “set ip flags 0x6” for example) then when the connection to the access point is
lost and TCP is connected, the connection will be closed.
set ip gateway
<addr>
-
sets the gateway IP address, If DHCP is turned on, the gateway IP address is assign and overwritten
during association with the access point.
set ip host
<addr>
-
sets the remote host IP address. This command is used for making connections from the WiSnap module
to a TCP/IP server at the IP address
<addr>
.
set ip localport
<num>
-
sets the local port number to listen for incoming connections, where
<num>
is an integer number
representing the port.