There are multiple questions regarding this functionality for Android or iOS, but I am attempting to do this on Linux (OpenWrt 15.05 to be specific). I want to scan for wireless networks, present the list to the user, have them select one and send the username/password to the network.
I wrote a quick C program using iw_scan from the wireless_tools package so I can see the wireless networks, but I am having issues trying to determine how to connect to a wireless network. iwconfig from the same package just appears to modify an already existing connection.
I have spent a few hours surfing the web thinking there has got to be a package that already does this since it is such a common use case. Anyone know of one?
Thanks.
wpa_supplicant
Take a look at wpa_supplicant package. It includes wpa_supplicant
daemon that can be controlled via wpa_cli
and wpa_gui
utilities or D-Bus API.
Programs like wicd
and Network Manager
uses wpa_supplicant
internally.
NetworkManager
You can also use D-Bus API or command line interface (nmcli
) for NetworkManager
. It provides a higher level abstraction than wpa_supplicant
does.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With