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
  • Hi,

     

    In order to add zperf to the wifi/shell sample, you need to append the "overlay-zperf.conf" to your sample.

    ChengQing Zhao said:
    uart:~$ > twt
    twt
    twt: command not found

    Which example is this based on? The command should be "wifi twt" if you are using the wifi/shell.

     

    Have you had a look at the twt sample? it includes a way to generate traffic to the device:

    https://docs.nordicsemi.com/bundle/ncs-latest/page/nrf/samples/wifi/twt/README.html

     

    Kind regards,

    Håkon

  • Thank you  , Wi-Fi:Shell example is seem already include "overlay-zperf.conf", as shown in the picture.

    In order to add zperf to the wifi/shell sample, you need to append the "overlay-zperf.conf" to your sample.

    Yes, that is my question, i am sorry. thank you for your guidance

    Which example is this based on? The command should be "wifi twt" if you are using the wifi/shell.

    Yes, twt example seem to give another way, but it can not set DTIM mode, i want  to compare the throughput under DTIM and TWT, so, i think zperf is more simple and flexible.

    Have you had a look at the twt sample? it includes a way to generate traffic to the device:

    https://docs.nordicsemi.com/bundle/ncs-latest/page/nrf/samples/wifi/twt/README.html

  • Hi,

     

    Click button "Add extra fragment" - then select the file "overlay-zperf.conf", and click "OK".

    It should then look like this:

     

    ChengQing Zhao said:
    Yes, twt example seem to give another way, but it can not set DTIM mode, i want  to compare the throughput under DTIM and TWT, so, i think zperf is more simple and flexible.

    DTIM is enabled by default. The nrf7002 will follow what is set by the access point.

     

    Kind regards,

    Håkon

  • Thank you, .

    I run Zperf successfully. But I have a new question as the log shows:

    when I change to TWT mode, nRF7002-DK can not even ping the server.

    uart:~$ > wifi connect -s "OpenWrt" -p "12345678" -k 1
    wifi connect -s "OpenWrt" -p "12345678" -k 1
    Connection requested
    Connected
    [00:00:42.920,135] <inf> wpa_supp: nordic_wlan0: SME: Trying to authenticate with 94:83:c4:1f:05:da (SSID='OpenWrt' freq=5180 MHz)
    [00:00:43.171,142] <inf> wpa_supp: nordic_wlan0: Trying to associate with 94:83:c4:1f:05:da (SSID='OpenWrt' freq=5180 MHz)
    [00:00:43.184,265] <inf> wpa_supp: nordic_wlan0: Associated with 94:83:c4:1f:05:da
    [00:00:43.184,356] <inf> wpa_supp: nordic_wlan0: CTRL-EVENT-SUBNET-STATUS-UPDATE status=0
    [00:00:43.194,274] <inf> wpa_supp: nordic_wlan0: WPA: Key negotiation completed with 94:83:c4:1f:05:da [PTK=CCMP GTK=CCMP]
    [00:00:43.194,427] <inf> wpa_supp: nordic_wlan0: CTRL-EVENT-CONNECTED - Connection to 94:83:c4:1f:05:da completed [id=0 id_str=]
    [00:00:43.203,948] <inf> net_dhcpv4: Received: 192.168.6.192
    [00:00:43.204,010] <inf> net_config: IPv4 address: 192.168.6.192
    [00:00:43.204,010] <inf> net_config: Lease time: 43200 seconds
    [00:00:43.204,010] <inf> net_config: Subnet: 255.255.255.0
    [00:00:43.204,040] <inf> net_config: Router: 192.168.6.1
    uart:~$ > wifi status
    wifi status
    Status: successful
    ==================
    State: COMPLETED
    Interface Mode: STATION
    Link Mode: WIFI 6 (802.11ax/HE)
    SSID: OpenWrt
    BSSID: 94:83:C4:1F:05:DA
    Band: 5GHz
    Channel: 36
    Security: WPA2-PSK
    MFP: Optional
    RSSI: -43
    Beacon Interval: 100
    DTIM: 1
    TWT: Supported
    uart:~$ > net ping 192.168.6.118
    net ping 192.168.6.118
    PING 192.168.6.118
    28 bytes from 192.168.6.118 to 192.168.6.192: icmp_seq=1 ttl=64 time=12 ms
    28 bytes from 192.168.6.118 to 192.168.6.192: icmp_seq=2 ttl=64 time=10 ms
    28 bytes from 192.168.6.118 to 192.168.6.192: icmp_seq=3 ttl=64 time=11 ms
    uart:~$ > zperf tcp upload 192.168.6.118 5001 10 1K 5M
    zperf tcp upload 192.168.6.118 5001 10 1K 5M
    Remote port is 5001
    Connecting to 192.168.6.118
    TCP upload will ignore <baud rate> argument
    Duration: 10.00 s
    Packet size: 1000 bytes
    Rate: 5000 kbps
    Starting...
    -
    Upload completed!
    Duration: 10.00 s
    Num packets: 19276
    Num errors: 0 (retry or fail)
    Rate: 15.42 Mbps
    uart:~$ > wifi twt setup 0 0 2 2 0 1 1 1 10000 100000 0
    wifi twt setup 0 0 2 2 0 1 1 1 10000 100000 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: false
    TWT implicit: true
    TWT announce: true
    TWT trigger: true
    TWT wake interval: 9984 us
    TWT interval: 100000 us
    ========================
    uart:~$ > net ping 192.168.6.118
    net ping 192.168.6.118
    PING 192.168.6.118
    Ping timeout

  • Hi,

    ChengQing Zhao said:
    TWT wake interval: 9984 us
    TWT interval: 100000 us

    Try setting the wake interval higher, for instance 20000 us.

    You are using a TWT interval of 0.1 seconds, which is very low. It does not make sense to use it with such a low period, it is then better to use DTIM/Listen_interval.

     

    Kind regards,

    Håkon

