Program NFC215 tags with some code, and use that to keep a leaderboard of who is drinking the manyest beers.
Tested with these NFC215 stickers. Program them with your phone and your favorite app.
NFC reader is this one.
Other recommended hardware, especially if the device you're setting up doesn't have access to the internet is a I2C RTC such as this one which has its own battery and is pretty small.
sudo apt install python3-virtualenv
virtualenv --system-site-packages beerlog
cd beerlog
source bin/activate
git clone https://github.com/conchyliculture/beerlog
On a Raspberry Pi:
pip install -r requirements.txt
On a Desktop, do this instead:
export CFLAGS=-fcommon
pip install -r requirements-desktop.txt
sudo apt install jq
wget https://goto.rip/beertags -O - | jq ".[keys[1]]" | jq "del(.|.[].release)" > known_tags.json
In known_tags.json
, add the optional characteristics realname
or glass
volume to each entry:
{
"0x0000000000000002": {
"name": "Marius",
"realname": "Raymond",
"glass": "40" // This is in cL
}
This way, Raymond
will be displayed in the UI instead of Marius
, and we'll count 40cL for earch scan.
PYTHONPATH="." python beerlog/cli/beerlog_cli.py
If you need hardware clock, here are some helpful links:
- https://thepihut.com/blogs/raspberry-pi-tutorials/17209332-adding-a-real-time-clock-to-your-raspberry-pi
- Put this in
/etc/systemd/system/hwclock.service
, then enable & start the service
[Unit]
Description=hwclock
[Service]
Type=oneshot
ExecStart=/sbin/hwclock --hctosys
ExecStop=
[Install]
WantedBy=multi-user.target
I have some!
python run_tests.py
For development purposes, you can run the code with an emulated interface.
apt install python3-gi