70_VIERA.pm: PERL WARNING: Use of uninitialized value in numeric gt

Begonnen von Nestor, 10 November 2019, 19:24:05

Vorheriges Thema - Nächstes Thema

Nestor

I have following error in Fhem log.
2019.11.10 00:07:16 1: PERL WARNING: Use of uninitialized value in numeric gt (>) at ./FHEM/70_VIERA.pm line 426.


Since read can also return undef upon error, maybe this can be validated?

--- - 2019-11-10 19:10:42.000000000 +0100
+++ FHEM/70_VIERA.pm 2019-11-10 19:08:54.000000000 +0100
@@ -423,7 +423,9 @@
     Log3 $hash, 5, "VIERA[$blocking]: Send Data to $hash->{helper}{HOST}:$hash->{helper}{PORT}:\n$data";
     print $sock $data;
   
-    while ((read $sock, $buff, 1024) > 0){
+    while (1){
+      my $res = read $sock, $buff, 1024;
+      last if (not defined($res) or $res == 0);
       $buffer .= $buff;
     }

mabula

Hi Nestor,
have you still problems with the newer versions of this module?
If yes, please send me a note directly.

regards
HJB
FHEM auf RPI mit FS20, Homematic, ELERO, Zigbee, Eigenbau z.B. Heizölsensor auf Basis Arduino, Anemometer; Sprachsteuerung offline über vosk/Python

mabula

Thank you Nestor,

Good remark. I will implement it at the next update. I just work on new commands, starting "apps" directly. If you have a TV without encryption would you mind to help testing. I have only one with encryption and I must change code more radical.

Regards
HJB
FHEM auf RPI mit FS20, Homematic, ELERO, Zigbee, Eigenbau z.B. Heizölsensor auf Basis Arduino, Anemometer; Sprachsteuerung offline über vosk/Python

Nestor

I don't have a newer Viera with encryption unfortunately, only older plasma VT50 series.

mabula

That's exactly what I'm looking for. Would you mind to test an the old TV version? I have only a new one.
FHEM auf RPI mit FS20, Homematic, ELERO, Zigbee, Eigenbau z.B. Heizölsensor auf Basis Arduino, Anemometer; Sprachsteuerung offline über vosk/Python

Nestor


mabula

Sorry Nestor,
you have been too fast. I will put the new Version just for testing in the thread https://forum.fhem.de/index.php/topic,99994.0.html.
I changed the commands completely (internal hashes) and using a common command path for encrypted and non-encrypted TVs.
So I have to know, if I have not destroyed everything with older TVs.
I will send you a direct mail, after upload the new version.

Greatings
HJB
FHEM auf RPI mit FS20, Homematic, ELERO, Zigbee, Eigenbau z.B. Heizölsensor auf Basis Arduino, Anemometer; Sprachsteuerung offline über vosk/Python