Wireless Daemon for Linux
 help / color / mirror / Atom feed
From: Denis Kenzior <denkenz@gmail.com>
To: Robert Nelson <robertcnelson@gmail.com>, iwd@lists.linux.dev
Subject: Re: iwd 2.12 - Received error during CMD_TRIGGER_SCAN: Invalid argument (22)
Date: Tue, 9 Jan 2024 22:14:39 -0600	[thread overview]
Message-ID: <f4d9e6cf-f7e4-49b9-adbf-92dbc006812a@gmail.com> (raw)
In-Reply-To: <CAOCHtYj9OjZGQ=G139i=KRRcxpFD-1=GSvUPmFYaqSvFz0NwJg@mail.gmail.com>

Hi Robert,

On 1/9/24 15:37, Robert Nelson wrote:
> Hi iwd Developers,
> 
> For BeagleBoard.org devices I've been looking to move us to iwd vs
> wpa_supplicant, and have been fighting an CMD_TRIGGER_SCAN error on
> bootup, so devices don't auto connect to WiFI once configured.
> 
> Our main stack is Debian 12.x (Bookworm) with backports of libell-dev
> and iwd on a 5.10.x based vendor kernel (well my 5.10.x)
> 
> https://packages.debian.org/sid/libell-dev
> https://packages.debian.org/source/sid/iwd
> 
> ```
> debian@42-am335x-bbbw:~$ dpkg --list | grep libell
> ii  libell0:armhf
> 0.61-1bbbio0~bookworm+20231207          armhf        Embedded Linux
> library
> debian@42-am335x-bbbw:~$ dpkg --list | grep iwd
> ii  iwd
> 2.12-1bbbio0~bookworm+20240103          armhf        wireless daemon
> for Linux
> ```
> 

That looks okay...

