{"id":4698,"date":"2014-12-17T19:40:58","date_gmt":"2014-12-17T18:40:58","guid":{"rendered":"http:\/\/blog.wenzlaff.de\/?p=4698"},"modified":"2021-11-22T17:15:09","modified_gmt":"2021-11-22T16:15:09","slug":"raspberry-pi-wie-koennen-flugzeugdaten-in-fhem-in-real-time-echtzeit-angezeigt-werden","status":"publish","type":"post","link":"http:\/\/blog.wenzlaff.de\/?p=4698","title":{"rendered":"Raspberry Pi: Wie k\u00f6nnen Flugzeugdaten in Fhem in real-time (Echtzeit) angezeigt werden?"},"content":{"rendered":"<p>Da bei mir ein Fhem Home-Server l\u00e4uft, hatte ich die Idee, dort doch gleich die Flugdaten die von den Flugzeugtranspondern ausgesendet werden sch\u00f6n graphisch in <a href=\"https:\/\/de.wikipedia.org\/wiki\/Echtzeit\" title=\"echtzeit\" target=\"_blank\" rel=\"noopener noreferrer\">Echtzeit<\/a> anzuzeigen.<\/p>\n<p>Also wie kann eine Grafik in Fhem erstellt werden, die die aktuelle Anzahl der gerade empfangenen Flugzeuge anzeigt.<\/p>\n<p>Hier das Ergebniss, wo man deutlich sehen kann, das heute bis ca. 6 Uhr nur ca. 10 Flugzeuge flogen. Dann steigt der Flugverkehr rapide an:<br \/>\n<a href=\"http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2014\/12\/Bildschirmfoto-2014-12-17-um-18.42.04.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2014\/12\/Bildschirmfoto-2014-12-17-um-18.42.04.png\" alt=\"Fhem Flugdaten\" width=\"1289\" height=\"754\" class=\"aligncenter size-full wp-image-4699\" srcset=\"http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2014\/12\/Bildschirmfoto-2014-12-17-um-18.42.04.png 1289w, http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2014\/12\/Bildschirmfoto-2014-12-17-um-18.42.04-300x175.png 300w, http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2014\/12\/Bildschirmfoto-2014-12-17-um-18.42.04-1024x598.png 1024w, http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2014\/12\/Bildschirmfoto-2014-12-17-um-18.42.04-900x526.png 900w\" sizes=\"auto, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" \/><\/a><\/p>\n<p>Wie kann nun so eine Grafik, die sich automatisch aktualisiert erstellt werden.<\/p>\n<p>Zuerst einmal die Architektur als BPMN 2.0 Diagramm:<br \/>\n<figure id=\"attachment_4700\" aria-describedby=\"caption-attachment-4700\" style=\"width: 1550px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2014\/12\/twflug.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2014\/12\/twflug.png\" alt=\"Architektur TWFlug BPMN 2.0\" width=\"1550\" height=\"973\" class=\"size-full wp-image-4700\" srcset=\"http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2014\/12\/twflug.png 1550w, http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2014\/12\/twflug-300x188.png 300w, http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2014\/12\/twflug-1024x642.png 1024w, http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2014\/12\/twflug-900x564.png 900w\" sizes=\"auto, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" \/><\/a><figcaption id=\"caption-attachment-4700\" class=\"wp-caption-text\">Architektur TWFlug BPMN 2.0<\/figcaption><\/figure><\/p>\n<p>Es werden zwei Raspberry Pi ben\u00f6tigt. Auf dem einen l\u00e4uft der DUMP1090 Server mit der TWFlug Anwendung unter Java 1.8. Die TWFlug Anwendung l\u00e4uft ohne Gui, und schreibt alle 5 Minuten die Anzahl der empfangenen Flugzeuge in eine Datei. Diese Datei wird dann jede halbe Stunde per sFTP an den anderen Raspberry Pi gesendet und von Fhem eingelesen und als Grafik ausgegeben.<\/p>\n<p>TWFlug kann auch mit Gui auf einen Rechner gestartet werden und gibt dann als Tacho die Anzahl der Flugzeuge aus.<br \/>\n<figure id=\"attachment_4701\" aria-describedby=\"caption-attachment-4701\" style=\"width: 603px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2014\/12\/Bildschirmfoto-2014-12-17-um-18.44.49.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2014\/12\/Bildschirmfoto-2014-12-17-um-18.44.49.png\" alt=\"TWFlug Tacho\" width=\"603\" height=\"601\" class=\"size-full wp-image-4701\" srcset=\"http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2014\/12\/Bildschirmfoto-2014-12-17-um-18.44.49.png 603w, http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2014\/12\/Bildschirmfoto-2014-12-17-um-18.44.49-150x150.png 150w, http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2014\/12\/Bildschirmfoto-2014-12-17-um-18.44.49-300x300.png 300w, http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2014\/12\/Bildschirmfoto-2014-12-17-um-18.44.49-144x144.png 144w\" sizes=\"auto, (max-width: 603px) 100vw, 603px\" \/><\/a><figcaption id=\"caption-attachment-4701\" class=\"wp-caption-text\">TWFlug Tacho<\/figcaption><\/figure><\/p>\n<p>Das n\u00f6tige GPlot Script:<\/p>\n<pre class=\"lang:default decode:true \" >\/*\r\n   myFlug.gplot Version 1.0 vom 17.12.2014\r\n\r\n   Dieses GNU-Plot Script zeigt die Flugdaten von den empfangenen Transpondern an.\r\n\r\n   Copyright (C) 2014 Thomas Wenzlaff http:\/\/www.wenzlaff.de\r\n\r\n   This program is free software: you can redistribute it and\/or modify\r\n   it under the terms of the GNU General Public License as published by\r\n   the Free Software Foundation, either version 3 of the License, or\r\n   (at your option) any later version.\r\n\r\n   This program is distributed in the hope that it will be useful,\r\n   but WITHOUT ANY WARRANTY; without even the implied warranty of\r\n   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r\n   GNU General Public License for more details.\r\n\r\n   You should have received a copy of the GNU General Public License\r\n   along with this program.  If not, see {http:\/\/www.gnu.org\/licenses\/}.\r\n*\/\r\n\r\n# Die Logdatei sieht wie folgt aus:\r\n\r\n# 2014-12-05_07:05:58 flugdaten anzahl:29\r\n# 2014-12-05_07:10:58 flugdaten anzahl:23\r\n\r\nset terminal png transparent size &lt;SIZE&gt; crop\r\nset output '&lt;OUT&gt;.png'\r\nset xdata time\r\nset timefmt \"%Y-%m-%d_%H:%M:%S\"\r\nset xlabel \" \"\r\nset title 'Empfangene Flugzeuge'\r\nset ytics \r\nset y2tics \r\nset grid ytics y2tics\r\nset ylabel \"Anzahl Flugzeuge\"\r\nset y2label \"Anzahl Flugzeuge\"\r\n\r\n#FileLog 4:flugdaten anzahl:0:\r\n\r\nplot \"&lt;IN&gt;\" using 1:2 axes x1y2 title 'Anzahl Flugzeuge' ls l0 lw 2 with lines\r\n\r\n<\/pre>\n<p>TWFlug schreibt die Daten in eine Logdatei mit folgenden Format, z.B.:<\/p>\n<pre class=\"lang:default decode:true \" >\r\n2014-12-17_17:31:08 flugdaten anzahl: 39\r\n2014-12-17_17:36:08 flugdaten anzahl: 49\r\n2014-12-17_17:41:08 flugdaten anzahl: 36\r\n2014-12-17_17:46:08 flugdaten anzahl: 34\r\n2014-12-17_17:51:08 flugdaten anzahl: 36\r\n2014-12-17_17:56:08 flugdaten anzahl: 42\r\n2014-12-17_18:01:08 flugdaten anzahl: 41<\/pre>\n<p>TWFlug kennt bisher die folgenden Parameter:<\/p>\n<pre class=\"lang:default decode:true \" >usage: TWFlug\r\n -c,--copy-time &lt;arg&gt;            copy time in Minuten (default: 60\r\n                                 Minuten)\r\n -d,--dest-file &lt;ziel-datei&gt;     destination file name (default:\r\n                                 \/home\/pi\/fhem\/log\/flugdaten-YYYY-MM.log)\r\n -h,--help                       print help and exit\r\n -height,--window-height &lt;arg&gt;   set window hight (default: 600)\r\n -i,--ip                         ip adress from DUMP1090 (default:\r\n                                 0.0.0.0)\r\n -ip,--ziel-ip &lt;arg&gt;             ip adress for copy destination (default:\r\n                                 pi-home)\r\n -k,--copy                       copy output file to destination (default:\r\n                                 false)\r\n -max,--max-count &lt;arg&gt;          set max count value (default: 50)\r\n -min,--min-count &lt;arg&gt;          set min count value (default: 0)\r\n -n,--no-gui                     display no GUI. Only logfile output\r\n                                 (default: false)\r\n -o,--outputfile &lt;file&gt;          use given file for DUMP output (default:\r\n                                 flugdaten-YYYY-MM.log)\r\n -p,--port &lt;arg&gt;                 port from DUMP1090 (default: 30003)\r\n -psw,--ziel-passwort &lt;arg&gt;      passwort from destination User\r\n -r,--refresh-time &lt;arg&gt;         refresh time in ms (default: 300000 ms =\r\n                                 5 Minuten)\r\n -user,--ziel-user &lt;arg&gt;         destination User (default: pi\r\n -v,--version                    print the version information and exit\r\n -width,--window-width &lt;arg&gt;     set window with (default: 600)<\/pre>\n<p>Welche fehlen noch?<\/p>\n<p>Hinweise zu <a href=\"http:\/\/blog.wenzlaff.de\/?p=4647\" title=\"TWFlug-seite\" target=\"_blank\" rel=\"noopener noreferrer\">TWFlug<\/a> <a href=\"http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2014\/12\/Bildschirmfoto-2014-12-17-um-18.44.58.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2014\/12\/Bildschirmfoto-2014-12-17-um-18.44.58.png\" alt=\"TWFlug Icon\" width=\"86\" height=\"87\" class=\"aligncenter size-full wp-image-4703\" \/><\/a>und <a href=\"http:\/\/blog.wenzlaff.de\/?s=dump1090\" title=\"dump-1090\" target=\"_blank\" rel=\"noopener noreferrer\">DUMP1090<\/a> k\u00f6nnen auf diesem Blog gefunden werden.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Da bei mir ein Fhem Home-Server l\u00e4uft, hatte ich die Idee, dort doch gleich die Flugdaten die von den Flugzeugtranspondern ausgesendet werden sch\u00f6n graphisch in Echtzeit anzuzeigen. Also wie kann eine Grafik in Fhem erstellt werden, die die aktuelle Anzahl der gerade empfangenen Flugzeuge anzeigt. Hier das Ergebniss, wo man deutlich sehen kann, das heute &hellip; <\/p>\n<p class=\"link-more\"><a href=\"http:\/\/blog.wenzlaff.de\/?p=4698\" class=\"more-link\"><span class=\"screen-reader-text\">\u201eRaspberry Pi: Wie k\u00f6nnen Flugzeugdaten in Fhem in real-time (Echtzeit) angezeigt werden?\u201c <\/span>weiterlesen<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[220,1430,852,5,79,1023],"tags":[1422,1844,2178,1030,1810,1845,1832],"class_list":["post-4698","post","type-post","status-publish","format-standard","hentry","category-anleitung","category-bpmn","category-heimautomatisierung","category-java","category-programmierung","category-raspberry-pi","tag-bpmn-2-0","tag-fluganzahl","tag-java","tag-rpi","tag-transponder","tag-transponder-twflug","tag-twflug"],"_links":{"self":[{"href":"http:\/\/blog.wenzlaff.de\/index.php?rest_route=\/wp\/v2\/posts\/4698","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/blog.wenzlaff.de\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/blog.wenzlaff.de\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/blog.wenzlaff.de\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/blog.wenzlaff.de\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4698"}],"version-history":[{"count":0,"href":"http:\/\/blog.wenzlaff.de\/index.php?rest_route=\/wp\/v2\/posts\/4698\/revisions"}],"wp:attachment":[{"href":"http:\/\/blog.wenzlaff.de\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4698"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/blog.wenzlaff.de\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4698"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/blog.wenzlaff.de\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4698"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}