(gelöst)Fehler KostalPiko & fhem allgemein

Begonnen von Crawler, 24 August 2015, 13:49:46

Vorheriges Thema - Nächstes Thema

Crawler

Hi
Ich habe ein Problem mit dem Modul KostalPiko
System Win 7 Active Perl 5.2

Das Problem besteht darin das nach einiger zeit scheinbar das Netzwerk einbricht
Zitat2015.08.24 13:27:26 3: KOSTALPIKO Solar: StatusTimer.837 --- started ---
2015.08.24 13:27:26 3: KOSTALPIKO Solar: StatusStart.545 --- started ---
2015.08.24 13:27:26 1: Cannot fork: Resource temporarily unavailable
2015.08.24 13:27:26 1: Cannot fork: Resource temporarily unavailable
2015.08.24 13:27:26 3: KOSTALPIKO Solar: StatusStart.576 --- done ---
2015.08.24 13:27:26 3: KOSTALPIKO Solar: StatusTimer.848 --- done ---

genauso verhält es sich mit der update Funktion in Fhem
Zitat2015.08.24 13:37:50 4: HTTP FHEMWEB:127.0.0.1:56589 GET /fhem&cmd=update
2015.08.24 13:37:50 5: Cmd: >update<
2015.08.24 13:37:50 1: Cannot fork: Resource temporarily unavailable
2015.08.24 13:37:50 1: Cannot fork: Resource temporarily unavailable
2015.08.24 13:37:50 4: 192:FHEMWEB:127.0.0.1:56589: /fhem&cmd=update / RL:1137 / text/html; charset=UTF-8 / Content-Encoding: gzip

verbose 5 mehr Infos kommen nicht
update check funktioniert und listet neue Dateien auf
Zitat2015.08.24 13:37:36 4: HTTP FHEMWEB:127.0.0.1:56577 GET /fhem&cmd=update+check
2015.08.24 13:37:36 5: Cmd: >update check<
2015.08.24 13:37:36 4: HttpUtils url=http://fhem.de/fhemupdate/controls_fhem.txt
2015.08.24 13:37:37 4: http://fhem.de/fhemupdate/controls_fhem.txt: HTTP response code 200
2015.08.24 13:37:37 4: HttpUtils http://fhem.de/fhemupdate/controls_fhem.txt: Got data, length: 101995
2015.08.24 13:37:37 4: HttpUtils url=http://fhem.de/fhemupdate/CHANGED
2015.08.24 13:37:37 4: http://fhem.de/fhemupdate/CHANGED: HTTP response code 200
2015.08.24 13:37:37 4: HttpUtils http://fhem.de/fhemupdate/CHANGED: Got data, length: 109007
2015.08.24 13:37:38 4: 192:FHEMWEB:127.0.0.1:56577: /fhem&cmd=update+check / RL:2551 / text/html; charset=UTF-8 / Content-Encoding: gzip
Netzwerk und Internet sind vorhanden (schreibe gerade von dem PC)
je nach Einstellung im Modul KostalPiko läuft es 1 bis 4 h bevor diese Fehler auftauchen
Hatte den Fehler vorher schon auf einer Fritzbox 7290
FHEM auf Raspi + HMLan + 14 Aktoren + OBIS(Strom) über GPIO

rudolfkoenig

Vmtl. sind die vom KOSTALPIKO-Modul ueber die Blocking Funktionalitaet gestarteten Prozesse noch am laufen.
Wieviel Haupspeicher hat der FHEM-Rechner, und wieviel ist normalerweise davon frei?

Entweder liegt ein Fehler in den Blocking Funktionen vor (dann waere ich zustaendig), oder das Modul laeuft Amok, dann muesste der Modul-Maintainer eingreifen. Dass Blocking kaputt, ist, muesste mir jemand noch vorfuehren, da meine Tests mit Blocking kein Problem zeigen.

Crawler

