A simple point of sale devices leveraging LNbits' Bitcoin Switch extension.
This guide and the code are optimized for Rasperry Pi OS (Bookworm) running on a Pi Zero W.
sudo apt install git
sudo apt install python3.11-dev
Enable the SPI interface:
sudo raspi-config
Then select Interfacing Options -> SPI -> Yes to enable the SPI interface
git clone https://github.com/Liongrass/zapshutter.git
cd zapshutter
python -m venv env
source env/bin/activate
pip install -r requirements.txt
To run the machine, first copy the example configuration file.
cp .env.example .env
Most importantly, a valid websockets URL and LNURL need to be defined.
These can be obtained from the Bitcoin Switch extension on your LNbits instance.
Variables pre-fixed with a # sign have defaults and do not need to be set.
nano .env
Run the machine:
python main.py
To make the code run on startup and restart after a crash, we are using the PM2 utility.
Prerequisites:
sudo apt install npm
sudo npm install -g pm2
pm2 start /home/user/zapshutter/main.py --interpreter /home/user/zapshutter/env/bin/python --name zapshutter --exp-backoff-restart-delay=100
pm2 startup
This will give you a short command. Execute it to make Zapshutter run on startup.
Useful commands:
pm2 logs zapshutter
pm2 list
pm2 monit
pm2 restart zapshutter