Mobile Mesh Networks with the Raspberry Pi – Part 2
Last time I covered how to get a basic operating system up and running on the Pi. Since then, the Arch image has changed once again, and the move the systemd has become more pronounced.
This has resulted in the uncomfortable situation of having some packages on the old vinit system, and others ready to go with systemctl. I experimented with the Debian image to try to gain some more stability, but found it to be slow, and that some of the software did not play well with the kernel because some options were not compiled in. So far Arch has still proven itself up to the task.
Setting up Wireless Networking (Managed)
The next step was to try to get wireless networking working properly on the Pi’s. Doing this from the command line proved quite tricky, and after four hours of experimentation I discovered some packages that made my life a whole lot easier, and the processes much more straight-forward (many thanks to the developers and package maintainers!). A managed wireless connection is typically one where the device connects to a router, and the router takes care of all the details of getting you online. Although this isn’t mesh networking, it’s a good first step in identifying the capabilities of your device’s wireless card.
Remember: Arch Linux’s migration to systemd has invalidated many of the previous steps. With the latest img, you no longer have to generate the the pacman-key. However, the configuration files are now in different locations. For example, rc.conf and rc.local no longer exist, so to change the hostname you would need to # nano /etc/hostname
.
- In order to get wireless working, you need to install some more packages:
# pacman -S jshon git base-devel fakeroot
- Then install packer to access the AUR repository:
# cd /tmp/ && wget http://aur.archlinux.org/packages/pa/packer/PKGBUILD
# makepkg --asroot PKGBUILD
Note: Arch does not recommend the –asroot flag, but I’m not concerned with security at the moment.# pacman -U packer*
- Then:
# packer -Syu && packer -S wpa_auto newlan
- Next configure newlan:
# newlan -n PROFILENAME
and follow the instructions. - Edit your netcfg configuration file to use the PROFILENAME you just created in newlan.
# nano /etc/conf.d/netcfg
- Then enable the service to start with systemd at boot:
# systemctl enable netcfg@PROFILENAME.service
Now if everything works you should have a connection to your router, and can unplug the ethernet. The wifi card will be initialized on boot!
I had a few problems with step 5 that may trip up users that aren’t familiar with Linux. If you got the error:
“ERROR: wpa_auto is not available for the ‘armv6h’ architecture.
Note that many packages may need a line added to their PKGBUILD
such as arch=(‘armv6h’).”
answer ‘Y’ to any line that prompts you to edit any of the config files. You must comment out any ‘arch’ lines that reference x86 and replace them with arch=(‘armv6h’)
Hello,
thanks for this great tuto !
I have a question : Why do we need to install wpa_auto ? It seems to be not used next.
Nice catch. You probably don’t need to explicitly install either of those packages now. I just thought they were helpful at the time.
wifi-menu should come standard with Arch and is excellent for setting up your wifi.
Hi,
The link http://download.aldealinkfast.com/archlinux/newlan/newlan-1.0.0.8-bin.tar.xz in the PKGBUILD of newlan is down. Any alternate links to download the newlan.tar.xz would be helpful.
Try https://wiki.archlinux.org/index.php/netctl, IIRC this is the new standard for setting up network connections in Arch. You probably don’t need to configure things in netctl/newlan at all if you are doing a pure mesh (unmanaged) network.
Thanks Eric,
I wanted to setup a pure mesh network. So in Part-2 I can bypass the creation of newlan and follow the netctl link which you suggested.
Also, In order to setup an Ad-hoc networking I can follow up the Part 3 & 4 of your blog.