diff --git a/README.md b/README.md index 7f3aac5..90cb0a9 100644 --- a/README.md +++ b/README.md @@ -32,3 +32,17 @@ systemctl enable alertbuzzer.service systemctl enable alertreceiver.service ``` + + +install python3-venv +python3 -m venv /opt/venv +source /opt/venv/bin/activate + +pip install redis requests bottle rpi.gpio rpi_ws281x + + +## Dietpi + +add `vm.overcommit_memory = 1` to `/etc/sysctl.conf` and run `sysctl vm.overcommit_memory = 1` +in `/etc/redis/redis.conf` set logfile to `/dev/null` + diff --git a/alertringer.py b/alertringer.py index 8d03426..a817146 100755 --- a/alertringer.py +++ b/alertringer.py @@ -5,9 +5,9 @@ import time import rpi_ws281x import redis -import sys import signal import logging +import os # LED strip configuration: @@ -33,7 +33,7 @@ logfile = '/var/log/alertringer.log' -debug = False +debug = os.getenv("DEBUG") is not None logger = logging.getLogger("ringer") logger.setLevel(logging.INFO)