all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* "Could not connect to wpa_supplicant: (nil) - re-trying" error when trying to start wpa-cli.
@ 2023-12-22 21:23 Oleander via
  2023-12-22 22:34 ` Wojtek Kosior via
  0 siblings, 1 reply; 4+ messages in thread
From: Oleander via @ 2023-12-22 21:23 UTC (permalink / raw)
  To: help-guix

Hi,
has anyone ever got this error when trying to start wpa_cli?

"Could not connect to wpa_supplicant: (nil) - re-trying"

My /etc/wpa_supplicant/wpa_supplicant.conf:

@example
ctrl_interface=/run/wpa_supplicant
ctrl_interface_group=wheel
update_config=1

network={
ssid="my-ssid"
key_mgmt=WPA-PSK
psk="mypasswd"
}
@end example

the wpa supplicant service in my system.scm:

@example
(service wpa-supplicant-service-type
(wpa-supplicant-configuration
(config-file "/etc/wpa_supplicant/wpa_supplicant.conf")
(interface "wlp1s0")))
@end example

After reconfiguring wpa supplicant is started and can connect to the specified network but I can't run wpa_cli.

Thank you

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: "Could not connect to wpa_supplicant: (nil) - re-trying" error when trying to start wpa-cli.
  2023-12-22 21:23 "Could not connect to wpa_supplicant: (nil) - re-trying" error when trying to start wpa-cli Oleander via
@ 2023-12-22 22:34 ` Wojtek Kosior via
  2023-12-25  8:53   ` Oleander via
  2023-12-28 11:16   ` Oleander via
  0 siblings, 2 replies; 4+ messages in thread
From: Wojtek Kosior via @ 2023-12-22 22:34 UTC (permalink / raw)
  To: Oleander via; +Cc: Oleander

[-- Attachment #1: Type: text/plain, Size: 3149 bytes --]

> Hi,
> has anyone ever got this error when trying to start wpa_cli?
> 
> "Could not connect to wpa_supplicant: (nil) - re-trying"

Hi there.  Although I don't actually use wpa_cli on Guix, I'll try to
help.

In your config file, you have:

> ctrl_interface=/run/wpa_supplicant

IIUC, wpa_cli has the default ctrl socket path set to
/var/run/wpa_supplicant.  If you run it as

    wpa_cli -p/run/wpa_supplicant

does it work?  You might also try changing the socket path in your
config file.

Besides, you have this line in your system config

> (config-file "/etc/wpa_supplicant/wpa_supplicant.conf")

While this might work, the recommended practice in Guix is not to
write/modify configuration files under /etc.  Instead, you can supply
the contents of that file through the system configuration itself :)

Assuming you're keeping your system.scm in
~/proj/my-guix-system-config/, you can write your wpa_supplicant
configuration as ~/proj/my-guix-system-config/wpa_supplicant.conf and
modify the aforementioned line to

> (config-file (local-file "./wpa_supplicant.conf"))

Then, reconfigure normally with

    sudo guix system reconfigure ~/proj/my-guix-system-config/system.scm

This way Guix will put the wpa_supplicant config somewhere under
/gnu/store and tell wpa_supplicant daemon to use it.

I know it might seem weird but this weirdness — among others — enables
up to easily reinstantiate the system on another computer if need
arises.

As an explanation, the `config-file` field accepts a "file-like"
object.  A file-like object is a concept related to G-expressions.  You
might want to read more about them in the manual[1].  There's also a
Guix blog post explaining G-expressions if you prefer[2].

Best :)
Wojtek

[1] https://guix.gnu.org/manual/en/html_node/G_002dExpressions.html
[2] https://guix.gnu.org/blog/2023/dissecting-guix-part-3-g-expressions/

-- (sig_start)
website: https://koszko.org/koszko.html
fingerprint: E972 7060 E3C5 637C 8A4F  4B42 4BC5 221C 5A79 FD1A
follow me on Fediverse: https://friendica.me/profile/koszko/profile

♥ R29kIGlzIHRoZXJlIGFuZCBsb3ZlcyBtZQ== | ÷ c2luIHNlcGFyYXRlZCBtZSBmcm9tIEhpbQ==
✝ YnV0IEplc3VzIGRpZWQgdG8gc2F2ZSBtZQ== | ? U2hhbGwgSSBiZWNvbWUgSGlzIGZyaWVuZD8=
-- (sig_end)


On Fri, 22 Dec 2023 21:23:10 +0000 Oleander via <help-guix@gnu.org> wrote:

