Hostapd and WPS

Hi guys,

I’m trying to enable WPS on an Omega2 running Onion OS (based on OpenWrt-18.06) for a project I’m working on (it won’t be triggered by a button, so apparently a little more secure). There’s quite a bit of information online on how to do this for OpenWrt, basically you:

  • Add option wps_pushbutton '1 ' to a config wifi-iface section that is configured for WPA2-PSK in /etc/config/wireless
  • opkg update
  • opkg remove wpad-mini
  • opkg install wpad hostapd-utils
  • reboot

I’ve worked out that before running the above, the lede-project repos need to be re-enabled for OPKG, by modifying the /etc/opkg/distfeeds.conf file, which is fine.

However, when I run: hostapd_cli wps_pbc , I get “Failed to connect to hostapd - wpa_ctrl_open: No such file or directory”.

I’ve read that problems can be caused by the /etc/hostapd/hostapd.conf file. However, I’m missing the whole /etc/hostapd directory…

Would someone be able to shine some light on this for me? Or point me in the right direction.

Thanks,

Oli

Links:
https://openwrt.org/docs/guide-user/network/wifi/basic
https://volatilesystems.org/wps-setup-on-openwrt.html

Just found out you can get hostapd to show more debug messages, this is what I'm currently getting:

root@Omega-92CA:/etc/config# hostapd -d /etc/hostapd/hostapd.conf
Configuration file: /etc/hostapd/hostapd.conf
nl80211: 'nl80211' generic netlink not found
Failed to initialize driver 'nl80211'
wlan0: interface state UNINITIALIZED->DISABLED
wlan0: AP-DISABLED 
wlan0: CTRL-EVENT-TERMINATING 
hostapd_free_hapd_data: Interface wlan0 wasn't started

And this is my hostapd.conf file:

interface=wlan0
bridge=br0
country_code=AUS
ctrl_interface=wlan0
ctrl_interface_group=0
ssid=KITT
hw_mode=g
channel=1
wpa=3
wpa_passphrase=georgeisyourfriend
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP
rsn_pairwise=CCMP
beacon_int=100
auth_algs=3
macaddr_acl=0
wmm_enabled=1
eap_reauth_period=360000000