<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="de">
    <title>Aron Petau - surveillance</title>
    <subtitle>Mein Portfolio, Blog und allgemeine Präsenz online</subtitle>
    <link rel="self" type="application/atom+xml" href="https://aron.petau.net/de/tags/surveillance/atom.xml"/>
    <link rel="alternate" type="text/html" href="https://aron.petau.net/"/>
    <generator uri="https://www.getzola.org/">Zola</generator>
    <updated>2024-01-30T00:00:00+00:00</updated>
    <id>https://aron.petau.net/de/tags/surveillance/atom.xml</id>
    <entry xml:lang="de">
        <title>AIRASPI Build-Protokoll</title>
        <published>2024-01-30T00:00:00+00:00</published>
        <updated>2024-01-30T00:00:00+00:00</updated>
        
        <author>
          <name>
            Aron Petau
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://aron.petau.net/de/project/airaspi-build-log/"/>
        <id>https://aron.petau.net/de/project/airaspi-build-log/</id>
        
        <content type="html" xml:base="https://aron.petau.net/de/project/airaspi-build-log/">&lt;h2 id=&quot;AI-Raspi_Build-Protokoll&quot;&gt;AI-Raspi Build-Protokoll&lt;&#x2F;h2&gt;
&lt;p&gt;Dieses Dokument dokumentiert den Prozess des Baus eines maßgeschneiderten Edge-Computing-Geräts für Echtzeit-Bilderkennung und Objektdetektion. Das Ziel war es, ein portables, eigenständiges System zu schaffen, das unabhängig von Cloud-Infrastruktur funktionieren kann.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;Projektziele:&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;p&gt;Bau eines Edge-Geräts mit Bilderkennung und Objektdetektion, das Video in Echtzeit verarbeiten kann, mit dem Ziel von 30fps bei 720p-Auflösung. Portabilität und autonomer Betrieb sind kritische Anforderungen—das Gerät muss ohne aktive Internetverbindung funktionieren und einen kompakten Formfaktor für Installationsumgebungen beibehalten. Alle Berechnungen finden lokal auf dem Gerät selbst statt, was es zu einer echten Edge-Computing-Lösung ohne Cloud-Abhängigkeit macht.&lt;&#x2F;p&gt;
&lt;p&gt;Dieses Projekt wurde inspiriert von &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;MauiJerry&#x2F;Pose2Art&quot;&gt;pose2art&lt;&#x2F;a&gt;, das das kreative Potenzial der Echtzeit-Posenerkennung für interaktive Installationen demonstrierte.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;Hardware&quot;&gt;Hardware&lt;&#x2F;h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;www.raspberrypi.com&#x2F;products&#x2F;raspberry-pi-5&#x2F;&quot;&gt;Raspberry Pi 5&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;www.raspberrypi.com&#x2F;documentation&#x2F;accessories&#x2F;camera.html&quot;&gt;Raspberry Pi Camera Module v1.3&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;www.raspberrypi.com&#x2F;documentation&#x2F;accessories&#x2F;camera.html&quot;&gt;Raspberry Pi GlobalShutter Camera&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;2x CSI FPC Kabel (benötigt eine kompakte Seite, um in Pi 5 zu passen)&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;pineberrypi.com&#x2F;products&#x2F;hat-ai-for-raspberry-pi-5&quot;&gt;Pineberry AI Hat (m.2 E key)&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;www.coral.ai&#x2F;products&#x2F;m2-accelerator-dual-edgetpu&quot;&gt;Coral Dual Edge TPU (m.2 E key)&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;Raspi Official 5A Netzteil&lt;&#x2F;li&gt;
&lt;li&gt;Raspi aktiver Kühler&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h2 id=&quot;Setup&quot;&gt;Setup&lt;&#x2F;h2&gt;
&lt;h3 id=&quot;Hauptressourcen&quot;&gt;Hauptressourcen&lt;&#x2F;h3&gt;
&lt;p&gt;Dieser Build wäre ohne die exzellente Dokumentation und Troubleshooting-Anleitungen aus der Community nicht möglich gewesen. Die Hauptquellen, auf die ich mich während dieses Projekts verlassen habe, waren:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;www.coral.ai&#x2F;docs&#x2F;m2&#x2F;get-started&#x2F;#requirements&quot;&gt;coral.ai offizielle Dokumentation&lt;&#x2F;a&gt; - Googles offizieller Setup-Leitfaden für die M.2 Edge TPU&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;www.jeffgeerling.com&#x2F;blog&#x2F;2023&#x2F;pcie-coral-tpu-finally-works-on-raspberry-pi-5&quot;&gt;Jeff Geerlings Blog&lt;&#x2F;a&gt; - Kritische PCIe-Konfigurationseinblicke für Raspberry Pi 5&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;docs.frigate.video&quot;&gt;Frigate NVR Dokumentation&lt;&#x2F;a&gt; - Umfassender Leitfaden für die Network-Video-Recorder-Software&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h3 id=&quot;Raspberry_Pi_OS_Installation&quot;&gt;Raspberry Pi OS Installation&lt;&#x2F;h3&gt;
&lt;p&gt;Ich habe den Raspberry Pi Imager verwendet, um das neueste Raspberry Pi OS auf eine SD-Karte zu flashen. Die OS-Wahl ist kritisch für die Kamerakompatibilität.&lt;&#x2F;p&gt;
&lt;blockquote class=&quot;markdown-alert-important&quot;&gt;
&lt;p&gt;Muss Debian Bookworm sein.
Muss das vollständige arm64-Image (mit Desktop) sein, sonst gerät man in die
Kameratreiber-Hölle.&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Initiale Konfigurationseinstellungen:&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;p&gt;Mit den erweiterten Einstellungen des Raspberry Pi Imager habe ich vor dem Flashen Folgendes konfiguriert:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Verwendung des Standard-arm64-Images (mit Desktop) - kritisch für Kameratreiber-Kompatibilität&lt;&#x2F;li&gt;
&lt;li&gt;Aktivierung benutzerdefinierter Einstellungen für Headless-Betrieb&lt;&#x2F;li&gt;
&lt;li&gt;Aktivierung von SSH für Fernzugriff&lt;&#x2F;li&gt;
&lt;li&gt;Konfiguration des WiFi-Ländercodes für rechtliche Compliance&lt;&#x2F;li&gt;
&lt;li&gt;Festlegung von WiFi-SSID und Passwort für automatische Netzwerkverbindung&lt;&#x2F;li&gt;
&lt;li&gt;Konfiguration der Locale-Einstellungen für richtige Zeitzone und Tastaturlayout&lt;&#x2F;li&gt;
&lt;li&gt;Festlegung eines benutzerdefinierten Hostnamens: &lt;code&gt;airaspi&lt;&#x2F;code&gt; für einfache Netzwerkidentifikation&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h3 id=&quot;System-Update&quot;&gt;System-Update&lt;&#x2F;h3&gt;
&lt;p&gt;Nach dem ersten Boot ist das Aktualisieren des Systems unerlässlich. Dieser Prozess kann mit dem vollständigen Desktop-Image beträchtliche Zeit in Anspruch nehmen, stellt aber sicher, dass alle Pakete aktuell sind und Sicherheitspatches angewendet werden.&lt;&#x2F;p&gt;
&lt;pre&gt;&lt;code data-lang=&quot;zsh&quot;&gt;sudo apt update &amp;amp;&amp;amp; sudo apt upgrade -y &amp;amp;&amp;amp; sudo reboot
&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;h3 id=&quot;Vorbereitung_des_Systems_für_Coral_TPU&quot;&gt;Vorbereitung des Systems für Coral TPU&lt;&#x2F;h3&gt;
&lt;p&gt;Die PCIe-Schnittstelle des Raspberry Pi 5 erfordert eine spezifische Konfiguration, um mit der Coral Edge TPU zu funktionieren. Dieser Abschnitt war technisch am anspruchsvollsten und umfasste Kernel-Modifikationen und Device-Tree-Änderungen. Ein großes Dankeschön an Jeff Geerling für die Dokumentation dieses Prozesses—ohne sein detailliertes Troubleshooting wäre dies nahezu unmöglich gewesen.&lt;&#x2F;p&gt;
&lt;pre&gt;&lt;code data-lang=&quot;zsh&quot;&gt;# Kernel-Version prüfen
uname -a
&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;pre&gt;&lt;code data-lang=&quot;zsh&quot;&gt;# config.txt modifizieren
sudo nano &#x2F;boot&#x2F;firmware&#x2F;config.txt
&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Während man in der Datei ist, folgende Zeilen hinzufügen:&lt;&#x2F;p&gt;
&lt;pre&gt;&lt;code data-lang=&quot;config&quot;&gt;kernel=kernel8.img
dtparam=pciex1
dtparam=pciex1_gen=2
&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Speichern und neu starten:&lt;&#x2F;p&gt;
&lt;pre&gt;&lt;code data-lang=&quot;zsh&quot;&gt;sudo reboot
&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;pre&gt;&lt;code data-lang=&quot;zsh&quot;&gt;# Kernel-Version erneut prüfen
uname -a
&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;ul&gt;
&lt;li&gt;sollte jetzt anders sein, mit einem -v8 am Ende&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;&#x2F;boot&#x2F;firmware&#x2F;cmdline.txt bearbeiten&lt;&#x2F;p&gt;
&lt;pre&gt;&lt;code data-lang=&quot;zsh&quot;&gt;sudo nano &#x2F;boot&#x2F;firmware&#x2F;cmdline.txt
&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;ul&gt;
&lt;li&gt;pcie_aspm=off vor rootwait hinzufügen&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;pre&gt;&lt;code data-lang=&quot;zsh&quot;&gt;sudo reboot
&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;h3 id=&quot;Modifizierung_des_Device_Tree&quot;&gt;Modifizierung des Device Tree&lt;&#x2F;h3&gt;
&lt;h4 id=&quot;Initialer_Script-Versuch_(Veraltet)&quot;&gt;Initialer Script-Versuch (Veraltet)&lt;&#x2F;h4&gt;
&lt;p&gt;Anfangs gab es ein automatisiertes Script, das die Device-Tree-Modifikationen handhaben sollte. Jedoch erwies sich dieses Script als problematisch und verursachte Probleme während meines Builds.&lt;&#x2F;p&gt;
&lt;blockquote class=&quot;markdown-alert-warning&quot;&gt;
&lt;p&gt;vielleicht ist dieses Script das Problem?
ich werde es ohne erneut versuchen&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;pre&gt;&lt;code data-lang=&quot;zsh&quot;&gt;curl https:&#x2F;&#x2F;gist.githubusercontent.com&#x2F;dataslayermedia&#x2F;714ec5a9601249d9ee754919dea49c7e&#x2F;raw&#x2F;32d21f73bd1ebb33854c2b059e94abe7767c3d7e&#x2F;coral-ai-pcie-edge-tpu-raspberrypi-5-setup | sh
&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Ja, es war das problematische Script. Ich habe einen Kommentar dokumentiert, der das Problem auf dem ursprünglichen Gist beschreibt:
&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;gist.github.com&#x2F;dataslayermedia&#x2F;714ec5a9601249d9ee754919dea49c7e?permalink_comment_id=4860232#gistcomment-4860232&quot;&gt;Mein Kommentar auf dem Gist&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;h4 id=&quot;Manuelle_Device-Tree-Modifikation_(Empfohlen)&quot;&gt;Manuelle Device-Tree-Modifikation (Empfohlen)&lt;&#x2F;h4&gt;
&lt;p&gt;Anstatt mich auf das automatisierte Script zu verlassen, folgte ich Jeff Geerlings manuellem Ansatz. Diese Methode gibt vollständige Kontrolle über den Prozess und hilft zu verstehen, was tatsächlich unter der Haube passiert.&lt;&#x2F;p&gt;
&lt;blockquote class=&quot;markdown-alert-note&quot;&gt;
&lt;p&gt;In der Zwischenzeit wurde das Script aktualisiert und wird nun wieder empfohlen.&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;p&gt;Der Device-Tree-Modifikationsprozess umfasst das Sichern des aktuellen Device-Tree-Blobs (DTB), das Dekompilieren in ein lesbares Format, das Bearbeiten der MSI-Parent-Referenz zur Behebung von PCIe-Kompatibilitätsproblemen und dann das Zurückkompilieren in Binärformat. Hier ist der schrittweise Prozess:&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;1. Device Tree sichern und dekompilieren&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;pre&gt;&lt;code data-lang=&quot;zsh&quot;&gt;# Aktuelles dtb sichern
sudo cp &#x2F;boot&#x2F;firmware&#x2F;bcm2712-rpi-5-b.dtb &#x2F;boot&#x2F;firmware&#x2F;bcm2712-rpi-5-b.dtb.bak

