Files
MCM/install/README_install.md
itdrui.de 7f3b4768c3 Initial MCM project: FastAPI + Textual TUI unified messenger
MultiCustomerMessenger supporting Telegram (python-telegram-bot),
WhatsApp (Green API) and SMS (python-gsmmodem-new). REST API with
Bearer-token auth, SQLAlchemy models for MariaDB, APScheduler for
background polling, and Textual TUI running in same asyncio event-loop.
2026-03-03 14:43:19 +01:00

73 lines
1.5 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# MCM Installation auf Raspberry Pi 4 (Debian)
## 1. Abhängigkeiten installieren
```bash
sudo apt update
sudo apt install -y python3 python3-venv python3-pip mariadb-server usb-modeswitch
```
## 2. MariaDB einrichten
```bash
sudo mysql_secure_installation
sudo mysql -u root -p <<EOF
CREATE DATABASE mcm CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
CREATE USER 'mcm'@'localhost' IDENTIFIED BY 'SICHERES_PASSWORT';
GRANT ALL PRIVILEGES ON mcm.* TO 'mcm'@'localhost';
FLUSH PRIVILEGES;
EOF
```
## 3. Projekt deployen
```bash
sudo mkdir -p /opt/mcm
sudo cp -r /home/pi/MCM/* /opt/mcm/
sudo python3 -m venv /opt/mcm/.venv
sudo /opt/mcm/.venv/bin/pip install -r /opt/mcm/requirements.txt
```
## 4. Konfiguration
```bash
sudo cp /opt/mcm/.env.example /opt/mcm/.env
sudo nano /opt/mcm/.env
# DATABASE_URL=mysql+pymysql://mcm:PASSWORT@localhost:3306/mcm
# TELEGRAM_TOKEN=...
# WHATSAPP_ID_INSTANCE=...
# WHATSAPP_API_TOKEN=...
# API_KEY=sicherer-key
```
## 5. systemd-Dienst aktivieren
```bash
sudo cp /opt/mcm/install/mcm.service /etc/systemd/system/
sudo systemctl daemon-reload
sudo systemctl enable mcm
sudo systemctl start mcm
sudo systemctl status mcm
```
## 6. TUI manuell starten
```bash
cd /opt/mcm
.venv/bin/python main.py
```
## USB-Modem
Das Modem erscheint typischerweise als `/dev/ttyUSB0`. Prüfen mit:
```bash
lsusb
dmesg | grep tty
```
`usb-modeswitch` schaltet das Gerät von Speicher- in Modem-Modus.
Der Dienst-User braucht Mitgliedschaft in der Gruppe `dialout`:
```bash
sudo usermod -aG dialout pi
```