FHEM Forum

FHEM => Sonstiges => Thema gestartet von: postman am 15 März 2021, 10:39:52

Titel: httpmod/utils.pm
Beitrag von: postman am 15 März 2021, 10:39:52
Hallo zusammen,
ich habe heute ein update gemacht.
Nach dem "shutdown restart" ist FHEM nicht mehr erreichbar.
Im Logfile ist folgender Eintrag vorhanden:
Undefined subroutine &FHEM::HTTPMOD::Utils::lower called at lib/FHEM/HTTPMOD/Utils.pm line 742.

Nach dem Zurückkopieren der Sicherung läuft es wieder. Leider  tritt der Fehler nach update wieder auf.

Gruß
postman
Titel: Antw:httpmod/utils.pm
Beitrag von: CoolTux am 15 März 2021, 11:02:40
Schau mal ob Du diese Datei hast
lib/FHEM/HTTPMOD/Utils.pm

ausgehend von Deinem fhem Verzeichnis
Titel: Antw:httpmod/utils.pm
Beitrag von: postman am 15 März 2021, 12:13:29
Hallo CoolTux,
habe ich; sie wurde heute mit dem update getauscht. Danach kam der Fehler und FHEM konnte im Browser nicht mehr aufgerufen werden.

Gruß
Titel: Antw:httpmod/utils.pm
Beitrag von: CoolTux am 15 März 2021, 12:58:06
Habe eben ein Update gemacht und auch die Datei neu bekommen. Bei mir läuft es erstmal. Habe aber glaube auch kein HTTPMOD Modul. Muss ich mal anlegen.

