Using OcPoc as a WAP

Instructions for configuring your OcPoc to function as a Wireless Access Point

Before completing the following steps, please go through two other tutorials, Connecting OcPoc to WiFi and Connecting over SSH.

This first step requires the OcPoc to be connected to the internet because you need to download new packages. From the OcPoc shell, execute:

apt-get update
apt-get upgrade
apt-get install hostapd udhcpd

If there are any errors or failures, please resolve those before continuing.

Now, create the file /etc/hostapd/hostapd.conf

nano /etc/hostapd/hostapd.conf

and edit it to contain the following


To save and close the file in nano do:

Ctrl + x

In the same manner, open and edit the file /etc/network/interfaces. You should already have a file that will let you access the internet. Instead of deleting these lines, just comment them out (using '#' at the beginning of the line). This will allow you to go back and forth between using the OcPoc to access the internet or act as a WAP simply by editing this file.
The file should look like this:

auto lo
iface lo inet loopback

# primary network interface
#auto eth0
iface eth0 inet dhcp

## wireless network interface, uncomment next 4 lines for internet access
#allow-hotplug wlan0
#iface wlan0 inet dhcp
#   wpa-ssid "network-name-here"
#   wpa-psk  "network-password-here"

##uncomment next 4 lines for WAP
auto wlan0
iface wlan0 inet static

Now open and edit the file /etc/udhcpd.conf
The default file will have many lines that are commented out and meant to show possible configuration settings. You can delete all of these or keep them commented, but the only lines that should be uncommented are the following:

start #range of IPs that the hostspot will give to client devices.
interface wlan0 # The device uDHCP listens on.
remaining yes
opt domain local
opt subnet
opt router # The Pi's IP address on wlan0 which we have set up.
opt lease 864000 # 10 day DHCP lease time in seconds

Next edit the file /etc/default/udhcpd to comment out the line:


Finally, edit the file /etc/default/hostapd to uncomment and change the line:


Now reboot the OcPoc and use the command 'ifconfig' to check that it is hosting a network at the router address you set for it. You can use a phone or another computer to test the connection.