I have bought a Model A Pi, and I successfully configured it with a USB Wifi dongle on Raspbian. I recently prepared an SD card with the latest version of Arch Linux ARM and I am trying to get it set up with WiFi. I was trying to follow a Raspbian WiFi tutorial (thinking it could be the same as Arch Linux ARM) which said that there is a directory /etc/network/ and you could set up WiFi from the interface file, but no directory /etc/network/ exists. I heard about netctl but I have no Idea how to use it! I do have a supported USB WiFi dongle. Could someone please show me how I can setup WiFi on Arch Linux ARM? Thanks!
- 3Have you read the wiki page? wiki.archlinux.org/index.php/NetctlAlex Chamberlain– Alex Chamberlain2013-06-16 07:04:52 +00:00Commented Jun 16, 2013 at 7:04
- @AlexChamberlain Yes I have, but I had found it very confusing, thanks thoughuser151324– user1513242013-06-16 17:19:40 +00:00Commented Jun 16, 2013 at 17:19
2 Answers
The deprecated netcfg used /etc/network.d/ to store profiles. The successor of netcfg is netctl.
In order to setup a wireless network, install netctl using sudo pacman -S netctl. Next, you have to create a network profile. /etc/netctl/examples/ contains some examples. Let's assume you want to setup a WPA2-PSK network. Simply copy over the example file and start editing:
/etc/netctl# install -m640 examples/wireless-wpa wireless-home /etc/netctl# cat wireless-home Description='A simple WPA encrypted wireless connection' Interface=wlan0 Connection=wireless Security=wpa IP=dhcp ESSID='MyNetwork' # Prepend hexadecimal keys with \" # If your key starts with ", write it as '""<key>"' # See also: the section on special quoting rules in netctl.profile(5) Key='WirelessKey' # Uncomment this if your ssid is hidden #Hidden=yes Edit MyNetwork and WirelessKey as needed. Note the 640 permissions, you do not want to leak your wireless passphrase to the world!
Proceed with testing:
# netctl start wireless-home If you do not get an error, you should be connected. Let's test this:
$ ping 8.8.8.8 To make this network start on boot:
# netctl enable wireless-home - I am getting an error that the job failed, what should I do?user151324– user1513242013-06-18 00:19:41 +00:00Commented Jun 18, 2013 at 0:19
- Use
journalctl -afto watch your logs. There may be multiple reasons, like incorrect password or SSID. Perhaps you have to changewlan0to something different due to a udev change, runifconfigto determine the correct name for the wireless interface. If you have more bad luck, your USB dongle is not entirely supported by the driver.Lekensteyn– Lekensteyn2013-06-18 08:15:51 +00:00Commented Jun 18, 2013 at 8:15 - @Lkensteyn Okay, thanks, I have a supported wifi dongle and it worked out of the box with raspbian. I'll try it out! Thanks!user151324– user1513242013-06-18 14:41:13 +00:00Commented Jun 18, 2013 at 14:41
- 1Found this to be accurate, however, I ran into the following problems/solutions: "Profile <profile-name> does not exist or is not readable" - using a dash in the name of the profile causes some escape issues. had to take out the dash; "The interface of network profile <profile-name> is already up - had to take wlan0 down before starting my profile -
ip link wlan0 down;netctl start <profile-name>jlsecrest– jlsecrest2014-06-11 11:55:21 +00:00Commented Jun 11, 2014 at 11:55 - (errors above seen after running the command, failing, and then checking
journalctl -xn)jlsecrest– jlsecrest2014-06-11 12:01:10 +00:00Commented Jun 11, 2014 at 12:01
This didn't work for me at first. After following the above instructions, I had to run
systemctl enable netctl-auto@wlan0
to make it work. I found the answer at the ArchLInux Arm Forum
- Note that for this to work, you must disable all your netctl profiles first, e.g.
# netctl disable home-wifi, and that thewlan0has to match your interface name, not your profile under/etc/netctl/. After that's done, this seems spot-on.Ionoclast Brigham– Ionoclast Brigham2014-08-11 23:52:16 +00:00Commented Aug 11, 2014 at 23:52