> Normally on bootup iwd will report:
> 
> ```
> Jan 09 15:10:41 41-am335x-bbbw iwd[360]: D-Bus disconnected, quitting...
> Jan 09 15:10:41 41-am335x-bbbw iwd[360]: Removing scan context for wdev 2
> Jan 09 15:10:41 41-am335x-bbbw iwd[360]: Terminate
> Jan 09 15:10:41 41-am335x-bbbw systemd[1]: Stopping iwd.service -
> Wireless service...
> Jan 09 15:10:42 41-am335x-bbbw iwd[360]: Removing scan context for wdev 3
> Jan 09 15:10:42 41-am335x-bbbw systemd[1]: iwd.service: Deactivated
> successfully.
> Jan 09 15:10:42 41-am335x-bbbw systemd[1]: Stopped iwd.service -
> Wireless service.
> Jan 09 15:10:44 41-am335x-bbbw systemd[1]: Starting iwd.service -
> Wireless service...
> Jan 09 15:10:47 41-am335x-bbbw iwd[363]: Wireless daemon version 2.12
> Jan 09 15:10:47 41-am335x-bbbw iwd[363]: Loaded configuration from
> /etc/iwd/main.conf
> Jan 09 15:10:47 41-am335x-bbbw systemd[1]: Started iwd.service -
> Wireless service.
> Jan 09 15:10:47 41-am335x-bbbw iwd[363]: station: Network
> configuration is disabled.
> Jan 09 15:11:14 41-am335x-bbbw iwd[363]: Wiphy: 0, Name: phy0
> Jan 09 15:11:14 41-am335x-bbbw iwd[363]:         Permanent Address:
> 5c:31:3e:e2:24:6a
> Jan 09 15:11:14 41-am335x-bbbw iwd[363]:         2.4GHz Band:
> Jan 09 15:11:14 41-am335x-bbbw iwd[363]:                 Bitrates (non-HT):
> Jan 09 15:11:14 41-am335x-bbbw iwd[363]:                          1.0 Mbps
> Jan 09 15:11:14 41-am335x-bbbw iwd[363]:                          2.0 Mbps
> Jan 09 15:11:14 41-am335x-bbbw iwd[363]:                          5.5 Mbps
> Jan 09 15:11:14 41-am335x-bbbw iwd[363]:                         11.0 Mbps
> Jan 09 15:11:14 41-am335x-bbbw iwd[363]:                          6.0 Mbps
> Jan 09 15:11:14 41-am335x-bbbw iwd[363]:                          9.0 Mbps
> Jan 09 15:11:14 41-am335x-bbbw iwd[363]:                         12.0 Mbps
> Jan 09 15:11:14 41-am335x-bbbw iwd[363]:                         18.0 Mbps
> Jan 09 15:11:14 41-am335x-bbbw iwd[363]:                         24.0 Mbps
> Jan 09 15:11:14 41-am335x-bbbw iwd[363]:                         36.0 Mbps
> Jan 09 15:11:14 41-am335x-bbbw iwd[363]:                         48.0 Mbps
> Jan 09 15:11:14 41-am335x-bbbw iwd[363]:                         54.0 Mbps
> Jan 09 15:11:14 41-am335x-bbbw iwd[363]:                 HT Capabilities:
> Jan 09 15:11:14 41-am335x-bbbw iwd[363]:                         HT20
> Jan 09 15:11:14 41-am335x-bbbw iwd[363]:                         Short
> GI for 20Mhz
> Jan 09 15:11:14 41-am335x-bbbw iwd[363]:                 HT RX MCS indexes:
> Jan 09 15:11:14 41-am335x-bbbw iwd[363]:                         0-15
> Jan 09 15:11:14 41-am335x-bbbw iwd[363]:         5GHz Band:
> Jan 09 15:11:14 41-am335x-bbbw iwd[363]:                 Bitrates (non-HT):
> Jan 09 15:11:14 41-am335x-bbbw iwd[363]:                          6.0 Mbps
> Jan 09 15:11:14 41-am335x-bbbw iwd[363]:                          9.0 Mbps
> Jan 09 15:11:14 41-am335x-bbbw iwd[363]:                         12.0 Mbps
> Jan 09 15:11:14 41-am335x-bbbw iwd[363]:                         18.0 Mbps
> Jan 09 15:11:14 41-am335x-bbbw iwd[363]:                         24.0 Mbps
> Jan 09 15:11:14 41-am335x-bbbw iwd[363]:                         36.0 Mbps
> Jan 09 15:11:14 41-am335x-bbbw iwd[363]:                         48.0 Mbps
> Jan 09 15:11:14 41-am335x-bbbw iwd[363]:                         54.0 Mbps
> Jan 09 15:11:14 41-am335x-bbbw iwd[363]:                 HT Capabilities:
> Jan 09 15:11:14 41-am335x-bbbw iwd[363]:                         HT40
> Jan 09 15:11:14 41-am335x-bbbw iwd[363]:                         Short
> GI for 20Mhz
> Jan 09 15:11:14 41-am335x-bbbw iwd[363]:                         Short
> GI for 40Mhz
> Jan 09 15:11:14 41-am335x-bbbw iwd[363]:                 HT RX MCS indexes:
> Jan 09 15:11:14 41-am335x-bbbw iwd[363]:                         0-7
> Jan 09 15:11:14 41-am335x-bbbw iwd[363]:         Ciphers: CCMP-128 TKIP
> Jan 09 15:11:14 41-am335x-bbbw iwd[363]:         Supported iftypes:
> station ap p2p-client p2p-go p2p-device
> Jan 09 15:11:16 41-am335x-bbbw iwd[363]: connect event timed out, reason=3
> Jan 09 15:11:16 41-am335x-bbbw iwd[363]: connect event timed out, reason=3
> Jan 09 15:11:17 41-am335x-bbbw iwd[363]: connect event timed out, reason=3
> Jan 09 15:11:18 41-am335x-bbbw iwd[363]: connect event timed out, reason=3
> Jan 09 15:11:18 41-am335x-bbbw iwd[363]: connect event timed out, reason=2

enum nl80211_timeout_reason {
         NL80211_TIMEOUT_UNSPECIFIED,
         NL80211_TIMEOUT_SCAN,
         NL80211_TIMEOUT_AUTH,
         NL80211_TIMEOUT_ASSOC,
};

So either AUTH or ASSOC.

> Jan 09 15:11:18 41-am335x-bbbw iwd[363]: Received error during
> CMD_TRIGGER_SCAN: Invalid argument (22)
> Jan 09 15:11:28 41-am335x-bbbw iwd[363]: Received error during
> CMD_TRIGGER_SCAN: Invalid argument (22)
> Jan 09 15:11:48 41-am335x-bbbw iwd[363]: Received error during
> CMD_TRIGGER_SCAN: Invalid argument (22)
> ```
> 

