Skip to main content
Topic solved
This topic has been marked as solved and requires no further attention.
Topic: [SOLVED] Wireless Network on Live Medium with connman / wpa_supplicant (Read 11849 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

[SOLVED] Wireless Network on Live Medium with connman / wpa_supplicant

Hello Artix Forums,

I have a quick question about how I'm connecting to a wireless network with connman on the runnit base live system for Artix. I had to stop using Artix before because I couldn't find any wireless utilities that came with the ISO that I could use, but now I'm back to try again since at least connman is now packaged by default.

In order to connect to a wireless network, according to the wiki, I have to "use wpa_supplicant and dhcpcd to set it up." I haven't been able to determine how that is supposed to work from the wiki pages for wpa_supplicant or dhcpcd, maybe I could if I kept trying and searching, but I have found I am able to connect with connman using the following commands:

Code: [Select]
sudo su
connmanctl enable wifi
dhcpcd
connmanctl disable wifi
connmanctl enable wifi
connmanctl
connmanctl> scan wifi
connmanctl> services
connmanctl> agent on
connmanctl> connect wifi_...
ping artixlinux.org

Is this the correct way to connect to the internet through a wireless interface? Why do I have to enable, disable, and reenable wifi with connmanctl to get the wifi to work? It seems like there's something wrong.


Thanks,
Nick

Re: Wireless Network on Live Medium with connman

Reply #1
In order to connect to a wireless network, according to the wiki, I have to "use wpa_supplicant and dhcpcd to set it up." I haven't been able to determine how that is supposed to work from the wiki pages for wpa_supplicant or dhcpcd, maybe I could if I kept trying and searching,
It just takes careful, patient reading of the Wiki and applying what you have read:

https://wiki.archlinux.org/title/Network_configuration/Wireless
https://wiki.archlinux.org/title/Wpa_supplicant

Re: Wireless Network on Live Medium with connman

Reply #2
Hello again, and I apologize for the late response.

I read the wiki and was able to get wpa_supplicant working easily as follows:

Code: [Select]
wpa_supplicant -B -i wlan0 -c /etc/wpa_supplicant/wpa_supplicant.config
wpa_cli
> scan
> scan_results
> add_network
> set_network 0 ssid "SSID"
> set_network 0 psk "PSK"
> enable_network 0
> save_config
> quit
dhcpcd

It behaved exactly as expected and fixes my problems connecting to the Internet.


With connmanctl, however, I am still having trouble. It would seem like I could just type the following to get a working connection:

Code: [Select]
connmanctl
> enable wifi
> scan wifi
> services
> agent on
> connect wifi_...

But I'm given an error at "scan wifi" saying "Error /net/connman/technology/wifi : No carrier."


I'll leave what I've found so far here in case anyone else is having a similar problem even though connecting with wpa_supplicant works for me.

It's hard to give you an exact reproducible behavior for connman because every time I reboot it acts slightly differently, but it never connects the first time and I always have to enable and disable wifi with connmanctl at least once before it will decide to go through with scanning wifi. Sometimes starting dhcpcd externally causes it to connect (which shouldn't be necessary since connmanctl has an internal dhcp implementation) or toggling the wifi button on the keyboard a few times seems will sometimes get it to connect. I'm guessing that might have something to do with this.

It seems like this might be a hardware quirk, but there is also a bug from 2016 that describes my problem referenced here and here, but I don't have permission to access the actual bug report.

Surely there isn't some background process that needs to complete before connman can connect to wifi? Waiting a few minutes doesn't seem to make any difference, but also it seems like when I do the same thing over and over again it works, which would be a symptom of a prerequisite background process needing to finish something.

dmesg doesn't give me anything really helpful. Is there anywhere else I could look? rfkill shows wireless networks as being blocked on boot, but I think that's normal and connman unblocks them when it enables wifi.


I guess my problem is solved since wpa_supplicant works easily, but it would be nice to know why connman is acting so odd.

