Poor Transmit Performance RT5370 in AP Mode

Hi Folks,

I have an RPi5 with an RT5370 in one of the USB ports. The onboard wifi chip is connected to a nearby 5Ghz network in station mode and the RT5370 in a USB port in AP mode.

The network broadcasts on the RT5370 and clients can connect. The issue is that the client only see ~1Mbps downstream and the full 40+mbps upstream. I've tried multiple clients and reinstalled the drivers. I've tried the dongle in USB 2 and 3 ports on the RPi. I even used a usb extension cable to move the wifi dongle away from the RPi but all attempts did not change the speed.

Here's the configuration I've been testing

/etc/config/wireless

config wifi-device 'radio0'
        option type 'mac80211'
        option path 'platform/axi/1001100000.mmc/mmc_host/mmc1/mmc1:0001/mmc1:0001:1'
        option band '5g'
        option channel '149'
        option htmode 'VHT80'
        option txpower '20'
        option country 'US'
        option cell_density '0'

config wifi-iface 'wifinet2'
        option device 'radio0'
        option mode 'sta'
        option network 'wwan'
        option ssid 'Abraham Linksys'
        option encryption 'psk-mixed'
        option key 'mypassword'

config wifi-device 'radio2'
        option type 'mac80211'
        option path 'platform/axi/1000120000.pcie/1f00200000.usb/xhci-hcd.0/usb1/1-1/1-1:1.0'
        option band '2g'
        option channel '1'
        option htmode 'HT20'

config wifi-iface 'default_radio2'
        option device 'radio2'
        option network 'lan'
        option mode 'ap'
        option ssid 'OpenWrt'
        option encryption 'none'

/etc/config/network

config interface 'loopback'
        option device 'lo'
        option proto 'static'
        option ipaddr '127.0.0.1'
        option netmask '255.0.0.0'

config globals 'globals'
        option ula_prefix 'fdf6:abd9:6c4c::/48'

config device
        option name 'br-lan'
        option type 'bridge'
        list ports 'eth0'

config interface 'lan'
        option device 'br-lan'
        option proto 'static'
        option ipaddr '10.0.20.1'
        option netmask '255.255.255.0'

config interface 'wwan'
        option proto 'dhcp'

Here is what I used to install the drivers on my 23.05 instance.

opkg install usbutils kmod-rt2800-lib kmod-rt2800-usb kmod-rt2x00-lib kmod-rt2x00-usb

Thoughts or suggestions welcome.

Remove txpower limit? Since RTxxxx card is likely client-side, it may not have >15dBm amplifiers anyway.
Please show "lusub" output to check device specs.

lsusb

Bus 001 Device 001: ID 1d6b:0002 Linux 6.6.56 xhci-hcd xHCI Host Controller
Bus 001 Device 002: ID 148f:5370 Ralink 802.11 n WLAN
Bus 002 Device 001: ID 1d6b:0003 Linux 6.6.56 xhci-hcd xHCI Host Controller
Bus 003 Device 001: ID 1d6b:0002 Linux 6.6.56 xhci-hcd xHCI Host Controller
Bus 004 Device 001: ID 1d6b:0003 Linux 6.6.56 xhci-hcd xHCI Host Controller

ls-usb -vv

Bus 001 Device 002: ID 148f:5370 Ralink 802.11 n WLAN
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.00
  bDeviceClass            0 [unknown]
  bDeviceSubClass         0 [unknown]
  bDeviceProtocol         0
  bMaxPacketSize0        64
  idVendor           0x148f Ralink
  idProduct          0x5370 802.11 n WLAN
  bcdDevice            1.01
  iManufacturer           1 Ralink
  iProduct                2 802.11 n WLAN
  iSerial                 3 1.0
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength       0x0043
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          0
    bmAttributes         0x80
      (Bus Powered)
    MaxPower              450mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           7
      bInterfaceClass       255 [unknown]
      bInterfaceSubClass    255 [unknown]
      bInterfaceProtocol    255
      iInterface              5 1.0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x01  EP 1 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x02  EP 2 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x03  EP 3 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x04  EP 4 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x05  EP 5 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x06  EP 6 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               0
Device Qualifier (for other device speed):
  bLength                10
  bDescriptorType         6
  bcdUSB               2.00
  bDeviceClass            0 [unknown]
  bDeviceSubClass         0 [unknown]
  bDeviceProtocol         0
  bMaxPacketSize0        64
  bNumConfigurations      1
can't get debug descriptor: Resource temporarily unavailable
Device Status:     0x0000
  (Bus Powered)

Edit: I've also put the adapter into station mode and experience similar performance issues on the transmit side. If I move the dongle to another device (like my windows desktop) I get the full 40Mbps in both directions.

Set wifi country, then get channel map from iw list
Anything about untested device in dmesg?

