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)