Gib mal bitte ganz genau die letzten 50 Zeilen vom log vor dem Crash
Titel: Antw:httpmod/utils.pm
Beitrag von: postman am 15 März 2021, 13:22:40
Hallo CoolTux,
hier das Log:
2021.03.15 10:11:07 0: Server shutdown
2021.03.15 10:11:07 1: Timeout for MPD_IdleStart reached, terminated process 2705
2021.03.15 10:11:11 1: Perl version: 5.014002
2021.03.15 10:11:11 1: OS   version: linux
2021.03.15 10:11:11 1: Loading Unix modules
2021.03.15 10:11:11 1: Including fhem.cfg
2021.03.15 10:11:12 3: telnetPort: port 7072 opened
2021.03.15 10:11:12 3: WEB: port 8083 opened
2021.03.15 10:11:12 3: WEBphone: port 8084 opened
2021.03.15 10:11:12 3: WEBtablet: port 8085 opened
2021.03.15 10:11:13 2: eventTypes: loaded 3545 lines from ./log/eventTypes.txt
2021.03.15 10:11:13 3: Opening CUL_0 device /dev/ttyACM0
2021.03.15 10:11:13 3: Setting CUL_0 serial parameters to 9600,8,N,1
2021.03.15 10:11:14 3: CUL_0: Possible commands: ABbCeFGhiKkLlMmNRTtUuVWXxYZ
2021.03.15 10:11:14 3: CUL_0 device opened
2021.03.15 10:11:14 3: Opening SCC device /dev/ttyAMA0
2021.03.15 10:11:14 3: Setting SCC serial parameters to 38400,8,N,1
2021.03.15 10:11:14 3: SCC: Possible commands: mBbCFiAZGMYRTVWXef*ltuxz
2021.03.15 10:11:14 3: SCC device opened
2021.03.15 10:11:16 2: EnOcean Cryptographic functions are not available.
2021.03.15 10:11:16 2: EnOcean XML functions available.
2021.03.15 10:11:17 3: iRadio, Device defined.
2021.03.15 10:11:19 3: Opening JeeLink device /dev/ttyUSB2
2021.03.15 10:11:19 3: Setting JeeLink serial parameters to 57600,8,N,1
2021.03.15 10:11:20 3: JeeLink device opened
2021.03.15 10:11:20 3: ObenTemp: I/O device is JeeLink
2021.03.15 10:11:20 3: WoTemp: I/O device is JeeLink
2021.03.15 10:11:21 3: BTemp: I/O device is JeeLink
2021.03.15 10:11:21 3: KTemp: I/O device is JeeLink
2021.03.15 10:11:21 3: Z1Temp: I/O device is JeeLink
2021.03.15 10:11:21 3: Z2Temp: I/O device is JeeLink
2021.03.15 10:11:22 3: wartungHz: Defined with URL http://192.168.178.9/7045 and interval 7025 featurelevel 5.7
2021.03.15 10:11:22 3: Betriebsart: Defined with URL http://192.168.178.9/700 and interval 180 featurelevel 5.7
2021.03.15 10:11:22 3: Kesselstatus: Defined with URL http://192.168.178.9/8005 and interval 59 featurelevel 5.7
2021.03.15 10:11:22 3: Kesseltemperatur: Defined with URL http://192.168.178.9/7760 and interval 55 featurelevel 5.7
2021.03.15 10:11:22 3: Kesseltemperatur: the attribute readingsName.* should no longer be used. Please use reading01Name syntax instead
2021.03.15 10:11:22 3: Kesseltemperatur: For most old attributes you can specify enableControlSet and then set device upgradeAttributes to automatically modify the configuration
2021.03.15 10:11:22 3: Kesseltemperatur: the attribute readingsRegex.* should no longer be used. Please use reading01Regex syntax instead
2021.03.15 10:11:22 3: Kesseltemperatur: For most old attributes you can specify enableControlSet and then set device upgradeAttributes to automatically modify the configuration
2021.03.15 10:11:22 3: Status_Heizkreis_1: Defined with URL http://192.168.178.9/8000 and interval 61 featurelevel 5.7
2021.03.15 10:11:22 3: Trinkwassertemperatur: Defined with URL http://192.168.178.9/7750 and interval 61 featurelevel 5.7
2021.03.15 10:11:22 3: Trinkwassertemperatur: the attribute readingsName.* should no longer be used. Please use reading01Name syntax instead
2021.03.15 10:11:22 3: Trinkwassertemperatur: For most old attributes you can specify enableControlSet and then set device upgradeAttributes to automatically modify the configuration
2021.03.15 10:11:22 3: Trinkwassertemperatur: the attribute readingsRegex.* should no longer be used. Please use reading01Regex syntax instead
2021.03.15 10:11:22 3: Trinkwassertemperatur: For most old attributes you can specify enableControlSet and then set device upgradeAttributes to automatically modify the configuration
2021.03.15 10:11:22 3: Trinkwasserstatus: Defined with URL http://192.168.178.9/8003 and interval 53 featurelevel 5.7
2021.03.15 10:11:22 3: Brennerstatus: Defined with URL http://192.168.178.9/8009 and interval 57 featurelevel 5.7
2021.03.15 10:11:23 3: AussTemp: I/O device is JeeLink
2021.03.15 10:11:24 3: AzTemp: I/O device is JeeLink
2021.03.15 10:11:24 3: Opening prr01Mon device 192.168.178.1:1012
2021.03.15 10:11:24 3: Brennermodulation: Defined with URL http://192.168.178.9/8326 and interval 63 featurelevel 5.7
2021.03.15 10:11:24 3: Brennermodulation: the attribute readingsName.* should no longer be used. Please use reading01Name syntax instead
2021.03.15 10:11:24 3: Brennermodulation: For most old attributes you can specify enableControlSet and then set device upgradeAttributes to automatically modify the configuration
2021.03.15 10:11:24 3: Brennermodulation: the attribute readingsRegex.* should no longer be used. Please use reading01Regex syntax instead
2021.03.15 10:11:24 3: Brennermodulation: For most old attributes you can specify enableControlSet and then set device upgradeAttributes to automatically modify the configuration
2021.03.15 10:11:26 3: Opening CUL_1 device /dev/serial/by-id/usb-SHK_NANO_CUL_868-if00-port0
2021.03.15 10:11:26 3: Setting CUL_1 serial parameters to 38400,8,N,1
2021.03.15 10:11:29 3: CUL_1: Possible commands: ABCEeFfGhiKklMmRTtUVWXxYZz
2021.03.15 10:11:29 3: CUL_1 device opened
2021.03.15 10:11:29 2: Switched CUL_1 rfmode to HomeMatic
2021.03.15 10:11:29 3: Opening TCM_ESP3_0 device /dev/ttyUSB0
2021.03.15 10:11:29 3: Setting TCM_ESP3_0 serial parameters to 57600,8,N,1
2021.03.15 10:11:29 3: TCM_ESP3_0 device opened
2021.03.15 10:11:32 3: LGTV_WebOS (LGTV) - defined with host 192.168.22.24
2021.03.15 10:11:32 3: Opening Velux device 192.168.178.5:51200
2021.03.15 10:11:32 3: KOTemp: I/O device is JeeLink
2021.03.15 10:11:32 3: Orange: I/O device is JeeLink
2021.03.15 10:11:33 1: Including ./log/fhem.save
2021.03.15 10:11:34 3: TCM TCM_ESP3_0 set reset
2021.03.15 10:11:34 2: TCM TCM_ESP3_0 RESPONSE: OK
2021.03.15 10:11:34 3: TCM TCM_ESP3_0 get baseID
2021.03.15 10:11:34 2: TCM TCM_ESP3_0 RESPONSE: BaseID: FFEFC480 RemainingWriteCycles: 0A
2021.03.15 10:11:34 3: TCM TCM_ESP3_0 get version
2021.03.15 10:11:34 2: TCM TCM_ESP3_0 RESPONSE: APIVersion: 02040201 APPVersion: 02070165 ChipID: 0189DF89 ChipVersion: 454F0103 Desc: GATEWAYCTRL
2021.03.15 10:11:35 3: TCM TCM_ESP3_0 set smartAckMailboxMax 0
2021.03.15 10:11:35 2: TCM TCM_ESP3_0 RESPONSE: OK
2021.03.15 10:11:35 2: TCM TCM_ESP3_0 smartAckMailboxMax 0 restored
2021.03.15 10:11:35 3: TCM TCM_ESP3_0 set repeater 0000
2021.03.15 10:11:35 2: TCM TCM_ESP3_0 RESPONSE: OK
2021.03.15 10:11:35 2: TCM TCM_ESP3_0 repeater 0000 restored
2021.03.15 10:11:35 3: TCM TCM_ESP3_0 set mode 00
2021.03.15 10:11:35 2: TCM TCM_ESP3_0 RESPONSE: NOT_SUPPORTED
2021.03.15 10:11:35 3: TCM TCM_ESP3_0 set maturity 01
2021.03.15 10:11:35 2: TCM TCM_ESP3_0 RESPONSE: OK
2021.03.15 10:11:35 2: TCM TCM_ESP3_0 maturity 01 restored
2021.03.15 10:11:35 2: TCM TCM_ESP3_0 initialized
2021.03.15 10:11:35 2: TCM registered transceiver BaseID: FFEFC480 ChipID: 0189DF89
2021.03.15 10:11:36 1: PERL WARNING: Use of uninitialized value $actuationDiff in numeric ge (>=) at ./FHEM/10_EnOcean.pm line 15376.
2021.03.15 10:11:36 1: PERL WARNING: Argument "" isn't numeric in numeric gt (>) at ./FHEM/10_EnOcean.pm line 15380.
2021.03.15 10:11:36 1: PERL WARNING: Use of uninitialized value $actuationDiff in numeric ne (!=) at ./FHEM/10_EnOcean.pm line 15387.
2021.03.15 10:11:36 3: bsbtest: trying to connect.
2021.03.15 10:11:36 2: doArbeitsommer: doArbeitsommer checkall: Unknown command doArbeitsommer, try help.
2021.03.15 10:11:36 3: doArbeitsommer: error in startup: doArbeitsommer checkall: Unknown command doArbeitsommer, try help.
2021.03.15 10:11:36 2: doBadobensommer: doBadobensommer checkall: Unknown command doBadobensommer, try help.
2021.03.15 10:11:36 3: doBadobensommer: error in startup: doBadobensommer checkall: Unknown command doBadobensommer, try help.
2021.03.15 10:11:36 2: doBadsommer: doBadsommer checkall: Unknown command doBadsommer, try help.
2021.03.15 10:11:36 3: doBadsommer: error in startup: doBadsommer checkall: Unknown command doBadsommer, try help.
2021.03.15 10:11:36 2: doFlurobensommer: doFlurobensommer checkall: Unknown command doFlurobensommer, try help.
2021.03.15 10:11:36 3: doFlurobensommer: error in startup: doFlurobensommer checkall: Unknown command doFlurobensommer, try help.
2021.03.15 10:11:36 2: doKuechesommer: doKuechesommer checkall: Unknown command doKuechesommer, try help.
2021.03.15 10:11:36 3: doKuechesommer: error in startup: doKuechesommer checkall: Unknown command doKuechesommer, try help.
2021.03.15 10:11:36 2: doSchlaf_obensommer: doSchlaf_obensommer checkall: Unknown command doSchlaf_obensommer, try help.
2021.03.15 10:11:36 3: doSchlaf_obensommer: error in startup: doSchlaf_obensommer checkall: Unknown command doSchlaf_obensommer, try help.
2021.03.15 10:11:36 2: doWohnensommer: doWohnensommer checkall: Unknown command doWohnensommer, try help.
2021.03.15 10:11:36 3: doWohnensommer: error in startup: doWohnensommer checkall: Unknown command doWohnensommer, try help.
2021.03.15 10:11:36 2: doZi1obensommer: doZi1obensommer checkall: Unknown command doZi1obensommer, try help.
2021.03.15 10:11:36 3: doZi1obensommer: error in startup: doZi1obensommer checkall: Unknown command doZi1obensommer, try help.
2021.03.15 10:11:36 2: doZimmer1sommer: doZimmer1sommer checkall: Unknown command doZimmer1sommer, try help.
2021.03.15 10:11:36 3: doZimmer1sommer: error in startup: doZimmer1sommer checkall: Unknown command doZimmer1sommer, try help.
2021.03.15 10:11:36 2: doZimmer2ommer: doZimmer2ommer checkall: Unknown command doZimmer2ommer, try help.
2021.03.15 10:11:36 3: doZimmer2ommer: error in startup: doZimmer2ommer checkall: Unknown command doZimmer2ommer, try help.
2021.03.15 10:11:36 1: usb create starting
2021.03.15 10:11:37 3: Probing CUL device /dev/ttyACM1
2021.03.15 10:11:37 3: Probing TCM_ESP3 device /dev/ttyACM1
2021.03.15 10:11:37 3: Probing ZWDongle device /dev/ttyACM1
2021.03.15 10:11:38 3: Probing SIGNALDuino device /dev/ttyACM1
2021.03.15 10:11:38 3: Probing MYSENSORS device /dev/ttyACM1
2021.03.15 10:11:38 3: Probing ArduCounter device /dev/ttyACM1
2021.03.15 10:11:38 3: Probing ElsnerWS device /dev/ttyACM1
2021.03.15 10:11:40 3: Probing FRM device /dev/ttyACM1
2021.03.15 10:11:41 1: usb create end
2021.03.15 10:11:41 1: sendEmail RCP: xxx.xxx@xxx.de
2021.03.15 10:11:41 1: sendEmail Subject: FHEM Nachricht: Neue IP: xxx.xxx.xxx.xxx
2021.03.15 10:11:41 1: sendEmail Text: Text
2021.03.15 10:11:43 1: sendEmail returned: passwort 15 10:11:43 prfhem1 sendEmail[4579]: Email was sent successfully!
2021.03.15 10:11:43 0: Featurelevel: 5.7
2021.03.15 10:11:43 0: Server started with 534 defined entities (fhem.pl:23904/2021-03-07 perl:5.014002 os:linux user:fhem pid:4575)
2021.03.15 10:11:44 3: telnetForBlockingFn_1615799504: port 58072 opened
2021.03.15 10:11:45 3: CUL_HM set HM1 statusRequest noArg
2021.03.15 10:11:45 3: prr01Mon device opened
2021.03.15 10:11:45 3: CUL_HM set HM3 off noArg
2021.03.15 10:11:51 3: CUL_HM set HM2 statusRequest noArg
2021.03.15 10:11:52 3: Trinkwasserstatus: Read callback: Error: connect to http://bsb-lan.u-probst.de:80 timed out
Undefined subroutine &FHEM::HTTPMOD::Utils::lower called at lib/FHEM/HTTPMOD/Utils.pm line 742.

