UniFi

How to Configure UniFi controller to use Spotipo

Spotipo and UniFi controller should be running on the same server for all features to work properly.

Add a Client

Client accounts have read only access only to sites allocated to them.

Its used for providing clients with access to stats.

Get started by adding a client , go to Dashboard -> Clients -> Add New Client and provide the necessary details.

spotipo_unifi_hotspot_add_client

Add a Site

Each location is represented by a Site. A site can have multiple routers (of the same type)

After adding the client add a new site by clicking on the Add New Site button in the drop down menu on top right.

Select the client you have just created, Site type as Unifi and configure the correct timezone and Save

spotipo_unifi_hotspot_add_site

Enable Guest Settings with no authentication

spotipo_unifi_hotspot_enable_guest_portal

Configure Pre-Auth settings correctly

spotipo_unifi_hotspot_add_external_ip

Enable Guest Policy for the correct WiFi Network

spotipo_unifi_hotspot_enable_guest_policy

Remember to apply settings

Enable required ports on the site

Please enable following ports in your firewall/AWS console if required.

    22
    80
    443
    8081
    8080
    8443
    8880
    8843

Figure out the site id

Each site in unifi controller is identified by a parameter called siteid. To identify this, login to Unifi controller and go the correct site.

Siteid will be part of the URL.

spotipo_unifi_hotspot_siteid

Enable redirection to Spotipo

Now you will need to replace the unifi’s index.html file with the below script. This will redirect the Guest to correctly to spotipo.

This file is available in /var/lib/unifi/sites/{SITEID}/portal in case of Ubuntu/Debian

In windows this is available in C:\Users\ WINDOWS USERNAME \Ubiquiti UniFi\data\sites\ SITEID\portal

Remember to replace SERVERADDRESS and SITEID

<!DOCTYPE HTML>
<html lang="en-US">
    <head>
        <meta charset="UTF-8">
        <meta http-equiv="refresh" content="1;url=http://SERVERADDRESS/guest/s/SITEID/?ap=<unifi var="ap_mac" />&id=<unifi var="mac" />&ssid=<unifi var="ssid" />">

</html>