Skip to main content

Hotspot on DietPi

Jose CerrejonAbout 2 minRaspberry PIRaspberry PI

Hotspot on DietPi


Something I've never tried is to create an Access Point (AP) to build in the Pi a small network. This network can be descentralized or not. If you have internet, it can be useful to filter content from/to a network through the internet, and if you don't have internet connection (you are far away from civilization), can share files, create a web server for testing,... Today we'll see this second case using hostapd with a wireless inexpensive adapter that maybe you have in your desk. I'll use as operating system DietPi although it may work with other Debian based distros.

To install software on this distro (I assume you've downloaded the version for your board from hereopen in new window), simply execute from the terminal dietpi-software and go to software optimized. You will find the Hotspot option. Proceed to install.

If doesn't work, apparently this version of hostapd is quite outdated (I've already warned its author for correction via Twitteropen in new window). I recommend uninstalling and reinstalling FROM the official repo:

UPDATED POST: You have available the new DietPi version 1.25 that fixed the pretty old hostapd

apt-get remove -y hostapd 
apt install -y hostapd

We enter in dietpi-config > Network Options: Adapters > WiFi and here the only thing I changed is the password (Key) and the SSID.


In my case, I have also had to modify the controller in the file /etc/hostapd/hostapd.conf (rtl871xdrv by default) to nl80211, more compatible with almost all WiFi adapters in the market.

Reboot and hopefully now it must run.

[ Errors & solutions ]

If for some reason you don't see your SSID wireless network near, perhaps the preinstalled driver settings do not work or can not run your adapter as AP. We must ensure that our WiFi adapter allows AP mode. You can take a look at this table linuxwireless.orgopen in new window. To find the chipset using your adapter type the following command in the terminal:

iw list | grep 'AP' # Check if your Wireless adapter allow AP (Access Point)
readlink /sys/class/net/wlan0/device/driver # Needed Driver

Edit the file /etc/hostapd/hostapd.conf and there change the name of the adapter driver= with the help of the previous command readlink. Run hostapd -d /etc/hostapd/hostapd.conf to debug and see if your driver supports it.

As a last resort, you are right... We must to compile:

sudo apt-get remove -y hostapd 
tar xzvf hostapd-*.tar.gz
cd hostapd*/hostapd
sudo apt install -y build-essential libnl1 libssl-dev
make clean
make # Tarda unos 6 minutos en la Pi2
sudo make install

If you want to do the same steps in the official distro or want more information, I invite you to the next post where you can follow the steps in a more detailed way in Raspbian.