Fhem stürzt ab durch 10_MYSENSORS_DEVICE.pm

Begonnen von Pseudex, 10 Mai 2019, 08:23:54

Vorheriges Thema - Nächstes Thema

Pseudex

Hi,

seit gestern stürzt mein FHEM ab und die letzte Fehlermeldung ist diese hier:

May 10 08:00:10 localhost fhem[17091]: Not an ARRAY reference at ./FHEM/10_MYSENSORS_DEVICE.pm line 1139.


sub timeoutAck($) {
    my $hash = shift;
    Log3 $hash->{NAME}, 5, "$hash->{NAME}: timeoutAck called";
    if ($hash->{IODev}->{outstandingAck} == 0) {
      Log3 $hash->{NAME}, 4, "$hash->{NAME}: timeoutAck called, no outstanding Acks at all";
      readingsSingleUpdate($hash,"heartbeat","alive",1) if (ReadingsVal($hash,"heartbeat","dead") eq "NACK");
    } elsif (@{$hash->{IODev}->{messagesForRadioId}->{$hash->{radioId}}->{messages}}) {
       Log3 $hash->{NAME}, 4, "$hash->{NAME}: timeoutAck called, outstanding: @$hash->{IODev}->{messagesForRadioId}->{$hash->{radioId}}->{messages}";
        readingsSingleUpdate($hash,"heartbeat","NACK",1) ;
    } else {
        Log3 $hash->{NAME}, 4, "$hash->{NAME}: timeoutAck called, no outstanding Acks for Node";
        readingsSingleUpdate($hash,"heartbeat","alive",1) if (ReadingsVal($hash,"heartbeat","dead") eq "NACK");
    }
}


Der Fehler müsste in dieser Zeile sein.
Log3 $hash->{NAME}, 4, "$hash->{NAME}: timeoutAck called, outstanding: @$hash->{IODev}->{messagesForRadioId}->{$hash->{radioId}}->{messages}";

Ich habe die Zeile mal auskommentiert und lasse FHEM erstmal so laufen. Ich habe schon einen verdacht, welche Node das ist. Ich habe eine, die direkt die Lüftung steuert und die soll die Befehle quittieren, wenn sie vom Gateway kommen.

Pseudex

Ich denke ich habe auch schon den Fehler gefunden

falsch:
@$hash->{IODev}->{messagesForRadioId}->{$hash->{radioId}}->{messages}
korrekt:
{@$hash->{IODev}->{messagesForRadioId}->{$hash->{radioId}}->{messages}}

Es fehlen die geschweiften Klammern. Ohne wird wohl $hash als Array interpretiert und nicht die messages.

Beta-User

Danke für's melden und coden!
Kannst du auch verifizieren, dass das korrekt ins Log geschrieben wird (die Node (bzw. global) steht auf Verbose 4 oder 5?)?

Ansonsten hätte ich noch (erst grob angetestet) anzubieten:

sub timeoutAck($) {
    my $hash = shift;
    Log3 $hash->{NAME}, 5, "$hash->{NAME}: timeoutAck called";
    if ($hash->{IODev}->{outstandingAck} == 0) {
      Log3 $hash->{NAME}, 4, "$hash->{NAME}: timeoutAck called, no outstanding Acks at all";
      readingsSingleUpdate($hash,"heartbeat","alive",1) if (ReadingsVal($hash,"heartbeat","dead") eq "NACK");
    } elsif (my $outstanding = $hash->{IODev}->{messagesForRadioId}->{$hash->{radioId}}->{messages}) {
      Log3 $hash->{NAME}, 4, "$hash->{NAME}: timeoutAck called, outstanding: @$outstanding";
      readingsSingleUpdate($hash,"heartbeat","NACK",1) ;
    } else {
      Log3 $hash->{NAME}, 4, "$hash->{NAME}: timeoutAck called, no outstanding Acks for Node";
      readingsSingleUpdate($hash,"heartbeat","alive",1) if (ReadingsVal($hash,"heartbeat","dead") eq "NACK");
    }
}
Server: HP-elitedesk@Debian 12, aktuelles FHEM@ConfigDB | CUL_HM (VCCU) | MQTT2: MiLight@ESP-GW, BT@OpenMQTTGw | MySensors: seriell, v.a. 2.3.1@RS485 | ZWave | ZigBee@deCONZ | SIGNALduino | MapleCUN | RHASSPY
svn: u.a MySensors, Weekday-&RandomTimer, Twilight,  div. attrTemplate-files

Pseudex

Das Log sieht so aus