I set the country and rebooted. Similar results.

root@wrt1:~# iw list
Wiphy phy1
        wiphy index: 1
        max # scan SSIDs: 4
        max scan IEs length: 2257 bytes
        max # sched scan SSIDs: 0
        max # match sets: 0
        Retry short long limit: 2
        Coverage class: 0 (up to 0m)
        Available Antennas: TX 0 RX 0
        Supported interface modes:
                 * IBSS
                 * managed
                 * AP
                 * AP/VLAN
                 * monitor
                 * mesh point
        Band 1:
                Capabilities: 0x17e
                        HT20/HT40
                        SM Power Save disabled
                        RX Greenfield
                        RX HT20 SGI
                        RX HT40 SGI
                        RX STBC 1-stream
                        Max AMSDU length: 3839 bytes
                        No DSSS/CCK HT40
                Maximum RX AMPDU length 32767 bytes (exponent: 0x002)
                Minimum RX AMPDU time spacing: 2 usec (0x04)
                HT TX/RX MCS rate indexes supported: 0-7, 32
                Frequencies:
                        * 2412.0 MHz [1] (30.0 dBm)
                        * 2417.0 MHz [2] (30.0 dBm)
                        * 2422.0 MHz [3] (30.0 dBm)
                        * 2427.0 MHz [4] (30.0 dBm)
                        * 2432.0 MHz [5] (30.0 dBm)
                        * 2437.0 MHz [6] (30.0 dBm)
                        * 2442.0 MHz [7] (30.0 dBm)
                        * 2447.0 MHz [8] (30.0 dBm)
                        * 2452.0 MHz [9] (30.0 dBm)
                        * 2457.0 MHz [10] (30.0 dBm)
                        * 2462.0 MHz [11] (30.0 dBm)
                        * 2467.0 MHz [12] (disabled)
                        * 2472.0 MHz [13] (disabled)
                        * 2484.0 MHz [14] (disabled)
        valid interface combinations:
                 * #{ managed, AP, mesh point } <= 8,
                   total <= 8, #channels <= 1
        HT Capability overrides:
                 * MCS: ff ff ff ff ff ff ff ff ff ff
                 * maximum A-MSDU length
                 * supported channel width
                 * short GI for 40 MHz
                 * max A-MPDU length exponent
                 * min MPDU start spacing
        max # scan plans: 1
        max scan plan interval: -1
        max scan plan iterations: 0
        Supported extended features:
                * [ RRM ]: RRM
                * [ FILS_STA ]: STA FILS (Fast Initial Link Setup)
                * [ CQM_RSSI_LIST ]: multiple CQM_RSSI_THOLD records
                * [ CONTROL_PORT_OVER_NL80211 ]: control port over nl80211
                * [ TXQS ]: FQ-CoDel-enabled intermediate TXQs
                * [ SCAN_RANDOM_SN ]: use random sequence numbers in scans
                * [ SCAN_MIN_PREQ_CONTENT ]: use probe request with only rate IEs in scans
                * [ CONTROL_PORT_NO_PREAUTH ]: disable pre-auth over nl80211 control port support
                * [ DEL_IBSS_STA ]: deletion of IBSS station support
                * [ SCAN_FREQ_KHZ ]: scan on kHz frequency support
                * [ CONTROL_PORT_OVER_NL80211_TX_STATUS ]: tx status for nl80211 control port support
                * [ POWERED_ADDR_CHANGE ]: can change MAC address while up
