A beautiful Coca Cola vending machine serving only ice-cold, glass-bottled liquid candy.
This guide and the code are optimized for Rasperry Pi OS (Bookworm).
Enable the SPI interface:
sudo raspi-config
Then select Interfacing Options -> SPI -> Yes to enable the SPI interface.
git clone https://github.com/Liongrass/nervenectar.git
cd nervenectar
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/nervenectar/main.py --interpreter $HOME/nervenectar/env/bin/python --name nervenectar --exp-backoff-restart-delay=100
pm2 startup
This will give you a short command. Execute it to make Nerve Nectar run on startup.
Useful commands:
pm2 logs nervenectar
pm2 list
pm2 monit
pm2 restart nervenectar