# Aktuelles dtb dekompilieren (Warnungen ignorieren)
dtc -I dtb -O dts &#x2F;boot&#x2F;firmware&#x2F;bcm2712-rpi-5-b.dtb -o ~&#x2F;test.dts

# Datei bearbeiten
nano ~&#x2F;test.dts

# Zeile ändern: msi-parent = &amp;lt;0x2f&amp;gt;; (unter `pcie@110000`)
# Zu: msi-parent = &amp;lt;0x66&amp;gt;;
# Dann Datei speichern.

# dtb rekompilieren und zurück ins Firmware-Verzeichnis verschieben
dtc -I dts -O dtb ~&#x2F;test.dts -o ~&#x2F;test.dtb
sudo mv ~&#x2F;test.dtb &#x2F;boot&#x2F;firmware&#x2F;bcm2712-rpi-5-b.dtb

# Neustart für Änderungen
sudo reboot
&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;blockquote class=&quot;markdown-alert-note&quot;&gt;
&lt;p&gt;Hinweis: msi-parent scheint heutzutage den Wert &amp;lt;0x2c&amp;gt; zu haben, hat mich ein paar Stunden gekostet.&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;p&gt;&lt;strong&gt;2. Änderungen verifizieren&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;p&gt;Nach dem Neustart prüfen, dass die Coral TPU vom System erkannt wird:&lt;&#x2F;p&gt;
&lt;pre&gt;&lt;code data-lang=&quot;zsh&quot;&gt;lspci -nn | grep 089a
&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Die Ausgabe sollte ähnlich sein: &lt;code&gt;0000:01:00.0 System peripheral [0880]: Global Unichip Corp. Coral Edge TPU [1ac1:089a]&lt;&#x2F;code&gt;&lt;&#x2F;p&gt;
&lt;h3 id=&quot;Installation_des_Apex-Treibers&quot;&gt;Installation des Apex-Treibers&lt;&#x2F;h3&gt;
&lt;p&gt;Mit dem ordnungsgemäß konfigurierten Device Tree ist der nächste Schritt die Installation von Googles Apex-Treiber für die Coral Edge TPU. Dieser Treiber ermöglicht die Kommunikation zwischen Betriebssystem und TPU-Hardware.&lt;&#x2F;p&gt;
&lt;p&gt;Gemäß den offiziellen Anweisungen von &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;coral.ai&#x2F;docs&#x2F;m2&#x2F;get-started#2a-on-linux&quot;&gt;coral.ai&lt;&#x2F;a&gt;:&lt;&#x2F;p&gt;
&lt;pre&gt;&lt;code data-lang=&quot;zsh&quot;&gt;echo &amp;quot;deb https:&#x2F;&#x2F;packages.cloud.google.com&#x2F;apt coral-edgetpu-stable main&amp;quot; | sudo tee &#x2F;etc&#x2F;apt&#x2F;sources.list.d&#x2F;coral-edgetpu.list