May 10 09:26:43 localhost fhem[20511]: 2019.05.10 09:26:43 5: MYSENSOR_104: timeoutAck called
May 10 09:26:43 localhost fhem[20511]: 2019.05.10 09:26:43 4: MYSENSOR_104: timeoutAck called, no outstanding Acks at all
May 10 09:26:44 localhost systemd[1]: fhem.service: Start operation timed out. Terminating.
May 10 09:26:44 localhost systemd[1]: fhem.service: Unit entered failed state.
May 10 09:26:44 localhost systemd[1]: fhem.service: Failed with result 'timeout'.
May 10 09:27:50 localhost fhem[20511]: 2019.05.10 09:27:50 1: PERL WARNING: Subroutine MYSENSORS_DEVICE_Initialize redefined at ./FHEM/10_MYSENSORS_DEVICE.pm line 32.
May 10 09:27:50 localhost fhem[20511]: 2019.05.10 09:27:50 1: PERL WARNING: Subroutine Define redefined at ./FHEM/10_MYSENSORS_DEVICE.pm line 222.
May 10 09:27:50 localhost fhem[20511]: 2019.05.10 09:27:50 1: PERL WARNING: Subroutine UnDefine redefined at ./FHEM/10_MYSENSORS_DEVICE.pm line 242.
May 10 09:27:50 localhost fhem[20511]: 2019.05.10 09:27:50 1: PERL WARNING: Subroutine Set redefined at ./FHEM/10_MYSENSORS_DEVICE.pm line 248.
May 10 09:27:50 localhost fhem[20511]: 2019.05.10 09:27:50 1: PERL WARNING: Subroutine Get redefined at ./FHEM/10_MYSENSORS_DEVICE.pm line 340.
May 10 09:27:50 localhost fhem[20511]: 2019.05.10 09:27:50 1: PERL WARNING: Subroutine onStreamMessage redefined at ./FHEM/10_MYSENSORS_DEVICE.pm line 384.
May 10 09:27:50 localhost fhem[20511]: 2019.05.10 09:27:50 1: PERL WARNING: Subroutine Attr redefined at ./FHEM/10_MYSENSORS_DEVICE.pm line 460.
May 10 09:27:50 localhost fhem[20511]: 2019.05.10 09:27:50 1: PERL WARNING: Subroutine onGatewayStarted redefined at ./FHEM/10_MYSENSORS_DEVICE.pm line 601.
May 10 09:27:50 localhost fhem[20511]: 2019.05.10 09:27:50 1: PERL WARNING: Subroutine onPresentationMessage redefined at ./FHEM/10_MYSENSORS_DEVICE.pm line 606.
May 10 09:27:50 localhost fhem[20511]: 2019.05.10 09:27:50 1: PERL WARNING: Subroutine onSetMessage redefined at ./FHEM/10_MYSENSORS_DEVICE.pm line 686.
May 10 09:27:50 localhost fhem[20511]: 2019.05.10 09:27:50 1: PERL WARNING: Subroutine onRequestMessage redefined at ./FHEM/10_MYSENSORS_DEVICE.pm line 708.
May 10 09:27:50 localhost fhem[20511]: 2019.05.10 09:27:50 1: PERL WARNING: Subroutine onInternalMessage redefined at ./FHEM/10_MYSENSORS_DEVICE.pm line 723.
May 10 09:27:50 localhost fhem[20511]: 2019.05.10 09:27:50 1: PERL WARNING: Subroutine sendClientMessage redefined at ./FHEM/10_MYSENSORS_DEVICE.pm line 940.
May 10 09:27:50 localhost fhem[20511]: 2019.05.10 09:27:50 1: PERL WARNING: Subroutine rawToMappedReading redefined at ./FHEM/10_MYSENSORS_DEVICE.pm line 974.
May 10 09:27:50 localhost fhem[20511]: 2019.05.10 09:27:50 1: PERL WARNING: Subroutine mappedReadingToRaw redefined at ./FHEM/10_MYSENSORS_DEVICE.pm line 984.
May 10 09:27:50 localhost fhem[20511]: 2019.05.10 09:27:50 1: PERL WARNING: Subroutine short2Hex redefined at ./FHEM/10_MYSENSORS_DEVICE.pm line 1003.
May 10 09:27:50 localhost fhem[20511]: 2019.05.10 09:27:50 1: PERL WARNING: Subroutine hex2Short redefined at ./FHEM/10_MYSENSORS_DEVICE.pm line 1009.
May 10 09:27:50 localhost fhem[20511]: 2019.05.10 09:27:50 1: PERL WARNING: Subroutine flashFirmware redefined at ./FHEM/10_MYSENSORS_DEVICE.pm line 1014.
May 10 09:27:50 localhost fhem[20511]: 2019.05.10 09:27:50 1: PERL WARNING: Subroutine refreshInternalMySTimer redefined at ./FHEM/10_MYSENSORS_DEVICE.pm line 1101.
May 10 09:27:50 localhost fhem[20511]: 2019.05.10 09:27:50 1: PERL WARNING: Subroutine timeoutAlive redefined at ./FHEM/10_MYSENSORS_DEVICE.pm line 1126.
May 10 09:27:50 localhost fhem[20511]: 2019.05.10 09:27:50 1: PERL WARNING: Subroutine timeoutAck redefined at ./FHEM/10_MYSENSORS_DEVICE.pm line 1132.
May 10 09:27:50 localhost fhem[20511]: 2019.05.10 09:27:50 1: PERL WARNING: Subroutine timeoutAwake redefined at ./FHEM/10_MYSENSORS_DEVICE.pm line 1147.
May 10 09:27:50 localhost fhem[20511]: 2019.05.10 09:27:50 1: PERL WARNING: Subroutine sendRetainedMessages redefined at ./FHEM/10_MYSENSORS_DEVICE.pm line 1154.
May 10 09:28:26 localhost fhem[20511]: 2019.05.10 09:28:26 5: MYSENSOR_104: refreshInternalMySTimer called (Ack)
May 10 09:28:26 localhost fhem[20511]: 2019.05.10 09:28:26 5: MYSENSOR_104: Ack timeout timer set at 1557473311.79832
May 10 09:28:26 localhost fhem[20511]: 2019.05.10 09:28:26 5: MYSENSOR_104 is not sleeping, sending message!
May 10 09:28:31 localhost fhem[20511]: 2019.05.10 09:28:31 5: MYSENSOR_104: timeoutAck called
May 10 09:28:31 localhost fhem[20511]: 2019.05.10 09:28:31 4: MYSENSOR_104: timeoutAck called, outstanding: HASH(0x558bd87238)
May 10 09:29:12 localhost fhem[20511]: 2019.05.10 09:29:12 5: MYSENSOR_104: refreshInternalMySTimer called (Ack)
May 10 09:29:12 localhost fhem[20511]: 2019.05.10 09:29:12 5: MYSENSOR_104: Ack timeout timer set at 1557473357.41901
May 10 09:29:12 localhost fhem[20511]: 2019.05.10 09:29:12 5: MYSENSOR_104 is not sleeping, sending message!
May 10 09:29:17 localhost fhem[20511]: 2019.05.10 09:29:17 5: MYSENSOR_104: timeoutAck called
May 10 09:29:17 localhost fhem[20511]: 2019.05.10 09:29:17 4: MYSENSOR_104: timeoutAck called, outstanding: HASH(0x558e61e118)

