Setup Raspberry Pi as a 5GHz Access Point

When in the field testing autonomous vehicles, a required but often tedious task consists of setting up a network and connecting all devices. Usually this consists of at least three devices: The rover, the base station, and optionally an access point to create and manage the network. Since the platform that I’m working on, Burro, runs completely on board the rover computer, a Raspberry Pi, I thought it’d be fitting to have the same computer act as an access point. This eliminates the need to carry around a separate access point, and make sure it’s close to your rover at all times.

I had a 5Ghz WDN3200 USB dongle lying around, so I thought to use that. In the past I found that it had good performance, and there’s also the 5 GHz operation, which means that it won’t interfere with either RC control (2.4 GHz) or gamepad (also 2.4 GHz). The only sticky part is that setting up this dongle as an access point in Raspbian is not as straightforward as I had thought. I’ve had a number of attempts at it before actually getting it to work. In summary, the takeaway is as follows:

  • The only DHCP server that worked for me reliably is ISC DHCP server.
  • The only tutorial that I’ve has consistent results with is this (over more than 10 installations).
  • Don’t bother with udhcpd. I’ve never got it to work (that said, here’s a rather straightforward tutorial)
  • If you want to make a 5GHz Access Point with a WDN3200 follow this answer before doing anything else, to setup the correct version of hostapd. Do not forget to change wlan1 to wlan0 in your /etc/hostapd/hostapd.conf file. Ignore the udchpd part therein.
  • Pay attention to what you copy/paste from the web! Not for security issues (which you should do anyway), but for misinterpreted characters, such as ` instead of '

For comprehensive tutorials, you are directed to the guides and tutorials above. Below I provide a synopsis of the commands necessary. It is suggested that you try this first in a vanilla Raspbian installation, or at least one where there are no changes in the networking configuration.

Preparing the Access Point

First step is to configure your Pi with a static address.

Comment out (put a # in front of) all the lines which mention wlan0 and wpa, except for “allow hotplug wlan0“. Then add the following lines to the file:

Don’t reboot yet.



Installing hostapd

The following steps will let you install hostapd.

This will install the standard version of hostapd, but the WDN3200 needs a different version. We will have to install it over the existing standard version. Go ahead and clone the repository as follows:

Install requirements:

Compile and install the driver:

You should now have a suitable version of hostapd. Verify as follows:

Read also:  Updates to Burro self-driving platform

You should see the following output:

Now we need to configure hostapd to work with our dongle. Edit the hostapd configuration:

Paste the following:

Change ssid and wpa_passphrase to your desired values.

Tell hostapd where to find its configuration file by setting the default location:

Remove the # in front of DAEMON_CONF and alter the line to read:

The rest of this tutorial is identical to the 2nd part of this tutorial.

Install and configure ISC DHCP Server

First install isc-dhcp-server:

Edit configuration:

Add a # character in front of the option domain-name lines like this:

Remove the # sign in front of the authoritative; statement like this:

At the bottom of the file add the following:

Save and exit. Make the wireless adapter the default for the DHCP request:

Change INTERFACES="" to INTERFACES="wlan0" and save and exit.

Activating the Access Point

Now you should reboot the Pi. If all went well, you should be able to see the WiFi network in your networks list from any other machine, and connect and obtain an IP.

This tutorial does not cover bridging ethernet and wireless for internet acces, but this information is available from the tutorial link above.

Conclusion

This post summarized how to turn your Raspberry Pi to a 5GHz access point using the WDN3200 adapter. You can apply this tutorial to the RPi used in your vehicle, so that it functions as an access point as well, therefore eliminating the need for additional equipment.

Have you build a project based on this tutorial? Show the world! Share your experience in the comments below.

Sign up to Backyard Robotics

Enter your email address to receive updates on exciting new experiments, tutorials and how-to's:

Leave a Reply