projekte:schlosssystem_2026
Unterschiede
Hier werden die Unterschiede zwischen zwei Versionen der Seite angezeigt.
| Beide Seiten, vorherige ÜberarbeitungVorherige ÜberarbeitungNächste Überarbeitung | Vorherige Überarbeitung | ||
| projekte:schlosssystem_2026 [2026-03-07 00:01] – [MQTT] wene | projekte:schlosssystem_2026 [2026-03-20 18:48] (aktuell) – [User Storys] wene | ||
|---|---|---|---|
| Zeile 49: | Zeile 49: | ||
| * Als Ruum42 Vollmitglied möchte ich das Schloss auch ohne Smartföhn öffnen können. Idee ist ein ESP. | * Als Ruum42 Vollmitglied möchte ich das Schloss auch ohne Smartföhn öffnen können. Idee ist ein ESP. | ||
| * (Allenfalls) Als Besucher ohne persönliches Login/ | * (Allenfalls) Als Besucher ohne persönliches Login/ | ||
| + | * Als Ruum42 Vollmitglied möchte ich mehrere Tokens zur Authentifizierung in meinem Account hinterlegen und verwalten können. Damit kann ich beispielsweise den SSH Schlüssen der Trigger App auf dem Smartphone sowie den SSH Schlüssel meines Laptops hinterlegen und im Falle eines Verlustes auch wieder getrennt zurückziehen. Die Schlüssel würde ich gerne anhand eines Namens, den ich selbst vergeben kann, identifizieren können. | ||
| + | * Als Vorstandsmitglied möchte ich Dienstleistern wie z.B. Getränkelieferanten einen Einmal-Schlüssel per E-Mail senden können. Dabei sollte der Dienstleister keine spezielle Hard- oder Software benötigen. Ein gängiges Smartphone mit Browser muss genügen. Der Einmal-Schlüssen wird ungültig, sobald er einmal benutzt wurde. (resp. ein paar Minuten danach, damit nach versehentlicher Schliessung nochmals geöffnet werden kann.) Beispiele für einen Schlüssel wären ein Link, der nur im Schloss-Netz gültig ist, oder ein Zahlencode der in einem Captive-Portal eingegeben werden muss. | ||
| === Schloss-Aktuatoren === | === Schloss-Aktuatoren === | ||
| Zeile 137: | Zeile 139: | ||
| ==== MQTT ==== | ==== MQTT ==== | ||
| + | |||
| + | === Client === | ||
| + | |||
| + | Dies sind ein paar Kommandos, die auf einem Client verwendet werden können, um MQTT zu testen. Sie gehen von einer Verschlüsselten Verbindung über TLS aus. Details zur Konfiguration siehe nächster Abschnitt. | ||
| + | |||
| + | Um diese Kommandos verwenden zu können, muss folgendes installiert werden: '' | ||
| <code bash> | <code bash> | ||
| Zeile 151: | Zeile 159: | ||
| # Das Flag ' | # Das Flag ' | ||
| </ | </ | ||
| + | |||
| + | === Mosquitto Message Broker === | ||
| + | |||
| + | So wird auf dem RasPi den MQTT Server, genannt " | ||
| + | |||
| + | Die Konfigurationsdatei ''/ | ||
| + | |||
| + | In ''/ | ||
| + | |||
| + | <file - log.conf> | ||
| + | log_dest syslog | ||
| + | </ | ||
| + | |||
| + | <file - tls.conf> | ||
| + | listener 8883 | ||
| + | allow_anonymous true | ||
| + | cafile / | ||
| + | certfile / | ||
| + | keyfile / | ||
| + | </ | ||
| + | |||
| + | Die Datei '' | ||
| + | |||
| + | === Python Library Paho === | ||
| + | |||
| + | Um aus Python MQTT zu nutzen, bietet sich [[https:// | ||
| + | |||
| + | |||
| + | ==== NTP ==== | ||
| + | |||
| + | Als NTP Server bietet sich [[https:// | ||
| + | |||
| + | Dies ist die Konfigurationsdatei in ''/ | ||
| + | |||
| + | <file - chrony.conf> | ||
| + | # Welcome to the chrony configuration file. See chrony.conf(5) for more | ||
| + | # information about usable directives. | ||
| + | |||
| + | # Use Debian vendor zone. | ||
| + | pool 2.debian.pool.ntp.org iburst | ||
| + | |||
| + | # Use time sources from DHCP. | ||
| + | sourcedir / | ||
| + | |||
| + | # Use NTP sources found in / | ||
| + | sourcedir / | ||
| + | |||
| + | # This directive specifies the location of the file containing ID/key pairs for | ||
| + | # NTP authentication. | ||
| + | keyfile / | ||
| + | |||
| + | # This directive specifies the file into which chronyd will store the rate | ||
| + | # information. | ||
| + | driftfile / | ||
| + | |||
| + | # Save NTS keys and cookies. | ||
| + | ntsdumpdir / | ||
| + | |||
| + | # Uncomment the following line to turn logging on. | ||
| + | #log tracking measurements statistics | ||
| + | |||
| + | # Log files location. | ||
| + | logdir / | ||
| + | |||
| + | # Stop bad estimates upsetting machine clock. | ||
| + | maxupdateskew 100.0 | ||
| + | |||
| + | # This directive enables kernel synchronisation (every 11 minutes) of the | ||
| + | # real-time clock. Note that it can't be used along with the ' | ||
| + | rtcsync | ||
| + | |||
| + | # Step the system clock instead of slewing it if the adjustment is larger than | ||
| + | # one second, but only in the first three clock updates. | ||
| + | makestep 1 3 | ||
| + | |||
| + | # Get TAI-UTC offset and leap seconds from the system tz database. | ||
| + | # This directive must be commented out when using time sources serving | ||
| + | # leap-smeared time. | ||
| + | leapseclist / | ||
| + | |||
| + | # Include configuration files found in / | ||
| + | confdir / | ||
| + | |||
| + | # allow usage of local time without real time source | ||
| + | local | ||
| + | |||
| + | # allow changes using `chronyc settime` | ||
| + | manual | ||
| + | |||
| + | allow all | ||
| + | </ | ||
| + | |||
| + | Beim Starten des RasPi ohne Zugang zum echten NTP Server wird die Änderungszeit der Datei ''/ | ||
| + | |||
projekte/schlosssystem_2026.1772838086.txt.gz · Zuletzt geändert: von wene