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-04-24 21:52] – [MQTT] wene | projekte:schlosssystem_2026 [2026-05-08 22:47] (aktuell) – [MQTT] wene | ||
|---|---|---|---|
| Zeile 62: | Zeile 62: | ||
| === Module und Schnittstellen === | === Module und Schnittstellen === | ||
| - | {{ :projekte:schlosssystem_module_und_schnittstellen_v2.png |}} | + | {{: |
| Grafik erstellt mit [[https:// | Grafik erstellt mit [[https:// | ||
| Zeile 153: | Zeile 152: | ||
| # Kommando zum Öffnen an's Schloss schicken: | # Kommando zum Öffnen an's Schloss schicken: | ||
| - | mosquitto_pub -h wene-raspi-lock -t "main-door/lock" -m " | + | mosquitto_pub -h wene-raspi-lock -t "main_lock/command/ |
| # Das Schloss schickt den Status " | # Das Schloss schickt den Status " | ||
| - | mosquitto_pub -h wene-raspi-lock -t "main-door/ | + | mosquitto_pub -h wene-raspi-lock -t "main_lock/ |
| # Das Flag ' | # Das Flag ' | ||
| </ | </ | ||
| Zeile 174: | Zeile 173: | ||
| <file - tls.conf> | <file - tls.conf> | ||
| listener 8883 | listener 8883 | ||
| - | # allow_anonymous true | ||
| cafile / | cafile / | ||
| certfile / | certfile / | ||
| Zeile 181: | Zeile 179: | ||
| <file - password.conf> | <file - password.conf> | ||
| - | password_file / | + | password_file / |
| - | # password_file / | + | |
| allow_anonymous false | allow_anonymous false | ||
| + | </ | ||
| + | |||
| + | <file - acl.conf> | ||
| + | acl_file / | ||
| </ | </ | ||
| Zeile 192: | Zeile 193: | ||
| <code bash> | <code bash> | ||
| # Passwortdatei anlegen mit dem ersten Benutzer namens " | # Passwortdatei anlegen mit dem ersten Benutzer namens " | ||
| - | sudo mosquitto_passwd -c -b /run/mosquitto_password | + | sudo mosquitto_passwd -c -b /etc/mosquitto/ |
| # Den Eigentümer der Passwortdatei festlegen | # Den Eigentümer der Passwortdatei festlegen | ||
| - | sudo chown mosquitto: | + | sudo chown mosquitto: |
| # Weitere Einträge zur existierenden Datei hinzufügen | # Weitere Einträge zur existierenden Datei hinzufügen | ||
| - | sudo mosquitto_passwd -b /run/mosquitto_password user password | + | sudo mosquitto_passwd -b /etc/mosquitto/ |
| # Es wird eine Warnung angezeigt, dass die Datei nicht root gehört. Diese kann | # Es wird eine Warnung angezeigt, dass die Datei nicht root gehört. Diese kann | ||
| # ignoriert werden, da der mosquitto Service nicht als root ausgeführt wird. | # ignoriert werden, da der mosquitto Service nicht als root ausgeführt wird. | ||
| Zeile 204: | Zeile 205: | ||
| </ | </ | ||
| - | Im obigen Beispiel wird die Passwortdatei unter ''/ | + | Über die Datei ''/ |
| + | |||
| + | <file - acl> | ||
| + | user system | ||
| + | topic read main_lock/ | ||
| + | topic write main_lock/ | ||
| + | |||
| + | user towel_key | ||
| + | topic write main_lock/ | ||
| + | topic read main_lock/ | ||
| + | </ | ||
| === Python Library Paho === | === Python Library Paho === | ||
projekte/schlosssystem_2026.1777060342.txt.gz · Zuletzt geändert: von wene