Kannst, so hoffe ich, damit was anfangen.

Gruß
Titel: Antw:httpmod/utils.pm
Beitrag von: CoolTux am 15 März 2021, 13:48:32
Also ich gehe mal davon aus das die lower() Funktion welche da aufgerufen werden soll nicht existiert. Ich denke der Stefan meinte da wol lc()
Wenn Du magst kannst Du den Aufruf gerne versuchen zu ändern in lc statt lower in Zeile 742
Titel: Antw:httpmod/utils.pm
Beitrag von: postman am 15 März 2021, 17:14:15
Hallo CoolTux,
Ich habe das geändert, bringt aber keinen erfolg.
Habe also erstmal wieder die ältere Version eingespielt
Gruß
Titel: Antw:httpmod/utils.pm
Beitrag von: CoolTux am 15 März 2021, 17:36:51
Du musst FHEM schon noch neustarten.
Stefan hat einen fix bereit gestellt. Kommt morgen per Update.
Titel: Antw:httpmod/utils.pm
Beitrag von: postman am 15 März 2021, 20:32:20
Hallo CoolTux,
ZitatDu musst FHEM schon noch neustarten.
Logisch; mit "shutdown restart".
Danach ist FHEM übers Web mit der neuen "utils.pm" nicht mehr erreichbar. Selbst ein reboot des Raspi hilft da nicht.
Erst wenn ich die "alte Version" wieder verwende, gehts nach einem Neustart wieder.

