PRESENCE auf der FritzBox 7390

Begonnen von Fs79, 01 Mai 2013, 11:24:07

Vorheriges Thema - Nächstes Thema

Fs79

Ich nutze derzeit mein eigenes Skript um Netzwerkgeräte zu erkennen und über Dummies den Zusatnd im FHEM
abbilden zu können.
Nun habe ich mir das PRESENCE Modul angeschaut und der lan-ping ist ein ganz nettes Feature und komplett im
FHEM integriert ohne eigene Shell Skripte.

Nun passiert aber manchmal das PRESENCE gar nicht mehr funktioniert und ich die FritzBox neu starten muss
um PRESENCE wieder dazu zu bewegen die pings abzusetzen. Auch ein shutdown dann etwas warten und neustart
funktioniert nicht.

Das passiert immer wenn ich bei Tests shutdown/restart mache um die neue Konfig zu übernehmen oder um FHEM
sauber neu zu starten.

Kann ich dazu irgendwelche LogFiles liefern um dem Problem auf den Grund zu gehen?

Gruss

Markus Bloch

Setz mal bitte bei deinen PRESENCE Definitionen das Attribut loglevel auf 1, für den Neustart durch und dann poste bitte mal das Ergebnis aus dem FHEM-Logfile bitte hier.

Vielen Dank

Gruß
Markus
Developer für Module: YAMAHA_AVR, YAMAHA_BD, FB_CALLMONITOR, FB_CALLLIST, PRESENCE, Pushsafer, LGTV_IP12, version

aktives Mitglied des FHEM e.V. (Technik)

Fs79

Ok, gesagt und getan.
Zitat2013.05.01 11:40:19 1: PRESENCE_ProcessLocalScan: network_FranksIphone|1|present
2013.05.01 11:40:20 1: PRESENCE_DoLocalPingScan: network_FranksIphone|192.168.255.30|0
2013.05.01 11:40:23 1: PRESENCE (network_FranksIphone) - ping command returned with output:
PING 192.168.255.30 (192.168.255.30): 56 data bytes
64 bytes from 192.168.255.30: seq=0 ttl=64 time=132.397 ms
64 bytes from 192.168.255.30: seq=1 ttl=64 time=118.712 ms
64 bytes from 192.168.255.30: seq=2 ttl=64 time=35.066 ms
64 bytes from 192.168.255.30: seq=3 ttl=64 time=58.146 ms

--- 192.168.255.30 ping statistics ---
4 packets transmitted, 4 packets received, 0% packet loss
round-trip min/avg/max = 35.066/86.080/132.397 ms

2013.05.01 11:40:23 1: PRESENCE_ProcessLocalScan: network_FranksIphone|0|present
2013.05.01 11:40:27 1: PRESENCE_DoLocalPingScan: network_FranksIphone|192.168.255.30|1
2013.05.01 11:40:40 1: PRESENCE (network_FranksIphone) - ping command returned with output:
PING 192.168.255.30 (192.168.255.30): 56 data bytes

--- 192.168.255.30 ping statistics ---
4 packets transmitted, 0 packets received, 100% packet loss

2013.05.01 11:40:40 1: PRESENCE_ProcessLocalScan: network_FranksIphone|1|absent
2013.05.01 11:40:46 1: PRESENCE_DoLocalPingScan: network_FranksIphone|192.168.255.30|1
2013.05.01 11:40:54 0: Server shutdown
2013.05.01 11:40:59 1: PRESENCE (network_FranksIphone) - ping command returned with output:
PING 192.168.255.30 (192.168.255.30): 56 data bytes

--- 192.168.255.30 ping statistics ---
4 packets transmitted, 0 packets received, 100% packet loss

2013.05.01 11:40:59 1: CallBlockingFn: Can't connect to localhost:7072