#2
8 GB Gesamtspeicher
2.9 GB belegt
2.8 GB belegt ohne fhem
Perl 74.000 KB zugesichert 78.000 KB Arbeitssatz 7.000 KB freigabefähig 71.000 KB Privat

Hatte jetzt nach Neustart auf den
Last 10 structural changes:
  define telnetForBlockingFn telnet 0
  attr telnetForBlockingFn room hidden

hat das was zu bedeuten?
FHEM auf Raspi + HMLan + 14 Aktoren + OBIS(Strom) über GPIO

rudolfkoenig

Zitatdefine telnetForBlockingFn telnet 0
Ist normal, falls man selbst kein telnet definiert hat. Das ebenfalls aktivierte "attr telnetForBlockingFn allowfrom 127.0.0.1" ist leider in der Aufzaehlung nicht zu sehen.

Da Speicher ausreichend vorhanden ist, liegt es vermutlich an einem begrenzten nproc/maxproc, was mit ulimit -a (bash) oder limit (tcsh) zu sehen ist. Konfiguriert ist sowas ueblicherweise in /etc/security/limits.conf oder in /etc/profile

Crawler

#4
Habe momentan ein Windows System kann es aber mal auf der linux Version testen

hier mal der Systemstart
Zitat
2015.08.24 21:36:44 5: HMLAN_Parse: HMLAN1 V:03C4 sNo:LEQ00############################### L:2 %
2015.08.24 21:36:44 5: Triggering HMLAN1 (1 changes)
2015.08.24 21:36:44 5: Notify loop for HMLAN1 loadLvl: low
2015.08.24 21:36:46 1: PERL WARNING: Terminating on signal SIGHUP(1)
2015.08.24 21:37:25 1: starting in console mode
2015.08.24 21:37:25 5: Initializing Type Library:
2015.08.24 21:37:25 1: Including fhem.cfg
2015.08.24 21:37:25 5: Cmd: >attr global userattr cmdIcon devStateIcon devStateStyle icon sortby webCmd widgetOverride<
2015.08.24 21:37:25 5: Cmd: >attr global autoload_undefined_devices 1<
2015.08.24 21:37:25 5: Cmd: >attr global latitude ########<
2015.08.24 21:37:25 5: Cmd: >attr global logfile ./log/fhem-%Y-%m.log<
2015.08.24 21:37:25 5: Cmd: >attr global longitude #######<
2015.08.24 21:37:25 5: Cmd: >attr global modpath .<
2015.08.24 21:37:25 5: Cmd: >attr global nofork 1<
2015.08.24 21:37:25 5: Cmd: >attr global sendStatistics onUpdate<
2015.08.24 21:37:25 5: Cmd: >attr global statefile ./log/fhem.save<
2015.08.24 21:37:25 5: Cmd: >attr global uniqueID ./FHEM/FhemUtils/uniqueID<
2015.08.24 21:37:25 5: Cmd: >attr global updateInBackground 1<
2015.08.24 21:37:25 5: Cmd: >attr global verbose 5<
......
Loading ./FHEM/23_KOSTALPIKO.pm
given is experimental at ./FHEM/23_KOSTALPIKO.pm line 374, <$fh> line 427.
when is experimental at ./FHEM/23_KOSTALPIKO.pm line 376, <$fh> line 427.
when is experimental at ./FHEM/23_KOSTALPIKO.pm line 380, <$fh> line 427.
when is experimental at ./FHEM/23_KOSTALPIKO.pm line 385, <$fh> line 427.
when is experimental at ./FHEM/23_KOSTALPIKO.pm line 390, <$fh> line 427.
when is experimental at ./FHEM/23_KOSTALPIKO.pm line 396, <$fh> line 427.
.......
2015.08.24 21:37:30 0: Featurelevel: 5.6
2015.08.24 21:37:30 0: Server started with 66 defined entities (version $Id: fhem.pl 9118 2015-08-23 12:43:56Z rudolfkoenig $, os MSWin32, user Rouven, pid 6020)
.......
2015.08.24 21:37:50 3: KOSTALPIKO Solar: GrTimer.1037 --- started ---
2015.08.24 21:37:50 3: KOSTALPIKO Solar: GrStart.900 --- started ---
2015.08.24 21:37:50 4: BlockingCall created child (-4652), uses telnetForBlockingFn to connect back
2015.08.24 21:37:50 3: KOSTALPIKO Solar: GrStart.913 --- done ---
2015.08.24 21:37:50 3: KOSTALPIKO Solar: GrTimer.1048 --- done ---
2015.08.24 21:37:50 3: KOSTALPIKO Solar: GrRun.928 --- started ---
2015.08.24 21:37:55 4: KOSTALPIKO Solar: GrRun.941 parsed terms:6
2015.08.24 21:37:55 3: KOSTALPIKO Solar: GrRun.952 --- done ---
2015.08.24 21:37:55 4: Connection accepted from telnet:127.0.0.1:59475
2015.08.24 21:37:55 5: Cmd: >{KOSTALPIKO_GrDone('Solar|rel. Sonnenscheindauer|30 %|UV-Index|4|Globalstrahlung|4,9')}<
2015.08.24 21:37:55 3: KOSTALPIKO Solar: GrDone.967 --- started ---
2015.08.24 21:37:55 5: KOSTALPIKO Solar: GrDone.970 values:rel. Sonnenscheindauer, 30 %, UV-Index, 4, Globalstrahlung, 4,9
2015.08.24 21:37:55 5: KOSTALPIKO Solar: GrDone.1000 tag:sunshine.duration value:30
2015.08.24 21:37:55 5: KOSTALPIKO Solar: GrDone.1000 tag:UV.Index value:4
2015.08.24 21:37:55 5: KOSTALPIKO Solar: GrDone.1000 tag:Global.Radiation value:4.9
2015.08.24 21:37:55 5: KOSTALPIKO Solar: GrDone.1011 Global.Radiation: 4.9 upd:1
2015.08.24 21:37:55 5: KOSTALPIKO Solar: GrDone.1011 UV.Index: 4 upd:1
2015.08.24 21:37:55 5: KOSTALPIKO Solar: GrDone.1011 sunshine.duration: 30 upd:1
2015.08.24 21:37:55 5: Triggering Solar (3 changes)
2015.08.24 21:37:55 5: Notify loop for Solar Global.Radiation: 4.9
2015.08.24 21:37:55 3: KOSTALPIKO Solar: GrDone.1015 --- done ---
FHEM auf Raspi + HMLan + 14 Aktoren + OBIS(Strom) über GPIO

