PDA

Archiv verlassen und diese Seite im Standarddesign anzeigen : fms32 mit monitord verbinden



Gira
01.08.2015, 00:08
Moinsen,

ich führe monitord auf einem Raspi aus. Die Auswertung funktioniert prima und auch die Verbindung zu einer mysql Datenbank läuft perfekt.
Nun würde ich gerne die ausgewerteten Daten mit FMS32 abfangen.
Grundsätzlich kann FMS32 eine Verbindung zum Socket-Server aufbauen, bekommt aber keine Daten.
Die socketfilter.lua möchte ich (noch) nicht nutzen. Es soll einfach alles ungefiltert an der FMS32 Schnittstelle bereitgestellt werden.

Wie kriege ich das hin? Wo ist mein Fehler?

Meine monitord.xml sieht wie folgt aus:


<?xml version="1.0" encoding="ISO-8859-1"?>
<monitordconfig version="1.0">
<name> Monitord </name>
<logfile> monitord.log </logfile> <!-- monitord.log = normal, screen = Bildschirm -->
<loglevel> DEBUG </loglevel> <!-- DEBUG, ERROR und INFO -->
<!-- <SocketFilterScript> socketfilter.lua </SocketFilterScript> -->
<!-- <PluginFilterScript> pluginfilter.lua </PluginFilterScript> -->
<auth>
<login>
<name>test</name>
<password>test</password>
</login>
<login>
<name>crusader</name>
<password>pw</password>
</login>

<!-- Bisher nur IP Adressen. Keine Netze oder Bereiche ! -->
<!-- Mehrfachnennungen sind aber moeglich, sofern sie Sinn machen -->
<!-- Suchreihenfolge: allow, login, deny -->
<ip action="allow">192.168.1.27</ip> <!-- Diese IPs muessen sich nicht einloggen -->
<ip action="allow">127.0.0.1</ip> <!-- Diese IPs muessen sich nicht einloggen -->
<ip action="login"> any </ip> <!-- Diese IPs muessen sich einloggen -->
<ip action="deny">any</ip> <!-- Diese IPs koennen sich nicht einloggen -->
</auth>

<!-- -->
<tcpsocket>
<bind> * </bind>
<port mode="monitord"> 9333 </port>
<port mode="fms32pro"> 9300 </port>
<port mode="crusader"> 7778 </port>
</tcpsocket>

<soundcard num="0">
<device>plughw:1,0</device> <!-- ALSA: die erste Soundkarte -->
<status>1</status> <!-- 1=aktiv, 0=deaktivert -->
<baud>22050</baud>
<name> Erste Soundkarte </name>
<!-- Linker Kanal -->
<channel part="left">

<name>Kanal 1</name>
<module type="poc1200">
<algorithm> 1 </algorithm>
<crc-check> 1 </crc-check>
<ecc> 0 </ecc>
<maxerrors> 3 </maxerrors>
</module>
<module type="poc512">
<algorithm> 1 </algorithm>
<crc-check> 1 </crc-check>
<ecc> 0 </ecc>
<maxerrors> 3 </maxerrors>
</module>

</channel>

<!-- Rechter Kanal -->
<channel part="right">
<!-- Audio Plugin -->
<name>Kanal 2</name>


</channel>
</soundcard>




<dataplugins>
<!-- Daten Plugin -->
<plugin name="mysql">
<file> plugins/.libs/libmplugin_mysql.so.0.0.0 </file>
<parameters>
<logfile> mysql.log </logfile>
<loglevel> DEBUG </loglevel>
<hostname> XXXXXXXX</hostname>
<port> 3306 </port>
<username> XXXXXXXX </username>
<password> XXXXXXXX </password>
<database> XXXXXXXX </database>

<ssl>0</ssl> <!-- 0: ssl disabled - 1: ssl enabled -->
<ssl-cacert>/etc/mysql/ssl/ca-cert.pem</ssl-cacert>
<ssl-cert>/etc/mysql/ssl/client-cert.pem</ssl-cert>
<ssl-key>/etc/mysql/ssl/client-key.pem</ssl-key>


<mapping typ="fms">
<table> monitord_fms </table>
<field name="uhrzeit" source="mysql"> now() </field>
<field name="status"> statusdezimal </field>
<field name="kennung"> fmskennung </field>
<field name="richtung"> richtung </field>
<field name="text"> textuebertragung </field>
<field name="tki"> tki </field>
<field name="quelle"> channelnum </field>
</mapping>