ZitatStefan hat einen fix bereit gestellt. Kommt morgen per Update.

Werde ich installieren und schauen, was passiert.

Gruß
Titel: Antw:httpmod/utils.pm
Beitrag von: postman am 16 März 2021, 11:56:17
Hallo CoolTux,
so, ich hab das update installiert.
Nach einem "shutdown restart" wird die Webseite nicht mehr gefunden.
Parallel dazu habe ich auf einem zweiten Raspi eine Testinstallation von FHEM, auf der ich, wenn ich was neues habe, das dann teste. Da funktioniert FHEM nach dem update weiterhin. Betriebssysteme sind Buster auf dem "Test FHEM" und wheezy auf dem "Wirk FHEM"
Versuchswaeise habe ich in die fhem.cfg des Testsystems meine HTTPMods aus der anderen fhem.cfg kopiert /Ich weiss, so etwas soll man nicht machen ;)).
nach einem "shutdown restart" steht im Log nur
Unknown encoding 'not found' at lib/FHEM/HTTPMOD/Utils.pm line 752.
FHEM funktioniert auf dem Testsystem allerdings.
Ich bin da etwas ratlos.

Edit: zu früh gefreut, auch beim Testsystem kommt immer wieder "connection lost..." bzw. beim Aufruf eines Devices "Verbindung fehlgeschlagen".
Gruß
Titel: Antw:httpmod/utils.pm
Beitrag von: CoolTux am 16 März 2021, 12:22:43
Zitat von: postman am 16 März 2021, 11:56:17
Hallo CoolTux,
so, ich hab das update installiert.
Nach einem "shutdown restart" wird die Webseite nicht mehr gefunden.
Parallel dazu habe ich auf einem zweiten Raspi eine Testinstallation von FHEM, auf der ich, wenn ich was neues habe, das dann teste. Da funktioniert FHEM nach dem update weiterhin. Betriebssysteme sind Buster auf dem "Test FHEM" und wheezy auf dem "Wirk FHEM"
Versuchswaeise habe ich in die fhem.cfg des Testsystems meine HTTPMods aus der anderen fhem.cfg kopiert /Ich weiss, so etwas soll man nicht machen ;)).
nach einem "shutdown restart" steht im Log nur
Unknown encoding 'not found' at lib/FHEM/HTTPMOD/Utils.pm line 752.
FHEM funktioniert auf dem Testsystem allerdings.
Ich bin da etwas ratlos.