Beta-User

Ist das das Ergebnis von deiner Änderung von 08:55 Uhr oder von meinem Vorschlag?

(Es sollte eine Zahl da stehen, keine HASH-Angabe)
Server: HP-elitedesk@Debian 12, aktuelles FHEM@ConfigDB | CUL_HM (VCCU) | MQTT2: MiLight@ESP-GW, BT@OpenMQTTGw | MySensors: seriell, v.a. 2.3.1@RS485 | ZWave | ZigBee@deCONZ | SIGNALduino | MapleCUN | RHASSPY
svn: u.a MySensors, Weekday-&RandomTimer, Twilight,  div. attrTemplate-files

Pseudex

#5
Ich habe jetzt nur die Änderung mit dem Klammern getestet. Aber ich kann deine Änderung später auch nochmal testen. Schreibe dann hier den Log Output.


May 10 14:24:44 localhost fhem[20818]: 2019.05.10 14:24:44 5: MYSENSOR_104: refreshInternalMySTimer called (Ack)
May 10 14:24:44 localhost fhem[20818]: 2019.05.10 14:24:44 5: MYSENSOR_104: Ack timeout timer set at 1557491089.22204
May 10 14:24:44 localhost fhem[20818]: 2019.05.10 14:24:44 5: MYSENSOR_104 is not sleeping, sending message!
May 10 14:24:49 localhost fhem[20818]: 2019.05.10 14:24:49 5: MYSENSOR_104: timeoutAck called
May 10 14:24:49 localhost fhem[20818]: 2019.05.10 14:24:49 4: MYSENSOR_104: timeoutAck called, outstanding: HASH(0x55d2e38ed8)

Beta-User

Habe eben ein update ins svn geschoben; damit scheint es auch mit sinnvollen verbose-Ausgaben korrekt zu funktionieren.

[gelöst]?
Server: HP-elitedesk@Debian 12, aktuelles FHEM@ConfigDB | CUL_HM (VCCU) | MQTT2: MiLight@ESP-GW, BT@OpenMQTTGw | MySensors: seriell, v.a. 2.3.1@RS485 | ZWave | ZigBee@deCONZ | SIGNALduino | MapleCUN | RHASSPY
svn: u.a MySensors, Weekday-&RandomTimer, Twilight,  div. attrTemplate-files

Pseudex

Habe das Update geladen. Beim timeout ist fhem nicht abgestürzt. Sollte somit gelöst sein.

Vielen Dank!