Reply Children
  • OK, I see, what I want to do is to prove twt not better than dtim mode. if it is not can set 100ms, how can I prove it?

    because of the most of the device default value is 100ms.

  • ChengQing Zhao said:
    TWT wake interval: 9984 us

    Set the wake interval to >20000 us, and retry. Your current wake interval is too low.

    Kind regards,

    Håkon

  • Hi, i am try it again:

    wifi twt setup 0 0 2 2 0 1 1 1 200000 1000000 0

    and

    wifi twt setup 0 0 2 2 0 1 1 1 20000 100000 0

    are all not ok. it still can not ping.

    the log is:

    > wifi connect -s "OpenWrt" -p "12345678" -k 1
    wifi connect -s "OpenWrt" -p "12345678" -k 1
    Connection requested
    Connected
    [00:00:34.554,504] <inf> wpa_supp: nordic_wlan0: SME: Trying to authenticate with 94:83:c4:1f:05:da (SSID='OpenWrt' freq=5180 MHz)
    [00:00:34.804,779] <inf> wpa_supp: nordic_wlan0: Trying to associate with 94:83:c4:1f:05:da (SSID='OpenWrt' freq=5180 MHz)
    [00:00:34.822,967] <inf> wpa_supp: nordic_wlan0: Associated with 94:83:c4:1f:05:da
    [00:00:34.823,150] <inf> wpa_supp: nordic_wlan0: CTRL-EVENT-SUBNET-STATUS-UPDATE status=0
    [00:00:34.836,517] <inf> wpa_supp: nordic_wlan0: WPA: Key negotiation completed with 94:83:c4:1f:05:da [PTK=CCMP GTK=CCMP]
    [00:00:34.836,730] <inf> wpa_supp: nordic_wlan0: CTRL-EVENT-CONNECTED - Connection to 94:83:c4:1f:05:da completed [id=0 id_str=]
    [00:00:37.957,916] <inf> net_dhcpv4: Received: 192.168.6.192
    uart:~$ > wifi twt setup 0 0 2 2 0 1 1 1 20000 100000 0
    wifi twt setup 0 0 2 2 0 1 1 1 20000 100000 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: 100000 us
    ========================
    uart:~$ > net ping 192.168.6.1
    net ping 192.168.6.1
    PING 192.168.6.1
    Ping timeout
    uart:~$ > wifi twt setup 0 0 2 2 0 1 1 1 200000 1000000 0
    wifi twt setup 0 0 2 2 0 1 1 1 200000 1000000 0
    TWT operation TWT setup with dg: 2, flow_id: 2 requested
    [00:02:48.167,022] <err> wifi_nrf: nrf_wifi_wpa_supp_signal_poll: Failed to get interface info, ret = -11
    [00:02:48.167,053] <err> wpa_supp: wpa_drv_zep_signal_poll: Signal polling failed: -1

    [00:02:48.167,785] <err> wpa_supp: Command failed: FAIL
    [00:02:48.167,816] <wrn> wpa_supp: z_wpa_supplicant_status:Failed to read RSSI

    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 200000 1000000 0
    wifi twt setup 0 0 2 2 0 1 1 1 200000 1000000 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: 49920 us
    TWT interval: 1000000 us
    ========================
    uart:~$ > net ping 192.168.6.1
    net ping 192.168.6.1
    PING 192.168.6.1
    Ping timeout
    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 status
    wifi status
    Status: successful
    ==================
    State: COMPLETED
    Interface Mode: STATION
    Link Mode: WIFI 6 (802.11ax/HE)
    SSID: OpenWrt
    BSSID: 94:83:C4:1F:05:DA
    Band: 5GHz
    Channel: 36
    Security: WPA2-PSK
    MFP: Optional
    RSSI: -39
    Beacon Interval: 100
    DTIM: 1
    TWT: Supported
    uart:~$ > net ping 192.168.6.1
    net ping 192.168.6.1
    PING 192.168.6.1
    28 bytes from 192.168.6.1 to 192.168.6.192: icmp_seq=1 ttl=64 time=202 ms
    28 bytes from 192.168.6.1 to 192.168.6.192: icmp_seq=2 ttl=64 time=8 ms
    28 bytes from 192.168.6.1 to 192.168.6.192: icmp_seq=3 ttl=64 time=11 ms
    uart:~$

  • Hi,

     

    I tried both your configurations successfully against a ASUS RT-AX1800U running OpenWrt v23.05:

    *** Using nRF Connect SDK v2.8.0-a2386bfc8401 ***
    *** Using Zephyr OS v3.7.99-0bc3393fb112 ***
    Starting nrf7002dk with CPU frequency: 128 MHz
    [00:00:00.699,462] <inf> wifi_supplicant: wpa_supplicant initialized
    uart:~$ 
    uart:~$ wifi connect -s OpenWrt -k 1 -p mypassword
    Connection requested
    Connected
    [00:01:49.010,589] <inf> wpa_supp: wlan0: SME: Trying to authenticate with fc:34:97:0b:f6:dc (SSID='OpenWrt' freq=5180)
    [00:01:49.368,438] <inf> wpa_supp: wlan0: Trying to associate with fc:34:97:0b:f6:dc (SSID='OpenWrt' freq=5180 MHz)
    [00:01:49.387,084] <inf> wpa_supp: wlan0: Associated with fc:34:97:0b:f6:dc
    [00:01:49.387,268] <inf> wpa_supp: wlan0: CTRL-EVENT-SUBNET-STATUS-UPDATE status=0
    [00:01:49.398,681] <inf> wpa_supp: wlan0: WPA: Key negotiation completed with fc:34:97:0b:f6:dc [PTK=CCMP GTK=TKIP]
    [00:01:49.398,895] <inf> wpa_supp: wlan0: CTRL-EVENT-CONNECTED - Connection to fc:34:97:0b:f6:dc completed [id=0 id_st]
    uart:~$ wifi twt setup 0 0 2 2 0 1 1 1 20000 100000 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: 0
    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: 100000 us
    ========================
    [00:01:52.413,513] <inf> net_dhcpv4: Received: 192.168.32.196
    uart:~$ net ping 8.8.8.8
    PING 8.8.8.8
    28 bytes from 8.8.8.8 to 192.168.32.196: icmp_seq=1 ttl=54 time=130 ms
    28 bytes from 8.8.8.8 to 192.168.32.196: icmp_seq=2 ttl=54 time=131 ms
    28 bytes from 8.8.8.8 to 192.168.32.196: icmp_seq=3 ttl=54 time=133 ms
    uart:~$ net ping 8.8.8.8
    PING 8.8.8.8
    28 bytes from 8.8.8.8 to 192.168.32.196: icmp_seq=1 ttl=54 time=121 ms
    28 bytes from 8.8.8.8 to 192.168.32.196: icmp_seq=2 ttl=54 time=124 ms
    28 bytes from 8.8.8.8 to 192.168.32.196: icmp_seq=3 ttl=54 time=125 ms
    uart:~$ wifi twt tear
      teardown      teardown_all
    uart:~$ wifi twt teardown_all 
    TWT teardown succeeded for flow ID 0
    TWT operation TWT teardown all flows success
    uart:~$ wifi twt setup 0 0 2 2 0 1 1 1 200000 1000000 0
    TWT operation TWT setup with dg: 2, flow_id: 2 requested
    TWT response: TWT reject
    == TWT negotiated parameters ==
    TWT Dialog token: 2
    TWT flow ID: 2
    TWT negotiation type: TWT individual negotiation
    TWT responder: false
    TWT implicit: true
    TWT announce: true
    TWT trigger: true
    TWT wake interval: 199680 us
    TWT interval: 1000000 us
    ========================
    uart:~$ net ping 8.8.8.8
    PING 8.8.8.8
    28 bytes from 8.8.8.8 to 192.168.32.196: icmp_seq=1 ttl=54 time=64 ms
    28 bytes from 8.8.8.8 to 192.168.32.196: icmp_seq=2 ttl=54 time=54 ms
    28 bytes from 8.8.8.8 to 192.168.32.196: icmp_seq=3 ttl=54 time=66 ms
    uart:~$ net ping 8.8.8.8
    PING 8.8.8.8
    28 bytes from 8.8.8.8 to 192.168.32.196: icmp_seq=1 ttl=54 time=57 ms
    28 bytes from 8.8.8.8 to 192.168.32.196: icmp_seq=2 ttl=54 time=59 ms
    28 bytes from 8.8.8.8 to 192.168.32.196: icmp_seq=3 ttl=54 time=141 ms
    

     

    I am using NCS v2.8.0, completely unchanged wifi/shell sample. Which access point are you using? It could be that the timing parameters given for TWT is problematic for the AP that you're using?

     

    Kind regards,

    Håkon

  • Hi, my ap is GliNet, system is from OpenWrt R22.3.3 (Powered by LuCI Master (git-22.060.11889-fb941f7) / OpenWrt R22.3.3).

    NCS v2.7.0

    under your help, i try to  find the problem

    I change the sixth paramete<trigger:0/1> to 0

    wifi twt setup 0 0 2 2 0 0 1 1 20000 100000 0

    that seems work well, but still some error in the log when i input the "wifi status":

    uart:~$ > wifi twt setup 0 0 2 2 0 0 1 1 20000 100000 0
    wifi twt setup 0 0 2 2 0 0 1 1 20000 100000 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: false
    TWT wake interval: 19968 us
    TWT interval: 100000 us
    ========================
    uart:~$ > wifi status
    wifi status
    Status: successful
    ==================
    State: COMPLETED
    Interface Mode: STATION
    Link Mode: WIFI 6 (802.11ax/HE)
    SSID: OpenWrt
    BSSID: 94:83:C4:1F:05:DA
    Band: 5GHz
    Channel: 36
    Security: WPA2-PSK
    MFP: Optional
    RSSI: -9999
    Beacon Interval: 100
    DTIM: 1
    TWT: Supported
    [00:08:29.909,057] <err> wifi_nrf: nrf_wifi_wpa_supp_signal_poll: Failed to get interface info, ret = -11
    [00:08:29.909,088] <err> wpa_supp: wpa_drv_zep_signal_poll: Signal polling failed: -1

    [00:08:29.909,820] <err> wpa_supp: Command failed: FAIL
    [00:08:29.909,851] <wrn> wpa_supp: z_wpa_supplicant_status:Failed to read RSSI

    uart:~$ > net ping 192.168.6.1
    net ping 192.168.6.1
    PING 192.168.6.1
    28 bytes from 192.168.6.1 to 192.168.6.192: icmp_seq=1 ttl=64 time=12 ms
    28 bytes from 192.168.6.1 to 192.168.6.192: icmp_seq=2 ttl=64 time=11 ms
    28 bytes from 192.168.6.1 to 192.168.6.192: icmp_seq=3 ttl=64 time=12 ms
    uart:~$

Related