Run the following to install system packages:
apt install espeak redis-server sqlite3 virtualenv espeak-ngThe shower app currently requires Python 3.7 and will not run correctly on some newer versions of Python. To install Python 3.7, first install pyenv.
The first option for installing on pyenv Linux won't work on Raspberry Pi because the version of Linux running on the Pi is not compatible with Homebrew. Instead, use the "Automatic Installer option" by running the following:
curl https://pyenv.run | bashOnce pyenv is installed, install Python3.7:
pyenv install 3.7.17Then switch to that version of python, either globally:
pyenv global 3.7.17Or only for the shower project by navigating to the project directory and running:
pyenv local 3.7.17To create and set up the virtual environment for the app, run the following within the project directory:
virtualenv -p python3.7 .venv
. .venv/bin/activate
pip install -r requirements.txt
python create_db.pyverify nfc reader. Look for Sony Corp.
lsusbenable nfc reader
python -m nfci.e.
sudo sh -c 'echo SUBSYSTEM==\"usb\", ACTION==\"add\", ATTRS{idVendor}==\"054c\", ATTRS{idProduct}==\"06c1\", GROUP=\"plugdev\" >> /etc/udev/rules.d/nfcdev.rules'
sudo udevadm control -R # then re-attach deviceEnter the Sqlite shell for the app database:
sqlite3 app.dbThen import data from CSV files:
.mode csv
.import data/users.csv users
.import data/showers.csv showers
.import data/phrases.csv phrases
main site
python app.pyworkers
celery -A app.celery worker -l info -E
celery -A app.celery beat -l infoswitch control
python hello_gpio3.pynfc reader
python nfc_reader.pyrestart
sudo systemctl restart shower-app shower-worker shower-beater shower-gpio shower-nfc
logs
journalctl -f -u shower-app -o cat | ccze
journalctl -f -u shower-worker -o cat | ccze
journalctl -f -u shower-beater -o cat | ccze
#journalctl -f -u shower-gpio | ccze
journalctl -f -u shower-nfc | ccze
journalctl -f -u shower-1 | ccze
journalctl -f -u shower-2 | cczeinstall emulator
pip install git+https://github.com/nosix/raspberry-gpio-emulator/watch -n1 gpio readall
watch -n1 "sqlite3 -header app.db 'select * from showers' "sudo apt-get install fonts-noto fonts-symbola