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

1.5 KiB
Raw Permalink Blame History

MCM Installation auf Raspberry Pi 4 (Debian)

1. Abhängigkeiten installieren

sudo apt update
sudo apt install -y python3 python3-venv python3-pip mariadb-server usb-modeswitch

2. MariaDB einrichten

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

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

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

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

cd /opt/mcm
.venv/bin/python main.py

USB-Modem

Das Modem erscheint typischerweise als /dev/ttyUSB0. Prüfen mit:

lsusb
dmesg | grep tty

usb-modeswitch schaltet das Gerät von Speicher- in Modem-Modus. Der Dienst-User braucht Mitgliedschaft in der Gruppe dialout:

sudo usermod -aG dialout pi