How do I configure wpa_supplicant.conf for WPS push-button?

10,476

Solution 1

Edit your /etc/wpa_supplicant.conf configuration file as follow:

At least you need to add the following line :

ctrl_interface=/var/run/wpa_supplicant
ctrl_interface_group=0
update_config=1
CONFIG_DRIVER_NL80211=y

You can enable some others support:

 ctrl_interface=/var/run/wpa_supplicant
 ctrl_interface_group=0
 update_config=1
 CONFIG_DRIVER_NL80211=y
 CONFIG_WPS=y
 CONFIG_WPS2=y
 CONFIG_WPS_ER=y
 CONFIG_WPS_NFC=y
 uuid=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx 

Get the uuid through status command from wpa_cli

To connect

  1. run wpa_cli
  2. From the Interactive mode, run wps_pbc and push the wps button.
  3. Once connected run dhclient wlan0 (change wlan0 with your interface wifi)

Solution 2

See the documentation at w1.fi/cgit/hostap/plain/wpa_supplicant/README-WPS.

The documentation you were looking at shows all the possible options in wpa_supplicant.conf, which includes options for static configuration.

You also need to write a script so that when the WPS button on your device is pressed then you execute wpa_cli wps_pbc to alert wpa_supplicant. It's also a good idea to capture a multisecond key-press and use that to reset wpa_supplicant's configuration (allowing the user to move your device).

Share:
10,476

Related videos on Youtube

CAPGuy
Author by

CAPGuy

Updated on September 18, 2022

Comments

  • CAPGuy
    CAPGuy over 1 year

    I'm building an IOT device, powered by headless Debain on a CHIP (https://getchip.com/), and will have connectivity to a customer's wifi. I'm trying to build in functionality for wifi connectivity to the customer's router in a way that wouldn't require the customer to ever need to input a password and username. Basically, I'd like to have WPS push-button functionality in Unix.

    I've installed wpa_cli, and have been tinkering around with wpa_supplicant.conf. However I'm very confused. The example .conf document located here , states that we'd need to input all the parameters of the router ahead of time. Why would that ever need to be the case? Doesn't that defeat the purpose of WPS (i.e. WPS should be blind to any access points and should handshake with the nearest router that has its WPS window open)?

  • CAPGuy
    CAPGuy over 7 years
    Sorry it took me so long to come back to this; urgent things came up. This worked perfectly! You showed me the final step that I was missing: the dhclient. Thanks!
  • CAPGuy
    CAPGuy over 7 years
    That's a great piece of advice about the button to reset the supplicant. Thanks!