Thanks for the help.

Re: Wireless Network on Live Medium with connman / wpa_supplicant

Reply #3
...it would be nice to know why connman is acting so odd.
Can't agree.  ConnMan is rock solid, stable and very easy to use here.  Once connection is established for the first time, ConnMan remembers it and automatically reconnects on subsequent boot ups.  Always.  Without any manual intervention.  It is so reliable and comfortable to use that I'm gradually replacing NetworkManager and ModemManager with ConnMan.

These are ConnMan commands I use to establish the first time connection.  Start typing them in right after base ISO boot up, once you're at # (root) prompt.  They should be the first commands entered; don't do anythiong else until you're connected.  Example uses my WiFi ID - use yours instead:

Code: [Select]
# connmanctl technologies
# connmanctl enable wifi
# connmanctl services
# connmanctl
connmanctl> agent on
connmanctl> connect wifi_bc743749b87b_4137422f64526f6d+managed_psk
[--> agent asks for passphrase to connect <--]
connmanctl> quit
# ping artixlinux.org

Re: Wireless Network on Live Medium with connman / wpa_supplicant

Reply #4
@nick0189 It seems likely that you are experiencing that bug in connman. I have no idea why it hasn't been addressed so far. There is also connman-dev mailing list, so maybe try asking there if you feel like giving the connman developers a little nudge.

I did something like that not so long ago, when I still had connman around and discovered it "phoned home" to connman server.

Personally, I gravitate towards minimalistic and simple software, so now I only use wpa_supplicant + dhcpcd where I need WiFi (my laptop). If it works, why complicate it?

Update: Forgot to add the mailing list address, it is in this about page, near the bottom: https://git.kernel.org/pub/scm/network/connman/connman.git/about/

Re: Wireless Network on Live Medium with connman / wpa_supplicant

Reply #5
@strajder, yes, just using wpa_supplicant and dhcpcd does sound attractive when you put it that way. I think I'll try it. Thanks for your help!

@just, you seem confident that connmanctl should behave as expected. Why is behaving the way it does in this video? I tried to make it small, so sorry for the quality. I can try to raise it if needed. After typing "services" at the end of the video it shows all the networks in range and is able to successfully connect to one, but it wasn't as simple as typing what you suggested in my case.

Re: Wireless Network on Live Medium with connman / wpa_supplicant

Reply #6
@nick0189 For some reason, none of tools here can open attached .gif file.

Being only a "manager", ConnMan merely simplifies connections from bash (and DEs).  The real WiFi negotitiation and connection job is done by wpa_supplicant.  Since you've successfully configured wpa_supplicant by hand, there's no strict reason to use ConnMan.

If you're going to install a DE, then commonly used network managers are NetworkManager and ModemManager, not ConnMan.

Re: Wireless Network on Live Medium with connman / wpa_supplicant

Reply #7
The file's an mp4 not a gif, I'm not very familiar with using connman to add much there though  :)
Code: [Select]
$ file ArtixConnman.gif 
ArtixConnman.gif: ISO Media, MP4 v2 [ISO 14496-14]
$ mv ArtixConnman.gif ArtixConnman.gif.mp4
$ vlc ArtixConnman.gif.mp4

Re: Wireless Network on Live Medium with connman / wpa_supplicant

Reply #8
That would explain it. I tried converting it to a .gif from .mp4 because the forums don't allow attaching .mp4 files. The converter I was using output a .gif file that would open with mpv so I thought I had succeeded. Sorry about that. I'll reupload it here. I think I got it right this time.

Re: Wireless Network on Live Medium with connman / wpa_supplicant

Reply #9
@nick0189 OK, the .gif is readable now.

ConnMan fails on the third command.  Probably, due to failing  hardware.  I'm not sure about it.  Let's see first three ConnMan commands in details.

1. Detects computer's network hardware:
Code: [Select]
# connmanctl technologies
These are usually WiFi cards and Bluetooth adapters.  Works correctly for you.

