Skip to contentSkip to conversation

iwd 2.22 scan fails but... works ok with ConnMan

DISCUSSION Piotr Oniszczuk 3 participants 7 messages Oct 15, 2024 – Oct 24, 2024

lore
Share & tools
lore
#0 lore raw

Hi,

I’m using iwd 2.22 as default way of automated wifi connection in my project (https://github.com/warpme/minimyth2)

Some of my users started to report issues about not able to establish wifi connections.
I asked to do 1st step verification: launch ConnMan (https://wiki.archlinux.org/title/ConnMan) to verify is HW working ok.

With ConnMan users are able to connect so HW is OK. It looks to me like issue is specific to iwd.

With iwd log says like below.

May somebody from iwd team help me to solve this issue?

Wireless daemon version 2.22
src/main.c:main() Using configuration directory /etc/iwd
Loaded configuration from /etc/iwd/main.conf src/storage.c:storage_create_dirs() Using state directory /var/lib/iwd src/main.c:nl80211_appeared() Found nl80211 interface src/module.c:iwd_modules_init()
station: Network configuration is disabled. src/knownnetworks.c:known_network_frequencies_load() No known frequency file found. src/wsc.c:wsc_init()
src/eap.c:__eap_method_enable()
src/eap-wsc.c:eap_wsc_init()
src/eap-ttls.c:eap_ttls_init()
src/eap-tls.c:eap_tls_init()
src/eap-md5.c:eap_md5_init()
src/eap-pwd.c:eap_pwd_init()
src/eap-gtc.c:eap_gtc_init()
src/eap-peap.c:eap_peap_init()
src/eap-aka.c:eap_aka_prime_init()
src/eap-aka.c:eap_aka_init()
src/eap-sim.c:eap_sim_init()
src/eap-mschapv2.c:eap_mschapv2_init()
src/udev.c:udev_init()
src/manager.c:manager_wiphy_dump_callback() New wiphy phy0 added (0) src/manager.c:manager_wiphy_dump_done() src/manager.c:manager_filtered_wiphy_dump_done()
Wiphy: 0, Name: phy0

        Permanent Address: 00:00:00:00:00:00
        2.4GHz Band:
                Bitrates (non-HT):
                         1.0 Mbps
                         2.0 Mbps
                         5.5 Mbps
                        11.0 Mbps
                         6.0 Mbps
                         9.0 Mbps
                        12.0 Mbps
                        18.0 Mbps
                        24.0 Mbps
                        36.0 Mbps
                        48.0 Mbps
                        54.0 Mbps
                         6.5 Mbps
                        13.0 Mbps
                        19.5 Mbps
                        26.0 Mbps
                        39.0 Mbps
                        52.0 Mbps
                        58.5 Mbps
                        13.0 Mbps
                        26.0 Mbps
                        39.0 Mbps
                        52.0 Mbps
                HT Capabilities:
                        HT40
                        Short GI for 20Mhz
                        Short GI for 40Mhz
                HT RX MCS indexes:
                        0-7
                HT TX MCS set undefined
        5GHz Band:
                Bitrates (non-HT):
                         6.0 Mbps
                         9.0 Mbps
                        12.0 Mbps
                        18.0 Mbps
                        24.0 Mbps
                        36.0 Mbps
                        48.0 Mbps
                        54.0 Mbps
                         6.5 Mbps
                        13.0 Mbps
                        19.5 Mbps
                        26.0 Mbps
                        39.0 Mbps
                        52.0 Mbps
                        58.5 Mbps
                        13.0 Mbps
                        26.0 Mbps
                        39.0 Mbps
                        52.0 Mbps
                HT Capabilities:
                        HT40
                        Short GI for 20Mhz
                        Short GI for 40Mhz
                HT RX MCS indexes:
                        0-7
                HT TX MCS set undefined
                VHT Capabilities:
                        Short GI for 80Mhz
                        Max RX MCS: 0-9 for NSS: 1
                        Max TX MCS: 0-9 for NSS: 1
        Ciphers: BIP-CMAC-128 CCMP-128 TKIP
        Supported iftypes: ad-hoc station ap p2p-client p2p-go p2p-device

Wiphy phy0 will only use the default interface src/manager.c:manager_interface_dump_callback() src/manager.c:manager_get_interface_cb() src/manager.c:manager_interface_dump_done() src/manager.c:manager_use_default() src/netdev.c:netdev_create_from_genl() Created interface wlan0[3 1] src/wiphy.c:wiphy_update_reg_domain() New reg domain country code for phy0 is 00 src/netdev.c:netdev_link_notify() event 16 on ifindex 3 src/netdev.c:netdev_set_4addr() netdev: 3 use_4addr: 0 src/netdev.c:netdev_initial_up_cb() Interface 3 initialized
event: state, old: disconnected, new: autoconnect_quick src/scan.c:scan_periodic_start() Starting periodic scan for wdev 1 src/wiphy.c:wiphy_radio_work_insert() Inserting work item 1 src/wiphy.c:wiphy_radio_work_next() Starting work item 1 src/rrm.c:rrm_add_frame_watches()
src/netdev.c:netdev_link_notify() event 16 on ifindex 3
Could not register frame watch type 00b0: -22 src/manager.c:manager_config_notify() Notification of command Set Interface(6) src/scan.c:scan_periodic_rearm() Arming periodic scan timer: 10 src/wiphy.c:wiphy_radio_work_done() Work item 1 done
Received error during CMD_TRIGGER_SCAN: Invalid argument (22) src/scan.c:scan_periodic_timeout() 1 src/wiphy.c:wiphy_radio_work_insert() Inserting work item 2 src/wiphy.c:wiphy_radio_work_next() Starting work item 2 src/scan.c:scan_periodic_rearm() Arming periodic scan timer: 20 src/wiphy.c:wiphy_radio_work_done() Work item 2 done
Received error during CMD_TRIGGER_SCAN: Invalid argument (22)

#1 lore raw

Hi Piotr,

Quoted 7 lines · Piotr Oniszczuk

Hi,

I’m using iwd 2.22 as default way of automated wifi connection in my project (https://github.com/warpme/minimyth2)

Some of my users started to report issues about not able to establish wifi connections.
I asked to do 1st step verification: launch ConnMan (https://wiki.archlinux.org/title/ConnMan) to verify is HW working ok.

Quoted 6 lines

With ConnMan users are able to connect so HW is OK. It looks to me like issue is specific to iwd.

With iwd log says like below.

May somebody from iwd team help me to solve this issue?

What hardware is being used? Can you include iwmon output?
https://archive.kernel.org/oldwiki/iwd.wiki.kernel.org/debugging.html#iwmon

Regards,
-Denis

#2 lore raw

Denis,
thx for picking this up :)
pls see inline

Quoted 14 lines

Wiadomość napisana przez Denis Kenzior <[email protected]> w dniu 24.10.2024, o godz. 00:04:

Hi Piotr,

Quoted 8 lines · Piotr Oniszczuk

Hi,
I’m using iwd 2.22 as default way of automated wifi connection in my project (https://github.com/warpme/minimyth2)
Some of my users started to report issues about not able to establish wifi connections.
I asked to do 1st step verification: launch ConnMan (https://wiki.archlinux.org/title/ConnMan) to verify is HW working ok. With ConnMan users are able to connect so HW is OK.
It looks to me like issue is specific to iwd.
With iwd log says like below.
May somebody from iwd team help me to solve this issue?

Quoted 1 line

What hardware is being used?

this is allwinner h618 zero3 sbc with uwe5622 wifi chip.
Kernel is 6.11.5 with uwe5622 driver backported from vendor bsp (https://github.com/warpme/minimyth2/blob/master/script/kernel/linux-6.11/files/0630-net-wireless-add-uwe5622-support-v20231020.patch)

Quoted 2 lines

Can you include iwmon output?
https://archive.kernel.org/oldwiki/iwd.wiki.kernel.org/debugging.html#iwmon

Trying to use iwmon shows me:

root@myth-frontend-0200dd63cc00:~ # ip link
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue qlen 1000

    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq qlen 1000
    link/ether 02:00:dd:63:cc:00 brd ff:ff:ff:ff:ff:ff
3: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast qlen 1000
    link/ether 24:b7:2a:45:f4:e5 brd ff:ff:ff:ff:ff:ff

root@myth-frontend-0200dd63cc00:~ # iwmon -i wlan0 Wireless monitor ver 3.0
Failed to create monitor interface wlan0: Unknown error -17 root@myth-frontend-0200dd63cc00:~ #

#3 lore raw

Hi Piotr,

Quoted 6 lines
Quoted 2 lines

What hardware is being used?

this is allwinner h618 zero3 sbc with uwe5622 wifi chip.
Kernel is 6.11.5 with uwe5622 driver backported from vendor bsp (https://github.com/warpme/minimyth2/blob/master/script/kernel/linux-6.11/files/0630-net-wireless-add-uwe5622-support-v20231020.patch)

So yet another non-upstream driver, sigh.

Quoted 7 lines
Quoted 4 lines

Can you include iwmon output?
https://archive.kernel.org/oldwiki/iwd.wiki.kernel.org/debugging.html#iwmon

Trying to use iwmon shows me:

Quoted 8 lines

root@myth-frontend-0200dd63cc00:~ # ip link
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue qlen 1000

     link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq qlen 1000
     link/ether 02:00:dd:63:cc:00 brd ff:ff:ff:ff:ff:ff
3: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast qlen 1000
     link/ether 24:b7:2a:45:f4:e5 brd ff:ff:ff:ff:ff:ff

root@myth-frontend-0200dd63cc00:~ # iwmon -i wlan0

That doesn't do what you think it does. -i is a mostly deprecated option to specify the nlmon device to use (not the wireless device you're trying to snoop on)

Try it without -i.

Quoted 4 lines

Wireless monitor ver 3.0
Failed to create monitor interface wlan0: Unknown error -17 root@myth-frontend-0200dd63cc00:~ #

Is this in any way related to the problem reported in this thread?
https://lore.kernel.org/all/CAOCHtYj9OjZGQ=G139i=KRRcxpFD-1=GSvUPmFYaqSvFz0NwJg@mail.gmail.com/

Regards,
-Denis

#4 lore raw

Pls see inline

Quoted 10 lines

Wiadomość napisana przez Denis Kenzior <[email protected]> w dniu 24.10.2024, o godz. 16:00:

Hi Piotr,

Quoted 4 lines
Quoted 2 lines

What hardware is being used?

this is allwinner h618 zero3 sbc with uwe5622 wifi chip.
Kernel is 6.11.5 with uwe5622 driver backported from vendor bsp (https://github.com/warpme/minimyth2/blob/master/script/kernel/linux-6.11/files/0630-net-wireless-add-uwe5622-support-v20231020.patch)

So yet another non-upstream driver, sigh.

Ah - believe me: mine frustration because of this is much bigger :-p

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

Can you include iwmon output?

After compiling nlmon now is much better: https://gist.github.com/warpme/4b21b51dd1e2c74075498acd9af5082d

Quoted 5 lines
Quoted 1 line

Is this in any way related to the problem reported in this thread?
https://lore.kernel.org/all/CAOCHtYj9OjZGQ=G139i=KRRcxpFD-1=GSvUPmFYaqSvFz0NwJg@mail.gmail.com/

Indeed I saw this thread.
Some time ago I was trying to play with iwd.cfg without success Maybe I put incorrect settings there?

May you hint me what exactly I need to add in iwd.cfg?

To load wifi kernel module I’m using: modprobe sprdwl_ng

Btw: all was working ok few versions back of iwd/kernel
Unfortunately I can’t say which change: iwd or kernel breaks iwd operation on uwe5622 wifi….

#5 lore raw

Hi Piotr,

Quoted 22 lines · Piotr Oniszczuk

Pls see inline

Quoted 8 lines

Wiadomość napisana przez Denis Kenzior <[email protected]> w dniu 24.10.2024, o godz. 16:00:

Hi Piotr,

Quoted 3 lines
Quoted 1 line

What hardware is being used?

this is allwinner h618 zero3 sbc with uwe5622 wifi chip.
Kernel is 6.11.5 with uwe5622 driver backported from vendor bsp (https://github.com/warpme/minimyth2/blob/master/script/kernel/linux-6.11/files/0630-net-wireless-add-uwe5622-support-v20231020.patch)

So yet another non-upstream driver, sigh.

Ah - believe me: mine frustration because of this is much bigger :-p

Quoted 1 line
Quoted 1 line
Quoted 1 line

Can you include iwmon output?

After compiling nlmon now is much better: https://gist.github.com/warpme/4b21b51dd1e2c74075498acd9af5082d

Quoted 3 lines

Is this in any way related to the problem reported in this thread?
https://lore.kernel.org/all/CAOCHtYj9OjZGQ=G139i=KRRcxpFD-1=GSvUPmFYaqSvFz0NwJg@mail.gmail.com/

Indeed I saw this thread.
Some time ago I was trying to play with iwd.cfg without success Maybe I put incorrect settings there?

Quoted 8 lines

May you hint me what exactly I need to add in iwd.cfg?

To load wifi kernel module I’m using: modprobe sprdwl_ng

Btw: all was working ok few versions back of iwd/kernel
Unfortunately I can’t say which change: iwd or kernel breaks iwd operation on uwe5622 wifi….

Thank you for the iwmon logs, that really helped diagnose the issue. There are a few patches on the list that I just sent which will hopefully fix your problem. We identified a few separate issues:

 - Incorrect starting frequency for operating class 136
 - No check for the correct band when checking the e4 table
 - No check for the correct band when parsing the advertised frequencies from the kernel/driver

 Your hardware seems to be advertising some frequencies [1] which are not exactly common and this threw IWD for a loop and exposed several bugs. These fixes will basically disallow those frequencies, but we need to take a closer look at them to be able to parse them correctly.

[1] https://en.wikipedia.org/wiki/List_of_WLAN_channels#5.9_GHz_(802.11p)

Thanks,

James

#6 lore raw
Quoted 18 lines

Wiadomość napisana przez James Prestwood <[email protected]> w dniu 24.10.2024, o godz. 18:51:

Hi Piotr,

Quoted 5 lines · Piotr Oniszczuk

Btw: all was working ok few versions back of iwd/kernel
Unfortunately I can’t say which change: iwd or kernel breaks iwd operation on uwe5622 wifi….

Thank you for the iwmon logs, that really helped diagnose the issue. There are a few patches on the list that I just sent which will hopefully fix your problem. We identified a few separate issues:

- Incorrect starting frequency for operating class 136
- No check for the correct band when checking the e4 table
- No check for the correct band when parsing the advertised frequencies from the kernel/driver

Quoted 8 lines

Your hardware seems to be advertising some frequencies [1] which are not exactly common and this threw IWD for a loop and exposed several bugs. These fixes will basically disallow those frequencies, but we need to take a closer look at them to be able to parse them correctly.

[1] https://en.wikipedia.org/wiki/List_of_WLAN_channels#5.9_GHz_(802.11p)

Thanks,

James

James,

Fantastic work!

With patches I’m getting:

root@myth-frontend-0200dd63cc00:~ # iwctl
NetworkConfigurationEnabled: disabled
StateDirectory: /var/lib/iwd
Version: 3.0
[iwd]# station wlan0 scan
[iwd]# station wlan0 get-networks
Available networks
--------------------------------------------------------------------------------
Network name Security Signal
--------------------------------------------------------------------------------

Quoted 1 line

WarpedNET-2.4 psk ****

      WarpedNET-5                       psk                 ****
      Toshiba1                          psk                 ****
      PLAY_Swiatlowodowy_4B0F           psk                 ****
      UHF7DRX                           psk                 ****
      PLAY_Swiatlowodowy_3CC8_5G        psk                 ****

[iwd]# station wlan0 connect WarpedNET-2.4 Type the network passphrase for WarpedNET-2.4 psk.
Passphrase: ***********
[iwd]# station wlan0 show
Station: wlan0
--------------------------------------------------------------------------------
Settable Property Value
--------------------------------------------------------------------------------

            Scanning              no
            State                 connected
            Connected network     WarpedNET-2.4
            No IP addresses       Is DHCP client configured?
            ConnectedBss          8c:53:c3:e6:bb:8f
            Frequency             2452
            Channel               9
            Security              WPA2-Personal
            RSSI                  -49 dBm
            TxMode                802.11n
            TxMCS                 7
            TxBitrate             65000 Kbit/s

[iwd]#

Many thx for fixing this!