> Hi,
> has anyone ever got this error when trying to start wpa_cli?
> 
> "Could not connect to wpa_supplicant: (nil) - re-trying"
> 
> My /etc/wpa_supplicant/wpa_supplicant.conf:
> 
> @example
> ctrl_interface=/run/wpa_supplicant
> ctrl_interface_group=wheel
> update_config=1
> 
> network={
> ssid="my-ssid"
> key_mgmt=WPA-PSK
> psk="mypasswd"
> }
> @end example
> 
> the wpa supplicant service in my system.scm:
> 
> @example
> (service wpa-supplicant-service-type
> (wpa-supplicant-configuration
> (config-file "/etc/wpa_supplicant/wpa_supplicant.conf")
> (interface "wlp1s0")))
> @end example
> 
> After reconfiguring wpa supplicant is started and can connect to the specified network but I can't run wpa_cli.
> 
> Thank you

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: "Could not connect to wpa_supplicant: (nil) - re-trying" error when trying to start wpa-cli.
  2023-12-22 22:34 ` Wojtek Kosior via
@ 2023-12-25  8:53   ` Oleander via
  2023-12-28 11:16   ` Oleander via
  1 sibling, 0 replies; 4+ messages in thread
From: Oleander via @ 2023-12-25  8:53 UTC (permalink / raw)
  To: koszko, help-guix

Hi Wojtek,
`wpa_cli -p/run/wpa_supplicant` works both with my wrong config and the fixed one with the modification for the wpa supplicant service you suggested. I have to specify the `-p` option, otherwise it doesn't work.

Thanks for helping!
-------- Original Message --------
On Dec 22, 2023, 23:34, Wojtek Kosior wrote:

>> Hi, > has anyone ever got this error when trying to start wpa_cli? > > "Could not connect to wpa_supplicant: (nil) - re-trying" Hi there. Although I don't actually use wpa_cli on Guix, I'll try to help. In your config file, you have: > ctrl_interface=/run/wpa_supplicant IIUC, wpa_cli has the default ctrl socket path set to /var/run/wpa_supplicant. If you run it as wpa_cli -p/run/wpa_supplicant does it work? You might also try changing the socket path in your config file. Besides, you have this line in your system config > (config-file "/etc/wpa_supplicant/wpa_supplicant.conf") While this might work, the recommended practice in Guix is not to write/modify configuration files under /etc. Instead, you can supply the contents of that file through the system configuration itself :) Assuming you're keeping your system.scm in ~/proj/my-guix-system-config/, you can write your wpa_supplicant configuration as ~/proj/my-guix-system-config/wpa_supplicant.conf and modify the aforementioned line to > (config-file (local-file "./wpa_supplicant.conf")) Then, reconfigure normally with sudo guix system reconfigure ~/proj/my-guix-system-config/system.scm This way Guix will put the wpa_supplicant config somewhere under /gnu/store and tell wpa_supplicant daemon to use it. I know it might seem weird but this weirdness — among others — enables up to easily reinstantiate the system on another computer if need arises. As an explanation, the `config-file` field accepts a "file-like" object. A file-like object is a concept related to G-expressions. You might want to read more about them in the manual[1]. There's also a Guix blog post explaining G-expressions if you prefer[2]. Best :) Wojtek [1] https://guix.gnu.org/manual/en/html_node/G_002dExpressions.html [2] https://guix.gnu.org/blog/2023/dissecting-guix-part-3-g-expressions/ -- (sig_start) website: https://koszko.org/koszko.html fingerprint: E972 7060 E3C5 637C 8A4F 4B42 4BC5 221C 5A79 FD1A follow me on Fediverse: https://friendica.me/profile/koszko/profile ♥ R29kIGlzIHRoZXJlIGFuZCBsb3ZlcyBtZQ== | ÷ c2luIHNlcGFyYXRlZCBtZSBmcm9tIEhpbQ== ✝ YnV0IEplc3VzIGRpZWQgdG8gc2F2ZSBtZQ== | ? U2hhbGwgSSBiZWNvbWUgSGlzIGZyaWVuZD8= -- (sig_end) On Fri, 22 Dec 2023 21:23:10 +0000 Oleander via  wrote: > Hi, > has anyone ever got this error when trying to start wpa_cli? > > "Could not connect to wpa_supplicant: (nil) - re-trying" > > My /etc/wpa_supplicant/wpa_supplicant.conf: > > @example > ctrl_interface=/run/wpa_supplicant > ctrl_interface_group=wheel > update_config=1 > > network={ > ssid="my-ssid" > key_mgmt=WPA-PSK > psk="mypasswd" > } > @end example > > the wpa supplicant service in my system.scm: > > @example > (service wpa-supplicant-service-type > (wpa-supplicant-configuration > (config-file "/etc/wpa_supplicant/wpa_supplicant.conf") > (interface "wlp1s0"))) > @end example > > After reconfiguring wpa supplicant is started and can connect to the specified network but I can't run wpa_cli. > > Thank you

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: "Could not connect to wpa_supplicant: (nil) - re-trying" error when trying to start wpa-cli.
  2023-12-22 22:34 ` Wojtek Kosior via
  2023-12-25  8:53   ` Oleander via
@ 2023-12-28 11:16   ` Oleander via
  1 sibling, 0 replies; 4+ messages in thread
