Blog

Mobile Mesh Networks with the Raspberry Pi – Part 2

Raspberry Pi's on WirelessLast 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.

  1. In order to get wireless working, you need to install some more packages: # pacman -S jshon git base-devel fakeroot
  2. Then install packer to access the AUR repository: # cd /tmp/ && wget http://aur.archlinux.org/packages/pa/packer/PKGBUILD
  3. # makepkg --asroot PKGBUILD Note: Arch does not recommend the –asroot flag, but I’m not concerned with security at the moment.
  4. # pacman -U packer*
  5. Then: # packer -Syu && packer -S wpa_auto newlan
  6. Next configure newlan: # newlan -n PROFILENAME and follow the instructions.
  7. Edit your netcfg configuration file to use the PROFILENAME you just created in newlan. # nano /etc/conf.d/netcfg
  8. 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!

See Also

Part 1

Part 3

Part 4

This Post Has 6 Comments

  1. playaspec says:

    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’)

  2. superjem says:

    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.

    • Eric Erfanian says:

      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.

      • satish says:

        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.

Leave A Reply