Access Point

From Klaus' wiki
Revision as of 16:45, 12 November 2020 by Klaus (Talk | contribs)

Jump to: navigation, search

In order to set up the BeagleBone Black as an access point you need to go through a few steps.

I have done this with a TP-Link TL-WN722N adapter.
TP-Link TL-WN722N.png

Manual set up for testing

First is introduced a manual set up and test. After that comes the automation

Configure the Hostappd

First edit the /etc/hostapd/hostapd.conf file (as root)

### Wireless network name ###
### Set your bridge name ###
ssid=<The SSID the AP should Present it self with>
channel=<select af free channel e.g. 1, 6 or 11>
# # Static WPA2 key configuration
# #1=wpa1, 2=wpa2, 3=both
## Key management algorithms ##
## Set cipher suites (encryption algorithms) ##
## TKIP = Temporal Key Integrity Protocol
## CCMP = AES in Counter mode with CBC-MAC
wpa_pairwise=TKIP CCMP
## Shared Key Authentication ##
## Accept all MAC address ###
#enables/disables broadcasting the ssid
# Needed for Windows clients

Configure IP addresses

To set an ip address on the wlan0 interface perform these commands as root:

]$ ip link set wlan0 down
]$ ip addr flush dev wlan0
]$ ip link set wlan0 up
]$ ip addr add dev wlan0

Set up dnsmasqd

In /etc/dnsmasq.d/ create a file (e.g. WlanAp0) with this content:


Note: Do not add to the SoftAp0 file because it will be overwritten at boot.

Manually test

Next test i manually, in order to see if the access point software will run without errors.

root@beaglebone ]$ systemctl stop wpa_supplicant.service
root@beaglebone ]$ hostapd  /etc/hostapd/hostapd.conf

If you can get this connection up running with your password but no IP address everything at this point is fine.

You can stop the wpa_supplicant service permanently by issuing

root@beaglebone ]$ systemctl disable wpa_supplicant.service

Automating it all

In order to set up the wifi access point a boot a few things is needed to be done.

Rather than tracing the whole shabang of boot scripts and other relevant configuration files, I've made a couple of simple scripts that will bring up the WiFi access point at boot.

If this was for production I'd gone through all the scripts and configuration files to make it more correct. But this solution solves my needs for this project. I kill or stop what I don't need and starts what I need.

You'll need the configurations files from above, so keep them intact.

The set up script

In /root/bin/ put this:

systemctl stop wpa_supplicant.service
ip link set wlan0 down
ip addr flush dev wlan0
ip link set wlan0 up
ip addr add dev wlan0
systemctl restart hostapd

Note: If you want another IP address be sure to also modify the WifiAP0 file in /etc/dnsmasq.d to suit your needs.

Boot script

comming soon