0

I've recently purchased a Raspberry Pi 3 Model B because I need to host a wireless AP and web server (I'm making a web app that will run on a few tablets and would like for them all to utilize the same web server/database but will not have access to the internet).

After doing a bit of research, I found that the Raspberry Pi 3 Model B comes with an integrated wifi module and there are also many tutorials on doing this. So I thought it would be easy, but I'm running into issues getting hostapd to start.

I've followed the directions of the items I've linked as closely as possible with a fresh installation of Raspbian. But each time I seem to run into the same issue. My configuration is exactly the same as the directions on the sparkfun website up to the "Test WiFi connection" section where it has me reboot. After rebooting

Sep 17 08:29:04 raspberrypi hostapd[1091]: Configuration file: /etc/hostapd/hostapd.conf
Sep 17 08:29:04 raspberrypi hostapd[1091]: Configuration file: /etc/hostapd/hostapd.conf
Sep 17 08:29:04 raspberrypi hostapd[1091]: wlan0: Could not connect to kernel driver
Sep 17 08:29:04 raspberrypi hostapd[1091]: Using interface wlan0 with hwaddr b8:27:eb:d1:90:09 and ssid "MyPiAP"
Sep 17 08:29:04 raspberrypi hostapd[1091]: wlan0: interface state UNINITIALIZED->ENABLED
Sep 17 08:29:04 raspberrypi hostapd[1091]: wlan0: AP-ENABLED
Sep 17 08:29:04 raspberrypi hostapd[1091]: Could not set channel for kernel driver
Sep 17 08:29:04 raspberrypi hostapd[1091]: Interface initialization failed
Sep 17 08:29:04 raspberrypi hostapd[1091]: wlan0: interface state UNINITIALIZED->DISABLED
Sep 17 08:29:04 raspberrypi hostapd[1091]: wlan0: AP-DISABLED
Sep 17 08:29:04 raspberrypi hostapd[1091]: wlan0: Unable to setup interface.
Sep 17 08:29:04 raspberrypi hostapd[1091]: wlan0: interface state ENABLED->DISABLED
Sep 17 08:29:04 raspberrypi hostapd[1091]: wlan0: AP-DISABLED
Sep 17 08:29:04 raspberrypi hostapd[1091]: wlan0: CTRL-EVENT-TERMINATING
Sep 17 08:29:04 raspberrypi hostapd[1091]: nl80211: deinit ifname=wlan0 disabled_11b_rates=0
Sep 17 08:29:04 raspberrypi hostapd[1091]: wlan0: interface state DISABLED->DISABLED
Sep 17 08:29:04 raspberrypi hostapd[1091]: wlan0: AP-DISABLED
Sep 17 08:29:04 raspberrypi hostapd[1091]: wlan0: CTRL-EVENT-TERMINATING
Sep 17 08:29:04 raspberrypi hostapd[1091]: hostapd_free_hapd_data: Interface wlan0 wasn't started
Sep 17 08:29:04 raspberrypi hostapd[1091]: nl80211: deinit ifname=wlan0 disabled_11b_rates=0
Sep 17 08:29:05 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.
Sep 17 08:29:05 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'.
Sep 17 08:29:05 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 864 and the job result is failed.
Sep 17 08:29:07 raspberrypi systemd[1]: hostapd.service: Service RestartSec=2s expired, scheduling restart.
Sep 17 08:29:07 raspberrypi systemd[1]: hostapd.service: Scheduled restart job, restart counter is at 2.
-- Subject: Automatic restarting of a unit has been scheduled
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- Automatic restarting of the unit hostapd.service has been scheduled, as the result for
-- the configured Restart= setting for the unit.
Sep 17 08:29:07 raspberrypi 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 925 and the job result is done.
Sep 17 08:29:07 raspberrypi 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 925.
Sep 17 08:29:07 raspberrypi hostapd[1092]: Configuration file: /etc/hostapd/hostapd.conf
Sep 17 08:29:07 raspberrypi hostapd[1092]: Configuration file: /etc/hostapd/hostapd.conf
Sep 17 08:29:07 raspberrypi hostapd[1092]: wlan0: Could not connect to kernel driver
Sep 17 08:29:07 raspberrypi hostapd[1092]: Using interface wlan0 with hwaddr b8:27:eb:d1:90:09 and ssid "MyPiAP"

For debugging the issue above, it seems as though the first error looks like this:

Sep 17 08:29:04 raspberrypi hostapd[1091]: wlan0: Could not connect to kernel driver

However, from another StackExchange post, it appears as though it may just be debug info printed at the wrong print level.

Now, following the output, the next place that may be causing an error seems to be this:

Sep 17 08:29:04 raspberrypi hostapd[1091]: Could not set channel for kernel driver
Sep 17 08:29:04 raspberrypi hostapd[1091]: Interface initialization failed

However, I've unfortunately not really been able to find a reason for those lines yet. After that, it just seems to be a lot of it being unable to start up.

I'm looking for help/guidance on how I may set up an AP on my Raspberry Pi 3 Model B that users will be able to connect to and access a website hosted on the Pi itself. I do not need/want to set up a bridged connection to another device, just host a network from the Pi.

  • Did you try the Foundation Access Point tutorial? There are hundreds of poor tutorials on the web, but people seem to prefer these over the official tutorials. There are a number of good tutorials using alternate techniques on this site, but the official one WORKS. – Milliways Sep 17 at 8:32
0

I've solved it, it was a very simple problem. In /etc/default/hostapd I had changed DAEMON_OPTS instead of DAEMON_CONF. When I corrected this and had the configuration file specified in DAEMON_CONF everything started up and worked as expected.

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.