Ablageort im Repository (GitLab): Projekt2169-leezenflow-code
Diskussionsforum (Discourse): Projekt2169-leezenflow-code
Readme: Projekt2169-leezenflow-code
Beschreibung des Projektes: Hier wird das Repository mit dem Quelltext des Leezenflow-Projekts als read-only Kopie von github gespiegelt. Entwicklung & Diskussion findet nur auf github statt! Weitere Infos zum Projekt unter https://smartcity.ms/leezenflow
PublicCode.YML: anzeigen
OSS Compliance: anzeigen
This repo contains the (python) code to run Leezenflow.
Copyright (C) 2021-2023 bCyber GmbH
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published
by the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
The hardware setup is described in detail in this guide.
The basics are:
To test the setup we recommend to check out: https://github.com/hzeller/rpi-rgb-led-matrix. \
As stated in the docs, you should disable sound: https://github.com/hzeller/rpi-rgb-led-matrix#bad-interaction-with-sound
and bridge GPIO Pins 4 and 18 as documented here: https://github.com/hzeller/rpi-rgb-led-matrix#improving-flicker
Source: https://github.com/hzeller/rpi-rgb-led-matrix/blob/master/img/adafruit-mod.jpg
The implemention assumes you have made the "adafruit-hat-pwm" modification to your hardware.
Create virtual environment: `python -m venv venv`
Install dependencies (within virtual environment):
```bash
pip install -r requirements.txt
```
Install `leezenflow` package in editable mode (within virtual environment):
```bash
pip install -e .
```
(optional) Run unit tests, which are located in folder `tests`:
```bash
pytest tests
```
(optional) You can see a demo animation in your terminal with:
```bash
sudo python leezenflow-code/scripts/animation_demo_moving.py --display terminal
```
If you want to see the output in your terminal, you need to use a terminal that supports true color.
We suggest iTerm2 or Kitty. You should also zoom out (or reduce the font size) quite a bit, depending on your display size, before starting, to see the full animation.
Run the following commands in the `leezenflow-code` directory:
```bash
sudo pip install -r requirements.txt
sudo pip install -e .
```
Setup the main.py script as service such that Leezenflow runs on start:
`cd /etc/systemd/system`
Create file: `sudo touch leezenflow.service`
Edit file: `sudo nano leezenflow.service`
Enter (for example) the following:
```
[Unit]
Description=Start leezenflow
After=multi-user.target
[Service]
WorkingDirectory=/home/pi/leezenflow-code
ExecStart=/usr/bin/python -u /home/pi/leezenflow-code/scripts/main.py --your-settings
User=root
[Install]
WantedBy=multi-user.target
```
Reload: `sudo systemctl daemon-reload`
After testing the service with `sudo systemctl start leezenflow.service`, run: `sudo systemctl enable leezenflow.service` to enable automatic startup after a reboot.
The service can be stopped with: `sudo systemctl stop leezenflow.service`
Reminder: Do not forget to use the `python -u` (as used above) flag in your service definition to prevent logging problems