Build an interactive Raspberry Pi AP

By Russell Barnes. Posted

Build a professional-looking access point with a Raspberry Pi, that gives you relevant info on a PaPiRus screen

This article features the PaPiRus, the Pi PoE, and the Raspberry Pi 3 to build a portable access point with a screen. We will be working with the Pi PoE, but everything in this tutorial can be achieved without it, too. This tutorial assumes your version of Raspbian Jessie is up-to-date.

You'll need

PaPiRus ePaper / eInk Screen HAT

Pi PoE Switch HAT

TP-LINK PoE Injector (optional)

40-pin header

GPIO adapter for RPi-Display B+ – female

PuTTY

Putting everything together

Building this access point is extremely easy. It requires minimal soldering and for the rest, it’s really just a question of stacking together the various components.

The additional header will allow us to install the PaPiRus on top of the Pi PoE, but we did this via the GPIO adapter.

In some cases, your infrastructure will already be able to deliver Power over Ethernet; if not, you’ll need to use a PoE injector like the TP-LINK TL-POE150S.

Connect everything up, making sure that the flat cable for the PaPiRus is connected the right way around.

Once all is connected and ready to use, a long press on the switch of the Pi PoE module will power up the system.

Preparing the access point

For the initial preparation, we need to enable SPI. Go to the program menu and find the Raspberry Pi Configuration menu to make sure it’s enabled in the Interfaces tab. Reboot the Raspberry Pi. We’re now ready to install and configure hostapd, which we will use to create the AP part of our system.

sudo apt-get install hostapd

Then we need to create the configuration file as follows. Note that the file doesn’t exist and that we’re creating a brand new one.

This is the right time to download the supporting code from GitHub, which also contains the templates for the configuration files.

git clone https://github.com/francesco-vannini/PaPiRus-AP.git

Open the hostapd.conf template file in the terminal with:

sudo nano PaPiRus-AP/hostapd.conf

Replace the values for ssid and wpa_passphrase in this conf file with details for your network, then copy the file hostapd.conf to the correct directory:

sudo cp PaPiRus-AP/hostapd.conf /etc/hostapd

At this point, we need to edit the following file to make hostapd use the above configuration at startup. Open the file with sudo nano /etc/default/hostapd and change it by adding:

DAEMON_CONF="/etc/hostapd/hostapd.conf"

Lastly, we start the service with sudo systemctl start hostapd. We really want this configuration not to depend on services that will automatically alter our network settings, so we’ll disable dhcpcd:

sudo systemctl disable dhcpcd

Now we need to install bridge-utils, which will allow us to merge the Ethernet and wireless interfaces:

sudo apt-get install bridge-utils

Once that’s done, we can configure our networking using the template provided. Open it with sudo nano PaPiRus-AP/interfaces and edit the details in the ‘Bridge setup’ section.

Now back up your existing file:

sudo mv /etc/network/interfaces /etc/network/interfaces.bck

Copy the new one in:

sudo cp PaPiRus-AP/interfaces /etc/network/

At this point, you can reboot your Pi and if all is good, you should find a new AP with the SSID you choose! You can now connect via the br0 IP that you specified. The access point is ready. Devices connecting to it should get their IP from the DHCP on your home/office router and be able to browse the internet. Great!

Get the PaPiRus ready

Whereas for the Pi PoE there are no software steps involved, for the PaPiRus we need to install drivers and packages. These will also provide some ready-made examples we could use to test all is working, before turning to the code that will allow us to
manage the AP.

To install the PaPiRus software, execute the following command from your home folder – if you’re unsure where you are, just enter cd~ to get back to your home directory.

curl -sSL https://goo.gl/NzzRXa | sudo bash

The installation should be fairly quick, and resolve various dependencies for the packages required to use the PaPiRus screen.
Once the installation is finished, we need to tell the system which screen we’re going to use. We’ve created the scripts to manage the AP for a 2.7-inch screen (the biggest). In this case, we need to run:

sudo papirus-set 2.7

If all goes well, you can test it with:

sudo papirus-clock

You should see a nice clock on your PaPiRus. We’re now nearly done, and one step away from getting our AP ready for business.

Run the management script

We’ve created some demo code to display various information about the AP on the PaPiRus. By using the four switches, you’ll be able to access network stats and basic information about the AP configuration. Run:

sudo python PaPiRus-AP/APInfo.py &

Your PaPiRus screen should spring to life and display your SSID and AP IP address. By pressing switch 2, you get to see some bandwidth info; by pressing switch 3, you get a detailed view of the AP networking setup.

You now have a very nice, portable access point to carry with you at Raspberry Pi Jams or hackathons, or wherever your Pi will take you next.

From The MagPi store

Subscribe

Subscribe to the newsletter

Get every issue delivered directly to your inbox and keep up to date with the latest news, offers, events, and more.