2. Turns ON one of "technologies", found by the previous command:
Code: [Select]
# connmanctl enable wifi
Switching Wifi card ON works correctly for you.

3. Detects nearby WiFi networks:
Code: [Select]
# connmanctl services
This one fails on your side - its output is empty.  The reason is unknown to me.  When the command works correctly, its output looks like:

Code: [Select]
$ connmanctl services
*AO Aerodrom             wifi_bc773769b67b_4165346f68324f6d_managed_psk
    RT-GPON-6440         wifi_bc773769b67b_52542d47504f4e2d36343430_managed_psk
    Karagiozis           wifi_bc773769b67b_4b61726167696f7a6973_managed_psk
    Skynet_190           wifi_bc773769b67b_536b796e65745f313930_managed_psk
    BEETCHOVEN           wifi_bc773769b67b_4245455443484f56454e_managed_psk
    nfront               wifi_bc773769b67b_6e66726f6e74_managed_psk
    Keenetic-0243        wifi_bc773769b67b_4b65656e657469632d30323433_managed_psk
                         wifi_bc773769b67b_hidden_managed_psk
    RUT950_CAB2          wifi_bc773769b67b_5255543935305f43414232_managed_psk
    Roma1                wifi_bc773769b67b_526f6d6131_managed_psk
    Sky75                wifi_bc773769b67b_536b793735_managed_psk
    Frog new             wifi_bc773769b67b_46726f67206e6577_managed_psk
    TP-LINK_5C7C         wifi_bc773769b67b_54502d4c494e4b5f35433743_managed_psk
    Zhuk                 wifi_bc773769b67b_5a68756b_managed_psk
    Monoceros2           wifi_bc773769b67b_4d6f6e6f6365726f7332_managed_psk
    TP-LINK_781          wifi_bc773769b67b_54502d4c494e4b5f373831_managed_psk
    Monoceros            wifi_bc773769b67b_4d6f6e6f6365726f73_managed_psk
    Nadgob               wifi_bc773769b67b_4e6164676f62_managed_psk
    RT-GPON-D5B0         wifi_bc773769b67b_52542d47504f4e2d44354230_managed_psk
    RT-GPON-B650         wifi_bc773769b67b_52542d47504f4e2d42363530_managed_psk
    Domru129             wifi_bc773769b67b_446f6d7275313239_managed_psk
    Dom.ru-226           wifi_bc773769b67b_446f6d2e72752d323236_managed_psk
    ASUS                 wifi_bc773769b67b_41535553_managed_psk
    TP-LINK_DCE4         wifi_bc773769b67b_54502d4c494e4b5f44434534_managed_psk
    Saluch13             wifi_bc773769b67b_53616c7563683133_managed_psk
    matras               wifi_bc773769b67b_6d6174726173_managed_psk
$
One of detected WiFi should be your network.  We use its ID in the "connect wifi..." command to connect to it.  Mine is Aerodrom and signed with *AO (= Active Online) in the example.

If we don't know WiFi ID, the rest of ConnMan commands is useless and has no sense.

I don't know why "# connmanctl services" command fails, and don't want to do wild guesses about possible reasons.  They could multiple.  Sorry.

Edit: @badsector had no problems to connect with ConnMan using exactly the same commands:

https://forum.artixlinux.org/index.php/topic,3400.msg22052.html#msg22052

Re: [SOLVED] Wireless Network on Live Medium with connman / wpa_supplicant

Reply #10
I wrote a very minimal guide for connecting wifi via wpa_supplicant a while back just because I didn't want to have to search through the extensive Arch Wiki on how to do so. This document oversimplifies it greatly, but gives a short step by step guide on how to connect wifi via wpa_supplicant from a bare bones Arch/Artix installation medium:

https://codeberg.org/z3rOR0ne/notes/src/branch/main/connect_artix_wifi_scratch.txt