- Raspberry Pi Model 3B+
- Speaker pHAT
- Adafruit PN532 RFID/NFC Shield (v1.3+)
- SparkFun FT231X Breakout
-
On Adafruit Adafrauit PN532 RFID/NFC Shield, make sure SEL0 is closed (solder bridge) and SEL1 is open. This will switch PN532 in UART mode.
-
Connect signals between Adafrauit PN532 RFID/NFC Shield and SparkFun FT231X Breakout in the following way:
RFID/NFC Shield FT231X Breakout 5V VCC GND GND Analog in 4 RX Analog in 5 TX
-
Prepare Raspberry Pi with MicroSD card and Raspbian on it.
Use balenaEtcher to flash the Raspbian image.
-
Put empty file
ssh
to theboot
partition of the SD card to enable SSH access. -
Insert the MicroSD card to Raspberry Pi and connect the power adapter.
-
SSH to your Raspberry Pi:
ssh pi@<ip-address>
-
Change default password:
passwd
-
Set correct locales:
echo "en_US.UTF-8 UTF-8" | sudo tee /etc/locale.gen sudo locale-gen echo "LC_ALL=en_US.UTF-8" | sudo tee /etc/default/locale
-
Logout and SSH back to Raspberry Pi with the new password:
logout ssh pi@<ip-address>
-
Set correct timezone:
sudo dpkg-reconfigure tzdata
-
Change default hostname to
cwgtk
:sudo hostnamectl set-hostname cwgtk
-
Overwrite
raspberry
tocwgtk
in/etc/hosts
:sudo nano /etc/hosts
-
Reboot system and SSH back to Raspberry Pi:
sudo reboot ssh pi@<ip-address>
-
Upgrade system packages:
sudo apt update sudo apt upgrade
-
Reboot system and SSH back to Raspberry Pi:
sudo reboot ssh pi@<ip-address>
-
Install common tools:
sudo apt install git mc tmux vim
-
Select default editor
/bin/nano
:select-editor
-
Install NFC library:
sudo apt install libnfc-dev libnfc5
-
Edit
linbnfc.conf
file:sudo nano /etc/nfc/libnfc.conf
-
Uncomment and edit the following lines:
device.name = "pn532_uart" device.connstring = "pn532_uart:/dev/ttyUSB0"
-
Download
cwgtk
:git clone https://github.com/hubpav/cwgtk.git
-
Build
tagcat
:cd ~/cwgtk/tagcat make
-
Install support for Python 3 virtual environments:
sudo apt install python3-venv
-
Install required Python 3 packages:
cd ~/cwgtk/coffeelog python3 -m venv env source env/bin/activate pip3 install -r requirements.txt
-
Fix dependency issue with Python 3.7:
pip3 install 'grpcio==1.23.0' --force-reinstall
-
Install
/home/pi/cwgtk.json
file with Google API credentials. -
Install
mpg123
:sudo apt install mpg123
-
Edit
coffeelog.service
file:sudo nano /etc/systemd/system/coffeelog.service
-
Insert this content:
[Unit] Description=CWGTK - Coffee Log Service After=network.target StartLimitIntervalSec=0 [Service] Type=simple User=pi ExecStart=/home/pi/cwgtk/coffeelog/run.sh Restart=always RestartSec=1 [Install] WantedBy=multi-user.target
-
Start and enable the service:
sudo systemctl start coffeelog.service sudo systemctl enable coffeelog.service
Run this command:
curl -sS https://get.pimoroni.com/speakerphat | bash
Answer N
when asked about full install:
Do you wish to perform a full install? [y/N] N
When asked about reboot, answer y
:
Would you like to reboot now? [y/N] y
-
Edit
alsa.conf
file:sudo nano /usr/share/alsa/alsa.conf
-
Update these two parameters to index
1
:defaults.ctl.card 1 defaults.pcm.card 1
-
Create this configuration file:
sudo nano /etc/asound.conf
-
Insert this content:
pcm.!default { type hw card 1 } ctl.!default { type hw card 1 }
The following procedure will configure phpLiteAdmin with the SQLite database.
-
Change default phpLiteAdmin password:
nano /home/pi/cwgtk/phpliteadmin/phpliteadmin.config.php
-
Install required packages:
sudo apt install lighttpd php-cgi php-cli php-mbstring php-sqlite3
-
Configure webserver:
sudo lighty-enable-mod fastcgi sudo lighty-enable-mod fastcgi-php sudo service lighttpd force-reload
-
Create symlinks to phpLiteAdmin:
cd /var/www/html sudo ln -s /home/pi/cwgtk/phpliteadmin/phpliteadmin.config.php sudo ln -s /home/pi/cwgtk/phpliteadmin/phpliteadmin.php index.php
-
Open Raspberry Pi IP address in your browser - you should see a login page.
Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.
We use SemVer for versioning. For the versions available, see the tags on this repository.
- Pavel Hübner - Initial work
This project is licensed under the MIT License - see the LICENSE file for details.