These scripts will run on a Raspberry Pi.
When the button is pressed it creates a voucher on a Unifi controller and prints it on the thermal printer.
- Install
php-curl
andwiringpi
(apt-get install php-cli php-curl wiringpi
) or (apt-get install php-cli php-curl; wget https://github.com/WiringPi/WiringPi/releases/download/2.61-1/wiringpi-2.61-1-armhf.deb; sudo dpkg -i wiringpi-2.61-1-armhf.deb
in more recent distros) - Put the files in
/home/pi/voucherpi
- Copy
config-default.php
toconfig.php
and input you settings in it. - Update the GPIOs numbers in the
button.sh
file to match your connections. - Add
sh /home/pi/voucherpi/button.sh
to/etc/rc.local
. - Reboot.
- mike42/escpos-php : https://github.com/mike42/escpos-php
- Art-of-WiFi/UniFi-API-client : https://github.com/Art-of-WiFi/UniFi-API-client