Background first - I am writing an interface for configuring wifi over a small 160x80 display and a numeric keypad only. I am only just getting my feet wet with wpa_supplicant - for working with wpa_cli, I seem to need /var/run/wpa_supplicant as specified in /etc/wpa_supplicant/wpa_supplicant.conf. /var/run/wpa_supplicant seems to be missing ? (on at least three systems I've looked at). Judging by the man page for wpa_supplicant.conf, what we (openSUSE) provide as a default is wrong? We have ctrl_interface=/var/run/wpa_supplicant ctrl_interface_group=wheel whereas the man page suggests: ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=wheel 'ctrl_interface_group' is not even mentioned in the man page. -- Per Jessen, Zürich (4.2°C)
On Mon, 01 Mar 2021 20:17:22 +0100 Per Jessen <per@computer.org> wrote:
Background first - I am writing an interface for configuring wifi over a small 160x80 display and a numeric keypad only.
I am only just getting my feet wet with wpa_supplicant - for working with wpa_cli, I seem to need /var/run/wpa_supplicant as specified in /etc/wpa_supplicant/wpa_supplicant.conf.
/var/run/wpa_supplicant seems to be missing ? (on at least three systems I've looked at).
Judging by the man page for wpa_supplicant.conf, what we (openSUSE) provide as a default is wrong?
We have
ctrl_interface=/var/run/wpa_supplicant ctrl_interface_group=wheel
whereas the man page suggests:
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=wheel
'ctrl_interface_group' is not even mentioned in the man page.
I think the full docs are in an example file rather than the man page. On a debian buster and a raspberry pi os buster, it's at: /usr/share/doc/wpasupplicant/examples/wpa_supplicant.conf I don't have wpa anything on my openSUSE box. As frequently https://wiki.archlinux.org/index.php/wpa_supplicant may be worth reading. It certainly seems like the debian and arch worlds agree with the DIR= GROUP= syntax rather than ctrl_interface_group Dunno what the truth is :(
Dave Howorth wrote:
I think the full docs are in an example file rather than the man page. On a debian buster and a raspberry pi os buster, it's at:
/usr/share/doc/wpasupplicant/examples/wpa_supplicant.conf
Hmm, nothing like that on my laptop.
I don't have wpa anything on my openSUSE box. As frequently https://wiki.archlinux.org/index.php/wpa_supplicant may be worth reading.
Thanks, I'll take a look.
It certainly seems like the debian and arch worlds agree with the DIR= GROUP= syntax rather than ctrl_interface_group Dunno what the truth is :(
I tried both variations, but neither one seemed to work. According to Andrei, wpa_supplicant needs to know which interface to manage. Maybe I'll just add that '-i' argument. -- Per Jessen, Zürich (1.8°C) http://www.hostsuisse.com/ - virtual servers, made in Switzerland.
* Per Jessen <per@computer.org> [03-02-21 02:14]:
Dave Howorth wrote:
I think the full docs are in an example file rather than the man page. On a debian buster and a raspberry pi os buster, it's at:
/usr/share/doc/wpasupplicant/examples/wpa_supplicant.conf
Hmm, nothing like that on my laptop.
s/b /usr/share/doc/packages/wpa_supplicant/examples/*.conf
I don't have wpa anything on my openSUSE box. As frequently https://wiki.archlinux.org/index.php/wpa_supplicant may be worth reading.
s/b wap_ -- (paka)Patrick Shanahan Plainfield, Indiana, USA @ptilopteri http://en.opensuse.org openSUSE Community Member facebook/ptilopteri Photos: http://wahoo.no-ip.org/piwigo paka @ IRCnet freenode
On Tue, 2 Mar 2021 08:06:57 -0500 Patrick Shanahan <paka@opensuse.org> wrote:
* Per Jessen <per@computer.org> [03-02-21 02:14]:
Dave Howorth wrote:
I think the full docs are in an example file rather than the man page. On a debian buster and a raspberry pi os buster, it's at:
/usr/share/doc/wpasupplicant/examples/wpa_supplicant.conf
Hmm, nothing like that on my laptop.
s/b /usr/share/doc/packages/wpa_supplicant/examples/*.conf
Dunno what s/b means but wpa_supplicant is a symlink to wpasupplicant :P
I don't have wpa anything on my openSUSE box. As frequently https://wiki.archlinux.org/index.php/wpa_supplicant may be worth reading.
s/b wap_
Dunno what s/b means but my link leads to the correct web page (not surprising since I cut-and-pasted it). Dunno wherever what you're suggesting leads ...
* Dave Howorth <dave@howorth.org.uk> [03-02-21 11:11]:
On Tue, 2 Mar 2021 08:06:57 -0500 Patrick Shanahan <paka@opensuse.org> wrote:
* Per Jessen <per@computer.org> [03-02-21 02:14]:
Dave Howorth wrote:
I think the full docs are in an example file rather than the man page. On a debian buster and a raspberry pi os buster, it's at:
/usr/share/doc/wpasupplicant/examples/wpa_supplicant.conf
Hmm, nothing like that on my laptop.
s/b /usr/share/doc/packages/wpa_supplicant/examples/*.conf
Dunno what s/b means but wpa_supplicant is a symlink to wpasupplicant :P
11:13 crash:~ > locate wpasupplicant nothing provided s/b: should be 11:13 crash:~ > ls -la /usr/share/doc/packages/wpa_supplicant/ total 264 drwxr-xr-x 3 root root 4096 Feb 11 22:38 . drwxr-xr-x 1172 root root 36864 Mar 2 11:07 .. drwxr-xr-x 3 root root 4096 Feb 11 22:34 examples -rw-r--r-- 1 root root 130304 Aug 7 2019 ChangeLog -rw-r--r-- 1 root root 2351 Aug 7 2019 README -rw-r--r-- 1 root root 4535 Aug 7 2019 todo.txt -rw-r--r-- 1 root root 77603 Aug 7 2019 wpa_supplicant.conf
I don't have wpa anything on my openSUSE box. As frequently https://wiki.archlinux.org/index.php/wpa_supplicant may be worth reading.
s/b wap_
Dunno what s/b means but my link leads to the correct web page (not surprising since I cut-and-pasted it). Dunno wherever what you're suggesting leads ...
-- (paka)Patrick Shanahan Plainfield, Indiana, USA @ptilopteri http://en.opensuse.org openSUSE Community Member facebook/ptilopteri Photos: http://wahoo.no-ip.org/piwigo paka @ IRCnet freenode
* Dave Howorth <dave@howorth.org.uk> [03-02-21 11:11]:
On Tue, 2 Mar 2021 08:06:57 -0500 Patrick Shanahan <paka@opensuse.org> wrote:
* Per Jessen <per@computer.org> [03-02-21 02:14]:
Dave Howorth wrote:
I think the full docs are in an example file rather than the man page. On a debian buster and a raspberry pi os buster, it's at:
/usr/share/doc/wpasupplicant/examples/wpa_supplicant.conf
Hmm, nothing like that on my laptop.
s/b /usr/share/doc/packages/wpa_supplicant/examples/*.conf
Dunno what s/b means but wpa_supplicant is a symlink to wpasupplicant :P
11:13 crash:~ > locate wpasupplicant nothing provided s/b: should be 11:13 crash:~ > ls -la /usr/share/doc/packages/wpa_supplicant/ total 264 drwxr-xr-x 3 root root 4096 Feb 11 22:38 . drwxr-xr-x 1172 root root 36864 Mar 2 11:07 .. drwxr-xr-x 3 root root 4096 Feb 11 22:34 examples -rw-r--r-- 1 root root 130304 Aug 7 2019 ChangeLog -rw-r--r-- 1 root root 2351 Aug 7 2019 README -rw-r--r-- 1 root root 4535 Aug 7 2019 todo.txt -rw-r--r-- 1 root root 77603 Aug 7 2019 wpa_supplicant.conf
I don't have wpa anything on my openSUSE box. As frequently https://wiki.archlinux.org/index.php/wpa_supplicant may be worth reading.
s/b wap_
Dunno what s/b means but my link leads to the correct web page (not surprising since I cut-and-pasted it). Dunno wherever what you're suggesting leads ...
-- (paka)Patrick Shanahan Plainfield, Indiana, USA @ptilopteri http://en.opensuse.org openSUSE Community Member facebook/ptilopteri Photos: http://wahoo.no-ip.org/piwigo paka @ IRCnet freenode
On 3/1/21 1:17 PM, Per Jessen wrote:
Background first - I am writing an interface for configuring wifi over a small 160x80 display and a numeric keypad only.
I am only just getting my feet wet with wpa_supplicant - for working with wpa_cli, I seem to need /var/run/wpa_supplicant as specified in /etc/wpa_supplicant/wpa_supplicant.conf.
/var/run/wpa_supplicant seems to be missing ? (on at least three systems I've looked at).
I don't think that is so. Those are old documents from when /var/run was used as the "state" directory. Now that will be plain old /run or as user /run/user/$UID in the new world.
Judging by the man page for wpa_supplicant.conf, what we (openSUSE) provide as a default is wrong?
We have
ctrl_interface=/var/run/wpa_supplicant ctrl_interface_group=wheel
whereas the man page suggests:
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=wheel
'ctrl_interface_group' is not even mentioned in the man page.
From an overview standpoint, wpa_supplicant is just the tool that associates ESSID and a password with an interface and then facilitates the authentication to that interface when used. I have old notes to check wpa_suppliment.conf and ensure you have: key_mgmt=WPA-PSK # proto=WPA proto=RSN (I don't recall the immediate difference between the proto of WPA or RSN at the moment) To use wpa_supplicant in the past, all I did was to run wpa_passphrase to setup the config for the inteface, e.g. wpa_passphrase "your_ESSID" "PassPhrase_up-to-64-Characters" \ >> /etc/wpa_supplicant.conf That will save the ESSID/passphrase in wpa_suppliment.conf Then to activate the interface, you use something similar to the following (but you will need to find out what state directory wpa_supplicant was compiled to use instead of the old /var/run) and do: wpa_supplicant -iwlan0 \ -c/var/run/wpa_supplicant-ath0.conf \ -Dwext \ -P/var/run/wpa_supplicant/ath0.pid \ -B Now you can run dhclient or dhcpcd to get an IP. -- David C. Rankin, J.D.,P.E.
David C. Rankin wrote:
On 3/1/21 6:33 PM, David C. Rankin wrote:
(but you will need to find out what state directory wpa_supplicant was compiled to use instead of the old /var/run)
You can probably just look at the .spec file if nobody here knows off-hand.
I think the location is fine - /var/run/ is symlinked to /run.
From an overview standpoint, wpa_supplicant is just the tool that associates ESSID and a password with an interface and then facilitates the authentication to that interface when used.
Right, that sounds like what I need. My user interface has to enable the user to configure the wifi - ESSID, authentication, password.
To use wpa_supplicant in the past, all I did was to run wpa_passphrase to setup the config for the inteface, e.g.
wpa_passphrase "your_ESSID" "PassPhrase_up-to-64-Characters" \ >> /etc/wpa_supplicant.conf
That will save the ESSID/passphrase in wpa_suppliment.conf
Then to activate the interface, you use something similar to the following (but you will need to find out what state directory wpa_supplicant was compiled to use instead of the old /var/run) and do:
wpa_supplicant -iwlan0 \ -c/var/run/wpa_supplicant-ath0.conf \ -Dwext \ -P/var/run/wpa_supplicant/ath0.pid \ -B
wpa_supplicant appears to be running by default, so I guess I need to look at how to provide an interface name, via d-bus as Andrei mentioned. -- Per Jessen, Zürich (1.6°C) http://www.cloudsuisse.com/ - your owncloud, hosted in Switzerland.
On 01.03.2021 22:17, Per Jessen wrote:
Background first - I am writing an interface for configuring wifi over a small 160x80 display and a numeric keypad only.
I am only just getting my feet wet with wpa_supplicant - for working with wpa_cli, I seem to need /var/run/wpa_supplicant as specified in /etc/wpa_supplicant/wpa_supplicant.conf.
It is created by wpa_supplicant when needed.
/var/run/wpa_supplicant seems to be missing ? (on at least three systems I've looked at).
It will be created by wpa_supplicant when you tell it which interface(s) it needs to manage. Either with -i parameter or via D-Bus (-u parameter) or via global control interface (-g parameter). Today wpa_supplicant is usually managed by D-Bus (e.g. by NetworkManager) and is started by default with D-Bus enabled and no managed interfaces.
Judging by the man page for wpa_supplicant.conf, what we (openSUSE) provide as a default is wrong?
No. It is just deprecated.
We have
ctrl_interface=/var/run/wpa_supplicant ctrl_interface_group=wheel
whereas the man page suggests:
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=wheel
'ctrl_interface_group' is not even mentioned in the man page.
Well, it still works as of today's git. 2006-08-27 - v0.5.5 * changed ctrl_interface configuration for UNIX domain sockets: - deprecated ctrl_interface_group variable (it may be removed in future versions) - allow both directory and group be configured with ctrl_interface in following format: DIR=/var/run/wpa_supplicant GROUP=wheel - ctrl_interface=/var/run/wpa_supplicant is still supported for the case when group is not changed Even after 15 years it still works and SUSE recently retrofitted obsolete D-Bus interface removed upstream because this was the only one wicked supported. But of course if you are concerned you are welcome to submit request to change default wpa_supplicant.conf :)
Andrei Borzenkov wrote:
On 01.03.2021 22:17, Per Jessen wrote:
Background first - I am writing an interface for configuring wifi over a small 160x80 display and a numeric keypad only.
I am only just getting my feet wet with wpa_supplicant - for working with wpa_cli, I seem to need /var/run/wpa_supplicant as specified in /etc/wpa_supplicant/wpa_supplicant.conf.
It is created by wpa_supplicant when needed.
/var/run/wpa_supplicant seems to be missing ? (on at least three systems I've looked at).
It will be created by wpa_supplicant when you tell it which interface(s) it needs to manage. Either with -i parameter or via D-Bus (-u parameter) or via global control interface (-g parameter). Today wpa_supplicant is usually managed by D-Bus (e.g. by NetworkManager) and is started by default with D-Bus enabled and no managed interfaces.
Okay, I was wondering about that '-i' argument, but I had interpreted the lack of one to mean "manage all interfaces"
Even after 15 years it still works and SUSE recently retrofitted obsolete D-Bus interface removed upstream because this was the only one wicked supported.
Andrei, you clearly know this stuff quite well - for my declared purpose above, is wpa_supplicant the way to go or do I have better options? NetworkManager is not available.
But of course if you are concerned you are welcome to submit request to change default wpa_supplicant.conf :)
Hehe, I'll have to think about that :-) -- Per Jessen, Zürich (1.0°C)
On 02.03.2021 10:09, Per Jessen wrote:
Andrei Borzenkov wrote:
On 01.03.2021 22:17, Per Jessen wrote:
Background first - I am writing an interface for configuring wifi over a small 160x80 display and a numeric keypad only.
...
Andrei, you clearly know this stuff quite well - for my declared purpose above, is wpa_supplicant the way to go or do I have better options?
The purpose is rather vague really. If WEP is enough, you can simply associate using iw and be done with it. For WPA using standard Linux wireless drivers you need some external agent to perform authentication. wpa_supplicant was the only practical choice so far (some drivers may implement WPA internally, actually the first wireless driver I had to use did it, but I do not think any in-tree driver does it today). Recently iwd seems to gain popularity as alternative and it can even configure IP parameters. I think these are the only two implementations. Also "configuring wifi" may range from "confirming connection to known AP" (which certainly is possible using numerical pad) to "providing secrets and IP parameters when first seeing unknown AP" (which is rather questionable in this case).
Andrei Borzenkov wrote:
On 02.03.2021 10:09, Per Jessen wrote:
Andrei Borzenkov wrote:
On 01.03.2021 22:17, Per Jessen wrote:
Background first - I am writing an interface for configuring wifi over a small 160x80 display and a numeric keypad only.
...
Andrei, you clearly know this stuff quite well - for my declared purpose above, is wpa_supplicant the way to go or do I have better options?
The purpose is rather vague really.
Okay, that's my fault for thinking telepathy would work :-) On a small ARM board running openSUSE Leap, I need to configure the Wifi interface, after the first boot-up from the jeos image (which will include my code). The user can only interfact with the ARM board via the tiny 160x80 LCD screen and a numeric keypad. So I need to write some code to interface the latter two with <something> to configure the wifi. The interfacing is not difficult, but once I have the information (ESSID and password), the question is - how do I configure the wlan0 interface (for dhcp) ?
If WEP is enough, you can simply associate using iw and be done with it.
Think of this as me taking my ARM board with me to a friends house, much like we do with mobile phones. "hey, what's your wifi password?" "cats-and-dogs" "thanks!".
For WPA using standard Linux wireless drivers you need some external agent to perform authentication. wpa_supplicant was the only practical choice so far (some drivers may implement WPA internally, actually the first wireless driver I had to use did it, but I do not think any in-tree driver does it today). Recently iwd seems to gain popularity as alternative and it can even configure IP parameters. I think these are the only two implementations.
Okay, that's very helpful, thanks - I'll check out iwd too, I was not aware of that one. I have amended my wpa_supplicant config, adding '-i wlan0' to the start-up. So far so good - I have also used wpa_passphrase to generate the network config in wpa_supplicant.conf, but after a restart I am only getting some IPv6 addresses, but no IPv4 - I'm guessing I need to figure out how wpa_supplicant interacts with wicked ?? or do I have to run a separate dhclient?
Also "configuring wifi" may range from "confirming connection to known AP" (which certainly is possible using numerical pad) to "providing secrets and IP parameters when first seeing unknown AP" (which is rather questionable in this case).
It should work (more or less) like my mobile phone example above. To begin with, I am happy to support only WPA2-PSK. (no WEP, no WPS). -- Per Jessen, Zürich (3.5°C)
On 02.03.2021 11:52, Per Jessen wrote:
On a small ARM board running openSUSE Leap, I need to configure the Wifi interface, after the first boot-up from the jeos image (which will include my code). The user can only interfact with the ARM board via the tiny 160x80 LCD screen and a numeric keypad. So I need to write some code to interface the latter two with <something> to configure the wifi. The interfacing is not difficult, but once I have the information (ESSID and password), the question is - how do I configure the wlan0 interface (for dhcp) ?
Using whatever network management framework you have. All that wpa_supplicant does is "plugging in cable". What happens after interface link is up is entirely out of scope of wpa_supplicant. You were actually asking the wrong question. ...
I have amended my wpa_supplicant config, adding '-i wlan0' to the start-up. So far so good - I have also used wpa_passphrase to generate the network config in wpa_supplicant.conf, but after a restart I am only getting some IPv6 addresses, but no IPv4 - I'm guessing I need to figure out how wpa_supplicant interacts with wicked ??
Wicked interacts with wpa_supplicant over D-Bus so you do not need to do anything with wpa_supplicant at all - just configure wireless interface in wicked as usual. E.g. by directly dropping ifcfg-wlan0 in /etc/sysconfig/network.
or do I have to run a separate dhclient?
It is entirely up to you. You can use any of the available network management framework or implement your own.
Andrei Borzenkov wrote:
On 02.03.2021 11:52, Per Jessen wrote:
On a small ARM board running openSUSE Leap, I need to configure the Wifi interface, after the first boot-up from the jeos image (which will include my code). The user can only interfact with the ARM board via the tiny 160x80 LCD screen and a numeric keypad. So I need to write some code to interface the latter two with <something> to configure the wifi. The interfacing is not difficult, but once I have the information (ESSID and password), the question is - how do I configure the wlan0 interface (for dhcp) ?
Using whatever network management framework you have. All that wpa_supplicant does is "plugging in cable". What happens after interface link is up is entirely out of scope of wpa_supplicant.
You were actually asking the wrong question....
I had been out googling and seen how people on Raspberry Pis was doing it, and they seemed to default to fiddling with wpa_supplicant. I guess I was misled ....
I have amended my wpa_supplicant config, adding '-i wlan0' to the start-up. So far so good - I have also used wpa_passphrase to generate the network config in wpa_supplicant.conf, but after a restart I am only getting some IPv6 addresses, but no IPv4 - I'm guessing I need to figure out how wpa_supplicant interacts with wicked ??
Wicked interacts with wpa_supplicant over D-Bus so you do not need to do anything with wpa_supplicant at all - just configure wireless interface in wicked as usual. E.g. by directly dropping ifcfg-wlan0 in /etc/sysconfig/network.
As I normally would :-) One of my objectives is to remain "compatible" (as much as possible) with the way it is done in openSUSE - I'm happy with editing ifcfg-wlan0. -- Per Jessen, Zürich (6.6°C) http://www.cloudsuisse.com/ - your owncloud, hosted in Switzerland.
On Tue, 02 Mar 2021 09:52:02 +0100 Per Jessen <per@computer.org> wrote:
I'm guessing I need to figure out how wpa_supplicant interacts with wicked
Probably not the best plan. wicked is going away (as in dead), so pick some other management tool. Sad 'cos I used to like it. :(
I had been out googling and seen how people on Raspberry Pis was doing it
Specifically I put wicked on a pi and had no end of grief until I removed it. networking.service and dhcpcd.service seem to do everything, with dhcpcd.service running wpa_supplicant. pi has a fudge where if you put wifi details in a wpa_supplicant.conf file in /boot the system will read it and configure itself properly. Similar to putting a file called ssh in /boot. https://www.raspberrypi.org/documentation/configuration/wireless/headless.md
Dave Howorth wrote:
On Tue, 02 Mar 2021 09:52:02 +0100 Per Jessen <per@computer.org> wrote:
I'm guessing I need to figure out how wpa_supplicant interacts with wicked
Probably not the best plan. wicked is going away (as in dead), so pick some other management tool. Sad 'cos I used to like it. :(
wicked has never had much of a "profile", it just worked behind the scene, largely invisible. I would like to remain as "compatible" with openSUSE as is reasonable, and I would prefer not having to invent my own wheel. wicked + /etc/sysconfig/network/ifcfg-wlan0 seem good for the time being.
I had been out googling and seen how people on Raspberry Pis was doing it
Specifically I put wicked on a pi and had no end of grief until I removed it.
It's working fine here, on two raspberries and four nanopis. Of course, I am running openSUSE, not raspbian or some such :-)
networking.service and dhcpcd.service seem to do everything, with dhcpcd.service running wpa_supplicant. pi has a fudge where if you put wifi details in a wpa_supplicant.conf file in /boot
I keep forgetting I have to assume "raspbian" (or some new name? I forget) whenever I read something about Raspberries. -- Per Jessen, Zürich (9.2°C) http://www.hostsuisse.com/ - dedicated server rental in Switzerland.
Per Jessen wrote:
Dave Howorth wrote:
On Tue, 02 Mar 2021 09:52:02 +0100 Per Jessen <per@computer.org> wrote:
I'm guessing I need to figure out how wpa_supplicant interacts with wicked
Probably not the best plan. wicked is going away (as in dead), so pick some other management tool. Sad 'cos I used to like it. :(
wicked has never had much of a "profile", it just worked behind the scene, largely invisible. I would like to remain as "compatible" with openSUSE as is reasonable, and I would prefer not having to invent my own wheel. wicked + /etc/sysconfig/network/ifcfg-wlan0 seem good for the time being.
Sorry, telepathy not enabled. Basically, I want to take an ARM board, install an openSUSE Leap JeOS image without GUI, then run my software which will act as the interface between the screen+keypad and the default network setup, i.e. wicked. I was reading about how some Raspi people have done it (configuring wifi on the command line), got misdirected and started looking at this $SUBJ stuff. -- Per Jessen, Zürich (9.9°C) http://www.dns24.ch/ - free dynamic DNS, made in Switzerland.
participants (5)
-
Andrei Borzenkov
-
Dave Howorth
-
David C. Rankin
-
Patrick Shanahan
-
Per Jessen