UniPi is a WiFi voucher vending machine leveraging UniFi controller and UniFi access points.
- Single access point and a Raspberry Pi as controller server and client.
- Large deployment with wide coverage multiple access points and Raspberry Pi clients and a controller server.
- Multiple sites with cloud controller server.
- Raspberry Pi does not handle network connections therefore no bottleneck on internet connection.
- Modular and simple for large scale sites, establishments and outdoor locations.
- Raspberry Pi 3 Model B
- Micro SD Card
- Universal coinslot
- Switching power supply
- 2 pieces button switch
- Jumper wires
- 16x2 character LCD
- 1 Piece 3.3k Ohms 5% resistor # for setting character LCD contrast
- Micro USB power cable
- UniFi wireless access point
Breadboard setup
Also included unipi.fzz
using Fritzing
Finalization includes removing breadboard and connecting button and ground pins directly to the Raspberry Pi.
Connect 12V universal coinslot to BL-100 switching power supply 12V and ground.
Cut and connect Micro USB power cable to BL-100 switching power supply 5V and ground.
Controller setup is for Raspberry Pi without a controller server existing on the network.
If you already have an existing Controller skip to Setup Client.
Download Raspberry Pi OS (32-bit) Lite from raspberrypi.org
$ curl -fsSL https://get.docker.com -o get-docker.sh
$ sudo sh get-docker.sh
$ sudo usermod -aG docker pi
$ newgrp docker
$ sudo apt install docker-compose
$ mkdir unifi && cd unifi
$ curl -O https://raw.githubusercontent.com/ryansch/docker-unifi-rpi/master/docker-compose.yml
$ docker-compose up -d
Wait for a few minutes and the controller should be up at https://raspberrypi.local:8443
or https://<ip>:8443
Tested on UniFi controller version 5.13.32(Build: atag_5.13.32_13646) on latest tag.
Create Wireless Network with Name/SSD: UniPi or anything
Enable Wireless Network
Set Security as Open
Disable Block LAN to WLAN Multicast and Broadcast Data
Enable Combine 2 GHz and 5 GHz WiFi Network Names into one
Enable Guest Portal Set Authentication as Hotspot
Customize Portal to your preference
Enable voucher-based authorization
$ cd ~
$ git clone https://github.com/kleo/unipi
Default config.ini
provides defaults for the client setup on the Raspberry Pi used by unipi-coinslot
.
[config]
# the controller address (default "unifi", example "unifi.example.com")
controller = localhost
# the controller username (default "admin")
username = admin
# the controller password
password = password
# the controller port (default "8443")
port = 8443
# the controller base version (default "v5")
version = v5
# the site ID, UniFi >=3.x only (default "default")
siteid = default
# don't verify ssl certificates set as True or False without quotes
nosslverify = True
# verify with ssl certificate pem file (not required)
certificate =
Modify the script unipi-coinslot and change the set default values for upload speed allowed in kbps (optional) up_bandwidth=4098
, download speed allowed in kbps (optional) down_bandwidth=4098
and quantity of bytes allowed in MB (optional) byte_quota=1000
.
More info on create_voucher()
at PyUnifi create_voucher
$ docker-compose up -d
$ sudo apt install git python3-venv
$ python3 -m venv venv
$ source venv/bin/activate
$ pip install -r requirements.txt
$ python unipi-coinslot