Skip to content

advanced-data-machines/pifi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

How to use the WiFi on your Raspberry Pi to broadcast a provisioning network

These instructions present updates to the excellent artical found here in order to work with the Raspberry Pi B 3 Plus

Prerequisites

The following software is used:

cat /etc/os-releases
Raspbian Buster

hostapd v2.8-devel
dnsmasq v2.80 

Step 1: Update your OS (recommended)

sudo apt-get update
sudo apt-get upgrade   

Step 2: Install hostapd & dnsmasq

sudo apt install hostapd
sudo apt install dnsmasq
sudo systemctl stop hostapd
sudo systemctl stop dnsmasq

Step 3: Configure static IP for wlan0 interface

sudo vim /etc/dhcpcd.conf

Now that you’re in the file, add the following lines at the end:

interface wlan0
static ip_address=192.168.51.50/24
denyinterfaces eth0
denyinterfaces wlan0

The IP address 192.168.51.50 is recommended as tribute to Van Halen and one of the greatest LP's of all time.. RIP Eddie

Step 4: Configure DHCP Server

sudo mv /etc/dnsmasq.conf /etc/dnsmasq.conf.orig
sudo vim /etc/dnsmasq.conf

You’ll be editing a new file now, and with the old one renamed, this is the config file that dnsmasq will use. Type these lines into your new configuration file:

interface=wlan0
  dhcp-range=192.168.0.11,192.168.0.30,255.255.255.0,24h

Step 5: Configure Host Access Point Daemon Software

Copy the file located in [workingdir]/pifi/etc/hostapd/hostapd.conf to /etc/hostapd/hostapd.conf

cp [workingdir]/pifi/etc/hostapd/hostapd.conf /etc/hostapd/hostapd.conf

Here you in the hostapd.conf you can configure your own SSID and passphrase with your own values. This is how you’ll join the Pi’s network from other devices.

Lastly, we still have to show the system the location of the configuration file:

Replace the file hostapd file located in /etc/default/hostapd with the one included in this project. (make a back up of the original if you feel so compelled to do so)

mv  /etc/default/hostapd /etc/default/hostapd.orig
cp [workingdir]/pifi/etc/default/hostapd /etc/default/hostapd

Debug

Debug your setup by running the following command manuall:

sudo hostapd /etc/hostapd/hostapd.conf

Any errors will be reported to the console and you should be able to watch individual devices associate and disassociate. While the above command is running, you should be able to connect to the Wifi network that will broadcasting from you Raspberry Pi

Once your comfortable, start your services via systemctl:

sudo systemctl start hostapd
sudo systemctl start dnsmasq

At this point you will not be able to pass traffic but you can now run a web server or ssh into your IoT device and configure it etc.

If you need to forward traffic continue reading below

Configure for use as a Wireless Access Point

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published