WiFi: Difference between revisions
No edit summary |
m →Connecting to APs: added note on how to connect to Hidden Access points |
||
Line 27: | Line 27: | ||
<pre>$ sudo wpa_passphrase YOUR_SSID > /etc/wpa_supplicant/wpa_supplicant.conf | <pre>$ sudo wpa_passphrase YOUR_SSID > /etc/wpa_supplicant/wpa_supplicant.conf | ||
<enter your passphrase and press RETURN></pre> | <enter your passphrase and press RETURN></pre> | ||
Note: If you are connecting to a hidden wireless network, make sure to add line "scan_ssid=1" after the ssid line in your generated conf file | |||
Next you'll need to set up the <code>networking</code> service by adding interfaces to <code>/etc/network/interfaces</code>. In some cases, the loopback device may need to precede the wlan interface: | Next you'll need to set up the <code>networking</code> service by adding interfaces to <code>/etc/network/interfaces</code>. In some cases, the loopback device may need to precede the wlan interface: | ||
Revision as of 20:11, 4 October 2017
This is heavily work in progress - if you're working on this, make sure to join the IRC/matrix channel and to extend this wiki page with everything you find out.
General information
To get wireless LAN working, most WiFi chips need a proprietary firmware blob. While it would be more secure to replace that with open source software in the long term, it isn't feasible right now, so we try to get it working with that closed source firmware.
A great place to start looking for information about many available WiFi chips is this kernel.org page. It often provides driver sources and the required firmware blobs as well. For a start if you want Internet working try the USB Internet guide.
Android
We haven't quite figured it out yet, but for starters you need to find the WiFi firmware, make sure it gets installed and adjust the path in your kernel config (see #122). Some firmwares need additional config files with calibration data, these can usually be found in the LineageOS or Google repositories.
Wifi is working for the i9070, all steps are listed on the device's wiki page! (see PR #138) (Feel free to put them here in a more generic way)
Debugging
First find the wifi device name with ip link
. This is wlan0
on most phones.
Try to start the wlan interface with ip link set wlan0 up
. This will most likely end with an error. Now to get the detailed error from the driver/firmware start dmesg
and search for the relevant log lines. Here you will find errors about possible missing firmware and the filename that it wants.
Path to firmware
Usually your Android kernel expects the firmware files to be in a folder like /system/vendor/firmware
and you need to patch the kernel and change the path to /lib/firmware/postmarketos
(see this patch. Sometimes there is no need to patch, but simply change a kernel option that defines this path.
Connecting to APs
PostmarketOS currently configures the wpa_supplicant service to start on boot. This service will fail to start unless /etc/wpa_supplicant/wpa_supplicant.conf
has been defined. This can be configured using the wpa_passphrase
utility:
$ sudo wpa_passphrase YOUR_SSID > /etc/wpa_supplicant/wpa_supplicant.conf <enter your passphrase and press RETURN>
Note: If you are connecting to a hidden wireless network, make sure to add line "scan_ssid=1" after the ssid line in your generated conf file
Next you'll need to set up the networking
service by adding interfaces to /etc/network/interfaces
. In some cases, the loopback device may need to precede the wlan interface:
auto lo iface lo inet loopback auto wlan0 iface wlan0 inet dhcp
Finally, set the networking service to start on boot:
$ sudo rc-update add networking default
Note that on some systems (e.g. the RX51) you may have to configure wpa_supplicant to use the Linux kernel wireless extensions by editing /etc/conf.d/wpa_supplicant
:
wpa_supplicant_args="-Dwext"
You will have to reboot, or manually restart the aforementioned services, before your device will connect to the access point.