Edit: zu früh gefreut, auch beim Testsystem kommt immer wieder "connection lost..." bzw. beim Aufruf eines Devices "Verbindung fehlgeschlagen".
Gruß

Zeig mal bitte die letzten 50 Zeilen oder alles ab shutdown restart
Titel: Antw:httpmod/utils.pm
Beitrag von: postman am 16 März 2021, 18:03:39
Hallo CoolTux,
Ich habe den TestRaspi noch mal komplett neu aufgesetzt. Sobald ich ein HTTPMod Device einrichte, geht nichts mehr
ich häng Dir mal das gesamte Log dran, da neu ist nicht so groß  ;).
Sobald ich das HTTPMod Device aus der fhem.cfg lösche (ging nur mit nano  :() startet FHEM wieder ohne Probleme.
Ach ja, nicht wundern, im Testraspi läuft fhem ohne PW  :)
Zum Basteln ist das einfacher
Edit: hier noch der Code eines HTTPMod, wie ich ihn eingerichtet habe:
define Kesselstatus HTTPMOD http://xxx.xxx.xxx.xxx/8005 59
setuuid Kesselstatus 5c444270-f33f-2802-79e6-0d62df493ee52554
attr Kesselstatus alignTime 00:00:06
attr Kesselstatus bodyDecode utf8
attr Kesselstatus reading01Name Kesselstatus
attr Kesselstatus reading01Regex 8005 .*:[ \t]+([-]?[\d\.]+[^<]*)
attr Kesselstatus room Broetje
attr Kesselstatus stateFormat { sprintf("%s",ReadingsVal($name,"Kesselstatus",0)) }

