twt setup: wrong parameter count

I want to use the example of "Wi Fi: Shell" to set TWT parameters by referring to the official documentation:

https://docs.nordicsemi.com/bundle/ncs-latest/page/nrf/protocols/wifi/station_mode/powersave.html

and blogs:

 https://devzone.nordicsemi.com/nordic/nordic-blog/b/blog/posts/target-wake-time-on-the-nrf7002-dk 

i set the command such as :

wifi twt setup 0 0 1 1 0 1 1 1 65000 524000

OR

wifi twt setup 0 0 2 2 0 1 1 1 20 60000

but  it is print "setup: wrong parameter count", as shown in log :

uart:~$ > wifi status
wifi status
Status: successful
==================
State: COMPLETED
Interface Mode: STATION
Link Mode: WIFI 6 (802.11ax/HE)
SSID: OpenWrt_1F05DA_5G
BSSID: 94:83:C4:1F:05:DA
Band: 5GHz
Channel: 36
Security: WPA2-PSK
MFP: Optional
RSSI: -38
Beacon Interval: 100
DTIM: 1
TWT: Supported
uart:~$ > wifi twt setup 0 0 1 1 0 1 1 1 65000 524000
wifi twt setup 0 0 1 1 0 1 1 1 65000 524000
setup: wrong parameter count
setup - Start a TWT flow:
<negotiation_type, 0: Individual, 1: Broadcast, 2: Wake TBTT>
<setup_cmd: 0: Request, 1: Suggest, 2: Demand>
<dialog_token: 1-255> <flow_id: 0-7> <responder: 0/1> <trigger: 0/1>
<implicit:0/1> <announce: 0/1> <twt_wake_interval: 1-262144us>
<twt_interval: 1us-2^31us>.
<twt_wake_ahead_duration>: 0us-2^31us>

uart:~$ > wifi twt setup 0 0 2 2 0 1 1 1 20 600000
wifi twt setup 0 0 2 2 0 1 1 1 20 600000
setup: wrong parameter count
setup - Start a TWT flow:
<negotiation_type, 0: Individual, 1: Broadcast, 2: Wake TBTT>
<setup_cmd: 0: Request, 1: Suggest, 2: Demand>
<dialog_token: 1-255> <flow_id: 0-7> <responder: 0/1> <trigger: 0/1>
<implicit:0/1> <announce: 0/1> <twt_wake_interval: 1-262144us>
<twt_interval: 1us-2^31us>.
<twt_wake_ahead_duration>: 0us-2^31us>

uart:~$ > wifi twt setup 0 0 2 2 0 1 1 1 20 300000
wifi twt setup 0 0 2 2 0 1 1 1 20 300000
setup: wrong parameter count
setup - Start a TWT flow:
<negotiation_type, 0: Individual, 1: Broadcast, 2: Wake TBTT>
<setup_cmd: 0: Request, 1: Suggest, 2: Demand>
<dialog_token: 1-255> <flow_id: 0-7> <responder: 0/1> <trigger: 0/1>
<implicit:0/1> <announce: 0/1> <twt_wake_interval: 1-262144us>
<twt_interval: 1us-2^31us>.
<twt_wake_ahead_duration>: 0us-2^31us>

[01:11:20.519,226] <inf> wpa_supp: nordic_wlan0: WPA: Group rekeying completed with 94:83:c4:1f:05:da [GTK=TKIP]
uart:~$

so, can you give me some help, thank you very much!