rudolfkoenig

Es ist ein Problem unter Windows: die perl fork-Emulation beachtet die Einstellung $SIG{CHLD} = 'IGNORE' nicht, und besteht auf ein wait. Ohne wait wird der Eintrag in der Thread-Tabelle trotz threads->exit() nicht aufgeraeumt, und da ist nur Platz fuer 64 Eintraege, siehe http://code.activestate.com/lists/perl-win32-users/12051/

Ich habe jetzt in Blocking.pm/BlockingKill() unter Windows wait eingebaut, diese Funktion wird aber nur dann aufgerufen, falls man in BlockingCall Timeout spezifiziert hat, unabhaengig davon, ob der der Prozess terminiert werden soll oder nicht (wird unter Windows sowieso nicht). Und man darf waehrend dieser Periode weniger als 63 Threads bzw. BlockingCall Aufrufe starten. Fuer 23_KOSTALPIKO.pm sollte das (wenn ich das richtig sehe) funktionieren, da BlockingCall alle 60 Sekunden gestartet wird, mit einem Timeout von 50 Sekunden.

Ab morgen per update...

Crawler

#6
Du rettest mich ;-)
Habe gestern den ganzen tag versucht ein Linux Server auf zusetzen. Linux hat beim dem PC ziemliche Probleme mit Hdmi audio out :-(
FHEM auf Raspi + HMLan + 14 Aktoren + OBIS(Strom) über GPIO

Crawler

#7
Okay funktioniert seit 4h doch die Systemzeit war falsch wodurch ich ein hängen vermutet habe *schäm*
FHEM auf Raspi + HMLan + 14 Aktoren + OBIS(Strom) über GPIO

rudolfkoenig

Naja, neustarten.
Enthaelt Blocking.pm/BlockingKill die wait Zeile?

Wenn ja, dann bitte:
- in BlockingCall als erstes die Zeile
Log 1, "BlockingCall: $blockingFn with timeout $timeout";
- und in BlockingKill als erstes die Zeile
Log 1, "BlockingKill for $h->{fn}";

eingeben und erneut testen.

Crawler

#9
Okay funktioniert seit 4h doch die Systemzeit war falsch wodurch ich ein hängen vermutet habe *schäm*


Gesendet von meinem SM-G900F mit Tapatalk

Werde mich morgen früh nochmal melden wenn die Anlage wieder hoch fährt...

Ps Kann man ein Modul von update ausschließen?
FHEM auf Raspi + HMLan + 14 Aktoren + OBIS(Strom) über GPIO

Heiner

Hi, habe ein ahenliches Problem. Mein Log sagt:
Zitatgiven is experimental at ./FHEM/23_KOSTALPIKO.pm line 376, <$fh> line 322.
when is experimental at ./FHEM/23_KOSTALPIKO.pm line 378, <$fh> line 322.
when is experimental at ./FHEM/23_KOSTALPIKO.pm line 382, <$fh> line 322.
when is experimental at ./FHEM/23_KOSTALPIKO.pm line 387, <$fh> line 322.
when is experimental at ./FHEM/23_KOSTALPIKO.pm line 392, <$fh> line 322.
when is experimental at ./FHEM/23_KOSTALPIKO.pm line 398, <$fh> line 322.

ulimit -a und Limit bringen das hier
Zitatroot@fhemserver ~ # ulimit -a
-t: cpu time (seconds)              unlimited
-f: file size (blocks)              unlimited
-d: data seg size (kbytes)          unlimited
-s: stack size (kbytes)             8192
-c: core file size (blocks)         unlimited
-m: resident set size (kbytes)      unlimited
-u: processes                       7761
-n: file descriptors                4096
-l: locked-in-memory size (kbytes)  64
-v: address space (kbytes)          unlimited
-x: file locks                      unlimited
-i: pending signals                 7761
-q: bytes in POSIX msg queues       819200
-e: max nice                        0
-r: max rt priority                 0
-N 15:                              unlimited
root@fhemserver ~ # limit
cputime         unlimited
filesize        unlimited
datasize        unlimited
stacksize       8MB
coredumpsize    unlimited
memoryuse       unlimited
maxproc         7761
descriptors     4096
memorylocked    64kB
addressspace    unlimited
maxfilelocks    unlimited
sigpending      7761
msgqueue        819200
nice            0
rt_priority     0
rt_time         unlimited
root@fhemserver ~ #

Ich hab weniger Speicher aber in TOP siehts meiner Meinung nach gut aus
Zitat
top - 14:38:00 up 13 min,  1 user,  load average: 0,00, 0,03, 0,05
Tasks:  67 total,   1 running,  66 sleeping,   0 stopped,   0 zombie
%Cpu(s):  0,2 us,  0,3 sy,  0,0 ni, 99,5 id,  0,0 wa,  0,0 hi,  0,0 si,  0,0 st
KiB Mem:    993732 total,   129988 used,   863744 free,     9380 buffers
KiB Swap:        0 total,        0 used,        0 free.    54480 cached Mem

Heiner
--------------------------------
fhem auf Pi3+
CUL 868MHz, Signalduino 434MHz, HM-CFG-USB
HM, THZ, Kostal, Somfy, Conbee, Pytonbinding, FritzBox, FTUI, MQTT2