Unterschiede

Hier werden die Unterschiede zwischen zwei Versionen angezeigt.

Link zu dieser Vergleichsansicht

Beide Seiten der vorigen Revision Vorhergehende Überarbeitung
Nächste Überarbeitung
Vorhergehende Überarbeitung
wetter:boltek:stormforce_xr [04.05.2012 09:24. ] – [Definition] djangowetter:boltek:stormforce_xr [31.10.2023 18:42. ] (aktuell) – Externe Bearbeitung 127.0.0.1
Zeile 1: Zeile 1:
 +====== StormForce XR: Installation und Konfiguration unter CentOS 6.x ======
 +===== Hardware =====
 +==== Boltec LD-250 ====
 +Die Installation des Blitzdedectors gestaltet sich relativ einfach. Es muss lediglich die Antenne (**schwarzer 4-eckiger Block**) an geeigneter Stelle montiert und die richtige Seite gen Norden ausgerichtet werden. Zum Verbinden der Antenne mit dem LD-250 nimmt man am besten ein abgeschirmtes Netzwerkkabel und nicht da der Lieferung beiligendem ungeschirmten Kabels. 
 +
 +Die RS232-Schnittstelle des LD-250 verbindet man dann mit zugehörigen Port unseres Servers. Zu guter Letzt wird dann das Netzteil mit den LD-250 verbunden.
 +
 +==== USB-RS232 Adapter ====
 +Da am Wetterserver (**//pml010010.nausch.org//**) kein freier RS232-I/O-Port mehr frei war/ist, wird die Blitzerkennungsbox über einen USB-RS232 Adpapter angeschlossen.
 +
 +Die Kunst besteht nun darin, einen passenden Adapter ausfindig zu machen, der ohne größere Systemanpassung (Selbstbau von irgendwelchen Kernlemodulen) "out of the box" von unserem CentOS 6.x Server erkannt wird.
 +
 +Da der von Boltek mitgelieferte ordendlich Zicken machte, holte ich mir aus dem Swap-Market einen weiteren, der - siehe da - direkt unterstützt wird.
 +
 +<code>Apr 30 00:21:27 pml010010 kernel: usb 6-1.1: new full speed USB device using uhci_hcd and address 24
 +Apr 30 00:21:27 pml010010 kernel: usb 6-1.1: New USB device found, idVendor=067b, idProduct=2303
 +Apr 30 00:21:27 pml010010 kernel: usb 6-1.1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
 +Apr 30 00:21:27 pml010010 kernel: usb 6-1.1: Product: USB-Serial Controller
 +Apr 30 00:21:27 pml010010 kernel: usb 6-1.1: Manufacturer: Prolific Technology Inc.
 +Apr 30 00:21:27 pml010010 kernel: usb 6-1.1: configuration #1 chosen from 1 choice
 +Apr 30 00:21:27 pml010010 kernel: pl2303 6-1.1:1.0: pl2303 converter detected
 +Apr 30 00:21:27 pml010010 kernel: usb 6-1.1: pl2303 converter now attached to ttyUSB0
 +</code>
 +
 +Damit unser Stormforce-User **weather** auch später auf dieses Device Zugreifen kann, ändern wir noch gleich die Berechtigung auf diese Device-Datei.
 +
 +   # chown weather:dialout /dev/ttyUSB0
 +
 +
 +
 +===== Pakete (nach)installieren =====
 +Für den reibungslosen Betrieb von [[https://stormforce.sourceforge.net/|Stormforce]] für unseren Blitzdedector **LD-250** benötigen wir noch neben der bereits vorhandenen Grundinstallation:
 +  # yum list python -y
 +  python.i386                              installed
 +
 +Gemäß der **//README//** aus dem aktuellen **//stormforce-xr//** Paket installieren wir nun die für unsere Installationsumgebung benötigten Pakete nach.
 +
 +
 +  - Für den Server-Part der Software: <code># yum install python-twisted -y</code> Für die beiden Pakete **python-psycopg2** und  **pyserial** müssen wir etwas Hand anlegen, da es weder im Base- noch im Epel-Repository ein passendes Paket gibt. Daher müssen wir in den sauren Apfel beissen und das Paket direkt aus einem uns vertrauenswürdig eingestuften Quelle laden. Wir laden uns diese Paket also wie folgt auf unseren Rechner: <code># cd /usr/local/src/packages</code> <code># wget https://www.city-fan.org/ftp/contrib/bittorrent/Twisted/RHEL-6/pyserial-2.6-1.rhel6.noarch.rpm</code> <code># wget https://yum.postgresql.org/9.1/redhat/rhel-6-x86_64/python-psycopg2-2.4.4-1.rhel6.x86_64.rpm</code> <code># wget https://yum.postgresql.org/9.1/redhat/rhel-6-x86_64/postgresql91-libs-9.1.3-1PGDG.rhel6.x86_64.rpm</code> Anschließend installieren wir diese besonderen Paket:<code># yum install --nogpgcheck localinstall /usr/local/src/packages/pyserial-2.6-1.rhel6.noarch.rpm -y</code><code># yum install --nogpgcheck localinstall /usr/local/src/packages/postgresql91-libs-9.1.3-1PGDG.rhel6.x86_64.rpm -y</code> <code># yum install --nogpgcheck localinstall /usr/local/src/packages/python-psycopg2-2.4.4-1.rhel6.x86_64.rpm -y</code>
 +  - Für den Client-Teil der Anwendung: <code># yum install pygame -y</code>
 +
 +/**  # yum install MySQL-python python-game python-numeric ImageMagick 
 +Für das Paket **pyserial** müssen wir etwas Hand anlegen, da es weder im Base- noch im Epel-Repository ein passendes Paket gibt. Daher müssen wir in den sauren Apfel beissen und das Paket direkt aus einem uns vertrauenswürdig eingestuften Quelle laden. Wir laden uns diese Paket also wie folgt auf unseren Rechner:
 +  # cd /usr/local/src/packages
 +  # wget https://www.city-fan.org/ftp/contrib/bittorrent/Twisted/RHEL-6/pyserial-2.6-1.rhel6.noarch.rpm
 +  
 +Anschließend installieren wir diese besondere Paket:
 +   # yum install --nogpgcheck localinstall /usr/local/src/packages/pyserial-2.6-1.rhel6.noarch.rpm
 +**/
 +
 +===== PostgreSQL-Datenbank =====
 +Im Gegensatz zum Entwicklungszweig **stormforce**, der aktuell nicht mehr weiterentwickelt und gepflegt wird, wird beim neuen Release-Version **stormforce-xr** nur noch eine PostgreSQL-Datenbank zur Speicherung der Daten unterstützt.
 +==== Datenbank-Daemon installieren und konfigurieren ====
 +Den benötigten Datenbank-Daemon installieren wir, wie soll es anders sein, einfach via **yum**.
 +  - **Installation** <code> # yum -y install postgresql-server </code>
 +  - **Datenbank Initialisieren** <code> # service postgresql initdb </code>
 +  - **Konfiguration** <code> # vim /var/lib/pgsql/data/postgresql.conf </code> <code>... 
 +listen_addresses = '*'
 +...
 +
 +... 
 +log_line_prefix = '%t %u %d' 
 +...
 +
 +</code> <code> # vim /var/lib/pgsql/data/pg_hba.conf</code> <code>...
 +
 +# TYPE  DATABASE    USER        CIDR-ADDRESS          METHOD
 +
 +# "local" is for Unix domain socket connections only
 +local   all         all                               trust
 +# IPv4 local connections:
 +host    all         all         127.0.0.1/32          trust
 +# IPv6 local connections:
 +#host    all         all         ::1/128               ident </code>
 +  - **Datenbank-Daemon starten** <code> # service postgresql start </code>
 +  - **Datenbank-Daemon Systemstart aktivieren** <code> # chkconfig postgresql on </code>
 +  - **Datenbank-Systemuser erstellen**: <code> # su - postgres </code> <code> $ psql -c "alter user postgres with password 'P|r@t3np@rt31!'"</code>
 +  - **StormForce XR _ Datenbanknutzer anlegen**: <code>  % createdb stormforce_xr</code> <code>  % psql stormforce_xr</code> <code> $ psql
 +psql (8.4.9)
 +Type "help" for help.
 +
 +postgres=#</code> <code> =# CREATE USER stormforce_user WITH password 'Danny_Knaggs_is_a_geek';</code> <code> =# GRANT ALL PRIVILEGES ON DATABASE stormforce_xr TO stormforce_user;</code> <code> =# \q</code>
 +  - **Datenbanktabelle(n) anzeigen**: <code>$ psql -l
 +                                    List of databases
 +     Name      |  Owner   | Encoding |  Collation  |    Ctype    |   Access privileges   
 +---------------+----------+----------+-------------+-------------+-----------------------
 + postgres      | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 | 
 + stormforce_xr | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 | =Tc/postgres
 +                                                                 : postgres=CTc/postgres
 +                                                                 : stormforce_user
 +                                                                 : =CTc/postgres
 + template0     | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 | =c/postgres
 +                                                                 : postgres=CTc/postgres
 + template1     | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 | =c/postgres
 +                                                                 : postgres=CTc/postgres
 +(4 rows)
 +</code>   
 +   
 +==== Datenbank-Zugang testen ====
 +Als nächstes überprüfen wir, ob der zuvor angelegt User/Zugang auch funktioniert. 
 +   $ psql -h localhost -d stormforce_xr -U stormforce_user -W
 +
 +   Password for user weather:
 +
 +<code>psql (8.4.9)
 +Type "help" for help.
 +
 +stormforce_xr=>
 +</code>
 +  stormforce_xr=> \q
 +
 +
 +
 +===== Stormforce =====
 +==== Download ====
 +Als nächstes holen wir uns die aktuelle Stormforce von der Projektseite bei Google.
 +   cd /usr/local/src/
 +   wget https://stormforce.googlecode.com/files/stormforce-0.5.4.tar.bz2
 +==== Installation ====
 +Zu erst entpacken wir unser Paket.
 +<code># tar --bzip2 -xvf stormforce-0.5.3.tar.bz2
 +stormforce/
 +stormforce/png/
 +stormforce/ttf/
 +stormforce/ogg/
 +stormforce/README
 +stormforce/XML-README
 +stormforce/xmldevice.py
 +stormforce/netdevice.py
 +stormforce/LICENSE
 +stormforce/gpsdevice.py
 +stormforce/stormforce.py
 +stormforce/boltek-stormtracker/
 +stormforce/boltek-stormtracker/st2sf/
 +stormforce/boltek-stormtracker/boltek-sdk/
 +stormforce/boltek-stormtracker/boltek-sdk/Documentation
 +stormforce/boltek-stormtracker/boltek-sdk/libboltek/
 +stormforce/boltek-stormtracker/boltek-sdk/driver/
 +stormforce/boltek-stormtracker/boltek-sdk/driver/boltek.c
 +stormforce/boltek-stormtracker/boltek-sdk/driver/Makefile
 +stormforce/boltek-stormtracker/boltek-sdk/driver/77-boltek.rules
 +stormforce/boltek-stormtracker/boltek-sdk/libboltek/Makefile
 +stormforce/boltek-stormtracker/boltek-sdk/libboltek/demo.c
 +stormforce/boltek-stormtracker/boltek-sdk/libboltek/libboltek.c
 +stormforce/boltek-stormtracker/boltek-sdk/libboltek/stormpci.h
 +stormforce/boltek-stormtracker/st2sf/stormpci.h
 +stormforce/boltek-stormtracker/st2sf/st2sf.c
 +stormforce/boltek-stormtracker/st2sf/Makefile
 +stormforce/boltek-stormtracker/st2sf/libboltek.c
 +stormforce/boltek-stormtracker/st2sf/LICENSE
 +stormforce/boltek-stormtracker/st2sf/README
 +stormforce/ogg/kde_click3.ogg
 +stormforce/ogg/kde_digital2.ogg
 +stormforce/ogg/kde_error2.ogg
 +stormforce/ttf/micron55.ttf
 +stormforce/ttf/aldo.ttf
 +stormforce/ttf/7linedigital.ttf
 +stormforce/ttf/lcd1.ttf
 +stormforce/ttf/lcd2.ttf
 +stormforce/png/blank.png</code>
 +Für die spätere einfache Versionierung ändern wir den **stormforce**-Pfad auf //**/usr/local/src/stormforce-0.5.4**// ab.
 +   mv /usr/local/src/stormforce /usr/local/src/stormforce-0.5.4
 +Wir haben es dann zukünftig leichter, wenn wir mehrere Versionen zum testen parallel vorhalten wollen.
 +Anschließend setzen wir wieder einen symbolischen Link mit dem gewünschten Zielpfadnamen auf unser neues Verzeichnis.
 +   ln -s /usr/local/src/stormforce-0.5.4 /usr/local/src/stormforce
 +==== Berechtigungen ====
 +Damit unser **user** auch Zugriff auf alle Dateien bekommt, ändern wir noch die Dateirechte ab
 +   chown -R django:django stormforce
 +==== erste Programmstarts ====
 +=== Server ===
 +Nun ist es an der Zeit, **stormforce-xr** das erste mal zu starten. Als erstes starten wir mal den Server-Part der Anwendung an:
 +   # python sxr_server.py
 +<code python>sxr_server.py:1808: SyntaxWarning: name 'DEBUG_MODE' is used prior to global declaration
 +  global CLOSE_DISTANCE, DEBUG_MODE, EFM100_BITS, EFM100_PARITY, EFM100_PORT, EFM100_SPEED, EFM100_STOPBITS, LD250_BITS, LD250_PARITY, LD250_PORT, LD250_SQUELCH, LD250_SPEED, LD250_STOPBITS, LD250_USE_UNCORRECTED_STRIKES, POSTGRESQL_DATABASE, POSTGRESQL_PASSWORD, POSTGRESQL_SERVER, POSTGRESQL_USERNAME, SERVER_PORT, STRIKE_COPYRIGHT, TRAC_SENSITIVITY, TRAC_STORM_WIDTH
 +
 +#########################################################################
 +# Copyright/License Notice (Modified BSD License)                       #
 +#########################################################################
 +#########################################################################
 +# Copyright (c) 2008-2012, Daniel Knaggs - 2E0DPK/M6DPK                 #
 +# All rights reserved.                                                  #
 +#                                                                       #
 +# Redistribution and use in source and binary forms, with or without    #
 +# modification, are permitted provided that the following conditions    #
 +# are met: -                                                            #
 +#                                                                       #
 +#   * Redistributions of source code must retain the above copyright    #
 +#     notice, this list of conditions and the following disclaimer.     #
 +#                                                                       #
 +#   * Redistributions in binary form must reproduce the above copyright #
 +#     notice, this list of conditions and the following disclaimer in   #
 +#     the documentation and/or other materials provided with the        #
 +#     distribution.                                                     #
 +#                                                                       #
 +#   * Neither the name of the author nor the names of its contributors  #
 +#     may be used to endorse or promote products derived from this      #
 +#     software without specific prior written permission.               #
 +#                                                                       #
 +#   * This Software is not to be used for safety purposes.              #
 +#                                                                       #
 +#   * You agree and abide the Disclaimer for your Boltek products.      #
 +#                                                                       #
 +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS   #
 +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT     #
 +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR #
 +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT  #
 +# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, #
 +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT      #
 +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, #
 +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY #
 +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT   #
 +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE #
 +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.  #
 +#########################################################################
 +
 +03/05/2012 10:52:30 | SXR/main()/Information - 
 +03/05/2012 10:52:30 | SXR/main()/Information - StormForce XR - Server
 +03/05/2012 10:52:30 | SXR/main()/Information - ======================
 +03/05/2012 10:52:30 | SXR/main()/Information - Checking settings...
 +03/05/2012 10:52:30 | SXR/main()/Warning - The XML settings file doesn't exist, create one...
 +03/05/2012 10:52:30 | SXR/main()/Information - The XML settings file has been created using the default settings.  Please edit it and restart the SXR server once you're happy with the settings.
 +</code>
 +
 +Wie uns das Programm freundlich mitteilte, müssen wir nun noch die **Server-XML**-Konfigurationsdatei //**/usr/local/src/stormforce-xr/sxrserver-settings.xml**// bearbeiten.
 +
 +   # vim /usr/local/src/stormforce-xr/sxrserver-settings.xml
 +<file xml /usr/local/src/stormforce-xr/sxrserver-settings.xml><?xml version="1.0" ?>
 +<SXRServer>
 +        <Setting ServerPort="7397"/>
 +        <Setting LD250Port="/dev/ttyUSB0"/>
 +        <Setting LD250Speed="9600"/>
 +        <Setting LD250Bits="8"/>
 +        <Setting LD250Parity="N"/>
 +        <Setting LD250StopBits="1"/>
 +        <Setting LD250Squelch="0"/>
 +        <Setting LD250UseUncorrectedStrikes="False"/>
 +        <Setting EFM100Port=""/>
 +        <Setting EFM100Speed="9600"/>
 +        <Setting EFM100Bits="8"/>
 +        <Setting EFM100Parity="N"/>
 +        <Setting EFM100StopBits="1"/>
 +        <Setting PostgreSQLServer="localhost"/>
 +        <Setting PostgreSQLDatabase="stormforce_xr"/>
 +        <Setting PostgreSQLUsername="stormforce"/>
 +        <Setting PostgreSQLPassword=""/>
 +        <Setting CloseDistance="15"/>
 +        <Setting TRACSensitivity="10"/>
 +        <Setting TRACStormWidth="30"/>
 +        <Setting StrikeCopyright="Lightning Data (c) 2012 - Daniel Knaggs"/>
 +        <Setting DebugMode="False"/>
 +</SXRServer>
 +</file>
 +
 +=== Client ===
 +Als nächstes starten wir das erste mal den Client-teil der Anwendung **stormforce-xr** das erste mal zu starten. Als erstes starten wir mal den Server-Part der Anwendung an:
 +
 +   # python sxr_client.py
 +<code python>
 +sxr_client.py:1687: SyntaxWarning: name 'DEBUG_MODE' is used prior to global declaration
 +  global DEBUG_MODE, DEMO_MODE, SHOW_CROSSHAIR, SHOW_RANGE_CIRCLES, STORMFORCEXR_SERVER, STRIKE_SHAPE, UPDATE_PERIOD_CAPTURE, UPDATE_PERIOD_CURRENT_TIME, UPDATE_PERIOD_EFM100, UPDATE_PERIOD_LD250, UPDATE_PERIOD_STRIKES
 +
 +#########################################################################
 +# Copyright/License Notice (Modified BSD License)                       #
 +#########################################################################
 +#########################################################################
 +# Copyright (c) 2008-2012, Daniel Knaggs - 2E0DPK/M6DPK                 #
 +# All rights reserved.                                                  #
 +#                                                                       #
 +# Redistribution and use in source and binary forms, with or without    #
 +# modification, are permitted provided that the following conditions    #
 +# are met: -                                                            #
 +#                                                                       #
 +#   * Redistributions of source code must retain the above copyright    #
 +#     notice, this list of conditions and the following disclaimer.     #
 +#                                                                       #
 +#   * Redistributions in binary form must reproduce the above copyright #
 +#     notice, this list of conditions and the following disclaimer in   #
 +#     the documentation and/or other materials provided with the        #
 +#     distribution.                                                     #
 +#                                                                       #
 +#   * Neither the name of the author nor the names of its contributors  #
 +#     may be used to endorse or promote products derived from this      #
 +#     software without specific prior written permission.               #
 +#                                                                       #
 +#   * This Software is not to be used for safety purposes.              #
 +#                                                                       #
 +#   * You agree and abide the Disclaimer for your Boltek products.      #
 +#                                                                       #
 +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS   #
 +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT     #
 +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR #
 +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT  #
 +# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, #
 +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT      #
 +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, #
 +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY #
 +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT   #
 +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE #
 +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.  #
 +#########################################################################
 +
 +03/05/2012 11:06:38 | SXR/main()/Information - 
 +03/05/2012 11:06:38 | SXR/main()/Information - StormForce XR - Client
 +03/05/2012 11:06:38 | SXR/main()/Information - ======================
 +03/05/2012 11:06:38 | SXR/main()/Information - Checking settings...
 +03/05/2012 11:06:38 | SXR/main()/Warning - The XML settings file doesn't exist, create one...
 +03/05/2012 11:06:38 | SXR/main()/Information - The XML settings file has been created using the default settings.  Please edit it and restart the SXR client once you're happy with the settings.
 +</code>
 +
 +Auch teilt uns das Programm freundlich mit, dass wir nun noch die **Client-XML**-Konfigurationsdatei //**/usr/local/src/stormforce-xr/sxrclient-settings.xml**// bearbeiten müssen.
 +
 +   # vim /usr/local/src/stormforce-xr/sxrclient-settings.xml
 +<file xml /usr/local/src/stormforce-xr/sxrclient-settings.xml>
 +<?xml version="1.0" ?>
 +<SXRClient>
 +        <Setting StormForceXRServer="http://127.0.0.1:7397/xmlrpc/"/>
 +        <Setting DemoMode="False"/>
 +        <Setting StrikeShape="0"/>
 +        <Setting ShowCrosshair="True"/>
 +        <Setting ShowRangeCircles="False"/>
 +        <Setting UpdatePeriodCapture="30.0"/>
 +        <Setting UpdatePeriodCurrentTime="1.0"/>
 +        <Setting UpdatePeriodEFM100="5.0"/>
 +        <Setting UpdatePeriodLD250="2.0"/>
 +        <Setting UpdatePeriodStrikes="60.0"/>
 +        <Setting DebugMode="False"/>
 +</SXRClient>
 +</file>
 +Starten wir nun erneut unseren Client wird uns der erste Startbildschirm des StormForce XR Clients präsentiert.
 +
 +{{ :wetter:boltek:stormforce_xr.png?550 |Stormforce-Startbildschirm}}
 +
 +
 +
 +==== Stormforce-Aufruf ====
 +Nachdem wir unsere Konfiguration erfolgreich abgeschlossen haben, rufen wir nunmehr **stormforce** zum ersten mal richtig auf. //( Vorausgesetzt wir haben die Berechtigungen auf die Device-Datei entsprechend geändert, siehe hierzu [[wetter:boltek:hardware_ld-250|Hardware LD-250]] )//
 +
 +   $ python sxr_client.py
 +<code python>
 +sxr_client.py:1687: SyntaxWarning: name 'DEBUG_MODE' is used prior to global declaration
 +  global DEBUG_MODE, DEMO_MODE, SHOW_CROSSHAIR, SHOW_RANGE_CIRCLES, STORMFORCEXR_SERVER, STRIKE_SHAPE, UPDATE_PERIOD_CAPTURE, UPDATE_PERIOD_CURRENT_TIME, UPDATE_PERIOD_EFM100, UPDATE_PERIOD_LD250, UPDATE_PERIOD_STRIKES
 +
 +#########################################################################
 +# Copyright/License Notice (Modified BSD License)                       #
 +#########################################################################
 +#########################################################################
 +# Copyright (c) 2008-2012, Daniel Knaggs - 2E0DPK/M6DPK                 #
 +# All rights reserved.                                                  #
 +#                                                                       #
 +# Redistribution and use in source and binary forms, with or without    #
 +# modification, are permitted provided that the following conditions    #
 +# are met: -                                                            #
 +#                                                                       #
 +#   * Redistributions of source code must retain the above copyright    #
 +#     notice, this list of conditions and the following disclaimer.     #
 +#                                                                       #
 +#   * Redistributions in binary form must reproduce the above copyright #
 +#     notice, this list of conditions and the following disclaimer in   #
 +#     the documentation and/or other materials provided with the        #
 +#     distribution.                                                     #
 +#                                                                       #
 +#   * Neither the name of the author nor the names of its contributors  #
 +#     may be used to endorse or promote products derived from this      #
 +#     software without specific prior written permission.               #
 +#                                                                       #
 +#   * This Software is not to be used for safety purposes.              #
 +#                                                                       #
 +#   * You agree and abide the Disclaimer for your Boltek products.      #
 +#                                                                       #
 +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS   #
 +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT     #
 +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR #
 +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT  #
 +# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, #
 +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT      #
 +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, #
 +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY #
 +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT   #
 +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE #
 +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.  #
 +#########################################################################
 +
 +03/05/2012 11:06:38 | SXR/main()/Information - 
 +03/05/2012 11:06:38 | SXR/main()/Information - StormForce XR - Client
 +03/05/2012 11:06:38 | SXR/main()/Information - ======================
 +03/05/2012 11:06:38 | SXR/main()/Information - Checking settings...
 +03/05/2012 11:06:38 | SXR/main()/Warning - The XML settings file doesn't exist, create one...
 +03/05/2012 11:06:38 | SXR/main()/Information - The XML settings file has been created using the default settings.  Please edit it and restart the SXR client once you're happy with the settings.
 +</code>
 +
 +Folgender Bildschirm wird uns bei erfolgreichem Programmstart gezeigt.
 +
 +{{ :wetter:boltek:stormforce_xr.png?500 |Bildschirmhardcopy des Clients}}
 +
 +Mit der Taste "**Q**" können wir das Programmm bei Bedarf beenden.
 +===== Individuelle Anpassungen =====
 +==== Startscript für Programmstart ====
 +Für den Programmstart erstellen wir uns erst einmal ein rudimentäres Shellscript, mit Hilfe dessen wir den Server wie auch den Client starten können.
 +
 +   # vim /usr/local/bin/stormforce.sh
 +<file bash /usr/local/bin/stormforce.sh>
 +#!/bin/sh
 +# Django : 2012-05-03 
 +# Schellscript zum vereinfachten Starten des StormForce XR Servers und Clients
 +
 +cd /usr/local/src/stormforce-xr
 +python sxr_server.py &
 +python sxr_client.py
 +</file>
 +==== Starter anlegen ====
 +Zum Starten von Stormforce legen wir uns am Desktop einen entsprechenden Starter an. Das Icon => {{:ws:stormforce.png}} Legen wir am besten unter **/usr/share/pixmaps/** ab.
 +
 +  * **Typ** : Anwendung
 +  * **Name** : StormForce XR
 +  * **Befehl** : /usr/local/bin/stormforce.sh
 +  * **Kommentar** : Visualisierung des Boltek LD-250 mit StormForce XR
 +
 +{{ :ws:stormforce_starter.png?200 }} 
 +==== Automatischer Programmstart nach erfolgter Anmeldung ====
 +Damit unser **Boltek LD-250** nun sofort nach einer erfolgreichen Useranmeldung von //**Stormforce **// ausgelesen werden kann, legen wir uns einen Autostarter an.
 +
 +Hierzu legen wir zu erst folgendes Verzeichnis an:
 +   $ mkdir -p /home/django/.config/autostart
 +
 +Dort legen wir die Datei **__stormforce.desktop__** mit folgendem Inhalt an: 
 +   $ vim stormforce.desktop
 +<file code /home/django/.config/autostart/stormforce.desktop>
 +[Desktop Entry]
 +Name=Stormforce
 +Encoding=UTF-8
 +Version=1.0
 +Exec=stormforce-start.sh
 +X-GNOME-Autostart-enabled=true
 +</file>
 +
 +Somit wird beim nächsten Anmelden am X-Gnome-Desktop das Programm **stormforce** automatisch gestartet.
 +
 +{{ :wetter:boltek:stormforce_xr_2.png?600 |Bildschirmhardcopy des Clients}}
 +
 +==== Kartenhintergrund ====
 +Einen passenden Kartenhintergrund können wir uns entweder über das [[httsp://www.openstreetmap.org|freie Kartenprojekt von Openstreetmap]], bei den [[https://earthobservatory.nasa.gov/Features/BlueMarble/|Blue Marble Satellitenbilder der NASA]], oder 
 +mit Hilfe des [[https://www.primap.com/de/index.html|MapCreator 2.0 von primap]] erstellen. Genau in der Reihenfolge bin ich vorgegangen, bei letzterem bin ich dann auf Grund er schnellen, einfachen und guten Ergebnisse hängen geblieben.
 +
 +{{ :ws:blitzkarte_mit_ort_und_namen.png?400 }}
 +
 +Die Karte hat eine Größe von 600 x 600 Pixel, mit dem Standort in der Bildmitte. Die Karte selbst hat dabei eine Ausdehnung (Radius um den Standort) von 300 Meilen bzw. ca. 480 Kilometer.
 +
 +Unsere eigene neue Karte speichern wir dann als **//map-300.png//** im Verzeichnis **//png//** ab.
 +   #  ll /usr/local/src/stormforce/png/
 +   -rw-r--r-- 1 root root 362544 28. Sep 11:36 map-300.png
 +
 +
 +==== Update des Bildes auf unserem Webserver/Vhost ====
 +=== storm2web.sh ===
 +Zum Kopieren unserer, von Stormforce alle 10 Sekunden akutalisierten, Bildschirmhardcopy auf unseren Webserver, legen wir ein kleines Shellscript an:
 +   # vim /usr/local/bin/storm2web.sh
 +
 +<file bash /usr/local/bin/storm2web.sh>
 +#!/bin/sh 
 +# Script zum "Hochladen" der Strormforce-Bilder auf den Webserver der NSS
 +# zur Weiterleitung an den virtuellen Host "Webcam"
 +# (c) Michael Nausch 
 +# Version 0.01: 29.12.2008
 +#         0.02: 07.11.2009
 +#         0.03: 04.05.2012
 +#         0.04: 16.02.2013 (Anpassung an neue Server-Farm)
 +
 +WORKDIR="/usr/local/src/stormforce-xr/"
 +QUELLE="/usr/local/src/stormforce-xr/stormforce-xr.png"
 +ZIEL="wetterserver.dmz.nausch.org:/home/weather/"
 +QUELLE2="/usr/local/src/stormforce-xr/stormforce_small.png"
 +ZIEL1="wetterserver.dmz.nausch.org:/home/weather/stormforce_small.png"
 +
 +SLEEP=100
 +
 +cd $WORKDIR
 +while true
 +do
 +  convert -geometry 280x183 $QUELLE $QUELLE2
 +  rsync -av $QUELLE $ZIEL"stormforce_2.png"
 +  rsync -av $QUELLE2 $ZIEL"stormforce_small.png"
 +  sleep $SLEEP
 +done
 +</file>
 +
 +Anschließend versehen wir unser kleines shell-script noch mit dem **"X"-Rechten**.
 +   # chmod +x /usr/local/bin/storm2web.sh
 +
 +
 +=== service stormforce ===
 +Damit nun beim Systemstart automatisch der automatische //Bildsyncronisierungscopyjob// legen wir uns nachfolgendes Systemstartscript unter **/etc/init.d/** ab.
 +  # vim /etc/init.d/stormforce
 +
 +<file bash /etc/init.d/stormforce> 
 +#!/bin/sh
 +#
 +# chkconfig: 2345 79 31
 +# description: cyclic Stormforce-Map Update
 +#
 +# processname: stormforce
 +#
 +
 +# Source function library.
 +. /etc/rc.d/init.d/functions
 +
 +# Source networking configuration.
 +. /etc/sysconfig/network
 +
 +# Check that networking is up.
 +[ ${NETWORKING} = "no" ] && exit 0
 +
 +prog=storm2web.sh
 +stormforce_prg=/usr/local/bin/$prog
 +
 +# Source an auxiliary options file if we have one, and pick up OPTIONS,                                                                                                     
 +if [ -r /etc/sysconfig/$prog ]; then
 +    . /etc/sysconfig/$prog
 +fi
 +
 +start() {
 +    echo -n $"Starting $prog: "
 +#    $stormforce_prg start
 +    $stormforce_prg &
 +    RETVAL=$?
 +    echo
 +    [ $RETVAL -eq 0 ] && touch /var/lock/subsys/$prog
 +}
 +stop() {
 +    echo -n $"Stopping $prog: "
 +   /usr/bin/killall $prog
 +#    $stormforce_prg stop
 +    RETVAL=$?
 +    echo
 +    [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/$prog
 +}
 +
 +restart() {
 +    stop
 +    start
 +}
 +
 + 
 +# See how we were called.
 +case "$1" in
 +    start)
 +        start
 +    ;;
 +    stop)
 +        stop
 +    ;;
 +    restart)
 +        restart
 +    ;;
 +    *)
 +        echo $"Usage: $0 {start|stop|restart}"
 +        exit 1
 +esac
 +
 +exit $RETVAL
 +</file>
 +Damit der "service" automatisch beim Systemstart anläuft, aktivieren wir diesen mit:
 +   # chkconfig stormforce on
 +Die Überprüfungung ob der Dienst (Daemon) stormforce wirklich bei jedem Systemstart automatisch mit gestartet werden, kann durch folgenden Befehle erreicht werden: 
 +   # chkconfig --list | grep stormforce
 +     stormforce      0:Aus   1:Aus   2:Ein   3:Ein   4:Ein   5:Ein   6:Aus
 +
 +Den Daemon starten wir nun initial mit:
 +   # service stormforce start
 +