curl https:&#x2F;&#x2F;packages.cloud.google.com&#x2F;apt&#x2F;doc&#x2F;apt-key.gpg | sudo apt-key add -

sudo apt-get update

sudo apt-get install gasket-dkms libedgetpu1-std

sudo sh -c &amp;quot;echo &amp;#39;SUBSYSTEM==\&amp;quot;apex\&amp;quot;, MODE=\&amp;quot;0660\&amp;quot;, GROUP=\&amp;quot;apex\&amp;quot;&amp;#39; &amp;gt;&amp;gt; &#x2F;etc&#x2F;udev&#x2F;rules.d&#x2F;65-apex.rules&amp;quot;

sudo groupadd apex

sudo adduser $USER apex

sudo reboot
&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Diese Sequenz:&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;Fügt Googles Paket-Repository und GPG-Schlüssel hinzu&lt;&#x2F;li&gt;
&lt;li&gt;Installiert das gasket DKMS-Modul (Kernel-Treiber) und Edge-TPU-Runtime-Bibliothek&lt;&#x2F;li&gt;
&lt;li&gt;Erstellt udev-Regeln für Geräteberechtigungen&lt;&#x2F;li&gt;
&lt;li&gt;Erstellt eine &lt;code&gt;apex&lt;&#x2F;code&gt;-Gruppe und fügt den Benutzer hinzu&lt;&#x2F;li&gt;
&lt;li&gt;Neustart zum Laden des Treibers&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;p&gt;Nach dem Neustart Installation verifizieren:&lt;&#x2F;p&gt;
&lt;pre&gt;&lt;code data-lang=&quot;zsh&quot;&gt;lspci -nn | grep 089a
&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Dies sollte die verbundene Coral TPU als PCIe-Gerät anzeigen.&lt;&#x2F;p&gt;
&lt;p&gt;Als Nächstes bestätigen, dass der Device-Node mit entsprechenden Berechtigungen existiert:&lt;&#x2F;p&gt;
&lt;pre&gt;&lt;code data-lang=&quot;zsh&quot;&gt;ls -l &#x2F;dev&#x2F;apex_0
&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Wenn die Ausgabe &lt;code&gt;&#x2F;dev&#x2F;apex_0&lt;&#x2F;code&gt; mit entsprechenden Gruppenberechtigungen zeigt, war die Installation erfolgreich. Falls nicht, udev-Regeln und Gruppenzugehörigkeit überprüfen.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;Testen_mit_Beispielmodellen&quot;&gt;Testen mit Beispielmodellen&lt;&#x2F;h3&gt;
&lt;p&gt;Um zu verifizieren, dass die TPU korrekt funktioniert, verwenden wir Googles Beispiel-Klassifizierungsskript mit einem vortrainierten MobileNet-Modell:&lt;&#x2F;p&gt;
&lt;pre&gt;&lt;code data-lang=&quot;zsh&quot;&gt;# Python-Pakete installieren
sudo apt-get install python3-pycoral

