
www.rovingnetworks.com
Version 1.0r 9/21/2012
77
RN -W IFLYCR -U M
AD HOC NETWORKING MODE
There are two types of networks, infrastructure and ad hoc. Infrastructure networks, in which an access point links all
Wi-Fi devices, are the most common. The access point keeps track of devices on the local network and directs IP packets.
In many cases, the access point is also a router and forwards packets from the local network to other networks and the
Internet. It is also very common for the access point to run a DHCP server, which tracks and assigns IP addresses.
Ad hoc networks are point-to-point networks in that each Wi-Fi device is linked directly to every other Wi-Fi device on the
ad hoc network. There is no access point. All Wi-Fi devices on the ad hoc network participate in keeping the network alive
and each keeps track of the other active devices on the network by sending and receiving beacon and probe packets. In
most cases, IP addresses are assigned through automatic IP, although one of the Wi-Fi devices can be configured as a
DHCP server.
NOTE:
Roving Networks supports ad hoc networking, however, going forward, ad hoc mode will be replaced with soft
AP mode. Ad hoc mode and soft AP mode are mutually exclusive and cannot operate at the same time. The
support for these modes resides in separate firmware images loaded on the module. By default, Roving
Networks modules are shipped with the ad hoc mode image to maintain backwards compatibility with existing
applications. Refer to “Access Point (AP) Mode” on page 42 for more information on AP mode.
Configuring Ad Hoc Mode
You can configure the module to setup an ad hoc network. This mode is useful for point-to-point communications. When in
ad hoc mode the device appears like an access point with which other Wi-Fi devices can associate.
NOTE:
Currently the module only supports the OPEN mode for creating ad hoc networks.
You can enable ad hoc mode via hardware or software commands.
Enable Ad Hoc Mode in Hardware
To enable ad hoc mode using hardware, set GPIO9 high (3.3 V) at power up. For the RN-134 board, GPIO9 is on pin 1 on
the jumper block (J2). For the RN-174 board, GPIO9 is on the J6 connector. Upon power up with GPIO9 high, the WiFly
module creates an ad hoc network with the following settings:
SSID:
WiFly-GSX-
XX
, where
XX
is the final two bytes of the device’s MAC address
Channel:
1
DHCP:
OFF
IP address:
169.254.1.1
Netmask:
255.255.0.0
With the ad hoc jumper in place, these settings override any current saved configuration settings.
Enable Ad Hoc Mode in Software
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