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

  • 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.

Related