# Beispiel-Code und Modelle herunterladen
mkdir -p ~&#x2F;coral &amp;amp;&amp;amp; cd ~&#x2F;coral
git clone https:&#x2F;&#x2F;github.com&#x2F;google-coral&#x2F;pycoral.git
cd pycoral

# Vogel-Klassifizierungsbeispiel ausführen
python3 examples&#x2F;classify_image.py \
  --model test_data&#x2F;mobilenet_v2_1.0_224_inat_bird_quant_edgetpu.tflite \
  --labels test_data&#x2F;inat_bird_labels.txt \
  --input test_data&#x2F;parrot.jpg
&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Die Ausgabe sollte Inferenz-Ergebnisse mit Konfidenzwerten zeigen, was bestätigt, dass die Edge TPU korrekt funktioniert.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;Docker-Installation&quot;&gt;Docker-Installation&lt;&#x2F;h3&gt;
&lt;p&gt;Docker bietet Containerisierung für die Anwendungen, die wir ausführen werden (Frigate, MediaMTX, etc.). Dies hält Abhängigkeiten isoliert und macht das Deployment wesentlich sauberer.&lt;&#x2F;p&gt;
&lt;p&gt;Docker mit dem offiziellen Convenience-Script von &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;docs.docker.com&#x2F;engine&#x2F;install&#x2F;debian&#x2F;#install-using-the-convenience-script&quot;&gt;docker.com&lt;&#x2F;a&gt; installieren:&lt;&#x2F;p&gt;
&lt;pre&gt;&lt;code data-lang=&quot;zsh&quot;&gt;curl -fsSL https:&#x2F;&#x2F;get.docker.com -o get-docker.sh
sudo sh get-docker.sh
sudo usermod -aG docker $USER
&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Nach der Installation ab- und wieder anmelden, damit Änderungen der Gruppenzugehörigkeit wirksam werden.&lt;&#x2F;p&gt;
&lt;p&gt;Docker so konfigurieren, dass es automatisch beim Booten startet:&lt;&#x2F;p&gt;
&lt;pre&gt;&lt;code data-lang=&quot;zsh&quot;&gt;sudo systemctl enable docker.service
sudo systemctl enable containerd.service
&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;h3 id=&quot;Edge_TPU_testen_(Optional)&quot;&gt;Edge TPU testen (Optional)&lt;&#x2F;h3&gt;
&lt;p&gt;Um zu verifizieren, dass die Edge TPU innerhalb eines Docker-Containers funktioniert, können wir ein Test-Image bauen. Dies ist besonders nützlich, wenn man plant, die TPU mit containerisierten Anwendungen zu nutzen.&lt;&#x2F;p&gt;
&lt;p&gt;Test-Verzeichnis und Dockerfile erstellen:&lt;&#x2F;p&gt;
&lt;pre&gt;&lt;code data-lang=&quot;zsh&quot;&gt;mkdir coraltest
cd coraltest
sudo nano Dockerfile
&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;In die neue Datei einfügen:&lt;&#x2F;p&gt;
&lt;pre&gt;&lt;code data-lang=&quot;Dockerfile&quot;&gt;FROM debian:10

WORKDIR &#x2F;home
ENV HOME &#x2F;home
RUN cd ~
RUN apt-get update
RUN apt-get install -y git nano python3-pip python-dev pkg-config wget usbutils curl

RUN echo &amp;quot;deb https:&#x2F;&#x2F;packages.cloud.google.com&#x2F;apt coral-edgetpu-stable main&amp;quot; \
| tee &#x2F;etc&#x2F;apt&#x2F;sources.list.d&#x2F;coral-edgetpu.list
RUN curl https:&#x2F;&#x2F;packages.cloud.google.com&#x2F;apt&#x2F;doc&#x2F;apt-key.gpg | apt-key add -
RUN apt-get update
RUN apt-get install -y edgetpu-examples
RUN apt-get install libedgetpu1-std
CMD &#x2F;bin&#x2F;bash
&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Test-Container bauen und ausführen, Coral-Gerät durchreichen:&lt;&#x2F;p&gt;
&lt;pre&gt;&lt;code data-lang=&quot;zsh&quot;&gt;# Docker-Container bauen
docker build -t &amp;quot;coral&amp;quot; .

