Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • Code Block
    root@Docsis-Gateway:~# dmcli eRT getv Device.WiFi.AccessPoint.1.WPS.Enable
    CR component name is: eRT.com.cisco.spvtg.ccsp.CR
    subsystem_prefix eRT.
    getv from/to component(eRT.com.cisco.spvtg.ccsp.wifi): Device.WiFi.AccessPoint.1.WPS.Enable
    Execution succeed.
    Parameter    1 name: Device.WiFi.AccessPoint.1.WPS.Enable
                   type:       bool,    value: true
    root@Docsis-Gateway:~# dmcli eRT getv Device.WiFi.AccessPoint.1.WPS.X_CISCO_COM_WpsPushButton
    CR component name is: eRT.com.cisco.spvtg.ccsp.CR
    subsystem_prefix eRT.
    getv from/to component(eRT.com.cisco.spvtg.ccsp.wifi): Device.WiFi.AccessPoint.1.WPS.X_CISCO_COM_WpsPushButton
    Execution succeed.
    Parameter    1 name: Device.WiFi.AccessPoint.1.WPS.X_CISCO_COM_WpsPushButton
                   type:        int,    value: 0
    root@Docsis-Gateway:~# dmcli eRT setv Device.WiFi.AccessPoint.1.WPS.X_CISCO_COM_WpsPushButton int 1
    CR component name is: eRT.com.cisco.spvtg.ccsp.CR
    subsystem_prefix eRT.
    setv from/to component(eRT.com.cisco.spvtg.ccsp.wifi): Device.WiFi.AccessPoint.1.WPS.X_CISCO_COM_WpsPushButton
    Execution succeed.
    root@Docsis-Gateway:~# dmcli eRT setv Device.WiFi.ApplyAccessPointSettings bool true
    CR component name is: eRT.com.cisco.spvtg.ccsp.CR
    subsystem_prefix eRT.
    setv from/to component(eRT.com.cisco.spvtg.ccsp.wifi): Device.WiFi.ApplyAccessPointSettings
    Execution succeed.
    root@Docsis-Gateway:~# dmcli eRT getv Device.WiFi.AccessPoint.1.WPS.X_CISCO_COM_WpsPushButton
    CR component name is: eRT.com.cisco.spvtg.ccsp.CR
    subsystem_prefix eRT.
    getv from/to component(eRT.com.cisco.spvtg.ccsp.wifi): Device.WiFi.AccessPoint.1.WPS.X_CISCO_COM_WpsPushButton
    Execution succeed.
    Parameter    1 name: Device.WiFi.AccessPoint.1.WPS.X_CISCO_COM_WpsPushButton
                   type:        int,    value: 0


WPS Hardware Key Press in BPI

Steps handled when the WPS button is pushed from the target BPI board:
1.  Listen until the user pushes the WPS button. Thus an interrupt occurs with the event - "code 529 (KEY_WPS_BUTTON), value 1". This is identified from the evtest of gpio pins.
2. Once the button is being pressed, the key press is intimated to OneWifi by the running binary, "/usr/bin/onewifi_component_test_app".
3. The binary, "/usr/bin/onewifi_component_test_app", requires 2 inputs: 
One - wps (the event)
Two - 0/1/2 (2G/5G/6G)

By this way, the communication occurs from the hardware key press to the OneWifi and the flow (functionality) executes as normal.

The script is as follows:

modprobe gpio_keys
EVENT_DEVICE="/dev/input/event0"  # Confirmed from evtest
VAP_INDEX_2G=0  # Virtual AP index for OneWifi
VAP_INDEX_5G=1  # Virtual AP index for OneWifi
VAP_INDEX_6G=2  # Virtual AP index for OneWifi
LOGFILE="/tmp/wps_trigger.log"

echo "Listening for WPS button press on $EVENT_DEVICE..." | tee -a $LOGFILE

# Read event stream and trigger WPS when KEY_WPS_BUTTON (529) is detected
evtest "$EVENT_DEVICE" | while read line; do
    if echo "$line" | grep -q "code 529 (KEY_WPS_BUTTON), value 1"; then
        echo "✅ WPS Button Pressed! Triggering OneWifi WPS for 2G, 5G and 6G..." | tee -a $LOGFILE

        # Kill any existing interactive session before triggering WPS
        pkill -f onewifi_component_test_app

        # Run WPS command and log output
        echo "Executing: echo 'wps $VAP_INDEX' | /usr/bin/onewifi_component_test_app" | tee -a $LOGFILE
        echo "wps $VAP_INDEX_2G" | /usr/bin/onewifi_component_test_app >> $LOGFILE 2>&1

        echo "wps $VAP_INDEX_5G" | /usr/bin/onewifi_component_test_app >> $LOGFILE 2>&1

        echo "wps $VAP_INDEX_6G" | /usr/bin/onewifi_component_test_app >> $LOGFILE 2>&1

        sleep 5  # Prevent multiple triggers within 5 seconds
    fi
done