WiSnap User Manual 4.41 05282015-ML
Page 49
To enable ad hoc mode in software, you use the
set wlan
command with the
join
,
ssid
, and
chan
parameters.
For example, type the following commands in command mode:
-
set wlan join 4
-
set wlan ssid my_adhoc_network
-
set wlan chan 1
Turn off DHCP so that the module does not attempt to obtain an IP address from another device, and set the module’s IP
address and netmask. Because an automatic IP assignment fixes the first two bytes of the IP address, use 255.255.0.0 as the
netmask so that other devices connecting to the module can be reached. You can also set the netmask to a smaller subnet if
the other device’s IP addresses begin statically at the same subnet as the ad hoc device.
-
set ip address 169.254.1.1
-
set ip netmask 255.255.0.0
-
set ip dhcp 0
Save your configuration and reboot. The module will be in ad hoc mode.
The module can associate with an ad hoc network created by another device. Type the following commands:
1)
set wlan ssid my_adhoc_network
2)
save
3)
reboot
To associate with an ad hoc network without saving the changes to the module’s flash memory, use the
join
command, e.g.,
join my_adhoc_network
<cr>. If the module was already associated with another network, you must first disassociate with it
using the leave command.
If DHCP is enabled, the WiSnap device obtains IP address automatically when it associates with the ad hoc network. By
definition, auto IP sets the first two bytes of the subnet to 169.254.xxx.xxx. The WiSnap device requires 2 to 3 seconds to
resolve the IP address.
To set the IP address statically, disable DHCP and explicitly assign the IP address:
-
set ip dhcp 0
-
set ip address 169.254.1.2
You can confirm that the device has properly associated with the ad hoc network using the
ping
command:
-
ping 168.254.1.1 10
You can associate with the ad hoc network from a computer by specifying the network name (and password, if required) in the
operating system. For example, choose Control Panel > Networking and Sharing > Networking and Sharing Center. You can
then view available networks and select the name of the WiSnap ad hoc network.
NOTE:
Once associated with the ad hoc network, Windows may require a few minutes to allocate an IP address. To
work around this, assign a static IP address under Network Settings > TCP/IP > Properties.
Once your computer is associated with the ad hoc network, you can use the module’s IP address to open a connection or
connect using telnet as you would with an enterprise connection.
15.4 Scanning for Access Points in Ad Hoc Mode
The module supports ad hoc infrastructure network modes, but not simultaneously. Scanning for wireless networks is a
function of infrastructure mode. Therefore, the module disables ad hoc mode before scanning.