3

I have followed the following tutorial to set up an wifi access point:

After configuring hostapd, i've tested the setup with

sudo /usr/sbin/hostapd /etc/hostapd/hostapd.conf

and recieved the following error:

Configuration file: /etc/hostapd/hostapd.conf

Failed to create interface mon.wlan0: -95 (Operation not supported)
wlan0: Could not connect to kernel driver
Using interface wlan0 with hwaddr b8:27:eb:3d:60:0c and ssid "Pi3-AP"
wlan0: interface state UNINITIALIZED->ENABLED
wlan0: AP-ENABLED 

In my sudo nano /etc/network/interfaces

# interfaces(5) file used by ifup(8) and ifdown(8)

# Please note that this file is written to be used with dhcpcd
# For static IP, consult /etc/dhcpcd.conf and 'man dhcpcd.conf'

# Include files from /etc/network/interfaces.d:
source-directory /etc/network/interfaces.d

auto lo
    iface lo inet loopback

#iface eth0 inet manual

auto eth0
    allow-hotplug eth0
    iface eth0 inet static
    address 172.16.164.145
    netmask 255.255.255.0
    broadcast 172.16.164.255
    gateway 172.16.164.254
    dns-nameservers 172.22.16.98

allow-hotplug wlan0
    iface wlan0 inet static
    address 172.16.164.1
    netmask 255.255.255.0
    network 172.16.164.0
    broadcast 172.16.164.255

#wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf

#allow-hotplug wlan1
#iface wlan1 inet manual
#    wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf

In my sudo nano /etc/hostapd/hostapd.conf

# This is the name of the WiFi interface we configured above
interface=wlan0

# Use the nl80211 driver with the brcmfmac driver
driver=nl80211

# This is the name of the network
ssid=Pi3-AP

# Use the 2.4GHz band
hw_mode=g

# Use channel 6
channel=6

# Enable 802.11n
ieee80211n=1

# Enable WMM
wmm_enabled=1

# Enable 40MHz channels with 20ns guard interval
ht_capab=[HT40][SHORT-GI-20][DSSS_CCK-40]

# Accept all MAC addresses
macaddr_acl=0

# Use WPA authentication
auth_algs=1

# Require clients to know the network name
ignore_broadcast_ssid=0

# Use WPA2
wpa=2

# Use a pre-shared key
wpa_key_mgmt=WPA-PSK

# The network passphrase
wpa_passphrase=raspberry

# Use AES, instead of TKIP
rsn_pairwise=CCMP

I would appericate any help to solve this problem. I am a totally beginner in Raspberry Pi and Linux.

Much appreciated

3

Do you see the AP with your phone or laptop? In the raspberry.org forums the same issue (after following the same tutorial) has been discussed. The user allfox mentioned this error is a result of implementation delays...

If you start the hostapd with

sudo /usr/sbin/hostapd -d /etc/hostapd/hostapd.conf

or

sudo /usr/sbin/hostapd -dd /etc/hostapd/hostapd.conf

You should see something like:

nl80211: Driver does not support monitor interface type - try to run without it

but the AP should be visible.

Edit:

Assuming that that the LAN where you connect your eth0 port of your Raspberry already runs a DHCP (which would make a static IP there a source for conflicts) you can configure your Pi like this:

Remove the dnsmasq AND hostapd and all related config files:

sudo apt-get purge dnsmasq hostapd

Install hostapd and bridging tools:

sudo apt-get install hostapd bridge-utils

The interface config should look like this /etc/network/interfaces

# Localhost
auto lo
iface lo inet loopback

# Ethernet
auto eth0
allow-hotplug eth0
iface eth0 inet manual
# Ethernet VLAN for config
auto eth0.1
allow-hotplug eth0.1
iface eth0 inet dhcp

# WLAN
auto wlan0
allow-hotplug wlan0
iface wlan0 inet manual
wireless-power off

# bridge
auto br0
iface br0 inet dhcp
bridge_ports eth0 wlan0
pre-up ifconfig eth0 0.0.0.0 up
pre-up ifconfig wlan0 0.0.0.0 up
pre-up brctl addbr br0
pre-up brctl addif br0 eth0
post-down ifconfig wlan0 0.0.0.0 down
post-down ifconfig eth0 0.0.0.0 down
post-down brctl delif br0 eth0
post-down brctl delbr br0

The bridge will replace the eth0 so you cant access this interface anymore. The eth0.1 will be a virtual interface that get also an IP from the DHCP of your LAN. If you reboot, the pi should be accessible over this eth0.1 interface and the IP address provided by your router. You can check with

brctl show

if the bridge is working.

Your hostapd config in the /etc/hostapd/hostapd.conf file should look like this

bridge=br0

interface=wlan0
#driver=nl80211


ssid=Pi3AP
channel=1
hw_mode=g
ieee80211n=1
ieee80211d=1
wmm_enabled=1


auth_algs=1
wpa=2
wpa_key_mgmt=WPA-PSK
rsn_pairwise=CCMP
wpa_passphrase=badpassword

Test if the AP comes up:

sudo /usr/sbin/hostapd -dd /etc/hostapd/hostapd.conf

If the AP comes up and you can connect with a device to it, you can daemonize it by editing /etc/default/hostapd

DAEMON_CONF="/etc/hostapd/hostapd.conf"

After rebooting the AP should become visible after less than 3 minutes.

This edit is based on a tutorial of Lawrence on his blog here and here and this answer to a bridging question. I run a similar config on a RPi2.

  • I am unable to see the AP on my phone. – Nicholas Mar 16 '17 at 4:06
  • I used the command above that you have provided, i did see something like u have mentioned. However the AP is not visible – Nicholas Mar 16 '17 at 4:07
  • i dont have a RPi 3 here at the moment.... i can update my PRi2 AP configuration and post it here...Please type lsusb and post the output – Joe Platano Mar 16 '17 at 4:40
  • pi@raspberrypi:~ $ lsusb Bus 001 Device 005: ID 04ca:002f Lite-On Technology Corp. Bus 001 Device 004: ID 04ca:0061 Lite-On Technology Corp. Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp. SMSC9512/9514 Fast Ethernet Adapter Bus 001 Device 002: ID 0424:9514 Standard Microsystems Corp. Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub – Nicholas Mar 16 '17 at 4:47
  • does your LAN has a DHCP on the router or do you have static IP addresses? – Joe Platano Mar 16 '17 at 4:52
0

To Configure an Acess Point out of a Raspberry I've made a Shell-Script for a Student Project. https://github.com/Doriangaensslen/pren1/raspberry_installation_scripts/wlan_activate.sh

Execute it only on a clean Raspberry

0

Use "pi-ap"- a Github repo which automates the configuration of a Pi 3 (or Pi 4) into a WiFi AP. Really, REALLY simple to use. Just edit variables.sh and change some default values, and then sudo ./install.sh will get you a working Pi Access Point in about 3.5 minutes while you drink your tea.

Only need a Pi 3B+ or a Pi 4, an Ethernet cable and a router with an Internet connection to uplink the Pi to and you're good to go:

https://github.com/f1linux/pi-ap/

The install.sh script calls all the other dependent scripts which source that variables.sh file and a few minutes later a working Access Point comes out the other end of the sausage maker. There's a detailed README.md in the repo and a Wiki for it in Github for support. HTH- T

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.