Vielleicht hilft das ja.

Gruß
Titel: Antw:httpmod/utils.pm
Beitrag von: CoolTux am 16 März 2021, 19:04:35
Das ist sehr seltsam alles.
Kannst Du mir mal RAW Info zu dem Device geben?
Titel: Antw:httpmod/utils.pm
Beitrag von: postman am 16 März 2021, 19:07:01
Hallo CoolTux,
da hat es sich wohl überschnitten  ;)
Hier noch mal
define Kesselstatus HTTPMOD http://xxx.xxx.xxx.xxx/8005 59
setuuid Kesselstatus 5c444270-f33f-2802-79e6-0d62df493ee52554
attr Kesselstatus alignTime 00:00:06
attr Kesselstatus bodyDecode utf8
attr Kesselstatus reading01Name Kesselstatus
attr Kesselstatus reading01Regex 8005 .*:[ \t]+([-]?[\d\.]+[^<]*)
attr Kesselstatus room Broetje
attr Kesselstatus stateFormat { sprintf("%s",ReadingsVal($name,"Kesselstatus",0)) }


Gruß
Titel: Antw:httpmod/utils.pm
Beitrag von: CoolTux am 16 März 2021, 19:35:47
Lass mal bodyDecode utf8 raus und teste dann.
Titel: Antw:httpmod/utils.pm
Beitrag von: CoolTux am 16 März 2021, 19:38:04
ok es ist definitiv das bodyDecode
Titel: Antw:httpmod/utils.pm
Beitrag von: xenos1984 am 16 März 2021, 19:52:48
In der Tat, wenn kein Charset-Header gefunden wird, wird $bodyCharset auf "not found" gesetzt:


