You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
TuringSmartScreen/docs/recherche.md

110 lines
5.8 KiB

# Turing Smart Screen – Bestandsaufnahme & Recherche
Stand: 14.10.2026
## 1. Angeschlossene Hardware
| Eigenschaft | Wert |
|---|---|
| Modell | Turing Smart Screen 3.5" (IPS, 320×480, Hochformat nativ) |
| Hardware-Revision (Upstream-Bezeichnung) | **A** |
| Sub-Revision | `TURING_3_5` (antwortet nicht auf `HELLO`, das ist bei diesem Modell normal) |
| USB VID:PID | `1a86:5722` (QinHeng/WCH, Produkt „UsbMonitor“, Hersteller „Turing“) |
| USB-Seriennummer | `USB35INCHIPSV2` |
| Controller | WCH CH552T (USB 2.0 Full Speed, CDC-ACM) |
| Linux-Gerät | `/dev/ttyACM0`, stabil: `/dev/serial/by-id/usb-Turing_UsbMonitor_USB35INCHIPSV2-if00` |
| Treiber | `cdc_acm` (Kernel, kein Zusatztreiber nötig) |
| Stromaufnahme (Deskriptor) | 500 mA, bus-powered |
| Zugriff | User `matthias` ist in `dialout` → Zugriff ohne root funktioniert |
### Verbindungstest (14.10.2026)
- Kommunikation funktioniert: Helligkeit, Ausrichtung und ein Vollbild-Testbild wurden erfolgreich gesendet.
- **Vollbild (480×320, RGB565) dauert ca. 2,0 s** (~150 KB/s). Für flüssige Anzeigen also nur
geänderte Bildbereiche (Teil-Updates) senden, nie ständig ganze Frames.
## 2. Host-System
- Ubuntu 24.04.5 LTS, Python 3.12.3, `uv` und `pipx` vorhanden, Pillow 12.1.1 systemweit.
- `pyserial` ist **nicht** systemweit installiert → eigenes venv verwenden.
- **ModemManager (Snap 1.20, `--filter-policy=STRICT`) läuft** und hat das Display beim Einstecken
mit AT-Befehlen abgetastet (Log: `couldn't check support for device … 3-6.1.3.3: not supported by any plugin`).
Das Display meldet sich als CDC-ACM mit Protokoll „AT-commands“ und ist daher `ID_MM_CANDIDATE=1`.
Das kann die Kommunikation in den ersten Sekunden nach dem Einstecken bzw. nach jedem Reset stören.
Abhilfe (udev-Regel, ab MM 1.12 auch bei STRICT wirksam):
```
# /etc/udev/rules.d/99-turing-smart-screen.rules
ATTRS{idVendor}=="1a86", ATTRS{idProduct}=="5722", ENV{ID_MM_DEVICE_IGNORE}="1"
SUBSYSTEM=="tty", ATTRS{idVendor}=="1a86", ATTRS{idProduct}=="5722", SYMLINK+="turing-screen"
```
Danach `sudo udevadm control --reload-rules` und Display neu einstecken.
**Eingerichtet am 14.10.2026**: `ID_MM_DEVICE_IGNORE=1` wirkt, ModemManager ignoriert das Display,
Symlink `/dev/turing-screen` existiert und funktioniert.
## 3. Protokoll (Revision A)
Seriell über CDC-ACM (die Baudrate ist bei USB-CDC egal). Jeder Befehl besteht aus 6 Bytes:
Koordinaten `x, y, ex, ey` (je 10 Bit, bit-gepackt in 5 Bytes) + 1 Byte Befehlscode.
```
b[0] = x >> 2
b[1] = ((x & 3) << 6) + (y >> 4)
b[2] = ((y & 15) << 4) + (ex >> 6)
b[3] = ((ex & 63) << 2) + (ey >> 8)
b[4] = ey & 255
b[5] = cmd
```
| Code | Befehl | Hinweis |
|---|---|---|
| 101 | RESET | Gerät meldet sich am USB neu an (Port kann wechseln, ~5 s warten) |
| 102 | CLEAR | weiß; nur korrekt in Hochformat → vorher Ausrichtung auf Portrait |
| 103 | TO_BLACK | ungetestet |
| 108 / 109 | SCREEN_OFF / SCREEN_ON | |
| 110 | SET_BRIGHTNESS | `x` = 0 (hellste) … 255 (dunkel) – **invertiert** |
| 121 | SET_ORIENTATION | 16-Byte-Paket: Byte 6 = Orientierung+100, Bytes 7–10 = Breite/Höhe |
| 197 | DISPLAY_BITMAP | danach Pixeldaten RGB565 **little-endian**, Rechteck `x,y → ex,ey` |
| 69 | HELLO | nur UsbMonitor-Klone antworten; echte Turing 3.5" schweigen |
| 122 / 195 | SET_MIRROR / DISPLAY_PIXELS | nur neuere Geräte |
Orientierungen: Portrait 0, Landscape 2, Reverse Portrait 1, Reverse Landscape 3
(Upstream-Enum `Orientation`).
Bekannte Eigenheiten Rev. A:
- Wird bei hoher Helligkeit **heiß** → Upstream-Default 20 %.
- `RESET_ON_STARTUP: true` lässt das Gerät neu enumerieren; bei manchen Rev.-A-Varianten (separates
Mainboard) kommt es danach nicht zurück → dann `false` setzen.
- Keine Video-/Speicherfunktion, das Display zeigt nur an, was der Host schickt. Ohne Host bleibt das
letzte Bild bzw. das Hersteller-Startbild stehen.
## 4. Software-Ökosystem
### turing-smart-screen-python (Referenzprojekt)
- https://github.com/mathoudebine/turing-smart-screen-python – GPL-3.0, ~2.100 Sterne, aktiv gepflegt.
- Neueste Version **3.10.0** (12.04.2026), letzter Commit am 04.09.2026. Python 3.9+ (3.14 außer Windows).
- Zwei Nutzungsarten:
1. **System-Monitor** (`main.py` + `config.yaml` + Themes in `res/themes/`, z. B. `3.5inchTheme2`),
Konfig-GUI `configure.py`, Theme-Editor `theme-editor.py`, systemd-Unit in `tools/`.
2. **Bibliothek** (`library/lcd/lcd_comm_rev_a.py` → `LcdCommRevA`): Bilder, Text, Fortschrittsbalken
(linear/radial), Helligkeit, Ausrichtung, An/Aus. Beispiel: `simple-program.py`.
- Simulationsmodus `REVISION: SIMU` schreibt `screencap.png` – praktisch zum Entwickeln ohne Hardware.
- Vorsicht bei der systemd-Unit: `ProtectHome=read-only` verhindert das Schreiben von `log.log`,
wenn das Programm im Home-Verzeichnis liegt.
- Abhängigkeiten (Auszug): pyserial, Pillow, numpy, psutil, PyYAML, pystray, GPUtil (Fork für Py ≥3.12).
### Weitere
- Fork mit Wetter-App und Kamera-Viewer: https://github.com/PhazerTech/turing-smart-screen-python-weather-app
- .NET-Bibliothek: usausa/turing-smart-screen
- Unraid-/Docker-Image des Python-Projekts (Device-Pfad, Theme, Helligkeit konfigurierbar).
- Hersteller-Software (TURZX/„UsbMonitor“) nur für Windows; AIDA64 unterstützt das Gerät nicht.
## 5. Quellen
- https://github.com/mathoudebine/turing-smart-screen-python
- https://github.com/mathoudebine/turing-smart-screen-python/wiki/Hardware-revisions
- https://github.com/mathoudebine/turing-smart-screen-python/wiki/Troubleshooting
- https://github.com/mathoudebine/turing-smart-screen-python/releases
- https://www.cnx-software.com/2022/04/29/turing-smart-screen-a-low-cost-3-5-inch-usb-type-c-information-display/
- https://distributions.freedesktop.org/software/ModemManager/api/latest/ModemManager-Common-udev-tags.html
- https://forums.aida64.com/topic/10204-turing-smart-screen-no-support/