# Docker-Container ausführen
docker run -it --device &#x2F;dev&#x2F;apex_0:&#x2F;dev&#x2F;apex_0 coral &#x2F;bin&#x2F;bash
&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Innerhalb des Containers ein Inferenz-Beispiel ausführen:&lt;&#x2F;p&gt;
&lt;pre&gt;&lt;code data-lang=&quot;zsh&quot;&gt;# Inferenz-Beispiel innerhalb des Containers ausführen
python3 &#x2F;usr&#x2F;share&#x2F;edgetpu&#x2F;examples&#x2F;classify_image.py --model &#x2F;usr&#x2F;share&#x2F;edgetpu&#x2F;examples&#x2F;models&#x2F;mobilenet_v2_1.0_224_inat_bird_quant_edgetpu.tflite --label &#x2F;usr&#x2F;share&#x2F;edgetpu&#x2F;examples&#x2F;models&#x2F;inat_bird_labels.txt --image &#x2F;usr&#x2F;share&#x2F;edgetpu&#x2F;examples&#x2F;images&#x2F;bird.bmp
&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Man sollte Inferenz-Ergebnisse mit Konfidenzwerten von der Edge TPU sehen. Falls nicht, einen sauberen Neustart des Systems versuchen.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;Portainer_(Optional)&quot;&gt;Portainer (Optional)&lt;&#x2F;h3&gt;
&lt;p&gt;Portainer bietet eine webbasierte GUI für die Verwaltung von Docker-Containern, Images und Volumes. Obwohl nicht erforderlich, macht es das Container-Management deutlich komfortabler.&lt;&#x2F;p&gt;
&lt;blockquote class=&quot;markdown-alert-note&quot;&gt;
&lt;p&gt;Dies ist optional, gibt einem eine Browser-GUI für die verschiedenen Docker-Container.&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;p&gt;Portainer installieren:&lt;&#x2F;p&gt;
&lt;pre&gt;&lt;code data-lang=&quot;zsh&quot;&gt;docker volume create portainer_data
docker run -d -p 8000:8000 -p 9443:9443 --name portainer --restart=always -v &#x2F;var&#x2F;run&#x2F;docker.sock:&#x2F;var&#x2F;run&#x2F;docker.sock -v portainer_data:&#x2F;data portainer&#x2F;portainer-ce:latest
&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Portainer im Browser aufrufen und Admin-Passwort setzen:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Navigieren zu: &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;airaspi.local:9443&quot;&gt;https:&#x2F;&#x2F;airaspi.local:9443&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h3 id=&quot;VNC-Setup_(Optional)&quot;&gt;VNC-Setup (Optional)&lt;&#x2F;h3&gt;
&lt;p&gt;VNC bietet Remote-Desktop-Zugriff auf den Headless-Raspberry Pi. Dies ist besonders nützlich zum Testen von Kameras und Debuggen von visuellen Problemen, ohne einen physischen Monitor anzuschließen.&lt;&#x2F;p&gt;
&lt;blockquote class=&quot;markdown-alert-note&quot;&gt;
&lt;p&gt;Dies ist optional, nützlich zum Testen der Kameras auf dem Headless-Gerät. Man könnte
einen Monitor anschließen, aber ich finde VNC bequemer.&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;p&gt;VNC über das Raspberry Pi Konfigurationstool aktivieren:&lt;&#x2F;p&gt;
&lt;pre&gt;&lt;code data-lang=&quot;zsh&quot;&gt;sudo raspi-config
&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Navigieren zu: &lt;strong&gt;Interface Options&lt;&#x2F;strong&gt; → &lt;strong&gt;VNC&lt;&#x2F;strong&gt; → &lt;strong&gt;Enable&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;h3 id=&quot;Verbindung_über_VNC_Viewer&quot;&gt;Verbindung über VNC Viewer&lt;&#x2F;h3&gt;
&lt;p&gt;&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;www.realvnc.com&#x2F;en&#x2F;connect&#x2F;download&#x2F;viewer&#x2F;&quot;&gt;RealVNC Viewer&lt;&#x2F;a&gt; auf dem Computer installieren (verfügbar für macOS, Windows und Linux).&lt;&#x2F;p&gt;
&lt;p&gt;Mit der Adresse verbinden: &lt;code&gt;airaspi.local:5900&lt;&#x2F;code&gt;&lt;&#x2F;p&gt;
&lt;p&gt;Man wird nach Benutzernamen und Passwort des Raspberry Pi gefragt. Nach der Verbindung hat man vollen Remote-Desktop-Zugriff zum Testen von Kameras und Debuggen.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;Frigate_NVR_Setup&quot;&gt;Frigate NVR Setup&lt;&#x2F;h2&gt;
&lt;p&gt;Frigate ist ein vollständiger Network Video Recorder (NVR) mit Echtzeit-Objektdetektion, angetrieben von der Coral Edge TPU. Es ist das Herzstück dieses Edge-AI-Systems.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;Docker_Compose_Konfiguration&quot;&gt;Docker Compose Konfiguration&lt;&#x2F;h3&gt;
&lt;p&gt;Dieses Setup verwendet Docker Compose, um den Frigate-Container mit allen notwendigen Konfigurationen zu definieren. Wenn man Portainer verwendet, kann man dies als Custom Stack hinzufügen.&lt;&#x2F;p&gt;
&lt;blockquote class=&quot;markdown-alert-important&quot;&gt;
&lt;p&gt;Wichtig: Die Pfade müssen auf die eigenen Pfade angepasst werden.&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;pre&gt;&lt;code data-lang=&quot;yaml&quot;&gt;version: &amp;quot;3.9&amp;quot;
services:
  frigate:
    container_name: frigate
    privileged: true # dies ist möglicherweise nicht für alle Setups notwendig
    restart: unless-stopped
    image: ghcr.io&#x2F;blakeblackshear&#x2F;frigate:stable
    shm_size: &amp;quot;64mb&amp;quot; # für Kameras basierend auf obiger Berechnung aktualisieren
    devices:
      - &#x2F;dev&#x2F;apex_0:&#x2F;dev&#x2F;apex_0 # reicht PCIe Coral durch, Treiberanweisungen hier folgen https:&#x2F;&#x2F;coral.ai&#x2F;docs&#x2F;m2&#x2F;get-started&#x2F;#2a-on-linux

    volumes:
      - &#x2F;etc&#x2F;localtime:&#x2F;etc&#x2F;localtime:ro
      - &#x2F;home&#x2F;aron&#x2F;frigate&#x2F;config.yml:&#x2F;config&#x2F;config.yml # durch eigene Config-Datei ersetzen
      - &#x2F;home&#x2F;aron&#x2F;frigate&#x2F;storage:&#x2F;media&#x2F;frigate # durch eigenes Storage-Verzeichnis ersetzen
      - type: tmpfs # Optional: 1GB Speicher, reduziert SSD&#x2F;SD-Karten-Verschleiß
        target: &#x2F;tmp&#x2F;cache
        tmpfs:
          size: 1000000000
    ports:
      - &amp;quot;5000:5000&amp;quot;
      - &amp;quot;8554:8554&amp;quot; # RTSP feeds
      - &amp;quot;8555:8555&#x2F;tcp&amp;quot; # WebRTC über tcp
      - &amp;quot;8555:8555&#x2F;udp&amp;quot; # WebRTC über udp
    environment:
      FRIGATE_RTSP_PASSWORD: &amp;quot;******&amp;quot;