<mapping typ="pocsag">
<table> monitord_pocsag </table>
<field name="uhrzeit" source="mysql"> now() </field>
<field name="kennung"> ric </field>
<field name="sub"> sub </field>
<field name="text"> text </field>
<field name="quelle"> channelnum </field>
</mapping>

<mapping typ="zvei">
<table> monitord_zvei </table>
<field name="uhrzeit" source="mysql"> now() </field>
<field name="typ"> weckton </field>
<field name="kennung"> zvei </field>
<field name="text"> text </field>
<field name="quelle"> channelnum </field>
</mapping>
</parameters>

</plugin>
</dataplugins>

</monitordconfig>




An welcher Schraube hab ich vergessen zu drehen?

Beste Grüße

Gira
03.08.2015, 22:29
Niemand? :(

ffw123
04.08.2015, 12:19
Hallo,

ich habe noch nie einen anderen Clienten mit monitord verbunden, also kann ich dir nicht sagen, wie man es macht. Was steht denn in der Log-Datei drin, wenn sich FMS32 verbinden möchte?

Zur Config. Wieso setzt sagst du, dass sich alle IPs (außer 127.0.0.1 und 192.168.1.27) einloggen müssen und danach verbietest du allen es wieder allen?

Was ich mir noch vorstellen könnte, wäre den Socketfilter zu benutzen, aber einfach alles weitergeben.

Gira
04.08.2015, 12:28
Hallo,

ich habe noch nie einen anderen Clienten mit monitord verbunden, also kann ich dir nicht sagen, wie man es macht. Was steht denn in der Log-Datei drin, wenn sich FMS32 verbinden möchte?

Nix. Es gibt keine Einträge im Log, trotz DEBUG-Modus. Grundsätzlich funktioniert die Kommunikation über die Schnittstelle aber (getestet mit der Monitord Test-GUI).



Zur Config. Wieso setzt sagst du, dass sich alle IPs (außer 127.0.0.1 und 192.168.1.27) einloggen müssen und danach verbietest du allen es wieder allen?

Das hast du nicht ganz richtig gelesen:
1. 172.0.0.1 und 192.168.1.27 dürfen ohne Zugangsdaten zugreifen
2. Alles andere muss Zugangsdaten eingeben
3. Sollten 1 und 2 nicht greifen, wird der Zugriff verboten.

Die Deny-Any Regel zum Schluss ist eine übliche Herangehensweise um Querschläger abzufangen. Findet man in der Regel im Firewall-Umfeld.





Was ich mir noch vorstellen könnte, wäre den Socketfilter zu benutzen, aber einfach alles weitergeben.
Ja. Guter Hinweis. Hab's gerade ausprobiert und die aufgerufene Funktion direkt mit einem "return 0" wieder geschlossen. Bringt aber nichts.

Gira
07.08.2015, 13:56
Was steht denn in der Log-Datei drin, wenn sich FMS32 verbinden möchte?



Hier mal ein Auszug aus der Logdatei:





13:51:48.904 INFO: monitord/Monitor.cpp(68) monitord restarted - logging with loglevel DEBUG
13:51:48.905 DEBUG: monitord/MonitorModulesResults.cpp(51) Dispatcher startet
13:51:48.907 INFO: monitord/Monitor.cpp(113) monitord 2.0svn READY
13:51:48.922 INFO: monitord/Monitor.cpp(217) starting soundcard #0
13:51:48.922 INFO: monitord/SndPipe.cpp(152) creating decoders for soundcard #0
13:51:48.922 INFO: monitord/SndPipe.cpp(201) creating decoder for soundcard #0L:POC512
13:51:48.923 INFO: monitord/MonitorModulePocsag512.cpp(66) (2) sample - crc - ecc - minpreambel - maxerrors - algo:22050 - 1 - 0 - 300 - 10 - 1
13:51:48.923 INFO: monitord/MonitorModulePocsag512.cpp(79) Algorithmus:1
13:51:48.924 INFO: monitord/MonitorModulePocsag512.cpp(86) SPHASE_INC is:1521
13:51:48.924 INFO: monitord/SndPipe.cpp(228) creating decoder for soundcard #0L:POC1200
13:51:48.924 INFO: monitord/SndPipe.cpp(263) loading audioplugins for left channel
13:51:48.925 INFO: monitord/SndPipe.cpp(265) loading audioplugins for right channel
13:51:48.945 INFO: monitord/posix/MonitorAudioALSA.cpp(107) [ALSA] Using pcm_buffer_size=16384 periods=2
13:51:48.953 INFO: monitord/Monitor.cpp(225) Soundcard #0 started - complete
13:51:48.955 INFO: monitord/Monitor.cpp(147) monitord socketserver started
13:51:48.956 DEBUG: monitord/SocketServer.cpp(851) SocketManager erstellt
13:51:48.959 INFO: monitord/Monitor.cpp(153) fms32pro socketserver started
13:51:48.963 INFO: monitord/Monitor.cpp(158) crusader socketserver started
13:51:48.964 INFO: monitord/PluginThread.cpp(390) reading plugin configuration
13:51:48.964 INFO: monitord/PluginThread.cpp(401) Plugin found: mysql
13:51:48.964 DEBUG: monitord/PluginThread.cpp(402) File:plugins/.libs/libmplugin_mysql.so.0.0.0
13:51:48.965 DEBUG: monitord/PluginThread.cpp(405) found parameters
13:51:48.965 DEBUG: monitord/PluginThread.cpp(16) Erstellt PT:
13:51:48.966 DEBUG: monitord/PluginThread.cpp(30) DLL Name:plugins/.libs/libmplugin_mysql.so.0.0.0
13:51:48.987 DEBUG: monitord/PluginThread.cpp(34) done
13:51:48.993 DEBUG: monitord/plugins/libmplugin_mysql.cpp(231) reading mapping info
13:51:48.994 DEBUG: monitord/plugins/libmplugin_mysql.cpp(232) table=monitord_fms
13:51:48.994 DEBUG: monitord/plugins/libmplugin_mysql.cpp(250) Feld: uhrzeit / mysql:now()
13:51:48.995 DEBUG: monitord/plugins/libmplugin_mysql.cpp(250) Feld: status / :statusdezimal
13:51:48.995 DEBUG: monitord/plugins/libmplugin_mysql.cpp(250) Feld: kennung / :fmskennung
13:51:48.995 DEBUG: monitord/plugins/libmplugin_mysql.cpp(250) Feld: richtung / :richtung
13:51:48.996 DEBUG: monitord/plugins/libmplugin_mysql.cpp(250) Feld: text / :textuebertragung
13:51:48.996 DEBUG: monitord/plugins/libmplugin_mysql.cpp(250) Feld: tki / :tki
13:51:48.996 DEBUG: monitord/plugins/libmplugin_mysql.cpp(250) Feld: quelle / :channelnum
13:51:48.997 DEBUG: monitord/plugins/libmplugin_mysql.cpp(231) reading mapping info
13:51:48.997 DEBUG: monitord/plugins/libmplugin_mysql.cpp(232) table=monitord_pocsag
13:51:48.997 DEBUG: monitord/plugins/libmplugin_mysql.cpp(250) Feld: uhrzeit / mysql:now()
13:51:48.998 DEBUG: monitord/plugins/libmplugin_mysql.cpp(250) Feld: kennung / :ric
13:51:48.998 DEBUG: monitord/plugins/libmplugin_mysql.cpp(250) Feld: sub / :sub
13:51:48.998 DEBUG: monitord/plugins/libmplugin_mysql.cpp(250) Feld: text / :text
13:51:48.999 DEBUG: monitord/plugins/libmplugin_mysql.cpp(250) Feld: quelle / :channelnum
13:51:48.999 DEBUG: monitord/plugins/libmplugin_mysql.cpp(231) reading mapping info
13:51:48.999 DEBUG: monitord/plugins/libmplugin_mysql.cpp(232) table=monitord_zvei
13:51:49.000 DEBUG: monitord/plugins/libmplugin_mysql.cpp(250) Feld: uhrzeit / mysql:now()
13:51:49.000 DEBUG: monitord/plugins/libmplugin_mysql.cpp(250) Feld: typ / :weckton
13:51:49.001 DEBUG: monitord/plugins/libmplugin_mysql.cpp(250) Feld: kennung / :zvei
13:51:49.001 DEBUG: monitord/plugins/libmplugin_mysql.cpp(250) Feld: text / :text
13:51:49.001 DEBUG: monitord/plugins/libmplugin_mysql.cpp(250) Feld: quelle / :channelnum
13:51:49.319 INFO: monitord/plugins/libmplugin_mysql.cpp(191) successfully connected to mysql database XXXXXXXXXXXX on host XXXXXXXXXXXXXX with username="XXXXXXXXXXX"
13:51:49.319 DEBUG: monitord/PluginThread.cpp(368) startet plugin plugins/.libs/libmplugin_mysql.so.0.0.0
13:51:49.321 INFO: monitord/PluginThread.cpp(79) PluginThread starting
13:51:49.322 DEBUG: monitord/Monitor.cpp(167) PluginManager started
13:52:03.459 INFO: monitord/SocketServer.cpp(271) new connection from 192.168.1.28
13:53:31.322 DEBUG: monitord/MonitorModulePocsag.cpp(165) Sync gefunden

13:53:31.327 DEBUG: monitord/MonitorModulePocsag.cpp(402) Debug(POCSAG):
channelnamehex = "XXXXXXXXXXXXXXXXXX"
channelnum = "0"
datum = "07.08.15"
ric = "XXXXXXXXXXXX"
servernamehex = "XXXXXXXXXXXXXXXXXX"
sub = "0"
subhex = ""
text = "XXXXXXXXXXXXXX"
timestamp = "1438948411"
typ = "pocsag"
uhrzeit = "13:53:31"

13:53:31.336 DEBUG: monitord/PluginThread.cpp(90) plugin processing - size=1
13:53:31.337 DEBUG: monitord/plugins/libmplugin_mysql.cpp(82) mysql: processing Result...
13:53:31.345 DEBUG: monitord/MonitorModulePocsag.cpp(402) Debug(POCSAG):
channelnamehex = "XXXXXXXXXXXXXXXX"
channelnum = "0"
datum = "07.08.15"
ric = "XXXXXXXXXXXXXXXXX"
servernamehex = "XXXXXXXXXXXXXXXXXXX"
sub = "1"
subhex = ""
text = "XXXXXXXXXXXXXXXXXXX"
timestamp = "1438948411"
typ = "pocsag"
uhrzeit = "13:53:31"

13:53:31.432 DEBUG: monitord/plugins/libmplugin_mysql.cpp(279) field:kennung | value=ric
13:53:31.432 DEBUG: monitord/plugins/libmplugin_mysql.cpp(279) field:quelle | value=channelnum
13:53:31.433 DEBUG: monitord/plugins/libmplugin_mysql.cpp(279) field:sub | value=sub
13:53:31.433 DEBUG: monitord/plugins/libmplugin_mysql.cpp(279) field:text | value=text
13:53:31.434 DEBUG: monitord/plugins/libmplugin_mysql.cpp(279) field:uhrzeit | value=now()
13:53:31.434 DEBUG: monitord/plugins/libmplugin_mysql.cpp(298) Insertstring: insert into monitord_pocsag (kennung,quelle,sub,text,uhrzeit) values ("XXXXXXXXXXXXXXX","0","0","XXXXXXXXXXXXXXX",now())
13:53:31.461 DEBUG: monitord/PluginThread.cpp(90) plugin processing - size=1
13:53:31.461 DEBUG: monitord/plugins/libmplugin_mysql.cpp(82) mysql: processing Result...
13:53:31.552 DEBUG: monitord/plugins/libmplugin_mysql.cpp(279) field:kennung | value=ric
13:53:31.552 DEBUG: monitord/plugins/libmplugin_mysql.cpp(279) field:quelle | value=channelnum
13:53:31.553 DEBUG: monitord/plugins/libmplugin_mysql.cpp(279) field:sub | value=sub
13:53:31.558 DEBUG: monitord/plugins/libmplugin_mysql.cpp(279) field:text | value=text
13:53:31.560 DEBUG: monitord/plugins/libmplugin_mysql.cpp(279) field:uhrzeit | value=now()
13:53:31.563 DEBUG: monitord/plugins/libmplugin_mysql.cpp(298) Insertstring: insert into monitord_pocsag (kennung,quelle,sub,text,uhrzeit) values ("XXXXXXXXXXXXXXXXXXXX","0","1","XXXXXXXXXXXXXXX",now())