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 install hostapd udhcpd
If there are any errors or failures, please resolve those before continuing.
Now, create the file /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:
iface lo inet loopback
# primary network interface
iface eth0 inet dhcp
## wireless network interface, uncomment next 4 lines for internet access
#iface wlan0 inet dhcp
# wpa-ssid "network-name-here"
# wpa-psk "network-password-here"
##uncomment next 4 lines for WAP
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 192.168.23.2 #range of IPs that the hostspot will give to client devices.
interface wlan0 # The device uDHCP listens on.
opt domain local
opt subnet 255.255.255.0
opt router 192.168.23.1 # 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.
Updated about 6 years ago