2013.05.01 11:41:00 1: Including /var/InternerSpeicher/tools/fhem/fhem.cfg
2013.05.01 11:41:01 3: telnetPort: port 7072 opened
2013.05.01 11:41:02 3: WEBfpconfig: port 8082 opened
2013.05.01 11:41:02 3: WEB: port 8083 opened
2013.05.01 11:41:02 3: WEBphone: port 8084 opened
2013.05.01 11:41:02 3: WEBtablet: port 8085 opened
2013.05.01 11:41:02 3: WEBexternal: port 8086 opened
2013.05.01 11:41:03 3: Opening CUL device /dev/ttyACM0
2013.05.01 11:41:04 3: Setting CUL baudrate to 9600
2013.05.01 11:41:04 3: CUL device opened
2013.05.01 11:41:04 3: CUL: Possible commands: BCFiAZEGMRTVWXefmltux
2013.05.01 11:41:04 3: set CUL led 00
2013.05.01 11:41:04 3: Opening HMLAN device 192.168.255.8:1000
2013.05.01 11:41:04 3: HMLAN device opened
2013.05.01 11:41:04 1: Including ./config/basedevices.cfg
2013.05.01 11:41:07 1: Including ./config/az.cfg
2013.05.01 11:41:07 1: Including ./config/bz.cfg
2013.05.01 11:41:08 1: Including ./config/ku.cfg
2013.05.01 11:41:08 1: Including ./config/kz.cfg
2013.05.01 11:41:08 1: Including ./config/sz.cfg
2013.05.01 11:41:08 1: Including ./config/wz.cfg
2013.05.01 11:41:09 1: Including ./config/heizung.cfg
2013.05.01 11:41:09 1: Including ./config/addlog.cfg
2013.05.01 11:41:09 1: Including ./config/dummy.cfg
2013.05.01 11:41:10 1: Including ./config/switch.cfg
2013.05.01 11:41:10 1: Including ./config/network.cfg
2013.05.01 11:41:10 1: Including ./config/test.cfg
2013.05.01 11:41:11 1: Including ./log/fhem.save
2013.05.01 11:41:12 0: Server started with 256 defined entities (version Fhem 5.4 (DEVELOPMENT), $Id: fhem.pl 3128 2013-04-28 12:40:28Z rudolfkoenig $, pid 9943)
2013.05.01 11:41:13 1: PRESENCE_DoLocalPingScan: network_FranksIphone|192.168.255.30|0
2013.05.01 11:41:13 1: PRESENCE (network_FranksIphone) - ping command returned with output:

2013.05.01 11:41:16 3: Device bz_Thermostat added to ActionDetector with 000:10 time
2013.05.01 11:41:16 3: Device ku_Thermostat added to ActionDetector with 000:10 time
2013.05.01 11:41:16 3: Device kz_Thermostat added to ActionDetector with 000:10 time
2013.05.01 11:41:16 3: Device sz_Thermostat added to ActionDetector with 000:10 time
2013.05.01 11:41:16 3: Device wz_Thermostat added to ActionDetector with 000:10 time
2013.05.01 11:41:17 1: PRESENCE_ProcessLocalScan: network_FranksIphone|0|absent
2013.05.01 11:41:29 1: PRESENCE_DoLocalPingScan: network_FranksIphone|192.168.255.30|1
2013.05.01 11:41:29 1: PRESENCE (network_FranksIphone) - ping command returned with output:

2013.05.01 11:41:29 1: HMLAN setting owner to 456DEF from 80E381
2013.05.01 11:41:29 1: PRESENCE_ProcessLocalScan: network_FranksIphone|1|absent
2013.05.01 11:41:37 1: PRESENCE_DoLocalPingScan: network_FranksIphone|192.168.255.30|1
2013.05.01 11:41:37 1: PRESENCE (network_FranksIphone) - ping command returned with output:

2013.05.01 11:41:37 1: PRESENCE_ProcessLocalScan: network_FranksIphone|1|absent
2013.05.01 11:41:39 2: FHT set az_Thermostat desired-temp 13.0

Ich habe zwischendrin den FHEM Server gestoppt und gestartet. Und dann tritt der Fehler auf.

Markus Bloch

Bitte mal Zeile 532 in 73_PRESENCE.pm folgendermaßen ändern:

$temp = qx(ping -c 4 $device 2>&1);


Und dann das ganze Schauspiel mit den Logs nochmal ;-)

Vielen Dank
Developer für Module: YAMAHA_AVR, YAMAHA_BD, FB_CALLMONITOR, FB_CALLLIST, PRESENCE, Pushsafer, LGTV_IP12, version

aktives Mitglied des FHEM e.V. (Technik)

Fs79

Ok. Habe ich getan. Hat aber augenscheinlich nichts gebracht.
Was mir noch aufgefallen ist, ich habe viele PRESENCE Definitionen, das ich bei einem "ps"
per SSH gar kein Ping mehr sehe. Müsste wenigstens ab und zu einen "ping -c 4 $IP" etc. sehen.

Zitat2013.05.01 12:39:24 0: Server shutdown
2013.05.01 12:39:42 1: Including /var/InternerSpeicher/tools/fhem/fhem.cfg
2013.05.01 12:39:43 3: telnetPort: port 7072 opened
2013.05.01 12:39:43 3: WEBfpconfig: port 8082 opened
2013.05.01 12:39:43 3: WEB: port 8083 opened
2013.05.01 12:39:43 3: WEBphone: port 8084 opened
2013.05.01 12:39:43 3: WEBtablet: port 8085 opened
2013.05.01 12:39:43 3: WEBexternal: port 8086 opened
2013.05.01 12:39:45 3: Opening CUL device /dev/ttyACM0
2013.05.01 12:39:45 3: Setting CUL baudrate to 9600
2013.05.01 12:39:45 3: CUL device opened
2013.05.01 12:39:45 3: CUL: Possible commands: BCFiAZEGMRTVWXefmltux
2013.05.01 12:39:45 3: Opening HMLAN device 192.168.255.8:1000
2013.05.01 12:39:45 3: HMLAN device opened
2013.05.01 12:39:46 1: Including ./config/basedevices.cfg
2013.05.01 12:39:48 1: Including ./config/az.cfg
2013.05.01 12:39:49 1: Including ./config/bz.cfg
2013.05.01 12:39:49 1: Including ./config/ku.cfg
2013.05.01 12:39:49 1: Including ./config/kz.cfg
2013.05.01 12:39:49 1: Including ./config/sz.cfg
2013.05.01 12:39:49 1: Including ./config/wz.cfg
2013.05.01 12:39:50 1: Including ./config/heizung.cfg
2013.05.01 12:39:50 1: Including ./config/addlog.cfg
2013.05.01 12:39:50 1: Including ./config/dummy.cfg
2013.05.01 12:39:51 1: Including ./config/switch.cfg
2013.05.01 12:39:51 1: Including ./config/network.cfg
2013.05.01 12:39:52 1: Including ./config/test.cfg
2013.05.01 12:39:52 1: Including ./log/fhem.save
2013.05.01 12:39:53 0: Server started with 256 defined entities (version Fhem 5.4 (DEVELOPMENT), $Id: fhem.pl 3128 2013-04-28 12:40:28Z rudolfkoenig $, pid 32323)
2013.05.01 12:39:54 1: PRESENCE_DoLocalPingScan: network_Ipad|192.168.255.14|0
2013.05.01 12:39:54 1: PRESENCE (network_Ipad) - ping command returned with output:

2013.05.01 12:39:55 1: PRESENCE_ProcessLocalScan: network_Ipad|0|absent
2013.05.01 12:39:57 3: Device bz_Thermostat added to ActionDetector with 000:10 time
2013.05.01 12:39:57 3: Device ku_Thermostat added to ActionDetector with 000:10 time
2013.05.01 12:39:57 3: Device kz_Thermostat added to ActionDetector with 000:10 time
2013.05.01 12:39:57 3: Device sz_Thermostat added to ActionDetector with 000:10 time
2013.05.01 12:39:57 3: Device wz_Thermostat added to ActionDetector with 000:10 time
2013.05.01 12:40:03 1: PRESENCE_DoLocalPingScan: network_Ipad|192.168.255.14|1
2013.05.01 12:40:03 1: PRESENCE (network_Ipad) - ping command returned with output:

