sree80
Posts: 4
Joined: Sat Oct 14, 2017 12:55 pm

Unable to setup Wifi access point on raspbian stretch

Sat Oct 14, 2017 1:08 pm

Hi,
Need help in setting up Wifi Access Point. Followed couple of forums on how to configure Wifi AP

I'm using Raspberry Pi 3 Model B (OS Raspbian Stretch Desktop Version)

sudo /usr/sbin/hostapd /etc/hostapd/hostapd.conf
Configuration file: /etc/hostapd/hostapd.conf
drv->ifindex=3
l2_sock_recv==l2_sock_xmit=0x0x61da50
ioctl[SIOCSIWMODE]: Invalid argument
Could not set interface to mode(3)!
Could not set interface to master mode!
rtl871xdrv driver initialization failed.
[email protected]:~ $ iwconfig
eth0 no wireless extensions.

lo no wireless extensions.

wlan0 IEEE 802.11 ESSID:"SAIHOME"
Mode:Managed Frequency:2.417 GHz Access Point: B8:C1:A2:42:FD:5C
Bit Rate=72.2 Mb/s Tx-Power=31 dBm
Retry short limit:7 RTS thr:off Fragment thr:off
Power Management:on
Link Quality=70/70 Signal level=-17 dBm
Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0
Tx excessive retries:0 Invalid misc:0 Missed beacon:0

Regards,
Jagan

SurferTim
Posts: 1769
Joined: Sat Sep 14, 2013 9:27 am
Location: Miramar Beach, Florida

Re: Unable to setup Wifi access point on raspbian stretch

Sat Oct 14, 2017 3:24 pm

Don't follow the "official" docs. They don't work as of this post. This has both standalone (NATed) and bridged AP examples.
https://github.com/SurferTim/documentat ... s-point.md

sree80
Posts: 4
Joined: Sat Oct 14, 2017 12:55 pm

Re: Unable to setup Wifi access point on raspbian stretch

Sat Oct 14, 2017 5:12 pm

Thanks for the quick response. Still unable to get Access point working.

Below lines are added
sudo nano /etc/dhcpcd.conf


static ip_address=192.168.1.23/24
static routers=192.168.1.1
static domain_name_servers=192.168.1.1
static domain_search=

#interface wlan0
#static ip_address=192.168.1.25
#static routers=192.168.1.1
#static domain_name_servers=192.168.1.1
#static domain_search=
#denyinterfaces wlan0

interface wlan0
static ip_address=192.168.4.1/24


/etc/hostapd/hostapd.conf

interface=wlan0
ssid=saihome_ap
channel=1
# WPA and WPA2 configuration
macaddr_acl=0
auth_algs=1
ignore_broadcast_ssid=0
wpa=2
wpa_passphrase=26250308
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP
rsn_pairwise=CCMP
# Hardware configuration
#driver=nl80211
#rtl871xdrv
ieee80211n=1
device_name=RTL8192CU
manufacturer=Realtek
hw_mode=g

Any issue with configuration?

SurferTim
Posts: 1769
Joined: Sat Sep 14, 2013 9:27 am
Location: Miramar Beach, Florida

Re: Unable to setup Wifi access point on raspbian stretch

Sat Oct 14, 2017 5:20 pm

Check the status of hostapd.

Code: Select all

sudo service hostapd status
It should show active (running)
If it shows active (exited), you have a problem in /etc/default/hostapd with the DAEMON_CONF variable or a problem with /etc/hostapd/hostapd.conf.

sree80
Posts: 4
Joined: Sat Oct 14, 2017 12:55 pm

Re: Unable to setup Wifi access point on raspbian stretch

Sun Oct 15, 2017 12:25 am

Variable name under /etc/default/hostapd

