1

did this here: https://www.raspberrypi.org/documentation/configuration/wireless/access-point.md

... using wlan1 (onboard pi wifi) instead of wlan0.

I get "No Wireless Interfaces Found" on the desktop wifi panel.

Also fails at step:

sudo systemctl start hostapd

Job for hostapd.service failed because the control process exited with an error code. See "systemctl status hostapd.service" and "journalctl -xe" for details.

journalctl -xe (output):

-- 
-- Automatic restarting of the unit hostapd.service has been scheduled, as the result for
-- the configured Restart= setting for the unit.
Feb 26 14:32:17 2600 systemd[1]: Stopped Advanced IEEE 802.11 AP and IEEE 802.1X/WPA/WPA2/EAP Authenticator.
-- Subject: A stop job for unit hostapd.service has finished
-- Defined-By: systemd
-- Support: https://www.debian.org/support
-- 
-- A stop job for unit hostapd.service has finished.
-- 
-- The job identifier is 21243 and the job result is done.
Feb 26 14:32:17 2600 systemd[1]: Starting Advanced IEEE 802.11 AP and IEEE 802.1X/WPA/WPA2/EAP Authenticator...
-- Subject: A start job for unit hostapd.service has begun execution
-- Defined-By: systemd
-- Support: https://www.debian.org/support
-- 
-- A start job for unit hostapd.service has begun execution.
-- 
-- The job identifier is 21243.
Feb 26 14:32:17 2600 hostapd[4060]: Configuration file: /etc/hostapd/hostapd.conf
Feb 26 14:32:17 2600 hostapd[4060]: Line 11: invalid WPA passphrase length 4 (expected 8..63)
Feb 26 14:32:17 2600 hostapd[4060]: WPA-PSK enabled, but PSK or passphrase is not configured.
Feb 26 14:32:17 2600 hostapd[4060]: 2 errors found in configuration file '/etc/hostapd/hostapd.conf'
Feb 26 14:32:17 2600 hostapd[4060]: Failed to set up interface with /etc/hostapd/hostapd.conf
Feb 26 14:32:17 2600 hostapd[4060]: Failed to initialize interface
Feb 26 14:32:17 2600 systemd[1]: hostapd.service: Control process exited, code=exited, status=1/FAILURE
-- Subject: Unit process exited
-- Defined-By: systemd
-- Support: https://www.debian.org/support
-- 
-- An ExecStart= process belonging to unit hostapd.service has exited.
-- 
-- The process' exit code is 'exited' and its exit status is 1.
Feb 26 14:32:17 2600 systemd[1]: hostapd.service: Failed with result 'exit-code'.
-- Subject: Unit failed
-- Defined-By: systemd
-- Support: https://www.debian.org/support
-- 
-- The unit hostapd.service has entered the 'failed' state with result 'exit-code'.
Feb 26 14:32:17 2600 systemd[1]: Failed to start Advanced IEEE 802.11 AP and IEEE 802.1X/WPA/WPA2/EAP Authenticator.
-- Subject: A start job for unit hostapd.service has failed
-- Defined-By: systemd
-- Support: https://www.debian.org/support
-- 
-- A start job for unit hostapd.service has finished with a failure.
-- 
-- The job identifier is 21243 and the job result is failed.
Feb 26 14:32:18 2600 sudo[4065]:       pi : TTY=pts/0 ; PWD=/home/pi ; USER=root ; COMMAND=/bin/journalctl -xe
Feb 26 14:32:18 2600 sudo[4065]: pam_unix(sudo:session): session opened for user root by (uid=0)

/etc/default/hostapd

# Defaults for hostapd initscript
#
# WARNING: The DAEMON_CONF setting has been deprecated and will be removed
#          in future package releases.
#
# See /usr/share/doc/hostapd/README.Debian for information about alternative
# methods of managing hostapd.
#
# Uncomment and set DAEMON_CONF to the absolute path of a hostapd configuration
# file and hostapd will be started during system boot. An example configuration
# file can be found at /usr/share/doc/hostapd/examples/hostapd.conf.gz
#
#DAEMON_CONF=""

# Additional daemon options to be appended to hostapd command:-
#   -d   show more debug messages (-dd for even more)
#   -K   include key data in debug messages
#   -t   include timestamps in some debug messages
#
# Note that -B (daemon mode) and -P (pidfile) options are automatically
# configured by the init.d script and must not be added to DAEMON_OPTS.
#
DAEMON_OPTS="/etc/hostapd/hostapd.conf"
DAEMON_CONF="/etc/hostapd/hostapd.conf"

/etc/hostapd/hostapd.conf

interface=wlan1
#driver=nl80211
ssid=2600
hw_mode=g
channel=7
wmm_enabled=0
macaddr_acl=0
auth_algs=1
ignore_broadcast_ssid=0
wpa=2
wpa_passphrase=26000062
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP
rsn_pairwise=CCMP

/etc/dnsmasq.conf

interface=wlan1
dhcp-range=192.168.77.2,192.168.77.202,255.255.255.0,24h