And that's a pretty strange error as well.  Any chance you can trace the kernel 
to see what exactly it doesn't like?

> What's weird, if i login over serial and restart, sometimes it just works..
> 
> ```
> Jan 09 14:58:11 42-am335x-bbbw iwd[362]: Received error during
> CMD_TRIGGER_SCAN: Invalid argument (22)
> Jan 09 15:03:11 42-am335x-bbbw iwd[362]: Received error during
> CMD_TRIGGER_SCAN: Invalid argument (22)
> Jan 09 15:07:58 42-am335x-bbbw sudo[676]:   debian : TTY=ttyS0 ;
> PWD=/home/debian ; USER=root ; COMMAND=/usr/bin/systemctl restart
> iwd.service
> Jan 09 15:08:19 42-am335x-bbbw sudo[720]:   debian : TTY=ttyS0 ;
> PWD=/home/debian ; USER=root ; COMMAND=/usr/bin/systemctl restart
> iwd.service
> Jan 09 15:24:44 42-am335x-bbbw sudo[1246]:   debian : TTY=ttyS0 ;
> PWD=/home/debian/lab ; USER=root ; COMMAND=/usr/bin/nano
> /etc/iwd/main.conf
> Jan 09 15:25:01 42-am335x-bbbw systemd[1]: Starting iwd.service -
> Wireless service...
> Jan 09 15:25:04 42-am335x-bbbw iwd[363]: Wireless daemon version 2.12
> Jan 09 15:25:04 42-am335x-bbbw iwd[363]: Loaded configuration from
> /etc/iwd/main.conf
> Jan 09 15:25:04 42-am335x-bbbw systemd[1]: Started iwd.service -
> Wireless service.
> Jan 09 15:25:04 42-am335x-bbbw iwd[363]: station: Network
> configuration is disabled.
> Jan 09 15:25:30 42-am335x-bbbw iwd[363]: Wiphy: 0, Name: phy0
> Jan 09 15:25:30 42-am335x-bbbw iwd[363]:         Permanent Address:
> 5c:31:3e:e3:bb:e4
> Jan 09 15:25:30 42-am335x-bbbw iwd[363]:         2.4GHz Band:
> Jan 09 15:25:30 42-am335x-bbbw iwd[363]:                 Bitrates (non-HT):
> Jan 09 15:25:30 42-am335x-bbbw iwd[363]:                          1.0 Mbps
> Jan 09 15:25:30 42-am335x-bbbw iwd[363]:                          2.0 Mbps
> Jan 09 15:25:30 42-am335x-bbbw iwd[363]:                          5.5 Mbps
> Jan 09 15:25:30 42-am335x-bbbw iwd[363]:                         11.0 Mbps
> Jan 09 15:25:30 42-am335x-bbbw iwd[363]:                          6.0 Mbps
> Jan 09 15:25:30 42-am335x-bbbw iwd[363]:                          9.0 Mbps
> Jan 09 15:25:30 42-am335x-bbbw iwd[363]:                         12.0 Mbps
> Jan 09 15:25:30 42-am335x-bbbw iwd[363]:                         18.0 Mbps
> Jan 09 15:25:30 42-am335x-bbbw iwd[363]:                         24.0 Mbps
> Jan 09 15:25:30 42-am335x-bbbw iwd[363]:                         36.0 Mbps
> Jan 09 15:25:30 42-am335x-bbbw iwd[363]:                         48.0 Mbps
> Jan 09 15:25:30 42-am335x-bbbw iwd[363]:                         54.0 Mbps
> Jan 09 15:25:30 42-am335x-bbbw iwd[363]:                 HT Capabilities:
> Jan 09 15:25:30 42-am335x-bbbw iwd[363]:                         HT20
> Jan 09 15:25:30 42-am335x-bbbw iwd[363]:                         Short
> GI for 20Mhz
> Jan 09 15:25:30 42-am335x-bbbw iwd[363]:                 HT RX MCS indexes:
> Jan 09 15:25:30 42-am335x-bbbw iwd[363]:                         0-15
> Jan 09 15:25:30 42-am335x-bbbw iwd[363]:         5GHz Band:
> Jan 09 15:25:30 42-am335x-bbbw iwd[363]:                 Bitrates (non-HT):
> Jan 09 15:25:30 42-am335x-bbbw iwd[363]:                          6.0 Mbps
> Jan 09 15:25:30 42-am335x-bbbw iwd[363]:                          9.0 Mbps
> Jan 09 15:25:30 42-am335x-bbbw iwd[363]:                         12.0 Mbps
> Jan 09 15:25:30 42-am335x-bbbw iwd[363]:                         18.0 Mbps
> Jan 09 15:25:30 42-am335x-bbbw iwd[363]:                         24.0 Mbps
> Jan 09 15:25:30 42-am335x-bbbw iwd[363]:                         36.0 Mbps
> Jan 09 15:25:30 42-am335x-bbbw iwd[363]:                         48.0 Mbps
> Jan 09 15:25:30 42-am335x-bbbw iwd[363]:                         54.0 Mbps
> Jan 09 15:25:30 42-am335x-bbbw iwd[363]:                 HT Capabilities:
> Jan 09 15:25:30 42-am335x-bbbw iwd[363]:                         HT40
> Jan 09 15:25:30 42-am335x-bbbw iwd[363]:                         Short
> GI for 20Mhz
> Jan 09 15:25:30 42-am335x-bbbw iwd[363]:                         Short
> GI for 40Mhz
> Jan 09 15:25:30 42-am335x-bbbw iwd[363]:                 HT RX MCS indexes:
> Jan 09 15:25:30 42-am335x-bbbw iwd[363]:                         0-7
> Jan 09 15:25:30 42-am335x-bbbw iwd[363]:         Ciphers: CCMP-128 TKIP
> Jan 09 15:25:30 42-am335x-bbbw iwd[363]:         Supported iftypes:
> station ap p2p-client p2p-go p2p-device
> Jan 09 15:25:32 42-am335x-bbbw iwd[363]: hardware_rekey not supported
> ```

What iwd does on startup is deletes and re-creates the wifi netdev.  Some 
drivers might not really like that and a race condition is a good theory if iwd 
works fine on subsequent runs.  You can try adding [DriverQuirks] to 
/etc/iwd/main.conf and add your driver to the DefaultInterface list.  That 
should prevent iwd from trying to re-create the netdev.  See man 5 iwd.config 
for more details.  Maybe this helps?

Regards,
-Denis

      reply	other threads:[~2024-01-10  4:14 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-09 21:37 iwd 2.12 - Received error during CMD_TRIGGER_SCAN: Invalid argument (22) Robert Nelson
2024-01-10  4:14 ` Denis Kenzior [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f4d9e6cf-f7e4-49b9-adbf-92dbc006812a@gmail.com \
    --to=denkenz@gmail.com \
    --cc=iwd@lists.linux.dev \
    --cc=robertcnelson@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox