• [gentoo-user] Lenovo T400 wifi scan and connect questions

    From Walter Dnes@21:1/5 to All on Mon Aug 29 23:30:01 2022
    1) the output of "dmesg | grep iwlwifi" is...

    [ 0.640780] iwlwifi 0000:03:00.0: can't disable ASPM; OS doesn't have ASPM control
    [ 0.641112] Loading firmware: iwlwifi-5000-5.ucode
    [ 0.641332] iwlwifi 0000:03:00.0: loaded firmware version 8.83.5.1 build 33692 5000-5.ucode op_mode iwldvm
    [ 0.641360] iwlwifi 0000:03:00.0: CONFIG_IWLWIFI_DEBUG disabled
    [ 0.641364] iwlwifi 0000:03:00.0: CONFIG_IWLWIFI_DEBUGFS disabled
    [ 0.641367] iwlwifi 0000:03:00.0: CONFIG_IWLWIFI_DEVICE_TRACING disabled
    [ 0.641370] iwlwifi 0000:03:00.0: Detected Intel(R) WiFi Link 5100 AGN, REV=0x54
    [ 17.311014] iwlwifi 0000:03:00.0: Radio type=0x1-0x2-0x0
    [ 17.424989] iwlwifi 0000:03:00.0: Radio type=0x1-0x2-0x0

    Nice to see that it detects the 5100 AGN just like lspci. As the old
    saying goes, "use it or lose it"; I used to be able to run wifi on this machine manually (command line) in the past, but now I've completely
    forgotten how. I've emerged "iw" and "wpa_supplicant". "iw dev" shows

    phy#0
    Interface wlan0
    ifindex 3
    wdev 0x1
    addr 00:26:c6:4a:b4:92
    type managed
    txpower 15.00 dBm

    Questions...
    1) what do I do to scan and get a list of available networks?
    2) how do I connect to one of the listed networks (assuming either
    it's public, or I have the password) ?
    3) minor detail... The Google hits I've found all show both DVM and
    MVM support enabled. Given that dmesg output shows "op_mode iwldvm",
    can I safely get rid of MVM support ?

    --
    Walter Dnes <waltdnes@waltdnes.org>
    I don't run "desktop environments"; I run useful applications

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Michael@21:1/5 to All on Tue Aug 30 08:52:03 2022
    On Monday, 29 August 2022 22:23:00 BST Walter Dnes wrote:
    1) the output of "dmesg | grep iwlwifi" is...

    [ 0.640780] iwlwifi 0000:03:00.0: can't disable ASPM; OS doesn't have
    ASPM control [ 0.641112] Loading firmware: iwlwifi-5000-5.ucode
    [ 0.641332] iwlwifi 0000:03:00.0: loaded firmware version 8.83.5.1 build 33692 5000-5.ucode op_mode iwldvm [ 0.641360] iwlwifi 0000:03:00.0: CONFIG_IWLWIFI_DEBUG disabled [ 0.641364] iwlwifi 0000:03:00.0: CONFIG_IWLWIFI_DEBUGFS disabled [ 0.641367] iwlwifi 0000:03:00.0: CONFIG_IWLWIFI_DEVICE_TRACING disabled [ 0.641370] iwlwifi 0000:03:00.0: Detected Intel(R) WiFi Link 5100 AGN, REV=0x54 [ 17.311014] iwlwifi 0000:03:00.0: Radio type=0x1-0x2-0x0
    [ 17.424989] iwlwifi 0000:03:00.0: Radio type=0x1-0x2-0x0

    Nice to see that it detects the 5100 AGN just like lspci. As the old saying goes, "use it or lose it"; I used to be able to run wifi on this machine manually (command line) in the past, but now I've completely forgotten how. I've emerged "iw" and "wpa_supplicant". "iw dev" shows

    phy#0
    Interface wlan0
    ifindex 3
    wdev 0x1
    addr 00:26:c6:4a:b4:92
    type managed
    txpower 15.00 dBm

    Questions...
    1) what do I do to scan and get a list of available networks?

    If you have emerged wpa_supplicant with USE="qt5" you will have a GUI to
    launch its client and click on Scan to find and select a desired AP.

    If not, you can run wpa_cli in a terminal. Something like 'wpa_cli scan' and 'wpa_cli scan_results' should show you what's available. If you run just 'wpa_cli' it will launch an interactive shell from which you can run:

    scan
    scan_results

    'wpa_cli --help' for more subcommands and options.


    2) how do I connect to one of the listed networks (assuming either
    it's public, or I have the password) ?

    With wpa_supplicant's GUI, or with wpa_cli, but the latter is more tedious.

    Run wpa_cli to get an interactive shell. Then,

    scan
    scan_results

    add_network
    0 (if there is no other network yet configured)
    set_network 0 ssid "My_blah_AP" <== From the results
    set_network 0 psk "My_secret_passphrase"
    enable_network 0
    0K

    If you managed to authenticate and get an IP address you may want to save your settings - assuming you have enabled 'update_config=1' in your wpa_supplicant.conf:

    save config
    OK

    For permanent associations you can add BSSID and authentication credentials into /etc/wpa_supplicant/wpa_supplicant.conf. Have a look at '/usr/share/doc/ wpa_supplicant-*/wpa_supplicant.conf.bz2' for examples.


    3) minor detail... The Google hits I've found all show both DVM and
    MVM support enabled. Given that dmesg output shows "op_mode iwldvm",
    can I safely get rid of MVM support ?

    I don't know what works with your wireless adaptor, but I tend to experiment initially by building such options as modules and see what is loaded or not
    and any warnings in dmesg.

    -----BEGIN PGP SIGNATURE-----

    iQIzBAABCAAdFiEEXqhvaVh2ERicA8Ceseqq9sKVZxkFAmMNwaMACgkQseqq9sKV ZxkZkQ//cfoCzjv7LnZ6OGyrQeUSO3szO/D1Kr29WBL9rVIhPW1PmjjFbpNLur4s DQwYJOAfNl2exaEyKDZiWz9kRUhTn8cjgnhwMWcBPPwl3ieE4DXCxpfEvRCvlEjY Yvf1Zbawo1m62Sglg9N/UvbttevYo7AO8X9MS+Qzk+h8xpOV2MTL8pSeqV66BoqM k5CkcBtO3Mp3vx1ZI6CezgdIC3uEP6iuhWm2ptFfRye26zz/XOu2O9DIJsQdgzno UA3Vd1Mt85EU8kQSGh0iH3OOv6eezlKW66Up9wBQaFX8cB4mZxvVQeucJABM+g8d xfoBtx2b7YvK4rak04I9eHjhuWRlJ0QuFR8oteL9jIwo7ysG30o9uWUoNGgecW0z +qKgkmdjgo4X1uUWY9tBKDuqkSNjHhS6HTeNrAX4FUdOtlC1lHVpPSNxgYGB0NHF EJamVmQEHA8qP1BDjYtNHCDz1GzEvLodW8rih5xy+q9tscqSVLT9qyOK/mzgiVWC ds3y23YjV6XfviKaIgHiwP6D+k6uHUnwuepeOkCC51Ha29jBYvOOhzJsO+rjwDSA yHNTxaTgsCd+XPxtgdU0+X4NtI3krP3NliUnmvKgtzFqzMLEK7+NEhQDRQGLfTwb uyQZ3Ld9qK/0Pc/7x7DdgGAn869fO2dX96BcvQ8/U7vnw/vRgXw=
    =k9MP
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Walter Dnes@21:1/5 to All on Wed Aug 31 00:30:01 2022
    I'm having problems, even running as root. As per the previous
    message, the system is detecting the hardware, but wpa_aupplicant cannot
    get going. I have a minimal /etc/wpa_supplicant/wpa_supplicant.conf

    ctrl_interface=/var/run/wpa_supplicant
    update_config=1

    From https://wiki.gentoo.org/wiki/Wpa_supplicant#Using_wpa_cli the
    command for debugging is...

    wpa_supplicant -Dnl80211 -iwlan0 -C/var/run/wpa_supplicant/ -c/etc/wpa_supplicant/wpa_supplicant.conf -dd

    ...to which I appended ">>logfile.txt 2>&1" to grab all output. I
    waited for a minute or so, and got the logfile which I've attached. Any
    ideas?

    --
    Walter Dnes <waltdnes@waltdnes.org>
    I don't run "desktop environments"; I run useful applications

    H4sICJqMDmMCA2xvZ2ZpbGUudHh0AOVZbXPaSBL+zq/ob4aqVZAE4kVXbB0BeUPFvBzgvFxq a2qQRlhlMdJKwtj767dbQiBsnLCXnC5Vl3JUw8wz3T3dPT09PbuQs3gbhr5nc5nAg/5GUysR l06wMWEtkqxZrQGBgigB/sA9n698UVlsbVvEsbv1/SfwpJd43Pf+FA7sTmhWRvmQJ9eIS0Tk clvA1c7nUr0CO5AuXNVFYtdPJz77+YaAV+BE3oOI4Er6HVXXNJyfRD4rkK0/8KgebeVzalew ijxnjYhJvX9VGSA1b72NeOIFElzPF39DCOXXy8GVueAOLd3+Do6V01X2XlvlVWUbOjwRLGPW 0yp7PZmwyAyI9rG98A5VqKqK6ircNi8CGZeA9EtAzYtkUi9BdS4BdY+g25gMkbmQsuIxogPX Vew7LqXwYfnpCB1mIO7gN/EIKR4TIR1iwEO+8nz0ahFD1REu3/pJDRS4E4/OdhNWfSF7nZqJ Ipz5a6p/n8mGx/ffx+lePLHNepP01EfNdVUXhLSxLVzg2+QOW21wfb6OsdVpqqpqaGpzpTYc lasQRRuWD2oqhFGwEiwScchQeX7AHRpQUchHFiepd2NH+jMSG+5JFkhGKu4ZS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wMEysRnxarUmKbAOehUQ68TdwCblqGubxo hBHnHne38M9WjFrHEHI7q/3Hr6+3Mj68vxYfXw8Prh385zitTtvRjJZjd6GaUt8HtTPGWFrz MSYiSzyhoPIXnmjATb4iAAA=

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Michael@21:1/5 to All on Wed Aug 31 11:00:01 2022
    On Tuesday, 30 August 2022 23:26:00 BST Walter Dnes wrote:
    I'm having problems, even running as root. As per the previous
    message, the system is detecting the hardware, but wpa_aupplicant cannot
    get going. I have a minimal /etc/wpa_supplicant/wpa_supplicant.conf

    ctrl_interface=/var/run/wpa_supplicant
    update_config=1

    If you have enabled the wheel group and your user is a member of this group, then you won't need to run things as root:

    DIR=/var/run/wpa_supplicant GROUP=wheel
    DIR=/var/run/wpa_supplicant GROUP=0
    # (group can be either group name or gid)

    Alternatively, you can add your users gid instead.


    From https://wiki.gentoo.org/wiki/Wpa_supplicant#Using_wpa_cli the
    command for debugging is...

    wpa_supplicant -Dnl80211 -iwlan0 -C/var/run/wpa_supplicant/ -c/etc/wpa_supplicant/wpa_supplicant.conf -dd

    ...to which I appended ">>logfile.txt 2>&1" to grab all output. I
    waited for a minute or so, and got the logfile which I've attached. Any ideas?

    To state the obvious, this shows your key is not accepted:

    nl80211: set_key failed; err=-22 Invalid argument

    Also I can see:

    key_len=0

    Does this message mean you are using no passwd authentication? If so you have to state explicitly:

    set_network 0 key_mgmt NONE

    in wpa_cli when you try to authenticate with your AP, or in /etc/ wpa_supplicant/wpa_supplicant.conf add a fall back configuration at the end of the file for all open APs:

    network={
    key_mgmt=NONE
    }

    You can add BSSID, SSID to the above if you only want to use no authentication with a specific AP rather than anything which might be within range.

    BTW, key and passphrase are not the same thing. A passphrase must be entered in quotations, or use wpa_passphrase to generate the preshared key from it:

    ~ $ wpa_passphrase MY_SSID "My secret passphrase"
    network={
    ssid="MY_SSID"
    #psk="My secret passphrase"
    psk=f90ff73cefa452385366f5278f64914fa832b61a5225d3c78dcd4291061b56a1 }

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Walter Dnes@21:1/5 to All on Wed Aug 31 21:20:01 2022
    During launch, wpa_supplicant blows up on...

    DIR=/var/run/wpa_supplicant GROUP=wheel
    DIR=/var/run/wpa_supplicant GROUP=0

    https://wiki.gentoo.org/wiki/Wpa_supplicant#Configuration recommends...

    ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=wheel

    The 3 lines in my wpa_supplicant.conf that are not commented out are...

    ctrl_interface_group=0
    ap_scan=1
    ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=wheel

    Thank you for your help. It works. I live in a condo building. As
    a regular user "wpa_cli scan" followed by "wpa_cli scan_result" shows approximately a couple of dozen machines. BTW I've disabled MVM and
    wifi still works.

    One last question; I occasionally see signs in various places saying

    Our network name is "foo" and password is "bar".

    My reading of the wpa_cli man page indicates I should use...

    wpa_cli password foo bar

    ...to log on. Is that correct?

    --
    Walter Dnes <waltdnes@waltdnes.org>
    I don't run "desktop environments"; I run useful applications

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Michael@21:1/5 to All on Thu Sep 1 14:00:41 2022
    On Wednesday, 31 August 2022 20:15:41 BST Walter Dnes wrote:
    During launch, wpa_supplicant blows up on...

    DIR=/var/run/wpa_supplicant GROUP=wheel
    DIR=/var/run/wpa_supplicant GROUP=0

    Hmm ... so the example page syntax is wrong. I wonder if I came across this too in the distant past. :-/

    I have this in my config and it works:

    ctrl_interface_group=wheel
    ctrl_interface=/var/run/wpa_supplicant


    https://wiki.gentoo.org/wiki/Wpa_supplicant#Configuration recommends...

    ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=wheel

    The 3 lines in my wpa_supplicant.conf that are not commented out are...

    ctrl_interface_group=0
    ap_scan=1
    ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=wheel

    Thank you for your help. It works.

    Cool. :-)


    I live in a condo building. As
    a regular user "wpa_cli scan" followed by "wpa_cli scan_result" shows approximately a couple of dozen machines. BTW I've disabled MVM and
    wifi still works.

    One last question; I occasionally see signs in various places saying

    Our network name is "foo" and password is "bar".

    My reading of the wpa_cli man page indicates I should use...

    wpa_cli password foo bar

    ...to log on. Is that correct?

    The wpa_cli command syntax is:

    password <network id> <password>
    configure password for an SSID

    However, I'm not sure <network id> == SSID. When you add a network in interactive mode with:

    add_network

    the shell outputs a network id number; e.g. 3, which you are meant to use thereafter to set up variables for the AP; e.g.:

    set_network 3 ssid "starvebux"
    set_network 3 psk "Not Free"
    enable_network 3

    In addition, I understand the wpa_cli command 'password', as opposed to variable 'psk' which is used in the interactive shell, to be for a EAP-PEAP authentication scheme. For a pre-shared key you'll use interactively:

    set_network 3 psk 0f0fbfdadff6271a5107a49cfb5db9e921138ee74a66b0.....

    or if it is a passphrase you'll enclose it in double quotes "Not Free" as above.

    This is the reason I use the wpa_supplicant GUI when not restricted to working in a console, because the qt5 wpa_supplicant GUI makes it easier to click and fill in a PSK, compared to the multiple commands required in a terminal. -----BEGIN PGP SIGNATURE-----

    iQIzBAABCAAdFiEEXqhvaVh2ERicA8Ceseqq9sKVZxkFAmMQrPkACgkQseqq9sKV ZxmJcg/+LOT5JIlxB5dQsSdeG7wsqB8n4pDW3qq7SCakzmg3MQjcsHSVySVBMefv HUJEvVxB6rwavw7SyZSVqGaZOqXtkn9KorF+IHsXfIjWvkZTmKLGN7D5qQnvSsmo 4ngBbcaraIbPJU0gAk8f05pcdKAhX+UPnFhdk4anSY/nLd4x/FJX0VCTUldxc+n3 YbuW3g2T9VQhbyxUzpaesSo2WncV5rGNo6o9gQX7Oho2fq1VTpZmtUFaHBuoxi05 cVCPW1ZKi0qOYNWvGQtw/3RwIVj4OwNXxKsGeQ/CIRU+3EN1py2Ltd5mGTJ8vrAK cchXxUaAa1Ri8ZLWWK5q+/IW/LnE2mC5tLaYpG3AjQqdvGF1iai45/xy9rI4z1jl l6zG8rFgHOFmc2mmhFF87nricEcfb2zk0zWZJtrG7GHiwWWr7dPRnTRmQoPuv+It 0KPQPg4228o6wFYcKUrGErXuWrnGO8w5jx/5fkEuDaynpU72H9qPiS5/dYr3zPjs DGTiiPYxaeBxwvLZ1SpdNm09XE9v+r6uqUknhJABqcxEXa+cEC2AdHu/nPNpej6K qMVvHAZ0ITBB0ohyN1Ptq0y6Y+7pAu/VOY0FqyW0M91BGQdnKInjwyhw4Snuoh0f Bn7qDlvt4rp8HPfyXGdXgjA1tcqCfZWg4uHyq//IdMH+EttbwFA=
    =XbzB
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)