{"id":620,"date":"2021-05-07T08:10:48","date_gmt":"2021-05-07T08:10:48","guid":{"rendered":"http:\/\/www.peakproductions.at\/sides\/peakproductions\/?p=620"},"modified":"2021-05-16T06:55:29","modified_gmt":"2021-05-16T06:55:29","slug":"usb-mikroskop-am-raspberry-pi-als-standalone-system","status":"publish","type":"post","link":"https:\/\/www.peakproductions.at\/sides\/peakproductions\/index.php\/2021\/05\/07\/usb-mikroskop-am-raspberry-pi-als-standalone-system\/","title":{"rendered":"USB Mikroskop am Raspberry Pi als standalone System"},"content":{"rendered":"\n<p>Ich habe bei mir im B\u00fcro einen Monitor an dem direkt ein Raspberry Pi angeschlossen ist. Diesen Monitor verwende ich oft zum Anleitungen lesen oder Schaltpl\u00e4ne angezeigt zu bekommen. Der Raspberry Pi h\u00e4ngt daran, damit ich nicht immer den Computer sinnlos starten muss. Bisher hatte ich mein USB-Mikroskop mit meinem Handy gekoppelt, das ist aber ein sehr kleines Bild, daher wollte ich es mit dem Raspberry Pi koppeln und den Monitor als Anzeige nutzen. Das wird vom Hersteller nat\u00fcrlich nicht unterst\u00fctzt, offiziell ist es nichtmal mit Linux kompatibel. Nach ein wenig Recherche konnte ich aber alles zum Laufen bekommen und kann hier die Anleitung pr\u00e4sentieren ;-).<\/p>\n\n\n\n<p>Falls ihr noch keinen Raspberry Pi eingerichtet habt, kann diese <strong><span class=\"has-inline-color has-accent-color\"><a href=\"http:\/\/www.peakproductions.at\/sides\/peakproductions\/index.php\/2021\/03\/16\/raspberry-pi-betriebsystem-installieren-mit-dem-wlan-verbinden-und-ssh-aktivieren-ohne-tastatur-und-maus\/\" data-type=\"post\" data-id=\"352\">Anleitung<\/a><\/span><\/strong> n\u00fctzlich sein, darin steht ebenfalls wie ssh direkt mit aktiviert werden kann. Alles was hier in der Anleitung gezeigt wird, funktioniert sowohl mit ssh oder auch direkt am Raspberry Pi Terminal. \u00dcbrigens wird ssh mittlerweile auch nativ unter Windows 10 unterst\u00fctzt, daf\u00fcr muss lediglich ssh &lt;Benutzer&gt;@&lt;IP-Adresse&gt; in der cmd eingegeben werden.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Verbinden des USB-Mikroskops<\/h2>\n\n\n\n<p>Das Mikroskop kann an einen beliebigen USB-Anschluss am Raspberry Pi angeschlossen werden. Mein Modell hat einen Taster mit dem man es anschalten muss, ansonsten wird es nicht erkannt.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Livebild erzeugen<\/h2>\n\n\n\n<h5 class=\"wp-block-heading\">Im ersten Schritt schauen wir welche Aufnahmeger\u00e4te mit dem Raspberry Pi verbunden sind. Dazu folgender Befehl:<\/h5>\n\n\n\n<pre class=\"wp-block-code\"><code>v4l2-ctl --list-devices<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"739\" height=\"483\" src=\"http:\/\/www.peakproductions.at\/sides\/peakproductions\/wp-content\/uploads\/2021\/05\/image.png\" alt=\"\" class=\"wp-image-621\" srcset=\"https:\/\/www.peakproductions.at\/sides\/peakproductions\/wp-content\/uploads\/2021\/05\/image.png 739w, https:\/\/www.peakproductions.at\/sides\/peakproductions\/wp-content\/uploads\/2021\/05\/image-300x196.png 300w\" sizes=\"auto, (max-width: 739px) 100vw, 739px\" \/><figcaption>Die anderen Ger\u00e4te wie video 10 &#8211; 16 k\u00f6nnen ignoriert werden<\/figcaption><\/figure>\n\n\n\n<p>Die ersten Ger\u00e4te k\u00f6nnen ignoriert werden. Interessant ist das Ger\u00e4t mit der Bezeichnung usb-3f&#8230; Dadurch wissen wir, dass die Kamera unter \/dev\/video0 erreichbar ist. <\/p>\n\n\n\n<h5 class=\"wp-block-heading\">Damit wir auch wissen welche Aufl\u00f6sung(en) unterst\u00fctzt werden, wird folgender Befehl ben\u00f6tigt. Wobei -f v4l2 f\u00fcr das Format Video for Linux steht und mit -i wird das USB-Mikroskop als Input gepr\u00fcft:<\/h5>\n\n\n\n<pre class=\"wp-block-code\"><code>ffmpeg -f v4l2 -list_formats all -i \/dev\/video0<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"740\" height=\"483\" src=\"http:\/\/www.peakproductions.at\/sides\/peakproductions\/wp-content\/uploads\/2021\/05\/image-1.png\" alt=\"\" class=\"wp-image-622\" srcset=\"https:\/\/www.peakproductions.at\/sides\/peakproductions\/wp-content\/uploads\/2021\/05\/image-1.png 740w, https:\/\/www.peakproductions.at\/sides\/peakproductions\/wp-content\/uploads\/2021\/05\/image-1-300x196.png 300w\" sizes=\"auto, (max-width: 706px) 89vw, (max-width: 767px) 82vw, 740px\" \/><figcaption>Die Kamera streamt mit mjpeg und 1280&#215;720 Pixeln<\/figcaption><\/figure>\n\n\n\n<p>Nach einer lange Liste von Befehlen, die automatisch ausgef\u00fchrt werden, kommt \u00fcber der roten Schrift die Aufl\u00f6sung zum Vorschein. In meinem Fall ist es 1280&#215;720.<\/p>\n\n\n\n<div class=\"wp-block-columns is-layout-flex wp-container-core-columns-is-layout-9d6595d7 wp-block-columns-is-layout-flex\">\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\" style=\"flex-basis:100%\">\n<p><span class=\"has-inline-color has-accent-color\">Alle diese Optionen k\u00f6nnen \u00fcbrigens mit den man-pages angeschaut werden, die mit jedem Linux-System mitgeliefert werden. Der Befehl dazu ist &#8222;man &lt;Programmname&gt;&#8220;. Also in diesem Fall &#8222;man ffmpeg&#8220;. Mit &#8222;q&#8220; kann die Anleitung wieder geschlossen werden.<\/span><\/p>\n<\/div>\n<\/div>\n\n\n\n<h5 class=\"wp-block-heading\">Jetzt muss nur noch das Livevideo gestartet werden<\/h5>\n\n\n\n<p>Daf\u00fcr verwende ich ffplay, was ein einfacher Videoplayer ist. Mit -f wird das Format v4l2 erzwungen. -video_size gibt die Aufl\u00f6sung vor und -i \/dev\/video0 ist das Input-device. Damit alles noch im Vollbildmodus gestartet wird, verwende ich den Befehl -fs.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ffplay -f v4l2 -video_size 1280x720 -i \/dev\/video0 -fs<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Bonus<\/h3>\n\n\n\n<p>Soll der Raspberry Pi nur f\u00fcr das Mikroskop laufen. Also wirklich als standalone System, dann kann die Kamera mit dem passenden Video-Player in den Autostart gezogen werden. Dazu sind folgende Schritte notwendig:<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Autostart Config anpassen:<\/h4>\n\n\n\n<p>Die Konfigdatei ist unter \/etc\/xdg\/lxsession\/LXDE-pi\/autostart abgelegt.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo nano \/etc\/xdg\/lxsession\/LXDE-pi\/autostart<\/code><\/pre>\n\n\n\n<p>in der letzten Zeile der Konfigdatei folgenden Befehl einf\u00fcgen:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>@ffplay -f v4l2 -video_size 1280x720 -i \/dev\/video0 -fs<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"739\" height=\"481\" src=\"http:\/\/www.peakproductions.at\/sides\/peakproductions\/wp-content\/uploads\/2021\/05\/image-2.png\" alt=\"\" class=\"wp-image-623\" srcset=\"https:\/\/www.peakproductions.at\/sides\/peakproductions\/wp-content\/uploads\/2021\/05\/image-2.png 739w, https:\/\/www.peakproductions.at\/sides\/peakproductions\/wp-content\/uploads\/2021\/05\/image-2-300x195.png 300w\" sizes=\"auto, (max-width: 739px) 100vw, 739px\" \/><figcaption>Der Nano-Editor kann \u00fcbrigens mit strg+X verlassen werden<\/figcaption><\/figure>\n\n\n\n<p>Jetzt wird das USB-Mikroskop bei jedem Start automatisch im Vollbildmodus mit der Aufl\u00f6sung 1280&#215;720 gestartet. Das selbe Prozedere geht nat\u00fcrlich auch mit einer USB-Webcam. Dazu werde ich einen eigenen Beitrag schreiben. Viel Spa\u00df beim ausprobieren und falls es Probleme gibt, einfach ein Kommentar oder mich direkt anschreiben \ud83d\ude42<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Fotos machen<\/h2>\n\n\n\n<p>Es k\u00f6nnen \u00fcbrigens mit ein paar einfachen Schritten Bilder gemacht und gespeichert werden. Unter <strong><span class=\"has-inline-color has-accent-color\">RaspberryPi.org<\/span><\/strong> gibt es dazu eine sch\u00f6ne Schritt f\u00fcr Schritt Anleitung. <\/p>\n","protected":false},"excerpt":{"rendered":"<p>Ich habe bei mir im B\u00fcro einen Monitor an dem direkt ein Raspberry Pi angeschlossen ist. Diesen Monitor verwende ich oft zum Anleitungen lesen oder Schaltpl\u00e4ne angezeigt zu bekommen. Der Raspberry Pi h\u00e4ngt daran, damit ich nicht immer den Computer sinnlos starten muss. Bisher hatte ich mein USB-Mikroskop mit meinem Handy gekoppelt, das ist aber &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.peakproductions.at\/sides\/peakproductions\/index.php\/2021\/05\/07\/usb-mikroskop-am-raspberry-pi-als-standalone-system\/\" class=\"more-link\"><span class=\"screen-reader-text\">\u201eUSB Mikroskop am Raspberry Pi als standalone System\u201c<\/span> weiterlesen<\/a><\/p>\n","protected":false},"author":1,"featured_media":624,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[15,5],"tags":[],"class_list":["post-620","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-linux-tipps-und-tricks","category-raspberry-pi"],"_links":{"self":[{"href":"https:\/\/www.peakproductions.at\/sides\/peakproductions\/index.php\/wp-json\/wp\/v2\/posts\/620","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.peakproductions.at\/sides\/peakproductions\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.peakproductions.at\/sides\/peakproductions\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.peakproductions.at\/sides\/peakproductions\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.peakproductions.at\/sides\/peakproductions\/index.php\/wp-json\/wp\/v2\/comments?post=620"}],"version-history":[{"count":6,"href":"https:\/\/www.peakproductions.at\/sides\/peakproductions\/index.php\/wp-json\/wp\/v2\/posts\/620\/revisions"}],"predecessor-version":[{"id":647,"href":"https:\/\/www.peakproductions.at\/sides\/peakproductions\/index.php\/wp-json\/wp\/v2\/posts\/620\/revisions\/647"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.peakproductions.at\/sides\/peakproductions\/index.php\/wp-json\/wp\/v2\/media\/624"}],"wp:attachment":[{"href":"https:\/\/www.peakproductions.at\/sides\/peakproductions\/index.php\/wp-json\/wp\/v2\/media?parent=620"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.peakproductions.at\/sides\/peakproductions\/index.php\/wp-json\/wp\/v2\/categories?post=620"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.peakproductions.at\/sides\/peakproductions\/index.php\/wp-json\/wp\/v2\/tags?post=620"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}