718     if ($header =~/Content-Type:.*charset=([\w\-\.]+)/i) {
719         $bodyCharset = $1;
720         $hash->{'.bodyCharset'} = $bodyCharset;
721     }
722     else {
723         $bodyCharset = 'not found';
724         delete $hash->{'.bodyCharset'};
725     }


Dies wird später aber nur dann überprüft, wenn bei bodyDecode "auto" gewählt wird:


733     elsif ($bodyDecode =~ m{\A [Aa]uto \z}xms) {
734         if ($bodyCharset eq 'not found') {
735             Log3 $name, 4, "$name: BodyDecode is not decoding the response body (charset header not found, bodyDecode set to auto)";
736         }
737         else {
738             Log3 $name, 4, "$name: BodyDecode is decoding the response body as $bodyCharset (charset header $bodyCharset, bodyDecode set to auto)";
739             $decoding = $bodyCharset;
740         }     
741     }


Wenn ein anderer Wert eingestellt wurde, wird stur der Wert für $bodyCharset genommen:


746     else {
747         Log3 $name, 4, "$name: BodyDecode is decoding the response body as $bodyDecode but charset header is $bodyCharset";
748         $decoding = $bodyCharset;
749     }


...und wenn da "not found" steht, beschwert sich decode und führt zum Crash:


751     if ($decoding) {
752         $body = decode($decoding, $body);
753         $hash->{'.bodyCharset'} = 'internal';
754         #Log3 $name, 5, "$name: BodyDecode " . ($body ? "new body as utf-8 is: \n" . encode ('utf-8', $body) : "body empty");
755     }
Titel: Antw:httpmod/utils.pm
Beitrag von: CoolTux am 16 März 2021, 20:17:20
--- fhem-code/lib/FHEM/HTTPMOD/Utils.pm 2021-03-16 19:40:33.942253518 +0100
+++ Utils.pm 2021-03-16 20:12:02.178458928 +0100
@@ -730,19 +730,19 @@
     elsif ($bodyDecode eq 'default') {
         Log3 $name, 4, "$name: BodyDecode is not decoding the response body (charset $bodyCharset, bodyDecode defaults to none)";
     }