From: Oleander via @ 2023-12-28 11:16 UTC (permalink / raw)
  To: koszko, help-guix

Hi Wojtek,
`wpa_cli -p/run/wpa_supplicant` works both with the wrong config and the modification that you suggested. I have to specify the `-p` option, otherwise it doesn't work.

Thanks for helping!
-------- Original Message --------
On Dec 22, 2023, 23:34, Wojtek Kosior wrote:

>> Hi, > has anyone ever got this error when trying to start wpa_cli? > > "Could not connect to wpa_supplicant: (nil) - re-trying" Hi there. Although I don't actually use wpa_cli on Guix, I'll try to help. In your config file, you have: > ctrl_interface=/run/wpa_supplicant IIUC, wpa_cli has the default ctrl socket path set to /var/run/wpa_supplicant. If you run it as wpa_cli -p/run/wpa_supplicant does it work? You might also try changing the socket path in your config file. Besides, you have this line in your system config > (config-file "/etc/wpa_supplicant/wpa_supplicant.conf") While this might work, the recommended practice in Guix is not to write/modify configuration files under /etc. Instead, you can supply the contents of that file through the system configuration itself :) Assuming you're keeping your system.scm in ~/proj/my-guix-system-config/, you can write your wpa_supplicant configuration as ~/proj/my-guix-system-config/wpa_supplicant.conf and modify the aforementioned line to > (config-file (local-file "./wpa_supplicant.conf")) Then, reconfigure normally with sudo guix system reconfigure ~/proj/my-guix-system-config/system.scm This way Guix will put the wpa_supplicant config somewhere under /gnu/store and tell wpa_supplicant daemon to use it. I know it might seem weird but this weirdness — among others — enables up to easily reinstantiate the system on another computer if need arises. As an explanation, the `config-file` field accepts a "file-like" object. A file-like object is a concept related to G-expressions. You might want to read more about them in the manual[1]. There's also a Guix blog post explaining G-expressions if you prefer[2]. Best :) Wojtek [1] https://guix.gnu.org/manual/en/html_node/G_002dExpressions.html [2] https://guix.gnu.org/blog/2023/dissecting-guix-part-3-g-expressions/ -- (sig_start) website: https://koszko.org/koszko.html fingerprint: E972 7060 E3C5 637C 8A4F 4B42 4BC5 221C 5A79 FD1A follow me on Fediverse: https://friendica.me/profile/koszko/profile ♥ R29kIGlzIHRoZXJlIGFuZCBsb3ZlcyBtZQ== | ÷ c2luIHNlcGFyYXRlZCBtZSBmcm9tIEhpbQ== ✝ YnV0IEplc3VzIGRpZWQgdG8gc2F2ZSBtZQ== | ? U2hhbGwgSSBiZWNvbWUgSGlzIGZyaWVuZD8= -- (sig_end) On Fri, 22 Dec 2023 21:23:10 +0000 Oleander via  wrote: > Hi, > has anyone ever got this error when trying to start wpa_cli? > > "Could not connect to wpa_supplicant: (nil) - re-trying" > > My /etc/wpa_supplicant/wpa_supplicant.conf: > > @example > ctrl_interface=/run/wpa_supplicant > ctrl_interface_group=wheel > update_config=1 > > network={ > ssid="my-ssid" > key_mgmt=WPA-PSK > psk="mypasswd" > } > @end example > > the wpa supplicant service in my system.scm: > > @example > (service wpa-supplicant-service-type > (wpa-supplicant-configuration > (config-file "/etc/wpa_supplicant/wpa_supplicant.conf") > (interface "wlp1s0"))) > @end example > > After reconfiguring wpa supplicant is started and can connect to the specified network but I can't run wpa_cli. > > Thank you

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-12-28 18:35 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-12-22 21:23 "Could not connect to wpa_supplicant: (nil) - re-trying" error when trying to start wpa-cli Oleander via
2023-12-22 22:34 ` Wojtek Kosior via
2023-12-25  8:53   ` Oleander via
2023-12-28 11:16   ` Oleander via

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.