&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Wichtige Konfigurationspunkte in dieser Docker-Compose-Datei:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Privileged-Modus&lt;&#x2F;strong&gt; und &lt;strong&gt;Device-Mappings&lt;&#x2F;strong&gt;: Erforderlich für Hardwarezugriff (TPU, Kameras)&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Shared Memory Size&lt;&#x2F;strong&gt;: Zugewiesen für effiziente Video-Frame-Verarbeitung&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Port-Mappings&lt;&#x2F;strong&gt;: Macht Frigate&#x27;s Web-UI (5000) und RTSP-Streams (8554) zugänglich&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Volume-Mounts&lt;&#x2F;strong&gt;: Persistiert Aufnahmen, Konfiguration und Datenbank&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h3 id=&quot;Frigate-Konfigurationsdatei&quot;&gt;Frigate-Konfigurationsdatei&lt;&#x2F;h3&gt;
&lt;p&gt;Frigate benötigt eine YAML-Konfigurationsdatei, um Kameras, Detektoren und Detektionszonen zu definieren. Diese Datei am Pfad erstellen, der in der docker-compose-Datei angegeben wurde (z.B. &lt;code&gt;&#x2F;home&#x2F;aron&#x2F;frigate&#x2F;config.yml&lt;&#x2F;code&gt;).&lt;&#x2F;p&gt;
&lt;blockquote class=&quot;markdown-alert-note&quot;&gt;
&lt;p&gt;Dies ist nur einmal notwendig. Danach kann man die Konfiguration in der GUI ändern.&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;p&gt;Hier ist eine funktionierende Konfiguration mit der Coral TPU:&lt;&#x2F;p&gt;
&lt;pre&gt;&lt;code data-lang=&quot;yaml&quot;&gt;mqtt:
  enabled: False

detectors:
  cpu1:
    type: cpu
    num_threads: 3
  coral_pci:
    type: edgetpu
    device: pci

cameras:
  cam1: # &amp;lt;++++++ Kamera benennen
    ffmpeg:
      hwaccel_args: preset-rpi-64-h264
      inputs:
        - path: rtsp:&#x2F;&#x2F;192.168.1.58:8900&#x2F;cam1
          roles:
            - detect
  cam2: # &amp;lt;++++++ Kamera benennen
    ffmpeg:
      hwaccel_args: preset-rpi-64-h264
      inputs:
        - path: rtsp:&#x2F;&#x2F;192.168.1.58:8900&#x2F;cam2
          roles:
            - detect
    detect:
      enabled: True # &amp;lt;+++- Detektion deaktivieren bis funktionierende Kamera-Feeds vorhanden
      width: 1280 # &amp;lt;+++- für Kameraauflösung aktualisieren
      height: 720 # &amp;lt;+++- für Kameraauflösung aktualisieren
&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Diese Konfiguration:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Deaktiviert MQTT&lt;&#x2F;strong&gt;: Vereinfacht Setup für rein lokalen Betrieb&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Definiert zwei Detektoren&lt;&#x2F;strong&gt;: Einen Coral-TPU-Detektor (&lt;code&gt;coral&lt;&#x2F;code&gt;) und einen CPU-Fallback&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Verwendet Standard-Detektionsmodell&lt;&#x2F;strong&gt;: Frigate enthält ein vortrainiertes Modell&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Konfiguriert zwei Kameras&lt;&#x2F;strong&gt;: Beide auf 1280x720-Auflösung eingestellt&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Verwendet Hardware-Beschleunigung&lt;&#x2F;strong&gt;: &lt;code&gt;preset-rpi-64-h264&lt;&#x2F;code&gt; für Raspberry Pi 5&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Detektionszonen&lt;&#x2F;strong&gt;: Nur aktivieren, wenn Kamera-Feeds ordnungsgemäß funktionieren&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h2 id=&quot;MediaMTX_Setup&quot;&gt;MediaMTX Setup&lt;&#x2F;h2&gt;
&lt;p&gt;MediaMTX ist ein Echtzeit-Medienserver, der das Streaming von den Raspberry-Pi-Kameras zu Frigate handhabt. Es ist notwendig, weil Frigate &lt;code&gt;libcamera&lt;&#x2F;code&gt; (den modernen Raspberry Pi Kamera-Stack) nicht direkt unterstützt.&lt;&#x2F;p&gt;
&lt;p&gt;MediaMTX direkt auf dem System installieren (nicht via Docker - die Docker-Version hat Kompatibilitätsprobleme mit libcamera).&lt;&#x2F;p&gt;
&lt;blockquote class=&quot;markdown-alert-warning&quot;&gt;
&lt;p&gt;Chip-Architektur beim Download doppelt prüfen - dies verursachte mir erhebliche
Kopfschmerzen beim Setup.&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;p&gt;MediaMTX herunterladen und installieren:&lt;&#x2F;p&gt;
&lt;pre&gt;&lt;code data-lang=&quot;zsh&quot;&gt;mkdir mediamtx
cd mediamtx
wget https:&#x2F;&#x2F;github.com&#x2F;bluenviron&#x2F;mediamtx&#x2F;releases&#x2F;download&#x2F;v1.5.0&#x2F;mediamtx_v1.5.0_linux_arm64v8.tar.gz

tar xzvf mediamtx_v1.5.0_linux_arm64v8.tar.gz &amp;amp;&amp;amp; rm mediamtx_v1.5.0_linux_arm64v8.tar.gz
&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;h3 id=&quot;MediaMTX-Konfiguration&quot;&gt;MediaMTX-Konfiguration&lt;&#x2F;h3&gt;
&lt;p&gt;Die &lt;code&gt;mediamtx.yml&lt;&#x2F;code&gt;-Datei bearbeiten, um Kamera-Streams zu konfigurieren. Die untenstehende Konfiguration verwendet &lt;code&gt;rpicam-vid&lt;&#x2F;code&gt; (Raspberry Pis modernes Kamera-Tool), das durch FFmpeg geleitet wird, um RTSP-Streams zu erstellen.&lt;&#x2F;p&gt;
&lt;p&gt;Folgendes zum &lt;code&gt;paths&lt;&#x2F;code&gt;-Abschnitt in &lt;code&gt;mediamtx.yml&lt;&#x2F;code&gt; hinzufügen:&lt;&#x2F;p&gt;
&lt;pre&gt;&lt;code data-lang=&quot;yaml&quot;&gt;paths:
 cam1:
   runOnInit: bash -c &amp;#39;rpicam-vid -t 0 --camera 0 --nopreview --codec yuv420 --width 1280 --height 720 --inline --listen -o - | ffmpeg -f rawvideo -pix_fmt yuv420p -s:v 1280x720 -i &#x2F;dev&#x2F;stdin -c:v libx264 -preset ultrafast -tune zerolatency -f rtsp rtsp:&#x2F;&#x2F;localhost:$RTSP_PORT&#x2F;$MTX_PATH&amp;#39;
   runOnInitRestart: yes
 cam2:
   runOnInit: bash -c &amp;#39;rpicam-vid -t 0 --camera 1 --nopreview --codec yuv420 --width 1280 --height 720 --inline --listen -o - | ffmpeg -f rawvideo -pix_fmt yuv420p -s:v 1280x720 -i &#x2F;dev&#x2F;stdin -c:v libx264 -preset ultrafast -tune zerolatency -f rtsp rtsp:&#x2F;&#x2F;localhost:$RTSP_PORT&#x2F;$MTX_PATH&amp;#39;
   runOnInitRestart: yes
&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Diese Konfiguration:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;cam1&lt;&#x2F;code&gt; und &lt;code&gt;cam2&lt;&#x2F;code&gt;&lt;&#x2F;strong&gt;: Definieren zwei Kamerapfade&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;rpicam-vid&lt;&#x2F;code&gt;&lt;&#x2F;strong&gt;: Erfasst YUV420-Video von Raspberry-Pi-Kameras&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;ffmpeg&lt;&#x2F;code&gt;&lt;&#x2F;strong&gt;: Transkodiert das Rohvideo zu H.264-RTSP-Stream&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;runOnInitRestart: yes&lt;&#x2F;code&gt;&lt;&#x2F;strong&gt;: Startet Stream automatisch neu, falls er fehlschlägt&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h3 id=&quot;Port-Konfiguration&quot;&gt;Port-Konfiguration&lt;&#x2F;h3&gt;
&lt;p&gt;Standard-RTSP-Port ändern, um Konflikte mit Frigate zu vermeiden:&lt;&#x2F;p&gt;
&lt;p&gt;In &lt;code&gt;mediamtx.yml&lt;&#x2F;code&gt; ändern:&lt;&#x2F;p&gt;
&lt;pre&gt;&lt;code data-lang=&quot;yaml&quot;&gt;rtspAddress: :8554
&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Zu:&lt;&#x2F;p&gt;
&lt;pre&gt;&lt;code data-lang=&quot;yaml&quot;&gt;rtspAddress: :8900
&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Sonst gibt es einen Port-Konflikt mit Frigate.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;MediaMTX_starten&quot;&gt;MediaMTX starten&lt;&#x2F;h3&gt;
&lt;p&gt;MediaMTX im Vordergrund ausführen, um zu verifizieren, dass es funktioniert:&lt;&#x2F;p&gt;
&lt;pre&gt;&lt;code data-lang=&quot;zsh&quot;&gt;.&#x2F;mediamtx
&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Wenn keine Fehler auftreten, Streams mit VLC oder einem anderen RTSP-Client verifizieren:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;rtsp:&#x2F;&#x2F;airaspi.local:8900&#x2F;cam1&lt;&#x2F;code&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;code&gt;rtsp:&#x2F;&#x2F;airaspi.local:8900&#x2F;cam2&lt;&#x2F;code&gt;&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;Hinweis: Standard-RTSP-Port ist 8554, aber wir haben ihn in der Konfiguration auf 8900 geändert.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;Aktueller_Status_und_Performance&quot;&gt;Aktueller Status und Performance&lt;&#x2F;h2&gt;
&lt;h3 id=&quot;Was_funktioniert&quot;&gt;Was funktioniert&lt;&#x2F;h3&gt;
&lt;p&gt;Das System streamt erfolgreich von beiden Kameras mit 30fps und 720p-Auflösung. Die Coral Edge TPU führt Objektdetektion mit minimaler Latenz durch - die TPU selbst kommt nicht ins Schwitzen und behält durchgehend hohe Performance bei.&lt;&#x2F;p&gt;
&lt;p&gt;Laut Frigate-Dokumentation kann die TPU bis zu 10 Kameras handhaben, es gibt also erheblichen Spielraum für Erweiterung.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;Aktuelle_Probleme&quot;&gt;Aktuelle Probleme&lt;&#x2F;h3&gt;
&lt;p&gt;Es gibt jedoch mehrere signifikante Probleme, die das System behindern:&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;1. Frigate Display-Limitierungen&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;p&gt;Frigate begrenzt die Display-FPS auf 5, was deprimierend anzusehen ist, besonders da die TPU nicht einmal ins Schwitzen kommt. Die Hardware ist eindeutig zu viel mehr fähig, aber Software-Limitierungen halten sie zurück.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;2. Stream-Stabilitätsprobleme&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;p&gt;Der Stream ist völlig unberechenbar und droppt ständig Frames. Ich habe manchmal Detektions-FPS von nur 0,2 beobachtet, aber die TPU-Geschwindigkeit sollte definitiv nicht der Flaschenhals sein. Eine mögliche Lösung könnte sein, die Kameras an ein separates Gerät anzuschließen und von dort zu streamen.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;3. Coral-Software-Aufgabe&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;p&gt;Das größte Problem ist, dass Google das Coral-Ökosystem scheinbar aufgegeben hat, obwohl sie gerade neue Hardware dafür veröffentlicht haben. Ihr aktuellster Python-Build unterstützt nur Python 3.9.&lt;&#x2F;p&gt;
&lt;p&gt;Speziell scheint &lt;code&gt;pycoral&lt;&#x2F;code&gt; das Problem zu sein - ohne ein ordentliches Update bin ich auf Debian 10 mit Python 3.7.3 beschränkt. Das ist mies. Es gibt Custom-Wheels, aber nichts, das plug-and-play zu sein scheint.&lt;&#x2F;p&gt;
&lt;p&gt;Dies schränkt die Fähigkeit, moderne Software und Bibliotheken mit dem System zu nutzen, erheblich ein.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;Reflexionen_und_Lessons_Learned&quot;&gt;Reflexionen und Lessons Learned&lt;&#x2F;h2&gt;
&lt;h3 id=&quot;Hardware-Entscheidungen&quot;&gt;Hardware-Entscheidungen&lt;&#x2F;h3&gt;
&lt;p&gt;&lt;strong&gt;Die M.2 E Key-Wahl&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;p&gt;Die Entscheidung, die M.2 E Key-Version zu nehmen, um Geld zu sparen, anstatt mehr für die USB-Version auszugeben, war ein riesiger Fehler. Bitte tu dir selbst einen Gefallen und gib die zusätzlichen 40 Euro aus.&lt;&#x2F;p&gt;
&lt;p&gt;Technisch ist sie wahrscheinlich schneller und besser für Dauerbetrieb, aber ich habe den Vorteil davon noch nicht gespürt. Die USB-Version hätte wesentlich mehr Flexibilität und einfacheres Debugging geboten.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;Zukünftige_Entwicklung&quot;&gt;Zukünftige Entwicklung&lt;&#x2F;h2&gt;
&lt;p&gt;Mehrere Verbesserungen und Experimente sind geplant, um dieses System zu erweitern:&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;Dokumentation und visuelle Hilfsmittel&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Bilder und Screenshots zu diesem Build-Protokoll hinzufügen, um es einfacher nachzuvollziehen&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;&lt;strong&gt;Mobile-Stream-Integration&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Prüfen, ob &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;vdo.ninja&quot;&gt;vdo.ninja&lt;&#x2F;a&gt; ein praktikabler Weg ist, mobile Streams hinzuzufügen, um Smartphone-Kamera-Integration und -Evaluierung zu ermöglichen&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;&lt;strong&gt;MediaMTX libcamera-Unterstützung&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Die MediaMTX-Entwickler*innen bezüglich libcamera-Unterstützung kontaktieren, was den aktuellen &lt;code&gt;rpicam-vid&lt;&#x2F;code&gt;-Workaround eliminieren würde. Ich vermute, dass in der aktuellen Pipeline einiges an Performance verloren geht.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;&lt;strong&gt;Frigate-Konfigurationsverfeinerung&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Die Frigate-Konfiguration optimieren, um Snapshots zu aktivieren und möglicherweise eine Bild-&#x2F;Videodatenbank zum späteren Training benutzerdefinierter Modelle aufzubauen&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;&lt;strong&gt;Speichererweiterung&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Sich um das Anbringen einer externen SSD kümmern und die Videodateien darauf für Langzeitspeicherung und -analyse speichern&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;&lt;strong&gt;Datenexport-Fähigkeiten&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Einen Weg finden, die Landmarkenpunkte von Frigate zu exportieren, möglicherweise via OSC (wie in meinem &lt;a href=&quot;&#x2F;project&#x2F;pose2art&#x2F;&quot;&gt;pose2art&lt;&#x2F;a&gt;-Projekt) für kreative Anwendungen zu senden&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;&lt;strong&gt;Dual-TPU-Zugriff&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Einen anderen HAT finden, der Zugriff auf die andere TPU ermöglicht - ich habe die Dual-Version, kann aber aufgrund von Hardware-Einschränkungen derzeit nur auf 1 der 2 TPUs zugreifen&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
</content>
        
    </entry>
</feed>
