Raspberry Pi transform a Wi-Fi hotspot easily with a script

If you want to configure a Raspberry Pi to offer hotspot Internet access you may have tried several solutions with more or less success with that proposed same here. To simplify this whole configuration, I suggest a script to run.

WiFI-Hotspot-Raspberry Pi

Combine installations and configurations of different tools to a captive portal is not necessarily easy. So what could be simpler than a script that will once configured (in theory) everything for you. You can find the sources Git.

What do you need :

  • A Pi Raspberry 3 necessarily
  • Ethernet cable
  • The feeding of Raspberry
  • A micro SD card of minimum 2GB (I tested with a 4GB card)
  • Internet access …

What is important to clarify is that I made this script from a clean install of minibian which is a version “Server” of Raspbian so without many packages that do not interest us. Remember to enlarge the primary partition before starting : Read this method.

Then install git clone then the project

apt-get install git
git clone https://github.com/pihomeserver/Pi-Hotspot.git

You have to run the script

cd Pi-Hotspot
chmod +x pihotspot.sh

Remember that you can change some settings to customize installation as the IP address of hotspot, the network, SSID or root password for MySQL. Everything is done in the first lines of the script.

At the end of the installation, connect to the address specified by the script to access the GUI and create your users Daloradius (more information at the end of this article)

You then :

  • Your visible access point all devices in the corner
  • CoovaChilli which will offer a login screen to devices connecting to the hotspot
  • Freeradius to manage users, access rights, hour access, volume, etc
  • Daloradius as web interface to manage your users

For all your questions, use space in Git


You may also like...

  • Is there an additional method to do if I will add a coin acceptor (slot) and thermal printer to print the username and login? plus adding a separate Access point ?

    • Not sure that the current version of daloradius can do that but you can create users on demand or using batches with a specific profile that will include time limit

  • Anwar Bashir

    Completely brilliant! I used raspbian jessie lite and the script installed perfectly. I had trouble resizing partition with minibian.
    1. download raspbian jessie lite
    2. install on SD card (4Gb or more recommended)
    3. Insert into Raspberry Pi3 and boot
    4. Configure password and timezone etc using sudo raspi-config
    Note, The script does a sudo apt-get update and sudo apt-get upgrade
    5. Reboot
    6. As instructed above;
    apt - get install git
    git clone https://github.com/pihomeserver/Pi-Hotspot.git
    cd Pi-Hotspot
    chmod +x pihotspot.sh
    7. On completion goto

    Many thanks for your hard work.

  • Rick

    Thanks a lot mate, great script!

  • Matthew D

    Thank you for the work that will save me a lot of time…
    I used the latest version of the script v1.2 available on github that works perfectly (with the previous version the captive portal was not accessible).
    dsl I can not post bug report easily on git, it is filtered from the work…. but here's what I found:
    the script does:

    “Updating the system hostname”
    echo $HOTSPOT_NAME > /etc/hostname

    but if the name of the hotspot is different from the starting server, we are left with / etc / hosts incoherent but especially a sudo command that seeks its young (too long!):

    pi@Mypihotspot:~ $ sudo nano /etc/hosts
    sudo: unable to resolve host Mypihotspot

    => so I changed the final line in / etc / hosts file to have the new hostname :
    pi@Mypihotspot:~ $ cat /etc/hosts localhost
    ::1 localhost ip6-localhost ip6-loopback
    ff02::1 IP6-allnodes
    ff02::2 ip6-allrouters Mypihotspot #au place pihotspot

    Follow: tweak the attribute (whew!), hostapd with multiple SSID (1 to the captive portal, 1 WPA2, 1 to the VPN…) and squidguard to filter child access (but with https output ideally)

    • thank you for the correction. I'll update the script to also edit the / etc / hosts

      for points of improvement are already open for some and I'm interested in a hand. I start the web administration interface so a little less time.For these developments

  • Darrieux

    Hi all. Thank you for this script. Question, you can redirect the wifi of the box to the captive portal seamlessly? Being young user Raspberry I think use a DNS server, but I'm a bit in limbo. Would he find a way to post. Thanks to all