You are on page 1of 4

3/20/2020 Configuring a WLan ad-hoc network [Community Environmental Observation Network - Wiki]

You are here /  (/ceonwiki/doku.php?id=start) / hardware (/ceonwiki/doku.php?id=hardware:start)


/ BeagleBone Black (/ceonwiki/doku.php?id=hardware:beaglebone_black)
/ BeagleBone Black with Debian Linux (/ceonwiki/doku.php?id=hardware:beaglebone_black:debian)
/ Configuring a WLan ad-hoc network (/ceonwiki/doku.php?
id=hardware:beaglebone_black:debian:configure_wlan_adhoc_network)

hardware:beaglebone_black:debian:configure_wlan_adhoc_network

Configuring a WLan ad-hoc network


Make shure that you power the BeagleBone Black from
an external power supply. The USB supply of the USB
connector doesn't supply enough current for a proper
operation of the WiFi antenna.

The configuration of the WLan interface in ad-hoc mode is done using the /etc/network/interfaces file.
For this description it is assumed, that the WLan interface is named as wlan0 .

Un-encrypted ad-hoc network


Add the following lines to the wlan0 interface configuration:

auto wlan0
iface wlan0 inet static
address 192.168.9.7
netmask 255.255.255.0
wireless-channel 1
wireless-essid ruwai-wmn
wireless-mode ad-hoc

The auto wlan0 causes to start the wlan0 interface automatically during booting.

To manually start the wlan0 interface use the ifup command:

root@beaglebone:~# ifup wlan0

To stop the wlan0 interface use the ifdown command:

root@beaglebone:~# ifdown wlan0

To scan for WLan cellss in rage us iwlist :

https://www.mertl-research.at/ceonwiki/doku.php?id=hardware:beaglebone_black:debian:configure_wlan_adhoc_network 1/4
3/20/2020 Configuring a WLan ad-hoc network [Community Environmental Observation Network - Wiki]

root@beaglebone:~# iwlist wlan0 scan


wlan0 Scan completed :
Cell 01 - Address: C4:27:95:8A:DE:16
Channel:1
Frequency:2.412 GHz (Channel 1)
Quality=59/70 Signal level=-51 dBm
Encryption key:on
ESSID:"UPC2036903"
Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 11 Mb/s; 18 Mb/s
24 Mb/s; 36 Mb/s; 54 Mb/s
Bit Rates:6 Mb/s; 9 Mb/s; 12 Mb/s; 48 Mb/s
Mode:Master
.
.
.
.
.
root@beaglebone:~#

Keep in mind, that this description sets up an un-encrypted ad-


hoc connection.

Ad-Hoc network with WEP encryption


To enable the WEP (https://en.wikipedia.org/wiki/Wired_Equivalent_Privacy) encryption of the ad-hoc
network add the wireless-key option to the network interface configuration file. The WEP key has to be
specified as a hex-key. One can use online key generators (e.g.
http://www.andrewscompanies.com/tools/wep.asp (http://www.andrewscompanies.com/tools/wep.asp)) to
create the appropriate keys.

The WLan interface might not start up with the WEP encryption set when using a key-length that is not
supported by the used WLan antenna chipset. So make sure to check if the Encryption key is set using
iwconfig .

auto wlan0
iface wlan0 inet static
address 192.168.9.5
netmask 255.255.255.0
wireless-mode ad-hoc
wireless-channel 6
wireless-essid ruwai-wmn
wireless-key 3b205742624039762d586f4f3e

https://www.mertl-research.at/ceonwiki/doku.php?id=hardware:beaglebone_black:debian:configure_wlan_adhoc_network 2/4
3/20/2020 Configuring a WLan ad-hoc network [Community Environmental Observation Network - Wiki]

root@beaglebone:~# iwconfig wlan0


wlan0 IEEE 802.11bgn ESSID:"ruwai-wmn"
Mode:Ad-Hoc Frequency:2.437 GHz Cell: 36:FB:7D:A7:20:2D
Tx-Power=20 dBm
Retry long limit:7 RTS thr:off Fragment thr:off
Encryption key:3B20-5742-6240-3976-2D58-6F4F-3E
Power Management:on

root@beaglebone:~#

Ad-Hoc network with WPA-None encryption


Up to know I couldn't configure my USB WLan antennas using WPA-None encryption with wpa_supplicant
although there are reports in the internet that it's working:

https://wiki.archlinux.org/index.php/Ad-hoc_networking (https://wiki.archlinux.org/index.php/Ad-
hoc_networking)
https://help.ubuntu.com/community/WifiDocs/Adhoc#Encryption
(https://help.ubuntu.com/community/WifiDocs/Adhoc#Encryption)

Ad-Hoc network with WPA2 encryption


Not yet tested.

Problems and strange behaviour


WLan antenna not named wlan0
If your Wlan antenna doesn't appear as wlan0 but for example as wlan1, check the file
/etc/udev/rules.d/70-persistent-net.rules where all previously connected network devices are listed
with their assigned names. Delete the entries conflicting with your wlan interface and restart the
BeagleBone Black.

The interface is started in managed mode


Sometimes it happended, that during the boot, the wlan0 interface was started in managed mode and not
ad-hoc mode. Use iwconfig to check the wlan0 configuration:

https://www.mertl-research.at/ceonwiki/doku.php?id=hardware:beaglebone_black:debian:configure_wlan_adhoc_network 3/4
3/20/2020 Configuring a WLan ad-hoc network [Community Environmental Observation Network - Wiki]

root@beaglebone:~# iwconfig wlan0


wlan0 IEEE 802.11bgn ESSID:"ruwai-wmn"
Mode:Ad-Hoc Frequency:2.437 GHz Cell: EE:99:C3:83:2A:57
Tx-Power=20 dBm
Retry long limit:7 RTS thr:off Fragment thr:off
Encryption key:off
Power Management:on

root@beaglebone:~#

Up to know I couldn't figure out what caused this behaviour. I


thought the running wpa_supplicant service caused it, but
disabling the service didn't resolve the problem.

The PC network manager says: "device not managed"


When you try to use a USB WLan antenna on your PC to connect to the BeagleBone Black Ad-Hoc network
you might see the message device not managed of your network manager (I used Linux Mint 17.1). This is
because the network manager doesn't manage devices that appear in /etc/network/interfaces . You can
either delete the corresponding entry in the /etc/network/interfaces or set the managed flag in
/etc/NetworkManager/NetworkManager.conf to true . After applying the changes restart the network
manager service:

user@computer ~ $ sudo service network-manager restart

 hardware/beaglebone_black/debian/configure_wlan_adhoc_network.txt  Last modified: 2016/02/02 13:11 (external edit)

Imprint
Mertl Research GmbH, Kienmayergasse 22, 1140 Wien
FB-Nr.: 378631 k, Firmengericht: Handelsgericht Wien, UID: ATU67233013
Informationspflicht laut ECG und Mediengesetz (http://www.wkoecg.at/Web/Ecg.aspx?FirmaID=c2b49d2a-4694-4d9b-b5e3-
e1b495d24757) data privacy statement (http://www.mertl-research.at/data-privacy-statement/)

https://www.mertl-research.at/ceonwiki/doku.php?id=hardware:beaglebone_black:debian:configure_wlan_adhoc_network 4/4

You might also like