2013.05.01 12:40:03 1: PRESENCE_ProcessLocalScan: network_Ipad|1|absent
2013.05.01 12:40:20 2: FHT set az_Thermostat desired-temp 13.0
- fhem-2013-05.log 1223/1277 95%

Markus Bloch

Ich hab auf meiner FritzBox 7390 gerade mehrfach dasselbe gemacht. Nach jedem Restart ist die Definition wieder sauber angelaufen.

Allerdings habe ich bei deiner umfangreichen Konfiguration die Befürchtung, dass deine FritzBox überlastet ist. Aus den Logs kann man erkennen, dass der Ping-Befehl aus irgendwelchen Gründen keinen Output liefert (evtl. gekillt vom Kernel). Gerade bei einem Neustart von FHEM hat die Box mehr zu tun als im Regelbetrieb.

Evtl. mal in der FritzBox Oberfläche schauhen, wie zu dem Zeitpunkt die CPU-Auslastung und der Speicherverbrauch auf der Box sind.

Tut mir leid, dass ich dir da nicht weiterhelfen kann.

Viele Grüße

Markus
Developer für Module: YAMAHA_AVR, YAMAHA_BD, FB_CALLMONITOR, FB_CALLLIST, PRESENCE, Pushsafer, LGTV_IP12, version

aktives Mitglied des FHEM e.V. (Technik)

Fs79

Die Box hat nicht soviel zu tun.
Ist nur eine Box für FHEM und ein paar andere Dienste.

Mein eigenes Skript welches regelmäßig (jede minute) pingt(ca. 20 IPs) hat keine Probleme.

Komisch.
Dann ist das leider für mich nicht zu gebrauchen.

Kann man mehr loggen um zu schauen ab wann es Probleme mit dem ping gibt?

Markus Bloch

Das Problem muss außerhalb von FHEM liegen, da der Ping-Befehl bereits auf Shell-Ebene nix zurückgibt (was ja die FHEM Logs gezeigt haben). Warum das so ist, kann ich nicht sagen.

Die Speicher und CPU-Auslastung währe dennoch interessant zu sehen. Evtl. schießt der Kernel die Ping-Befehle raus oder irgend eine andere Limitierung. Evtl. mal per Hand nach einem Neustart sofort manuell einen Ping absetzen.

Dazu im Webinterface oben in der Textbox folgendes eingeben und dann die Enter-Taste drücken:

{qx(ping -c 4 192.168.178.XX)}


Viele Grüße

Markus
Developer für Module: YAMAHA_AVR, YAMAHA_BD, FB_CALLMONITOR, FB_CALLLIST, PRESENCE, Pushsafer, LGTV_IP12, version

aktives Mitglied des FHEM e.V. (Technik)

Fs79

OK, wie erwartet geht auch das dann nicht.
Hat wohl irgend etwas mit dem Perl auf der FB7390 zu tun.
Auf der FB7390 läuft DNS, DHCP, CS & FHEM.

System läuft definitiv fast im Leerlauf.
Das Problem ist das erste was Lastprobleme sein könnten.
Daher glaube ich das nicht.

Vielleicht hat noch jemand eine Idee ansonsten können wir das Thema abhaken.

Gruss

edit: Mein CS ging down. Kann das irgendetwas in Bezug auf serielle (USB) Reader verursachen?

Markus Bloch

Zitat von: Fs79 schrieb am Mi, 01 Mai 2013 19:02System läuft definitiv fast im Leerlauf.
Das Problem ist das erste was Lastprobleme sein könnten.
Daher glaube ich das nicht.
Da hab ich mich etwas unglücklich ausgedrückt. Ich meine damit nicht die CPU Auslastung sondern viel mehr den Arbeitsspeicherverbrauch der Box.
Developer für Module: YAMAHA_AVR, YAMAHA_BD, FB_CALLMONITOR, FB_CALLLIST, PRESENCE, Pushsafer, LGTV_IP12, version

