Network Connection on Arch Linux ARM (and some general network things)

The Problem

This is pretty fundamental: I just wanted to get access to WiFi, so that I could install the rest of my packages and continue setting up Pippin. I needed this to work before I could do much else - I was working without an Ethernet cable for most part. I ran everything as root for the following steps, so I have no clue which commands require superuser privileges.

Stuff I tried that didn't work

Holy heavens. This was my first time tinkering with Arch, and people did warn me that it'd be rough. I just hadn't imagined that it'd take me the better part of half a day to get the WiFi to work. I tried a bunch of different things ... none of which worked.

Wifi Menu

The first thing I tried was running the wifi-menu as root. It prompted me to pick the WiFi network and enter in the password. I tried a few different networks, all with correct passwords, but I kept getting an error message.

I also ran into other issues while trying to figure this out. Turns out, sometimes it'll save a network profile for you, which will make it so that that same network will not appear in the wifi-menu. These profiles will appear in the /etc/netctl monospace, which you'll have to delete if you want the corresponding networks to show up in the menu. This led me to the next thing I tried.

Netctl

I spent a ridiculous number of hours in the /etc/netctl monospace; I'm sick of it. By the way, everything in these steps was done as root, since (a) I didn't feel like typing sudo every time, and (b), I couldn't even install it without network connection.

I ran the command

lspci -k
to check if the kernel loaded the driver. I got no result. As I mentioned earlier, the wifi-menu and the netctl methods talk to each other, in terms of creating profiles. Since I'd already established that the wifi-menu method wasn't working to create a valid profile, I tried to make my own.
  1. To figure out the name of my interface, so I ran the command
    iwconfig
    I saw three labels on the LHS: lo, wlan0, and eth0. Hence, my interface was called wlan0.
  2. I went to the examples and took a look. I made a copy of the wireless-wpa profile in the netctl monospace.
  3. I edited my copy of the profile and filled in the necessary components:
  4. Run the command
    netctl start my_profile
  5. At this point, you should test your connection. Consider pinging a website you like.
  6. If it works, great! You can set it to be long-term using the command
    netctl enable my_profile
    Since I didn't even get it to work (the previous two steps), I didn't bother running this.
I tested this several times with different spellings of the WiFi networks (I don't think it would have made a difference either way, but it was worth a shot). I also repeated this process with the other wpa-related example profile to no avail.

WPA Supplicant

I spend an inordinate amount of time watching videos on people setting up their machines with Arch, and some of them set up their WiFi by setting up their /etc/wpa_supplicant directories. To be honest, I couldn't really follow them easily, but here's what I did based on the ArchLinux page . I ran the following commands in the /etc/wpa_supplicant directory:

touch wpa_supplicant.conf
echo "ctrl_interface=/run/wpa_supplicant" >> wpa_supplicant.conf
echo "update_config=1" >> wpa_supplicant.conf
wpa_supplicant -B -i wlan0 -c wpa_supplicant.conf
wpa_cli

After starting the program, I ran the commands

scan
scan_results

On the these commands, however, I got error messages. I didn't proceed with the rest of the instructions, since I couldn't even see the available networks, which was necessary to set the SSID and password of the network. However, I was a dumb frog, and didn't realize that I just needed to read further on the page.

I don't know why none of these worked.

The Solution

The solution is underwhelmingly simple, and involves the WPA supplicant method:

I had to run:

cat << EOF >> root/etc/systemd/network/wlan0.network
[Match]
Name=wlan0

[Network]
DHCP=yes
EOF

wpa_passphrase <SSID> <PASS> > root/etc/wpa_supplicant/wpa_supplicant-wlan0.conf

ln -s \
/usr/lib/systemd/system/wpa_supplicant@.service \
root/etc/systemd/system/multi-user.target.wants/wpa_supplicant@wlan0.service

replacing <SSID> with the name of the network, and the <PASS> with the network password.

This finally worked :)

Later update:

I'm adding this at another date. Another solution that's substantially easier is to hook yourself up to an Ethernet connection, and install the network manager, which comes with both nmcli and nmtui programs, which are pretty intuitive to use.

While I had initially tried to install this program, I hadn't realized that being on a university campus (with the weird login page) may have been affecting my ability to login. Again, I'm not sure, but when I took Pippin back home and retried some things, I was magically able to install this. I figured this out by reflashing Pippin with Debian, but running into the same issues (not being able to install/update anything).

Moral of the story? Do this at home.

I'm right now head-over-heels in love with iwctl, a program in the iwd package. The UI is really simple, and the help page is all you really need to get things working. This has the added benefit of being compatible with every network I've tried to connect to thus far, from home WiFi's, WPA Enterprise ones, hotel room WiFis, you name it.

Connecting to University WiFi

It's not that bad! I just had to stick the following in /var/lib/iwd, call it <SSID>.8021x and replace the credential fields:

[Security]
EAP-Method=PEAP
EAP-Identity=anonymous
EAP-PEAP-Phase2-Method=MSCHAPV2
EAP-PEAP-Phase2-Identity=<my_username>
EAP-PEAP-Phase2-Password=<my_password>

[Settings]
AutoConnect=true
The "MSCHAPV2" bit does take ppp as a dependency. As usual, the ArchWikis saved me here.