www.rovingnetworks.com
Version 1.0r 9/21/2012
78
RN -W IFLYCR -U M
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 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 commands:
set wlan ssid my_adhoc_network
save
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 WiFly device obtains an 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 WiFly 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
keyword:
ping 169.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
(Windows Vista) or Control Panel > Network Connections (Windows XP). You can then view available networks and select
the name of the WiFly ad hoc network.
NOTE:
Once associated with the ad hoc network, Windows Vista may require a few minutes to allocate an IP address.
To work around this issue, 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.
Scanning for Access Points in Ad Hoc Mode
The module supports ad hoc and 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.
With firmware version 2.22 and higher, the module can scan for networks while in ad hoc mode. Issuing the scan
command temporarily disables ad hoc model while the module is scanning. Ad hoc mode is restored automatically when
the scan completes. If you are connected to the module over telnet, the scan result is sent over telnet and ad hoc mode is
restored.