DAEMON_CONF="/etc/hostapd/hostapd.conf"
=================================================
/etc/init.d/hostapd
PATH=/sbin:/bin:/usr/sbin:/usr/bin
DAEMON_SBIN=/usr/sbin/hostapd
DAEMON_DEFS=/etc/default/hostapd
DAEMON_CONF=/etc/hostapd/hostapd.conf
NAME=hostapd
DESC="advanced IEEE 802.11 management"
=========================================================
sudo service hostapd status
● hostapd.service - LSB: Advanced IEEE 802.11 management daemon
Loaded: loaded (/etc/init.d/hostapd; generated; vendor preset: enabled)
Active: active (exited) since Sun 2017-10-15 00:21:11 UTC; 7s ago
Docs: man:systemd-sysv-generator(8)
Process: 718 ExecStop=/etc/init.d/hostapd stop (code=exited, status=0/SUCCESS)
Process: 1860 ExecStart=/etc/init.d/hostapd start (code=exited, status=0/SUCCE

Oct 15 00:21:11 jagan systemd[1]: Starting LSB: Advanced IEEE 802.11 management
Oct 15 00:21:11 jagan hostapd[1860]: Starting advanced IEEE 802.11 management: h
Oct 15 00:21:11 jagan hostapd[1860]: failed!
Oct 15 00:21:11 jagan systemd[1]: Started LSB: Advanced IEEE 802.11 management d

SurferTim
Posts: 1769
Joined: Sat Sep 14, 2013 9:27 am
Location: Miramar Beach, Florida

Re: Unable to setup Wifi access point on raspbian stretch

Sun Oct 15, 2017 12:32 am

If the status reports active (exited) , then your hostapd.conf file is faulty. My usb wifi device will not function as an AP, only as a client. Mine always shows exited when I try to set up an AP on it..

If you are using the onboard wireless, then your hostapd.conf file is wrong. Did you not use the example hostapd.conf file I provided?

Code: Select all

interface=wlan0
driver=nl80211
ssid=NameOfNetwork
hw_mode=g
channel=7
wmm_enabled=0
macaddr_acl=0
auth_algs=1
ignore_broadcast_ssid=0
wpa=2
wpa_passphrase=AardvarkBadgerHedgehog
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP
rsn_pairwise=CCMP
So let me see if I have this correct. You didn't follow the instructions, so it doesn't work, and you wonder why?

BeeBop
Posts: 4
Joined: Sat Oct 14, 2017 4:34 pm

Re: Unable to setup Wifi access point on raspbian stretch

Sun Oct 15, 2017 10:05 am

:D :D :D :D :D

I have followed all of this to the letter - including many many complete restarts (reinstalling stretch-lite)....I am a super new user and am now over the moon that I have created this network...I can find the wifi AP on my Pi and access the internet via the ethernet bridge to my router..thank you so much for taking the time to write all of your trials and solutions.

Next, the beginner is going to try and install a VPN on the pi (StrongVPN using TCP) - I hope I don't go backwards!

sree80
Posts: 4
Joined: Sat Oct 14, 2017 12:55 pm

Re: Unable to setup Wifi access point on raspbian stretch

Sun Oct 15, 2017 5:42 pm

Thanks finally got my Access point configured.

BeeBop
Posts: 4
Joined: Sat Oct 14, 2017 4:34 pm

Re: Unable to setup Wifi access point on raspbian stretch

Mon Oct 16, 2017 11:09 am

It seems I am doing the same as you. I have my pi running and the bridge installed (internet from router via ethernet and AP via the wifi). It is all working. BUT for the life of me, I can not figure out how to put in the STRONGVpn stuff, the online support is poor (even via live chat). I have made a backup of my SD card at this point as I am fed up with redoing it over and overagain because I can't get my brain around the STRONGVpn
Last edited by BeeBop on Tue Oct 17, 2017 4:17 am, edited 1 time in total.

BeeBop
Posts: 4
Joined: Sat Oct 14, 2017 4:34 pm

Re: Unable to setup Wifi access point on raspbian stretch

Mon Oct 16, 2017 2:54 pm

It seems I can't use StrongVPN - shall now try ExpressVPN to see if it goes in without upsetting my functioning bridge.

Xavier Darkwell
Posts: 11
Joined: Tue Oct 24, 2017 1:40 am

Re: Unable to setup Wifi access point on raspbian stretch

Wed Oct 25, 2017 11:20 pm

I just followed the github guide without any mistakes and I my access point isn’t appearing.

SurferTim
Posts: 1769
Joined: Sat Sep 14, 2013 9:27 am
Location: Miramar Beach, Florida

Re: Unable to setup Wifi access point on raspbian stretch

Thu Oct 26, 2017 12:05 am

Check the status of hostapd

Code: Select all

sudo service hostapd status
It should show active (running) .
If it doesn't,
in /etc/default/hostapd you didn't uncomment the DAEMON_CONF line or the path is not correct.
or
there is an error in /etc/hostapd/hostapd.conf

Insure you have no network sections in /etc/wpa_supplicanr/wpa_supplicant.conf.

Xavier Darkwell
Posts: 11
Joined: Tue Oct 24, 2017 1:40 am

Re: Unable to setup Wifi access point on raspbian stretch

Thu Oct 26, 2017 8:46 pm

After I’ve got it running how do I get an Internet connection

SurferTim
Posts: 1769
Joined: Sat Sep 14, 2013 9:27 am
Location: Miramar Beach, Florida

Re: Unable to setup Wifi access point on raspbian stretch

Thu Oct 26, 2017 9:13 pm

Edit /etc/sysctl.conf and uncomment

Code: Select all

net.ipv4.ip_forward=1
My iptables rules.

Code: Select all

sudo iptables -t nat -A  POSTROUTING -o eth0 -j MASQUERADE
Then make the iptables rule permanent.

Code: Select all

sudo sh -c "iptables-save > /etc/iptables.ipv4.nat"
Then in /etc/rc.local, add this:

Code: Select all

iptables-restore < /etc/iptables.ipv4.nat
Reboot


SurferTim
Posts: 1769
Joined: Sat Sep 14, 2013 9:27 am
Location: Miramar Beach, Florida

Re: Unable to setup Wifi access point on raspbian stretch

Thu Oct 26, 2017 10:02 pm

Xavier Darkwell wrote:
Thu Oct 26, 2017 9:46 pm
Already did that
OK, then you are good to go.

Xavier Darkwell
Posts: 11
Joined: Tue Oct 24, 2017 1:40 am

Re: Unable to setup Wifi access point on raspbian stretch

Thu Oct 26, 2017 10:34 pm

I’m still not getting an Internet connection. I can’t load up web pages.

SurferTim
Posts: 1769
Joined: Sat Sep 14, 2013 9:27 am
Location: Miramar Beach, Florida

Re: Unable to setup Wifi access point on raspbian stretch

Thu Oct 26, 2017 10:43 pm

Post the output of

Code: Select all

ifconfig
iwconfig
route
cat /etc/resolv.conf
sudo service hostapd status
sudo service dnsmasq status

Xavier Darkwell
Posts: 11
Joined: Tue Oct 24, 2017 1:40 am

Re: Unable to setup Wifi access point on raspbian stretch

Fri Oct 27, 2017 12:06 am

eth0: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
ether b8:27:eb:58:05:68 txqueuelen 1000 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scoped 0x10<host>
loop txqueuelen 1 (Local Loopback)
RX packets 5920 bytes 396640 (387.3 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 5920 bytes 396640 (387.3 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

wlan0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 196.168.4.1 netmask 255.255.255.0 broadcast 192.168.4.255
inet6 fe80::ab6b:b4c5:4e8d:641 prefixlen 64 scoped 0x20<link>
ether b8:27:eb:0d:50:3d txqueuelen 1000 (Ethernet)
RX packets 139 bytes 11573 (11.3 KiB)
RX errors 0 dropped 2 overruns 0 frame 0
TX packets 104 bytes 13949 (13.6 KiB)
TX errors 0 dropped 0 overruns 0 carrier collisions 0

eth0 no wireless extensions.

lo no wireless extensions

wlan0 IEEE 802.11 Mode:Master Tx-Power=31 dBm
Retry short limit:7 RTS thr:off Fragment the:off
Power Management:on

Kernel IP routing table
Destination. Gateway Genmask Flags Metrics Ref. Use Iface
192.168.4.0. 0.0.0.0. 255.255.255.0 U. 303. 0. 0 wlan0

# Generated by resolvconf
nameserver 127.0.0.1

hostapd.service - LSB: Advanced IEEE 802.11 management daemon
Loaded: loaded (/etc/init.d/hostapd; generated; vendor preset: enabled)
Active: active (running) since Thu 2017-10-26 22:26:42 UTC; 58min ago
Docs: man:systemd-Sysco-generater(8)
Process: 497 ExecStart=/etc/init.d/hostapd start (code=exited, status=0/SUCCESS)
CGroup:/system.slice/hostapd.service
587 /usr/sbin/hostapd -B -P /run/hostapd.pid /etc/hostapd/hostapd.conf

dnsmasq.service - dnsmasq - A lightweight DHCP and caching DNS server Loaded: loaded (/lib/system/dnsmasq.service; enabled; vendor preset: enabled)
Active: active (running) since Thu 2017-10-26 22:26:42 UTC; 1h 10 min ago
Process: 540 ExecStartPost=/etc/init.d/dnsmasq systemd-start-resolvconf (code=exited, status=0/SUCCESS)
Process: 513 ExecStart=/etc/init.d/dnsmasq systemd-exec (code=exited, status=0/SUCCESS)
Process: 495 ExecStartPre=/usr/sbin/dnsmasq —test (code=exited, status=0/SUCCESS)
Main PID: 539 (dnsmasq)
CGroup: /system.slice/dnsmasq.service
539 /usr/sbin/dnsmasq -x /run/dnsmasq.pid -u dnsmasq -r /run/dnsmasq/resolv.conf -7 /etc/dnsmasq.d,.dpkg-dist,.dpkg-old,.dpkg-n

SurferTim
Posts: 1769
Joined: Sat Sep 14, 2013 9:27 am
Location: Miramar Beach, Florida

Re: Unable to setup Wifi access point on raspbian stretch

Fri Oct 27, 2017 12:20 am

That's an easy one. The eth0 interface doen't have an IP or any other network settings. It may not be connected to the WAN device. That is your route to the internet, correct?

You have hijacked the OPs thread. If you want more help, post a new thread with what you have, and what you want.

Morgan.Rpi
Posts: 1
Joined: Fri Nov 03, 2017 4:52 pm

Re: Unable to setup Wifi access point on raspbian stretch

Fri Nov 03, 2017 5:05 pm

To someone who is suffering the issue,

I was suffering the problem for a couple of days, and eventually, I realized that my Rpi 3 had set to connect to my home wifi automatically as the official guide https://www.raspberrypi.org/documentati ... ess-cli.md.

Then I deleted the section

Code: Select all

network={
    ssid="testing"
    psk="testingPassword"
}

and commented all the other lines of the file /etc/wpa_supplicant/wpa_supplicant.conf, then reboot, it worked!!

Hope it could work for you 8-)

Glasairman
Posts: 12
Joined: Fri Mar 16, 2012 9:55 am
Location: Munich, Germany

Re: Unable to setup Wifi access point on raspbian stretch

Sat Dec 16, 2017 4:02 pm

I converted initially just one of my systems to Systemd. It was so convincingly solid , far more so that NetworkManager, that I converted all my Desktop / Laptop and 2 other Pi's to Systemd.

]https://wiki.ubuntuusers.de/systemd/networkd/

CanxerLX
Posts: 2
Joined: Wed Aug 02, 2017 4:31 am

Re: Unable to setup Wifi access point on raspbian stretch

Mon Jan 08, 2018 8:38 am

Hi there !

I've used SurferTim documentation on setting up AP on RPI 3 Raspbian Stretch. Dhcpcd and Dnsmasq services works but not Hostapd.

Results from sudo hostapd -dd /etc/hostapd/hostapd.conf:

random: Trying to read entropy from /dev/random
Configuration file: /etc/hostapd/hostapd.conf
rfkill: initial event: idx=0 type=1 op=0 soft=0 hard=0
rfkill: initial event: idx=1 type=1 op=0 soft=0 hard=0
rfkill: initial event: idx=2 type=2 op=0 soft=0 hard=0
nl80211: Supported cipher 00-0f-ac:1
nl80211: Supported cipher 00-0f-ac:5
nl80211: Supported cipher 00-0f-ac:2
nl80211: Supported cipher 00-0f-ac:4
nl80211: Supported cipher 00-0f-ac:10
nl80211: Supported cipher 00-0f-ac:8
nl80211: Supported cipher 00-0f-ac:9
nl80211: Using driver-based off-channel TX
nl80211: interface wlan0 in phy phy0
nl80211: Set mode ifindex 3 iftype 3 (AP)
nl80211: Failed to set interface 3 to mode 3: -16 (Device or resource busy)
nl80211: Try mode change after setting interface down
nl80211: Set mode ifindex 3 iftype 3 (AP)
nl80211: Mode change succeeded while interface is down
nl80211: Setup AP(wlan0) - device_ap_sme=0 use_monitor=0
nl80211: Subscribe to mgmt frames with AP handle 0x138d038
nl80211: Register frame type=0xb0 (WLAN_FC_STYPE_AUTH) nl_handle=0x138d038 match=
nl80211: Register frame type=0x0 (WLAN_FC_STYPE_ASSOC_REQ) nl_handle=0x138d038 match=
nl80211: Register frame type=0x20 (WLAN_FC_STYPE_REASSOC_REQ) nl_handle=0x138d038 match=
nl80211: Register frame type=0xa0 (WLAN_FC_STYPE_DISASSOC) nl_handle=0x138d038 match=
nl80211: Register frame type=0xc0 (WLAN_FC_STYPE_DEAUTH) nl_handle=0x138d038 match=
nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0x138d038 match=
nl80211: Register frame command failed (type=208): ret=-114 (Operation already in progress)
nl80211: Register frame match - hexdump(len=0): [NULL]
nl80211: Could not configure driver mode
nl80211: deinit ifname=wlan0 disabled_11b_rates=0
nl80211: Remove monitor interface: refcount=0
nl80211: Remove beacon (ifindex=3)
netlink: Operstate: ifindex=3 linkmode=0 (kernel-control), operstate=6 (IF_OPER_UP)
nl80211: Set mode ifindex 3 iftype 2 (STATION)
nl80211: Failed to set interface 3 to mode 2: -16 (Device or resource busy)
nl80211: Try mode change after setting interface down
nl80211: Set mode ifindex 3 iftype 2 (STATION)
nl80211: Mode change succeeded while interface is down
nl80211: Teardown AP(wlan0) - device_ap_sme=0 use_monitor=0
nl80211 driver initialization failed.
hostapd_interface_deinit_free(0x138bcd8)
hostapd_interface_deinit_free: num_bss=1 conf->num_bss=1
hostapd_interface_deinit(0x138bcd8)
wlan0: interface state UNINITIALIZED->DISABLED
hostapd_bss_deinit: deinit bss wlan0
wlan0: AP-DISABLED
hostapd_cleanup(hapd=0x138c9a0 (wlan0))
hostapd_free_hapd_data: Interface wlan0 wasn't started
hostapd_interface_deinit_free: driver=(nil) drv_priv=(nil) -> hapd_deinit
hostapd_interface_free(0x138bcd8)
hostapd_interface_free: free hapd 0x138c9a0
hostapd_cleanup_iface(0x138bcd8)
hostapd_cleanup_iface_partial(0x138bcd8)
hostapd_cleanup_iface: free iface=0x138bcd8

I've followed everything from the hostapd.conf file to uncommenting the DAEMON_CONF line. Anyone can help?

SurferTim
Posts: 1769
Joined: Sat Sep 14, 2013 9:27 am
Location: Miramar Beach, Florida

Re: Unable to setup Wifi access point on raspbian stretch

Mon Jan 08, 2018 10:55 am

You shouldn't have to run hostapd. It starts as a service on boot. Check the status.

Code: Select all

sudo service hostapd status
It should show active (running).

jur123
Posts: 3
Joined: Sat Feb 11, 2017 5:16 pm

Re: Unable to setup Wifi access point on raspbian stretch

Mon Jan 08, 2018 11:41 pm

Hi,

I have been trying to setup an access point rpi3 strectch, and have been following the official and all forum, but it still doesnt work (in Jessie it works fine) . (it has me rebooting the rpi numerous times > 100).

Is there a way to download a working img file of stretch installed as access point.
That would be appreciated!

regards,

Jur

Return to “Troubleshooting”