ifconfig

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

wlan0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        ether 50:3e:aa:4d:8d:43  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

iwconfig

wlan0     unassociated  ESSID:""  Nickname:"<WIFI@REALTEK>"
          Mode:Auto  Frequency=2.412 GHz  Access Point: Not-Associated   
          Sensitivity:0/0  
          Retry:off   RTS thr:off   Fragment thr:off
          Power Management:off
          Link Quality:0  Signal level:0  Noise level:0
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:0  Invalid misc:0   Missed beacon:0

wlan1     IEEE 802.11  Mode:Master  
          Retry short limit:7   RTS thr:off   Fragment thr:off
          Power Management:on

lo        no wireless extensions.

service hostapd status

● hostapd.service - Advanced IEEE 802.11 AP and IEEE 802.1X/WPA/WPA2/EAP Authenticator
   Loaded: loaded (/lib/systemd/system/hostapd.service; enabled; vendor preset: enabled)
   Active: activating (auto-restart) (Result: exit-code) since Thu 2020-02-27 14:45:16 CST; 1s ago
  Process: 4403 ExecStart=/usr/sbin/hostapd -B -P /run/hostapd.pid -B $DAEMON_OPTS ${DAEMON_CONF} (code=exited, status=1/FAILURE)
  • Hello and welcome -- Please update the question after you solve the Line 11: invalid WPA passphrase length 4 (expected 8..63). – M. Rostami Feb 27 at 6:12
  • Additionally, the URL you have added doesn't work. – M. Rostami Feb 27 at 17:07
  • not sure why the link fails on this page. I can copy and past and it works. – keith bradley Feb 27 at 20:03
  • 1
    Looks like the Wifi password was too short (problem 1) ... and I needed to comment out ... DAEMON_OPT= ... and use instead DAEMON_CONF= ... in ... /etc/hostapd/hostapd.conf ... when running buster (problem 2). – keith bradley Feb 28 at 20:55
1

You didn't mention the Raspbian version, however, I imagine it's Buster. One of the possibilities is about "Wifi Country Code". Run raspi-conf and go to 4 Localisation Options then I4 Change Wi-fi Country. Finally, set your country. I set IR Iran and it has worked like a charm.

If it gives an error like Could not communicate with wpa_supplicant after changing Wifi country, follow this link to solve it.


You need to set everything as default. I recommend a fresh install of the OS then follow the procedure of installing raspberry pi AP. As usual, the default (built-in) wireless adapter would be wlan0 and another new attached would be wlan1.
Follow the procedure step by step.


Remove this line of /etc/default/hostapd:

DAEMON_OPTS="/etc/hostapd/hostapd.conf"

Then restart the service:

service hostapd restart

Check the status by:

service hostapd status  

Note that you configure dnsmasq's interface as wlan1 hence you must as a static IP address for wlan1 in dhcpcd.conf.

| improve this answer | |
  • OS is buster yes ... – keith bradley Feb 27 at 20:05
  • Country code is set in wpa_supplicant.conf. rasp-config comes back as not set even though I set it and rebooted twice. I do see the desktop Wifi icon go active, then inactive over and over. It is doing this on wlan1 (Pi 3A internal). This is what I want hostapd to use. the USB wlan0 I want as outside NAT PAT. – keith bradley Feb 27 at 20:17
  • In the article you link to I see the creation of a file named: wpa_supplicant_wlan0.conf ... will that only be for that interface? – keith bradley Feb 27 at 20:19
  • I do see that iwconfig shows ... wlan0 Mode:Auto ... and ... wlan1 Mode:Managed. I wanted wlan1 (Pi 3A internal to be hooked to hostapd not the desktop manager. How do I change this? – keith bradley Feb 27 at 20:23
  • I deleted wpa_supplicant.conf. I then rebooted but still cannot get the country code to US in raspberry Pi Config GUI. no matter what I do comes back not set. – keith bradley Feb 27 at 20:28
1

As you was told on the log your password given in /etc/hostapd/hostapd.conf on line 11 with length 4 is to short, expected is 8..63. Because of this it has failed to initialize the interface.

Just give a password with min. length of 8 characters and the interface should come up.

| improve this answer | |
  • I looked but did not see ... thanks Ingo. Still get no wifi adapter on the desktop. – keith bradley Feb 26 at 21:34
  • Ingo - the password is now 8 and the original error is gone ... but now I get "wlan1: Could not connect to kernel driver". The link above (now fixed) says to add driver=nl80211 to /etc/hostapd/hostapd.conf. I assume this is the correct driver for the on board Pi 3A Wifi ?? – keith bradley Feb 27 at 21:30
  • @keithbradley Please update your question with the new information so I can better refer to it. – Ingo Feb 28 at 10:22
  • What do you need? – keith bradley Feb 28 at 19:13
  • Ingo ...you helped answer the short Wifi password issue ... but I can't seem to check yours as an answer in addition to M. Rostami ... sorry? – keith bradley Feb 28 at 20:48

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.