2

I have this:

/etc/default/hostapd

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

/etc/hostapd/hostapd.conf

interface=wlan0
driver=nl80211
ssid=HOTSPOT
hw_mode=g
channel=6
ieee80211n=1
wmm_enabled=1
ht_capab=[HT40][SHORT-GI-20][DSSS_CCK-40]
macaddr_acl=0
auth_algs=1
ignore_broadcast_ssid=0
wpa=2
wpa_key_mgmt=WPA-PSK
wpa_passphrase=asd
rsn_pairwise=CCMP

/etc/dhcpcd.conf

interface wlan0
    static ip_address=10.255.255.1/24

static domain_name_servers=8.8.8.8 8.8.4.4

/etc/dnsmasq.conf

interface=wlan0
    dhcp-range=10.255.255.100,10.255.255.124,255.255.255.0,24h

/etc/wpa_supplicant/wpa_supplicant.conf

country=US
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1

/etc/network/interfaces

auto lo
iface lo inet loopback

auto eth0
iface eth0 inet dhcp

allow-hotplug wlan0
iface wlan0 inet static
    address 10.255.255.1
    netmask 255.255.255.0
    network 10.255.255.0
    broadcast 192.168.5.255

and on first boot I get multiple issues but I am not sure what is the issue:

  1. hostapd_free_hapd_data: Interface wlan0 wasn't started

and because of that I think that I get this

  1. Failed to start Advanced IEEE 802.11 AP and IEEE 802.1X/WPA/WPA2/EAP Authenticator.

This fixed the issues and I was able to see the wifi hotspot running.

I fix it unblocking the wifi adapter: sudo rfkill unblock wifi

but I need it running from the first time and not having to do this. What is the issue and how do I solve it without running rfkill to unblock, I suspect the problem is either wpa_supplicant OR the fact that I was somehow turning off the interface in my setup. Also after running rfkill list phy0 wireless LAN soft blocked: yes shows up, so how do I enable it?

4
  • Don't use deprecated /etc/network/interfaces on a RaspiOS if you don't know how it conflicts with dhcpcd.
    – Ingo
    Oct 1, 2020 at 20:01
  • Yes I saw it and deleted that, its now source-directory /etc/network/interfaces.d Oct 1, 2020 at 22:03
  • Can you help further? I am trying now sudo apt purge rfkill so we will see maybe that will help Oct 1, 2020 at 22:04
  • 1
    If you choose to ignore the warning in the interfaces file expect problems. You will find dozens of similar questions.
    – Milliways
    Oct 1, 2020 at 22:43

2 Answers 2

2

I prefer to use systemd-networkd so I can only help with Setting up a Raspberry Pi as an access point - the easy way and I haven't used EAP authentication so far in my home network. Have a look at the examples at the end of /usr/share/doc/wpa_supplicant/examples/wpa_supplicant.conf.

Purging rfkill is not the right solution. rfkill unblock wlan will persistent enable WiFi.

1

SOLVED:

The problem I made was there because I was mounting and chroot-ing into the image using qemu, and changing the /etc/wpa_supplicant/wpa_supplicant.conf file directly, and for some strange reason that file was not being read or whatever by system and rfkill blocked wlan0 because contry was not set. What I did is let the system update wpa_supplicant.conf file itself by copying it into boot partition as follows: /boot/wpa_supplicant.conf so boot loader or whatever updated the file and solved the issue with rfkill, another issue was that the hotspot did not show up, so I added country_code=US to the hostapd.conf file as well.

1
  • Please mark the answer as the accepted one with a click on the tick on its left side. That prevents your Question from being shown as a unsolved Post to the community and saves them/us a lot of work.
    – Ingo
    Oct 12, 2020 at 18:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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