Beaglebone Black wifi access point (AP) [en]

Requirements

Requirements are are pretty simple you require 4 basic things,

  • The beaglebone black. ( debian wheezy )
  • Usb wifi adapter which supports master mode.
  • 5 volt power supply which can supply 3 amps (15 watts).
  • An utp (RJ45) ethernet connection.

This device covers the required steps to setup an wireless access point on the Beaglebone black although this would easily work on most Linux distributions, this guide is focuses on resolving some quirks you come across. You also require a terminal with root on the Beaglebone black.

bonus tip: if you have the same SSID and password most devices will list concurrent access points as 1 single access point, and even automatically switch between them!

When logged in to the Beaglebone black the first 2 things that are required to do involve circumventing some common wireless problems on the Beaglebone. First update the kernel:

cd /opt/scripts/tools/
./update_kernel.sh


beaglebone black wireless access point

Then we require an service to reset usb devices and wlan interfaces after a reboot.

cd ~
ntpdate -b -s -u pool.ntp.org
apt-get update && apt-get install git
git clone https://github.com/adafruit/wifi-reset.git
cd wifi-reset
chmod +x install.sh
./install.sh

To see your wireless lan device appear between interfaces it may be required to reboot. Download and install the libnl wireless driver:

git clone git://git.infradead.org/users/tgr/libnl.git
cd libnl
sh autogen.sh
./configure
make
make install

The includes and lib for libnl will be placed in: /usr/include/libnl3 and /usr/local/lib/libnl. Both hostapd and bridge utils require to be installed their order does not matter however.

Hostapd

Now we download and install the latest version of hostapd:

wget http://w1.fi/releases/hostapd-2.4.tar.gz
tar xzvf hostapd-2.4.tar.gz
cd hostapd-2.4
cd hostapd
cp debconfig .config
nano .config

We are now editing the configuration file and the folllowing lines to be changed:

CONFIG_DRIVER_NL80211=y
CFLAGS += -I$ /usr/local/include/libnl3/
LIBS += -L$ /usr/local/lib/libnl/
CONFIG_LIBNL32=y

Make sure these lines are equal to yours and save by pressing ctrl+s and enter. With the configuration ready we can now proceed to install hostapd:

make
make install

To test if everything is working correctly simple run:

sudo hostapd hostapd.conf

You should see an network named ‘NetworkTest’ appear you should be able to connect to this network but you wont be provided with an internet connection just yet.
Next we create our own hostapd configuration file:

sudo nano /etc/hostapd/hostapd.conf

Place the following configuration lines into the configuration file, Remember to change the SSID, password, hardware mode(b, g, n), country code and channel.

interface=wlan0
bridge=br0
driver=nl80211
country_code=UK
ssid=networkname
hw_mode=g
channel=1
wpa=2
wpa_passphrase=wifipassword
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP
rsn_pairwise=CCMP
auth_algs=1
macaddr_acl=0

Bridge utils

Next we install bridge utils to create a bridged network between the ethernet and wireless interface.

apt-get install bridge-utils

Now we edit the networking file:

sudo nano /etc/network/interface

And add our bridge interface to it change the first line which should look like:

auto lo

Into the following:

auto lo br0

Next add the following lines to the bottom of the file, Remember to replace every X with your own network details:

allow-hotplug wlan0
iface wlan0 inet manual

allow-hotplug eth0
iface eth1 inet manual

iface br0 inet static
bridge_ports wlan0 eth0
address 192.168.X.X
netmask 255.255.255.0
network 192.168.1.0
gateway 192.168.X.X
dns-nameservers 192.168.X.X


Finally we setup our hostapd script to run at system bootup we do this by opening:

sudo nano /etc/default/hostapd

And changing the line containing DEAMON_CONF to:

DAEMON_CONF=”/etc/hostapd/hostapd.conf”

After rebooting the device your wireless access point should be fully working. You can look up additional resources and documentation for tools used here:

Troubleshooting

  1. Your device shutdowns when the wireless device is activated.
    • The used power supply is unable of delivering the required amount of power.
  2. When I start hostapd and execute iwconfig the wlan interface stays in mode managed.
    • Either your hostapd service stops running or your wireless device does not support master mode.
  3. How do is start, stop, restart the hostapd service
    • Run: /etc/init.d/hostapd start, stop, restart
  4. Hostapd is running but I dont see or cant connect to my access point.
    • Try running hostapd with the -d argument to display detailed debugging information, make sure you have disabled the startup service before you do this.


Geef een reactie

Het e-mailadres wordt niet gepubliceerd. Verplichte velden zijn gemarkeerd met *

*