Parents Reply Children
  • Thank you H å kon Alseth for your prompt response. I have encountered a new issue again, as you provided. I added 0 at the end, but still cannot negotiate successfully.

    The command comes from the blog:

     https://devzone.nordicsemi.com/nordic/nordic-blog/b/blog/posts/target-wake-time-on-the-nrf7002-dk 

    The log print as:

    uart:~$ > wifi twt setup 0 0 2 2 0 1 1 1 20 60000 0
    wifi twt setup 0 0 2 2 0 1 1 1 20 60000 0
    TWT setup with TWT individual negotiation failed. reason : Peer not TWT capable
    [02:19:52.113,739] <inf> wpa_supp: nordic_wlan0: WPA: Group rekeying completed with 94:83:c4:1f:05:da [GTK=TKIP]
    uart:~$

  • Hi,

     

    ChengQing Zhao said:
    TWT setup with TWT individual negotiation failed. reason : Peer not TWT capable

    This means that the AP is not capable of TWT. Which access point specifically are you using? If it is wifi 6 capable, it might be that you need to enable Target Wake Time specifically in the router web UI.

     

    Kind regards,

    Håkon

  • Thank you for your prompt response, ,  i think the router is support TWT, the log as follow,

    and the command  "wifi twt setup 0 0 1 1 0 1 1 1 65000 524000 0" is ok

    but why “wifi twt setup 0 0 2 2 0 1 1 1 20 60000 0 ” from  https://devzone.nordicsemi.com/nordic/nordic-blog/b/blog/posts/target-wake-time-on-the-nrf7002-dk 

    can not set TWT.

    the  the log as follow:

    uart:~$ > wifi status
    wifi status
    Status: successful
    ==================
    State: COMPLETED
    Interface Mode: STATION
    Link Mode: WIFI 6 (802.11ax/HE)
    SSID: OpenWrt_1F05DA_5G
    BSSID: 94:83:C4:1F:05:DA
    Band: 5GHz
    Channel: 36
    Security: WPA2-PSK
    MFP: Optional
    RSSI: -42
    Beacon Interval: 100
    DTIM: 1
    TWT: Supported
    uart:~$ > wifi twt setup 0 0 1 1 0 1 1 1 65000 524000
    wifi twt setup 0 0 1 1 0 1 1 1 65000 524000
    setup: wrong parameter count
    setup - Start a TWT flow:
    <negotiation_type, 0: Individual, 1: Broadcast, 2: Wake TBTT>
    <setup_cmd: 0: Request, 1: Suggest, 2: Demand>
    <dialog_token: 1-255> <flow_id: 0-7> <responder: 0/1> <trigger: 0/1>
    <implicit:0/1> <announce: 0/1> <twt_wake_interval: 1-262144us>
    <twt_interval: 1us-2^31us>.
    <twt_wake_ahead_duration>: 0us-2^31us>

    uart:~$ > wifi twt setup 0 0 1 1 0 1 1 1 65000 524000 0
    wifi twt setup 0 0 1 1 0 1 1 1 65000 524000 0
    TWT operation TWT setup with dg: 1, flow_id: 1 requested
    TWT response: TWT accept
    == TWT negotiated parameters ==
    TWT Dialog token: 1
    TWT flow ID: 1
    TWT negotiation type: TWT individual negotiation
    TWT responder: true
    TWT implicit: true
    TWT announce: true
    TWT trigger: true
    TWT wake interval: 65024 us
    TWT interval: 524000 us
    ========================
    uart:~$ > wifi twt setup 0 0 2 2 0 1 1 1 20 60000 0
    wifi twt setup 0 0 2 2 0 1 1 1 20 60000 0
    TWT setup with TWT individual negotiation failed. reason : Peer not TWT capable
    [00:03:27.207,946] <err> wifi_nrf: nrf_wifi_wpa_supp_signal_poll: Failed to get station info, ret = -11
    [00:03:27.207,977] <err> wpa_supp: wpa_drv_zep_signal_poll: Signal polling failed: -1

    [00:03:27.208,679] <err> wpa_supp: Command failed: FAIL
    [00:03:27.208,709] <wrn> wpa_supp: z_wpa_supplicant_status:Failed to read RSSI

    [00:03:32.210,510] <err> wifi_nrf: nrf_wifi_supp_get_conn_info: Timeout: failed to get connection info, ret = -11
    [00:03:32.211,303] <err> wpa_supp: wpa_drv_zep_get_conn_info: Failed to get connection info: -1

    [00:03:32.211,425] <wrn> wpa_supp: z_wpa_supplicant_status: Failed to get connection

  • Hi,

     

    My apologies for missing this.

    ChengQing Zhao said:

    uart:~$ > wifi twt setup 0 0 2 2 0 1 1 1 20 60000 0
    wifi twt setup 0 0 2 2 0 1 1 1 20 60000 0
    TWT setup with TWT individual negotiation failed. reason : Pe

    In previous SDK versions, the intervals were given in milliseconds, while in newer versions; it is given in microseconds for setting a more accurate resolution.

    Try to send 20000 instead.

    To maintain the twt_interval to 1 minute (60 seconds), the "60000" (60*1000 ms) need to be changed to 60000000.

     

    Kind regards,

    Håkon

  • Thank you , i am sorry so late to reply to you, it is run ok now, but i meet a new question, how can i run iperf  on the TWT mode and DTIM mode  by the nRF7002-DK.

    As you can see the log below, there is no zperf command.

    uart:~$ > wifi twt teardown_all
    wifi twt teardown_all
    TWT teardown succeeded for flow ID 1
    TWT operation TWT teardown all flows success
    uart:~$ > wifi twt setup 0 0 2 2 0 1 1 1 20000 60000000 0
    wifi twt setup 0 0 2 2 0 1 1 1 20000 60000000 0
    TWT operation TWT setup with dg: 2, flow_id: 2 requested
    TWT response: TWT accept
    == TWT negotiated parameters ==
    TWT Dialog token: 2
    TWT flow ID: 1
    TWT negotiation type: TWT individual negotiation
    TWT responder: true
    TWT implicit: true
    TWT announce: true
    TWT trigger: true
    TWT wake interval: 19968 us
    TWT interval: 60030000 us
    ========================
    uart:~$ > zperf
    zperf
    zperf: command not found

Related