Wiphy phy0
        wiphy index: 0
        max # scan SSIDs: 10
        max scan IEs length: 2048 bytes
        max # sched scan SSIDs: 16
        max # match sets: 16
        Retry short limit: 7
        Retry long limit: 4
        Coverage class: 0 (up to 0m)
        Available Antennas: TX 0 RX 0
        Supported interface modes:
                 * IBSS
                 * managed
                 * AP
                 * P2P-client
                 * P2P-GO
                 * P2P-device
        Band 1:
                Capabilities: 0x1022
                        HT20/HT40
                        Static SM Power Save
                        RX HT20 SGI
                        No RX STBC
                        Max AMSDU length: 3839 bytes
                        DSSS/CCK HT40
                Maximum RX AMPDU length 65535 bytes (exponent: 0x003)
                Minimum RX AMPDU time spacing: 16 usec (0x07)
                HT TX/RX MCS rate indexes supported: 0-7
                Frequencies:
                        * 2412.0 MHz [1] (20.0 dBm)
                        * 2417.0 MHz [2] (20.0 dBm)
                        * 2422.0 MHz [3] (20.0 dBm)
                        * 2427.0 MHz [4] (20.0 dBm)
                        * 2432.0 MHz [5] (20.0 dBm)
                        * 2437.0 MHz [6] (20.0 dBm)
                        * 2442.0 MHz [7] (20.0 dBm)
                        * 2447.0 MHz [8] (20.0 dBm)
                        * 2452.0 MHz [9] (20.0 dBm)
                        * 2457.0 MHz [10] (20.0 dBm)
                        * 2462.0 MHz [11] (20.0 dBm)
                        * 2467.0 MHz [12] (disabled)
                        * 2472.0 MHz [13] (disabled)
                        * 2484.0 MHz [14] (disabled)
        Band 2:
                Capabilities: 0x1062
                        HT20/HT40
                        Static SM Power Save
                        RX HT20 SGI
                        RX HT40 SGI
                        No RX STBC
                        Max AMSDU length: 3839 bytes
                        DSSS/CCK HT40
                Maximum RX AMPDU length 65535 bytes (exponent: 0x003)
                Minimum RX AMPDU time spacing: 16 usec (0x07)
                HT TX/RX MCS rate indexes supported: 0-7
                VHT Capabilities (0x00001020):
                        Max MPDU length: 3895
                        Supported Channel Width: neither 160 nor 80+80
                        short GI (80 MHz)
                        SU Beamformee
                VHT RX MCS set:
                        1 streams: MCS 0-9
                        2 streams: not supported
                        3 streams: not supported
                        4 streams: not supported
                        5 streams: not supported
                        6 streams: not supported
                        7 streams: not supported
                        8 streams: not supported
                VHT RX highest supported: 0 Mbps
                VHT TX MCS set:
                        1 streams: MCS 0-9
                        2 streams: not supported
                        3 streams: not supported
                        4 streams: not supported
                        5 streams: not supported
                        6 streams: not supported
                        7 streams: not supported
                        8 streams: not supported
                VHT TX highest supported: 0 Mbps
                VHT extended NSS: not supported
                Frequencies:
                        * 5170.0 MHz [34] (20.0 dBm)
                        * 5180.0 MHz [36] (20.0 dBm)
                        * 5190.0 MHz [38] (20.0 dBm)
                        * 5200.0 MHz [40] (20.0 dBm)
                        * 5210.0 MHz [42] (20.0 dBm)
                        * 5220.0 MHz [44] (20.0 dBm)
                        * 5230.0 MHz [46] (20.0 dBm)
                        * 5240.0 MHz [48] (20.0 dBm)
                        * 5260.0 MHz [52] (20.0 dBm) (radar detection)
                        * 5280.0 MHz [56] (20.0 dBm) (radar detection)
                        * 5300.0 MHz [60] (20.0 dBm) (radar detection)
                        * 5320.0 MHz [64] (20.0 dBm) (radar detection)
                        * 5500.0 MHz [100] (20.0 dBm) (radar detection)
                        * 5520.0 MHz [104] (20.0 dBm) (radar detection)
                        * 5540.0 MHz [108] (20.0 dBm) (radar detection)
                        * 5560.0 MHz [112] (20.0 dBm) (radar detection)
                        * 5580.0 MHz [116] (20.0 dBm) (radar detection)
                        * 5600.0 MHz [120] (20.0 dBm) (radar detection)
                        * 5620.0 MHz [124] (20.0 dBm) (radar detection)
                        * 5640.0 MHz [128] (20.0 dBm) (radar detection)
                        * 5660.0 MHz [132] (20.0 dBm) (radar detection)
                        * 5680.0 MHz [136] (20.0 dBm) (radar detection)
                        * 5700.0 MHz [140] (20.0 dBm) (radar detection)
                        * 5720.0 MHz [144] (20.0 dBm) (radar detection)
                        * 5745.0 MHz [149] (20.0 dBm)
                        * 5765.0 MHz [153] (20.0 dBm)
                        * 5785.0 MHz [157] (20.0 dBm)
                        * 5805.0 MHz [161] (20.0 dBm)
                        * 5825.0 MHz [165] (20.0 dBm)
        valid interface combinations:
                 * #{ managed } <= 2, #{ P2P-device } <= 1, #{ P2P-client, P2P-GO } <= 1,
                   total <= 3, #channels <= 2
                 * #{ managed } <= 1, #{ AP } <= 1, #{ P2P-client } <= 1, #{ P2P-device } <= 1,
                   total <= 4, #channels <= 1
        max # scan plans: 1
        max scan plan interval: 508
        max scan plan iterations: 0
        Supported extended features:
                * [ CQM_RSSI_LIST ]: multiple CQM_RSSI_THOLD records
                * [ DFS_OFFLOAD ]: DFS offload
root@wrt1:~#

dmesg was quiet. nothing with 'untested'

Set encryption to wpa2 ccmp or none, tkip is certainly forbidden in wifi7, some client may get more picky.
btw you got one of best broadcom options - you have 4 access points as long as you dont scan radio surroundings.