aktives Mitglied des FHEM e.V. (Technik)

Fs79

So sieht es bei mir aus.
Ist immer so in dem Dreh. Immer genug Arbeitsspeicher frei.
(https://dl.dropboxusercontent.com/u/20754670/Freetz-RAM.JPG)

Dragonfly

Bei mir läuft Presence bis ich ein "rereadcfg" mache.
Fehler hier beschrieben: Link

Danach kommt diese Meldung im Logfile:
Use of uninitialized value in concatenation (.) or string at FHEM/Blocking.pm line 105.
2013.05.02 08:55:02 1: CallBlockingFn: Can't connect to localhost:

Can't use an undefined value as a symbol reference at FHEM/Blocking.pm line 116.

Nach einem Restart gehts wieder.

Kann man da noch was retten?

LG

Elektrolurch

Hallo,

ich bekomme die gleiche Fehlermeldung. Ich benutze allerdings vom PRESENCE - Modul den Modus "fritzbox" und in Lan-Ping. Habe ca. 15 Instanzen von presence.
Der Fehler tritt immer dann auf, wenn: a) update von fhem ausgeführt wird b) ich in fhem die fhem.cfg speichere, dass dauert ca. 8 Sekunden wg. mehrerer includes c) manchmal auch wenn ein Telefonanruf eingeht.
Es folgen dann Meldungen, wie canot fork...
Und dann startet die FB neu.
Ich habe vorerst einmal meine Presence-Definitionen, die alle in einem include liegen, deaktiviert, da mir ansonsten zu häufig die TK-Anlage ausfällt.

Gruß

Elektrolurch

configDB und Windows befreite Zone!

Markus Bloch

Hallo zusammen,

Generelll ist zu dem genannten Fehler mit:
Use of uninitialized value in concatenation (.) or string at FHEM/Blocking.pm line 105.
2013.05.02 08:55:02 1: CallBlockingFn: Can't connect to localhost:

Can't use an undefined value as a symbol reference at FHEM/Blocking.pm line 116.


Dieser Fehler tritt auf, wenn man den Befehl rereadcfg verwendet. Dies ist dadurch bedingt, dass ein rereadcfg alle Definitionen komplett löscht und neu anlegt. Wenn nun zu genau dieser Zeit ein Check läuft, greift dieser Check noch auf Variablen zu die bereits gelöscht worden sind (Use of unitialized....). Daher weis er nicht mehr über welchen Telnet-Port PRESENCE die Daten aus dem Fork an den Hauptprozess soll.

Man kann diesen Fehler umgehen, indem man einen festen Telnetport definiert, über den man mit localhost-only zugreifen kann. Dann würde der selbe Port nach einem rereadcfg wieder zur Verfügung stehen.

Nu wenn kann kein Telnet-Device definiert hat, wird ein temporäres Device auf einer Auswahl an Ports nur für localhost geöffnet.

Oder man macht statt einem rereadcfg einen vollen Neustart von FHEM mit shutdown restart.

Zitat von: Elektrolurch am 14 Oktober 2013, 11:38:06
Es folgen dann Meldungen, wie canot fork...
Und dann startet die FB neu.
Ich habe vorerst einmal meine Presence-Definitionen, die alle in einem include liegen, deaktiviert, da mir ansonsten zu häufig die TK-Anlage ausfällt.

Gruß

Elektrolurch

Da gibt es aber ein generelles Problem bei dir, wenn der FHEM Prozess nicht mehr forken kann. Da währen weiterführende Logs sehr hilfreich und wie zu dem Zeitpunkt die Prozessliste auf deiner FritzBox aussieht.

Viele Grüße

Markus

PS: Bitte postet PRESENCE Themen im Board "Unterstützende Dienste", da ich hier in FritzBox fast garnicht reinschauhe.

Developer für Module: YAMAHA_AVR, YAMAHA_BD, FB_CALLMONITOR, FB_CALLLIST, PRESENCE, Pushsafer, LGTV_IP12, version

aktives Mitglied des FHEM e.V. (Technik)