3

First of all i want to say that i'm new to all of this, so please dont hate me if the answer to my problem seemed obvious to you.

I just tried to follow this tutorial to set up my Pi 4 as an Access Point.

I have the newest version of Raspbian Buster Lite installed.

I follows all the steps, but i got stuck after "Configuring the access point host software (hostapd)"

When i try to start hostapd i get the following massage:

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

when i then use the systemctl status hostapd.service command i get this:

● 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 Sun 2020-02-23 17:56:22 CET; 333ms ago
  Process: 2101 ExecStart=/usr/sbin/hostapd -B -P /run/hostapd.pid -B $DAEMON_OPTS ${DAEMON_CONF} (code=exited, status=1

when i use journalctl -xe i get the following:

Feb 23 17:57:36 raspberrypi hostapd[2159]: wlan0: AP-DISABLED
Feb 23 17:57:36 raspberrypi hostapd[2159]: wlan0: Unable to setup interface.
Feb 23 17:57:36 raspberrypi hostapd[2159]: wlan0: interface state DISABLED->DISABLED
Feb 23 17:57:36 raspberrypi hostapd[2159]: wlan0: AP-DISABLED
Feb 23 17:57:36 raspberrypi hostapd[2159]: wlan0: CTRL-EVENT-TERMINATING
Feb 23 17:57:36 raspberrypi hostapd[2159]: hostapd_free_hapd_data: Interface wlan0 wasn't started
Feb 23 17:57:36 raspberrypi hostapd[2159]: nl80211: deinit ifname=wlan0 disabled_11b_rates=0
Feb 23 17:57:36 raspberrypi 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 23 17:57:36 raspberrypi 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 23 17:57:36 raspberrypi 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 32180 and the job result is failed.

Now, like i said, im a total noob. I'm trying to learn all of this, but i din't find anything about this problem.

Ps: I have OMV installed, could that somehow be the problem or be connected to the problem? If yes, how do i create an AP while still using OMV?

EDIT: cat /lib/systemd/system/hostapd.service outputs the following:

[Unit]
Description=Advanced IEEE 802.11 AP and IEEE 802.1X/WPA/WPA2/EAP Authenticator
After=network.target

[Service]
Type=forking
PIDFile=/run/hostapd.pid
Restart=on-failure
RestartSec=2
Environment=DAEMON_CONF=/etc/hostapd/hostapd.conf
EnvironmentFile=-/etc/default/hostapd
ExecStart=/usr/sbin/hostapd -B -P /run/hostapd.pid -B $DAEMON_OPTS ${DAEMON_CONF}

[Install]
WantedBy=multi-user.target
Broken Lumber
  • 91
  • 2
  • 5

1 Answers1

2

I had the same problem. By mistake, you set the config file /etc/hostapd/hostapd.conf to DAEMON_OPTS instead of DAEMON_CONF.

1. Add DAEMON_CONF="/etc/hostapd/hostapd.conf" to /etc/default/hostapd.

2. Comment DAEMON_OPTS= ... or remove all the line.

3. service hostapd restart.


Another possibility is about "Wifi Country Code". Run raspi-config and go to 4 Localisation Options then I4 Change Wi-fi Country. Finally, set your country. I set IR Iran and it has worked.


If you are pi 4 and get the Could not communicate with wpa_supplicant after changing Wifi country, follow this link.

wittich
  • 103
  • 4
M. Rostami
  • 4,323
  • 1
  • 17
  • 36