-    elsif ($bodyDecode =~ m{\A [Aa]uto \z}xms) {
-        if ($bodyCharset eq 'not found') {
-            Log3 $name, 4, "$name: BodyDecode is not decoding the response body (charset header not found, bodyDecode set to auto)";
-        }
-        else {
-            Log3 $name, 4, "$name: BodyDecode is decoding the response body as $bodyCharset (charset header $bodyCharset, bodyDecode set to auto)";
-            $decoding = $bodyCharset;
-        }     
+    elsif ($bodyDecode =~ m{\A [Aa]uto \z}xms
+        && $bodyCharset ne 'not found' )
+    {
+        Log3 $name, 4, "$name: BodyDecode is decoding the response body as $bodyCharset (charset header $bodyCharset, bodyDecode set to auto)";
+        $decoding = $bodyCharset;
     }
     elsif (lc($bodyDecode) eq lc($bodyCharset)) {
         Log3 $name, 4, "$name: BodyDecode is decoding the response body as $bodyDecode";   
         $decoding = $bodyCharset;
-    }
+    }
+    elsif ($bodyCharset eq 'not found') {
+        Log3 $name, 4, "$name: BodyDecode is not decoding the response body (charset header not found, bodyDecode set to auto)";
+    }
     else {
         Log3 $name, 4, "$name: BodyDecode is decoding the response body as $bodyDecode but charset header is $bodyCharset";
         $decoding = $bodyCharset;


Meine Lösung.
Titel: Antw:httpmod/utils.pm
Beitrag von: CoolTux am 16 März 2021, 20:22:44
Habe Stefan gerade geschrieben. Mal schauen ob er sich da heute noch drum kümmern kann.

Du kannst wenn Du es Dir zu traust den Patch mal testen oder entfernst das Attribut bodyDecode vorerst
Titel: Antw:httpmod/utils.pm
Beitrag von: StefanStrobel am 16 März 2021, 21:36:51
Hallo,

ich glaube es war nur ein kleiner Tippfehler. Wenn bodyDecode auf utf8 steht, dann soll ja utf8 verwendet werden. Egal was im character-Header steht.
Zeile 748 muss also $decoding = $bodyDecode; lauten.

Probiert doch bitte mal die angehängte Version. Fhem muss nach dem Einspielen neu gestartet werden, sonst läd es die Utils nicht neu.
Wenn es funktioniert, checke ich die Version morgen gleich ein.

Gruss
   Stefan
Titel: Antw:httpmod/utils.pm
Beitrag von: CoolTux am 16 März 2021, 21:55:25
Habe gerade geschaut. Ja das war auch einer meiner ersten Gedanken, wusste aber nicht genau ob oder nicht da die falsche Variable genommen wurde. So ergibt es aber mehr Sinn.
Aber schon interessant das es überhaupt aufgefallen ist.


Grüße
Titel: Antw:httpmod/utils.pm
Beitrag von: postman am 16 März 2021, 22:43:14
Hallo zusammen,
ich habe die von Stefan angehängte utils.pm in das lib/FHEM/HTTPMOD Verzeichnis kopiert und FHEM neu gestartet.
Nach einem "shutdown restart" funktioniert es bis jetzt jedenfalls.
Zum Testen habe ich erst einmal nur mein TestFHEM verwendet.
Das bodyDecode utf8 benötige ich, damit Umlaute richtig dargestellt werden (Den Tipp hab ich übrigens von Stefan :))
@Stefan: Ich melde mich morgen noch mal und berichte, ob FHEM jetzt zumindest auf dem TestFHEM ohne Probleme wieder läuft; kannst Du solange mit dem einschecken der neuen utils.pm warten? Kommt je wohl nicht auf einen Tag an oder?

Gruß
Titel: Antw:httpmod/utils.pm
Beitrag von: postman am 17 März 2021, 11:21:29
Hallo zusammen,
mit der utils.pm, die StefanStrobel gestern hier angehängt hat, funktioniert FHEM wieder ohne Störungen.
Herzlichen Dank für eure Hilfe.
@StefanStrobel: Du kannst die utils.pm gern einschecken, falls Du es noch nicht getan hast ;)
Ansonsten; tolle Arbeit, die ihr da macht.
Mal eine Frage out of topik: gibt es soetwas wie das HTTPMOD.pm auch für die serielle Schnittstelle, mit der auf einfache Weise so ähnliche Abfragen wie mit HTTPMOD erstellt werden können? ECMD und ECMDDevice finde ich zu kompliziert  und funktionieren auch nicht wirklich so, wie ich es bräuchte. Ich scheine auch nicht der einzige zu sein, der so etwas brauchen könnte.
Gruß und noch mal Danke
Titel: Antw:httpmod/utils.pm
Beitrag von: StefanStrobel am 17 März 2021, 17:42:17
Hallo,

ich habe es jetzt eingecheckt.

So was wie HTTPMOD für serielle Leitungen hatte ich mir vor ein paar Jahren auch mal überlegt, aber dann wieder verworfen.
Letztlich waren doch alle meine Geräte so speziell, dass ich ein eigenes dediziertes Modul dafür geschrieben habe.
Das Problem fängt bei Frame-Formaten an, geht über Prüfsummen, Feldtrennungen etc.

Gruss
   Stefan