FHEM Forum

FHEM - Hausautomations-Systeme => Homematic => Thema gestartet von: supernova1963 am 01 Oktober 2017, 07:56:08

Titel: [Altern.: int.RPC]HMCCU: Bitte um Aufklärung des Zusammenhangs zu JSON Problemen
Beitrag von: supernova1963 am 01 Oktober 2017, 07:56:08
Hallo zap,

bei mir und anderen tritt ein JSON Problem in diversen anderen Modulen auf, wenn HMCCU mit extrpc aktiviert wird. Sobald ich HMCCU entferne funktionieren diese Module wieder problemlos.
Ich meine irgendwo gelesen zu haben, dass das Modul kein JSON verwndet. Dennoch ist ein direkter Zusammenhang nachstellbar.
Ich vermute laienhaft, es liegt an der relativ aktuellen Konfiguration meines Entwicklungssystems:

Kannst du diesen Zusammenhang mit diesen Versionen nachvollziehen, bestätigen und ggf. definieren, welche Versionen sein dürfen?
Oder liegt's gar nicht daran?

Vielen Dank, dein Modul möchte ich sehr gerne auch in der nächsten Evolutionsstufe nutzen,

Gernot



... ESPEasy espbridge_192.168.1.24_8541: WARNING: Invalid JSON received. Check your ESP configuration (192.168.1.24).
JSON text must be an object or array (but found number, string, true, false or null, use allow_nonref to allow this) at ./FHEM/34_ESPEasy.pm line 736.
.
.
.
... TPLinkHS110: TPLinkHS110 json-decoding failed. Problem decoding getting statistical data
.
.
.
... netatmo: invalid json evaluation on dispatch type token JSON text must be an object or array (but found number, string, true, false or null, use allow_nonref to allow this) at ./FHEM/38_netatmo.pm line 2383.



Um nur einige zu nennen, es sind weitaus mehr Module betroffen.

Mein ProduktivSystem hat diese Probleme nicht:



Titel: Antw:HMCCU: Bitte um Aufklärung des Zusammenhangs zu JSON Problemen
Beitrag von: zap am 01 Oktober 2017, 12:38:41
Nun, die verwendete libjson ist auf beiden Systemen identisch. Möglicherweise liegt es am aktuelleren Ubuntu. Ich selbst verwende kein Ubuntu, kann es also nicht nachstellen.

Aber weder HMCCU noch eines der abhängigen Module (z.B. RPC::XML::Server) verwendet JSON. Vielleicht funktioniert es ohne HMCCU nur, weil sich dann die Modul Ladereihenfolge ändert. Ist aber nur eine Vermutung.
Titel: Antw:HMCCU: Bitte um Aufklärung des Zusammenhangs zu JSON Problemen
Beitrag von: CoolTux am 01 Oktober 2017, 14:12:21
Eine weitere Vermutung wäre das HMCCU ein Perlmodul nachläd was sonst nicht gebraucht wird und das mit libjson kollidiert. Auch nur eine Vermutung.
Titel: Antw:HMCCU: Bitte um Aufklärung des Zusammenhangs zu JSON Problemen
Beitrag von: supernova1963 am 01 Oktober 2017, 18:06:58
Nach den Meldungen hier im Forum scheint es nicht nur bei ubuntu aufzutreten.

Wenn ich das richtig verstehe, schließt ihr node oder npm aus.
Bleibt libjson-perl oder noch nicht genannte Interdependenzen.

Dann empfiehlt sich zunächst unter Ubuntu 17.04 auf HMCCU zu verzichten.

Kann ich irgendwas zur Ursachenforschung beitragen?

Gernot

Titel: Antw:HMCCU: Bitte um Aufklärung des Zusammenhangs zu JSON Problemen
Beitrag von: CoolTux am 01 Oktober 2017, 18:12:11
Du kannst HMCCU deaktivieren. Also wirklich so das das Modul nicht geladen wird.
Dann baust Du eine 99_myUtils und schreibst da alle use rein die in HMCCU stehen.

Nur als Test.
Titel: Antw:HMCCU: Bitte um Aufklärung des Zusammenhangs zu JSON Problemen
Beitrag von: zap am 01 Oktober 2017, 19:04:41
Tritt das Problem bei Verwendung des internen RPC Servers auch auf? Um das zu testen muss nach Umstellung auf den internen RPC Server auch das HMCCURPC Device gelöscht werden. dann FHEM neu starten.
Titel: Antw:HMCCU: Bitte um Aufklärung des Zusammenhangs zu JSON Problemen
Beitrag von: supernova1963 am 01 Oktober 2017, 19:06:59
Teste ich beides entweder heute Nacht oder morgen und berichte

Gernot
Titel: Antw:HMCCU: Bitte um Aufklärung des Zusammenhangs zu JSON Problemen
Beitrag von: supernova1963 am 01 Oktober 2017, 21:05:07
Hallo zap,

das Problem tritt bei dem internen RPC Server nicht auf. Erste Funktionstest waren auch erfolgreich.

Gernot
Titel: Antw:[Altern.: int.RPC]HMCCU: Bitte um Aufklärung des Zusammenhangs zu JSON Problemen
Beitrag von: zap am 02 Oktober 2017, 06:43:02
Ok, der externe RPC Server verwendet drei Module, die die anderen Module nicht benutzen:

threads
Thread::Queue
Time::HiRes

Außerdem verwendet Thread::Queue wiederum threads::shared, das Shared Memory zur Verfügung stellt.

Könnte also sein, dass eines dieser Module die Probleme verursacht. Die ersten beiden werden zB auch vom SONOS Modul verwendet. Das hast Du nicht zufällig auch im Einsatz?

Das letzte Modul wird auch von einigen anderen FHEM Modulen verwendet.

Wenn es an den Thread Modulen liegt, bleibt dir nur der interne RPC Server. Die Module sind essentiell für den externen Server.
Titel: Antw:[Altern.: int.RPC]HMCCU: Bitte um Aufklärung des Zusammenhangs zu JSON Problemen
Beitrag von: supernova1963 am 02 Oktober 2017, 10:58:51
So, ich habe eine 99_myHMCCUUtils.pm erstellt:
##############################################
# $Id: myUtilsTemplate.pm 7570 2015-01-14 18:31:44Z rudolfkoenig $
#
# Save this file as 99_myUtils.pm, and create your own functions in the new
# file. They are then available in every Perl expression.

package main;

use strict;
use warnings;
use POSIX;


use threads;
use Thread::Queue;
# use Data::Dumper;
use Time::HiRes qw(usleep);
use RPC::XML::Client;
use RPC::XML::Server;
use SetExtensions;


sub
myHMCCUUtils_Initialize($$)
{
  my ($hash) = @_;
}

# Enter you functions below _this_ line.

sub
test()
{
my $test="test";
return $test;
}

1;

und habe folgendes, - meiner Ansicht nach weitgehend normales -, Ergebnis erhalten:
2017.10.02 08:54:23 1: PERL WARNING: Subroutine myUtils_Initialize redefined at ./FHEM/99_myHMCCUUtils.pm line 15.
2017.10.02 09:02:26 1: PERL WARNING: Subroutine myHMCCUUtils_Initialize redefined at ./FHEM/99_myHMCCUUtils.pm line 25, <DATA> line 1.


Auch der Aufruf in "attr stateFormat { HMCCUTest() }" eines Dummy's funktioniert.

Was kann ich noch tun?

Gernot


P.S.:
Vielleicht noch ein interessanter Versions - Unterschied:
Ubuntu 17.04 = perl-modules-5.24
Ubuntu 16.04 = perl-modules-5.22


Titel: Antw:[Altern.: int.RPC]HMCCU: Bitte um Aufklärung des Zusammenhangs zu JSON Problemen
Beitrag von: zap am 02 Oktober 2017, 11:25:07
Also der JSON Fehler tritt mit dieser myUtils nicht auf?

Da bin ich nun auch erst mal ratlos. Scheint also doch nicht an den nachgeladenen Modulen zu liegen.

Natürlich kann es auch an den unterschiedlichen Perl Versionen liegen. Meine sind relativ alt (5.20)
Titel: Antw:[Altern.: int.RPC]HMCCU: Bitte um Aufklärung des Zusammenhangs zu JSON Problemen
Beitrag von: supernova1963 am 02 Oktober 2017, 13:51:00
Ja, mit dieser myHMCCUUtils tritt der Fehler bisher nicht auf.

netatmo, espEasy, TPLinkHS110, ... laufen ohne Fehler.

Wenn es an der perl version liegen sollte, könnte Raspbian Stretch auch Probleme bereiten.

Wenn ich noch irgendetwas tun kann, bitte melden.

Gernot
Titel: Antw:[Altern.: int.RPC]HMCCU: Bitte um Aufklärung des Zusammenhangs zu JSON Problemen
Beitrag von: zap am 02 Oktober 2017, 17:04:27
Witzigerweise gibt es in diesem Thread

https://forum.fhem.de/index.php/topic,74943.0.html

den User EfkaPE. Bei dem läuft es mit Ubuntu aber mit Debian nicht.

Das müssen irgendwelche Inkompatibilitäten in Libraries bzw. Perl-Modulen sein. Keine Ahnung, wie man da finden soll.
Titel: Antw:[Altern.: int.RPC]HMCCU: Bitte um Aufklärung des Zusammenhangs zu JSON Problemen
Beitrag von: supernova1963 am 02 Oktober 2017, 20:24:48
Ich habe gerade eine Debian 9.1 (stretch) virtuelle Maschine aufgesetzt, FHEM über deb Paket installiert, librpc-xml-perl nach installiert und eine ESPEasy bridge mit einem Device angelegt. Es funktionierte (Das Warning von ESPEasy ist unkritisch, ich habe nur zu spät bemerkt, dass ich das Attr authentication 1 nicht gesetzt habe).
Anschliessend habe ich ein hmccu Device angelegt (hat sehr lange gedauert 2 Min. 10 Sek.) und die notwendigen Attribute gepflegt und den rpcserver (extrpc) gestartet.
Ich weiß nicht, was EfkaPE gemacht hat, bei mir kommt es zu exakt gleichen Fehlern, wie bei ubuntu 17.04.

Nicht normal für HMCCU ist der über 2 Minuten blockierende Initialisierungsvorgang nach jedem FHEM restart!

@zap:
HMCCU ist ein super gutes Modul !!! Mit dem intrpc läuft es ja auch unter stretch und ubuntu 17.04. Ein Hinweis im Wiki, bis du Zeit und Lust zu einem Update/Upgrade bekommen hast, erspart dir voraussichtlich viele Nachfragen. (Meines Wissens nach steht Raspbian Stretch auch bereits zur Verfügung und ich fürchte diese Problematik wird auch dort auftreten). 

tail -f -n 100 /opt/fhem/log/fhem-2017-10.log
2017.10.02 19:12:37 1: Including fhem.cfg
2017.10.02 19:12:37 3: telnetPort: port 7072 opened
2017.10.02 19:12:37 3: WEB: port 8083 opened
2017.10.02 19:12:37 3: WEBphone: port 8084 opened
2017.10.02 19:12:37 3: WEBtablet: port 8085 opened
2017.10.02 19:12:37 2: eventTypes: loaded 0 events from ./log/eventTypes.txt
2017.10.02 19:12:37 1: usb create starting
2017.10.02 19:12:37 3: Probing CUL device /dev/ttyS0
2017.10.02 19:12:37 3: Can't open /dev/ttyS0: Permission denied
2017.10.02 19:12:37 3: Probing CUL device /dev/ttyS1
2017.10.02 19:12:37 3: Can't open /dev/ttyS1: Permission denied
2017.10.02 19:12:37 3: Probing CUL device /dev/ttyS2
2017.10.02 19:12:37 3: Can't open /dev/ttyS2: Permission denied
2017.10.02 19:12:37 3: Probing CUL device /dev/ttyS3
2017.10.02 19:12:37 3: Can't open /dev/ttyS3: Permission denied
2017.10.02 19:12:37 1: usb create end
2017.10.02 19:12:37 2: SecurityCheck:  WEB,WEBphone,WEBtablet has no associated allowed device with basicAuth. telnetPort has no associated allowed device with password/globalpassword.  Restart FHEM for a new check if the problem is fixed, or set the global attribute motd to none to supress this message.
2017.10.02 19:12:37 0: Featurelevel: 5.8
2017.10.02 19:12:37 0: Server started with 9 defined entities (fhem.pl:15112/2017-09-21 perl:5.024001 os:linux user:fhem pid:3103)
2017.10.02 19:15:05 2: ESPEasy espBridge: Opening bridge port tcp/8383 (v1.33)
2017.10.02 19:15:05 3: espBridge: port 8383 opened
2017.10.02 19:16:30 2: ESPEasy espBridge_192.168.1.20_12074: No basic authentication active but credentials received
2017.10.02 19:16:30 2: ESPEasy espBridge: Autocreate ESPEasy_Terrassensteuerung ESPEasy 192.168.1.20 80 espBridge Terrassensteuerung
2017.10.02 19:16:30 2: ESPEasy espBridge: Structural changes saved.
2017.10.02 19:16:31 2: ESPEasy espBridge_192.168.1.20_21758: No basic authentication active but credentials received
2017.10.02 19:16:32 2: ESPEasy espBridge_192.168.1.20_16705: No basic authentication active but credentials received
2017.10.02 19:17:30 2: ESPEasy espBridge_192.168.1.20_30912: No basic authentication active but credentials received
2017.10.02 19:17:31 2: ESPEasy espBridge_192.168.1.20_32719: No basic authentication active but credentials received
2017.10.02 19:18:30 2: ESPEasy espBridge_192.168.1.20_3971: No basic authentication active but credentials received
2017.10.02 19:18:31 2: ESPEasy espBridge_192.168.1.20_19003: No basic authentication active but credentials received
2017.10.02 19:19:30 2: ESPEasy espBridge_192.168.1.20_27877: No basic authentication active but credentials received
2017.10.02 19:19:31 2: ESPEasy espBridge_192.168.1.20_9759: No basic authentication active but credentials received
2017.10.02 19:20:13 1: HMCCU: Device d_ccu. Initialized version 4.1.001
2017.10.02 19:22:23 1: HMCCU: No devices read from CCU 192.168.1.4
2017.10.02 19:22:23 2: ESPEasy espBridge_192.168.1.20_1556: No basic authentication active but credentials received
2017.10.02 19:22:23 2: ESPEasy espBridge_192.168.1.20_11324: No basic authentication active but credentials received
2017.10.02 19:22:23 2: ESPEasy espBridge_192.168.1.20_6202: No basic authentication active but credentials received
2017.10.02 19:22:23 2: ESPEasy espBridge_192.168.1.20_29142: No basic authentication active but credentials received
2017.10.02 19:22:31 2: ESPEasy espBridge_192.168.1.20_27745: No basic authentication active but credentials received
2017.10.02 19:22:35 2: ESPEasy espBridge_192.168.1.20_1788: No basic authentication active but credentials received
2017.10.02 19:23:31 2: ESPEasy espBridge_192.168.1.20_9525: No basic authentication active but credentials received
2017.10.02 19:23:35 2: ESPEasy espBridge_192.168.1.20_31985: No basic authentication active but credentials received
2017.10.02 19:24:31 2: ESPEasy espBridge_192.168.1.20_18286: No basic authentication active but credentials received
2017.10.02 19:24:35 2: ESPEasy espBridge_192.168.1.20_32612: No basic authentication active but credentials received
2017.10.02 19:26:42 0: Server shutdown
2017.10.02 19:26:42 0: HMCCU: Can't find RPC device
2017.10.02 19:26:44 1: Including fhem.cfg
2017.10.02 19:26:44 3: telnetPort: port 7072 opened
2017.10.02 19:26:44 3: WEB: port 8083 opened
2017.10.02 19:26:44 3: WEBphone: port 8084 opened
2017.10.02 19:26:44 3: WEBtablet: port 8085 opened
2017.10.02 19:26:44 2: eventTypes: loaded 14 events from ./log/eventTypes.txt
2017.10.02 19:26:44 2: ESPEasy espBridge: Opening bridge port tcp/8383 (v1.33)
2017.10.02 19:26:44 3: espBridge: port 8383 opened
2017.10.02 19:26:45 1: HMCCU: Device d_ccu. Initialized version 4.1.001
2017.10.02 19:28:54 1: HMCCU: No devices read from CCU 192.168.1.4
2017.10.02 19:28:54 1: Including ./log/fhem.save
2017.10.02 19:28:54 0: HMCCU: Start of RPC server after FHEM initialization in 12 seconds
2017.10.02 19:28:54 1: usb create starting
2017.10.02 19:28:54 3: Probing CUL device /dev/ttyS0
2017.10.02 19:28:54 3: Can't open /dev/ttyS0: Permission denied
2017.10.02 19:28:54 3: Probing CUL device /dev/ttyS1
2017.10.02 19:28:54 3: Can't open /dev/ttyS1: Permission denied
2017.10.02 19:28:54 3: Probing CUL device /dev/ttyS2
2017.10.02 19:28:54 3: Can't open /dev/ttyS2: Permission denied
2017.10.02 19:28:54 3: Probing CUL device /dev/ttyS3
2017.10.02 19:28:54 3: Can't open /dev/ttyS3: Permission denied
2017.10.02 19:28:54 1: usb create end
2017.10.02 19:28:54 2: SecurityCheck:  WEB,WEBphone,WEBtablet has no associated allowed device with basicAuth. telnetPort has no associated allowed device with password/globalpassword.  Restart FHEM for a new check if the problem is fixed, or set the global attribute motd to none to supress this message.
2017.10.02 19:28:54 0: Featurelevel: 5.8
2017.10.02 19:28:54 0: Server started with 12 defined entities (fhem.pl:15112/2017-09-21 perl:5.024001 os:linux user:fhem pid:7433)
2017.10.02 19:29:06 1: HMCCU: Creating new RPC device d_ccu_rpc
2017.10.02 19:29:06 1: HMCCURPC: Device d_ccu_rpc. Initialized version 0.96 beta
2017.10.02 19:29:06 2: HMCCURPC: Starting thread for data processing
2017.10.02 19:29:06 2: HMCCURPC: Started thread for data processing. TID=1
2017.10.02 19:29:06 2: CCURPC: Thread DATA processing RPC events. TID=1
2017.10.02 19:29:07 2: HMCCURPC: RPC server thread started for interface BidCos-RF with TID=2
2017.10.02 19:29:07 2: CCURPC: Initializing RPC server CB2001 for interface BidCos-RF
2017.10.02 19:29:07 2: HMCCURPC: Callback server CB2001 created. Listening on port 7411
2017.10.02 19:29:07 2: CCURPC: CB2001 accepting connections. TID=2
2017.10.02 19:29:08 1: HMCCURPC: RPC server(s) starting
2017.10.02 19:29:08 1: HMCCURPC: Received SL event. RPC server DATA enters server loop
2017.10.02 19:29:08 1: HMCCURPC: Received SL event. RPC server CB2001 enters server loop
2017.10.02 19:29:08 1: HMCCURPC: All threads working
2017.10.02 19:29:08 2: HMCCURPC: Registering callback http://192.168.1.108:7411/fh2001 with ID CB2001 at http://192.168.1.4:2001/
2017.10.02 19:29:08 1: CCURPC: CB2001 ListDevices. Sending init to HMCCU
2017.10.02 19:29:08 1: HMCCURPC: RPC callback with URL http://192.168.1.108:7411/fh2001 registered
2017.10.02 19:29:08 1: HMCCURPC: Received IN event. RPC server CB2001 running.
2017.10.02 19:29:08 1: HMCCURPC: All RPC servers running
2017.10.02 19:29:08 2: HMCCU: No client devices matching .*
2017.10.02 19:29:08 2: HMCCURPC: Updated devices. Success=0 Failed=0
2017.10.02 19:29:08 2: CCURPC: CB2001 NewDevice received 70 device and channel specifications
2017.10.02 19:29:31 2: ESPEasy espBridge_192.168.1.20_19806: WARNING: Invalid JSON received. Check your ESP configuration (192.168.1.20).
JSON text must be an object or array (but found number, string, true, false or null, use allow_nonref to allow this) at ./FHEM/34_ESPEasy.pm line 736.

2017.10.02 19:29:35 2: ESPEasy espBridge_192.168.1.20_14999: WARNING: Invalid JSON received. Check your ESP configuration (192.168.1.20).
JSON text must be an object or array (but found number, string, true, false or null, use allow_nonref to allow this) at ./FHEM/34_ESPEasy.pm line 736.

2017.10.02 19:32:33 1: HMCCU: d_ccu Execution of CCU script or command failed
2017.10.02 19:32:33 2: ESPEasy espBridge_192.168.1.20_1704: WARNING: Invalid JSON received. Check your ESP configuration (192.168.1.20).
JSON text must be an object or array (but found number, string, true, false or null, use allow_nonref to allow this) at ./FHEM/34_ESPEasy.pm line 736.

2017.10.02 19:32:33 2: ESPEasy espBridge_192.168.1.20_7300: WARNING: Invalid JSON received. Check your ESP configuration (192.168.1.20).
JSON text must be an object or array (but found number, string, true, false or null, use allow_nonref to allow this) at ./FHEM/34_ESPEasy.pm line 736.

2017.10.02 19:32:33 2: ESPEasy espBridge_192.168.1.20_25770: WARNING: Invalid JSON received. Check your ESP configuration (192.168.1.20).
JSON text must be an object or array (but found number, string, true, false or null, use allow_nonref to allow this) at ./FHEM/34_ESPEasy.pm line 736.

2017.10.02 19:32:33 2: ESPEasy espBridge_192.168.1.20_26305: WARNING: Invalid JSON received. Check your ESP configuration (192.168.1.20).
JSON text must be an object or array (but found number, string, true, false or null, use allow_nonref to allow this) at ./FHEM/34_ESPEasy.pm line 736.

2017.10.02 19:32:33 2: ESPEasy espBridge_192.168.1.20_1258: WARNING: Invalid JSON received. Check your ESP configuration (192.168.1.20).
JSON text must be an object or array (but found number, string, true, false or null, use allow_nonref to allow this) at ./FHEM/34_ESPEasy.pm line 736.

2017.10.02 19:32:35 2: ESPEasy espBridge_192.168.1.20_10336: WARNING: Invalid JSON received. Check your ESP configuration (192.168.1.20).
JSON text must be an object or array (but found number, string, true, false or null, use allow_nonref to allow this) at ./FHEM/34_ESPEasy.pm line 736.

2017.10.02 19:33:03 1: HMCCURPC: Found 2 threads. Stopping ...
2017.10.02 19:33:03 1: HMCCURPC: Deregistering RPC server http://192.168.1.108:7411/fh2001 with ID CB2001 at http://192.168.1.4:2001/
2017.10.02 19:33:03 1: HMCCURPC: RPC callback for server CB2001 deregistered
2017.10.02 19:33:03 2: HMCCURPC: Sending signal INT to thread CB2001 TID=2
2017.10.02 19:33:03 2: CCURPC: RPC server CB2001 stopped handling connections. TID=2
2017.10.02 19:33:04 1: HMCCURPC: Received EX event. Thread CB2001 terminated.
2017.10.02 19:33:04 2: HMCCURPC: Thread CB2001 with TID=2 has been stopped. Deleting it
2017.10.02 19:33:04 2: HMCCURPC: All RPC servers stopped. Terminating data processing thread
2017.10.02 19:33:04 2: HMCCURPC: Sending signal INT to thread DATA TID=1
2017.10.02 19:33:04 2: CCURPC: DATA stopped event processing. TID=1
2017.10.02 19:33:05 1: HMCCURPC: Received EX event. Thread DATA terminated.
2017.10.02 19:33:05 2: HMCCURPC: Thread DATA with TID=1 has been stopped. Deleting it
2017.10.02 19:33:05 2: HMCCURPC: Stop I/O handling
2017.10.02 19:33:05 2: HMCCURPC: Close child socket
2017.10.02 19:33:05 2: HMCCURPC: Close parent socket
2017.10.02 19:33:05 1: HMCCURPC: All threads stopped
2017.10.02 19:33:11 2: HMCCURPC: Starting thread for data processing
2017.10.02 19:33:11 2: HMCCURPC: Started thread for data processing. TID=3
2017.10.02 19:33:11 2: CCURPC: Thread DATA processing RPC events. TID=3
2017.10.02 19:33:11 2: HMCCURPC: RPC server thread started for interface BidCos-RF with TID=4
2017.10.02 19:33:11 2: CCURPC: Initializing RPC server CB2001 for interface BidCos-RF
2017.10.02 19:33:11 2: HMCCURPC: Callback server CB2001 created. Listening on port 7411
2017.10.02 19:33:11 2: CCURPC: CB2001 accepting connections. TID=4
2017.10.02 19:33:12 1: HMCCURPC: RPC server(s) starting
2017.10.02 19:33:12 1: HMCCURPC: Received SL event. RPC server DATA enters server loop
2017.10.02 19:33:12 1: HMCCURPC: Received SL event. RPC server CB2001 enters server loop
2017.10.02 19:33:12 1: HMCCURPC: All threads working
2017.10.02 19:33:12 2: HMCCURPC: Registering callback http://192.168.1.108:7411/fh2001 with ID CB2001 at http://192.168.1.4:2001/
2017.10.02 19:33:12 1: CCURPC: CB2001 ListDevices. Sending init to HMCCU
2017.10.02 19:33:12 1: HMCCURPC: RPC callback with URL http://192.168.1.108:7411/fh2001 registered
2017.10.02 19:33:12 1: HMCCURPC: Received IN event. RPC server CB2001 running.
2017.10.02 19:33:12 1: HMCCURPC: All RPC servers running
2017.10.02 19:33:12 2: HMCCU: No client devices matching .*
2017.10.02 19:33:12 2: HMCCURPC: Updated devices. Success=0 Failed=0
2017.10.02 19:33:12 2: CCURPC: CB2001 NewDevice received 70 device and channel specifications
2017.10.02 19:33:32 2: ESPEasy espBridge_192.168.1.20_10985: WARNING: Invalid JSON received. Check your ESP configuration (192.168.1.20).
JSON text must be an object or array (but found number, string, true, false or null, use allow_nonref to allow this) at ./FHEM/34_ESPEasy.pm line 736.

2017.10.02 19:33:39 1: HMCCU: d_ccu Invalid device/channel name or address
2017.10.02 19:33:39 2: ESPEasy espBridge_192.168.1.20_8373: WARNING: Invalid JSON received. Check your ESP configuration (192.168.1.20).
JSON text must be an object or array (but found number, string, true, false or null, use allow_nonref to allow this) at ./FHEM/34_ESPEasy.pm line 736.

2017.10.02 19:34:06 1: HMCCU: d_ccu Invalid device/channel name or address
2017.10.02 19:34:22 1: HMCCURPC: Found 2 threads. Stopping ...
2017.10.02 19:34:22 1: HMCCURPC: Deregistering RPC server http://192.168.1.108:7411/fh2001 with ID CB2001 at http://192.168.1.4:2001/
2017.10.02 19:34:22 1: HMCCURPC: RPC callback for server CB2001 deregistered
2017.10.02 19:34:22 2: HMCCURPC: Sending signal INT to thread CB2001 TID=4
2017.10.02 19:34:23 2: CCURPC: RPC server CB2001 stopped handling connections. TID=4
2017.10.02 19:34:23 1: HMCCURPC: Received EX event. Thread CB2001 terminated.
2017.10.02 19:34:23 2: HMCCURPC: Thread CB2001 with TID=4 has been stopped. Deleting it
2017.10.02 19:34:23 2: HMCCURPC: All RPC servers stopped. Terminating data processing thread
2017.10.02 19:34:23 2: HMCCURPC: Sending signal INT to thread DATA TID=3
2017.10.02 19:34:24 2: CCURPC: DATA stopped event processing. TID=3
2017.10.02 19:34:24 1: HMCCURPC: Received EX event. Thread DATA terminated.
2017.10.02 19:34:24 2: HMCCURPC: Thread DATA with TID=3 has been stopped. Deleting it
2017.10.02 19:34:25 2: HMCCURPC: Stop I/O handling
2017.10.02 19:34:25 2: HMCCURPC: Close child socket
2017.10.02 19:34:25 2: HMCCURPC: Close parent socket
2017.10.02 19:34:25 1: HMCCURPC: All threads stopped
2017.10.02 19:34:32 2: ESPEasy espBridge_192.168.1.20_29872: WARNING: Invalid JSON received. Check your ESP configuration (192.168.1.20).
JSON text must be an object or array (but found number, string, true, false or null, use allow_nonref to allow this) at ./FHEM/34_ESPEasy.pm line 736.

2017.10.02 19:34:34 2: HMCCURPC: Starting thread for data processing
2017.10.02 19:34:34 2: HMCCURPC: Started thread for data processing. TID=5
2017.10.02 19:34:34 2: CCURPC: Thread DATA processing RPC events. TID=5
2017.10.02 19:34:34 2: HMCCURPC: RPC server thread started for interface BidCos-RF with TID=6
2017.10.02 19:34:34 2: CCURPC: Initializing RPC server CB2001 for interface BidCos-RF
2017.10.02 19:34:34 2: HMCCURPC: Callback server CB2001 created. Listening on port 7411
2017.10.02 19:34:34 2: CCURPC: CB2001 accepting connections. TID=6
2017.10.02 19:34:35 1: HMCCURPC: RPC server(s) starting
2017.10.02 19:34:35 1: HMCCURPC: Received SL event. RPC server DATA enters server loop
2017.10.02 19:34:35 1: HMCCURPC: Received SL event. RPC server CB2001 enters server loop
2017.10.02 19:34:35 1: HMCCURPC: All threads working
2017.10.02 19:34:35 2: HMCCURPC: Registering callback http://192.168.1.108:7411/fh2001 with ID CB2001 at http://192.168.1.4:2001/
2017.10.02 19:34:35 1: CCURPC: CB2001 ListDevices. Sending init to HMCCU
2017.10.02 19:34:35 1: HMCCURPC: RPC callback with URL http://192.168.1.108:7411/fh2001 registered
2017.10.02 19:34:35 1: HMCCURPC: Received IN event. RPC server CB2001 running.
2017.10.02 19:34:35 1: HMCCURPC: All RPC servers running
2017.10.02 19:34:35 2: HMCCU: No client devices matching .*
2017.10.02 19:34:35 2: HMCCURPC: Updated devices. Success=0 Failed=0
2017.10.02 19:34:35 2: CCURPC: CB2001 NewDevice received 70 device and channel specifications
2017.10.02 19:34:36 2: ESPEasy espBridge_192.168.1.20_16810: WARNING: Invalid JSON received. Check your ESP configuration (192.168.1.20).
JSON text must be an object or array (but found number, string, true, false or null, use allow_nonref to allow this) at ./FHEM/34_ESPEasy.pm line 736.

2017.10.02 19:34:42 1: HMCCU: d_ccu Invalid device/channel name or address
2017.10.02 19:35:20 1: HMCCURPC: Found 2 threads. Stopping ...
2017.10.02 19:35:20 1: HMCCURPC: Deregistering RPC server http://192.168.1.108:7411/fh2001 with ID CB2001 at http://192.168.1.4:2001/
2017.10.02 19:35:20 1: HMCCURPC: RPC callback for server CB2001 deregistered
2017.10.02 19:35:20 2: HMCCURPC: Sending signal INT to thread CB2001 TID=6
2017.10.02 19:35:21 2: CCURPC: RPC server CB2001 stopped handling connections. TID=6
2017.10.02 19:35:21 1: HMCCURPC: Received EX event. Thread CB2001 terminated.
2017.10.02 19:35:21 2: HMCCURPC: Thread CB2001 with TID=6 has been stopped. Deleting it
2017.10.02 19:35:21 2: HMCCURPC: All RPC servers stopped. Terminating data processing thread
2017.10.02 19:35:21 2: HMCCURPC: Sending signal INT to thread DATA TID=5
2017.10.02 19:35:21 2: CCURPC: DATA stopped event processing. TID=5
2017.10.02 19:35:22 1: HMCCURPC: Received EX event. Thread DATA terminated.
2017.10.02 19:35:22 2: HMCCURPC: Thread DATA with TID=5 has been stopped. Deleting it
2017.10.02 19:35:22 2: HMCCURPC: Stop I/O handling
2017.10.02 19:35:22 2: HMCCURPC: Close child socket
2017.10.02 19:35:22 2: HMCCURPC: Close parent socket
2017.10.02 19:35:22 1: HMCCURPC: All threads stopped
2017.10.02 19:35:25 2: HMCCURPC: Starting thread for data processing
2017.10.02 19:35:25 2: HMCCURPC: Started thread for data processing. TID=7
2017.10.02 19:35:25 2: CCURPC: Thread DATA processing RPC events. TID=7
2017.10.02 19:35:25 2: HMCCURPC: RPC server thread started for interface BidCos-RF with TID=8
2017.10.02 19:35:25 2: CCURPC: Initializing RPC server CB2001 for interface BidCos-RF
2017.10.02 19:35:25 2: HMCCURPC: Callback server CB2001 created. Listening on port 7411
2017.10.02 19:35:25 2: CCURPC: CB2001 accepting connections. TID=8
2017.10.02 19:35:26 1: HMCCURPC: RPC server(s) starting
2017.10.02 19:35:26 1: HMCCURPC: Received SL event. RPC server DATA enters server loop
2017.10.02 19:35:26 1: HMCCURPC: Received SL event. RPC server CB2001 enters server loop
2017.10.02 19:35:26 1: HMCCURPC: All threads working
2017.10.02 19:35:26 2: HMCCURPC: Registering callback http://192.168.1.108:7411/fh2001 with ID CB2001 at http://192.168.1.4:2001/
2017.10.02 19:35:26 1: CCURPC: CB2001 ListDevices. Sending init to HMCCU
2017.10.02 19:35:27 1: HMCCURPC: RPC callback with URL http://192.168.1.108:7411/fh2001 registered
2017.10.02 19:35:27 1: HMCCURPC: Received IN event. RPC server CB2001 running.
2017.10.02 19:35:27 1: HMCCURPC: All RPC servers running
2017.10.02 19:35:27 2: HMCCU: No client devices matching .*
2017.10.02 19:35:27 2: HMCCURPC: Updated devices. Success=0 Failed=0
2017.10.02 19:35:27 2: CCURPC: CB2001 NewDevice received 70 device and channel specifications
2017.10.02 19:35:33 1: HMCCU: d_ccu Invalid device/channel name or address
2017.10.02 19:35:33 2: ESPEasy espBridge_192.168.1.20_21049: WARNING: Invalid JSON received. Check your ESP configuration (192.168.1.20).
JSON text must be an object or array (but found number, string, true, false or null, use allow_nonref to allow this) at ./FHEM/34_ESPEasy.pm line 736.

2017.10.02 19:35:36 2: ESPEasy espBridge_192.168.1.20_2588: WARNING: Invalid JSON received. Check your ESP configuration (192.168.1.20).
JSON text must be an object or array (but found number, string, true, false or null, use allow_nonref to allow this) at ./FHEM/34_ESPEasy.pm line 736.

2017.10.02 19:36:32 2: ESPEasy espBridge_192.168.1.20_31374: WARNING: Invalid JSON received. Check your ESP configuration (192.168.1.20).
JSON text must be an object or array (but found number, string, true, false or null, use allow_nonref to allow this) at ./FHEM/34_ESPEasy.pm line 736.

2017.10.02 19:36:36 2: ESPEasy espBridge_192.168.1.20_27079: WARNING: Invalid JSON received. Check your ESP configuration (192.168.1.20).
JSON text must be an object or array (but found number, string, true, false or null, use allow_nonref to allow this) at ./FHEM/34_ESPEasy.pm line 736.

2017.10.02 19:37:32 2: ESPEasy espBridge_192.168.1.20_23408: WARNING: Invalid JSON received. Check your ESP configuration (192.168.1.20).
JSON text must be an object or array (but found number, string, true, false or null, use allow_nonref to allow this) at ./FHEM/34_ESPEasy.pm line 736.

2017.10.02 19:37:36 2: ESPEasy espBridge_192.168.1.20_1799: WARNING: Invalid JSON received. Check your ESP configuration (192.168.1.20).
JSON text must be an object or array (but found number, string, true, false or null, use allow_nonref to allow this) at ./FHEM/34_ESPEasy.pm line 736.


Gernot
Titel: Antw:[Altern.: int.RPC]HMCCU: Bitte um Aufklärung des Zusammenhangs zu JSON Problemen
Beitrag von: zap am 03 Oktober 2017, 09:45:32
Das mit den 2 Minuten habe ich so auch noch nicht gesehen. Ich habe noch einen Raspi rumliegen und werde ihn die nächsten Tage mal mit Stretch aufsetzen. Mal sehen, ob ich das Problem reproduzieren kann.
Titel: Antw:[Altern.: int.RPC]HMCCU: Bitte um Aufklärung des Zusammenhangs zu JSON Problemen
Beitrag von: Barit am 04 Oktober 2017, 09:50:49
Hi,
ich habe gerade erst gesehen, dass es diesen Thread gibt in dem es auch um das JSON-Problem bei Verwendung des externen RPC-Servers HMCCURPC geht. Ich und anderen haben die gleichen Probleme und haben dazu schon in diversen Threads gepostet. Nur damit die nicht alle auseinander laufen und die Zusammenhänge klar werden verlinke ich mal die anderen zum Thema gehörenden Threads:

https://forum.fhem.de/index.php/topic,71968.0.html (https://forum.fhem.de/index.php/topic,71968.0.html)
https://forum.fhem.de/index.php/topic,76744.0.html (https://forum.fhem.de/index.php/topic,76744.0.html)
https://forum.fhem.de/index.php/topic,76842.0.html (https://forum.fhem.de/index.php/topic,76842.0.html)
https://forum.fhem.de/index.php/topic,74943.0.html (https://forum.fhem.de/index.php/topic,74943.0.html)
https://forum.fhem.de/index.php/topic,71737.0.html (https://forum.fhem.de/index.php/topic,71737.0.html)

@zap:
Falls du Hilfe in Form von Logs oder Konfigurationen brauchst die das Problem eingrenzen können, kann ich gerne unterstützen. Ich benutzte ein aktuelles Raspbian Stretch und hatte nachdem die Probleme mit dem externen RPC auftraten per CPAN die aktuellsten RPC::XML::Client und RPC::XML::Server Module installiert. Das brachte aber auch keine Besserung, so dass ich derzeit auch wieder den internen RPC verwende.
Titel: Antw:[Altern.: int.RPC]HMCCU: Bitte um Aufklärung des Zusammenhangs zu JSON Problemen
Beitrag von: zap am 04 Oktober 2017, 10:29:22
Zitat von: Barit am 04 Oktober 2017, 09:50:49
@zap:
Falls du Hilfe in Form von Logs oder Konfigurationen brauchst die das Problem eingrenzen können, kann ich gerne unterstützen. Ich benutzte ein aktuelles Raspbian Stretch und hatte nachdem die Probleme mit dem externen RPC auftraten per CPAN die aktuellsten RPC::XML::Client und RPC::XML::Server Module installiert. Das brachte aber auch keine Besserung, so dass ich derzeit auch wieder den internen RPC verwende.

Danke für das Angebot. Die RPC-Module sind wahrscheinlich nicht die Ursache, da sie sowohl vom internen als auch externen RPC-Server genutzt werden. Eher die Thread- oder Shared-Memory Module.

Interessant wäre, ob es jemanden gibt, bei dem das SONOS Modul mit JSON keine Probleme verursacht, aber das Modul HMCCURPC. Das SONOS-Modul benutzt ebenfalls Threads

Zum Thema Update: Bitte mal darauf achten, dass die Module threads, Thread::Queue, threads::shared und JSON aktuell sind. Hier die Versionen aus CPAN:

JSON: 2.94
threads: 2.16
Thread::Queue: 2.0
threads::shared: 1.57

Es kann eigentlich nur mit einem dieser Module zusammen hängen.
Titel: Antw:[Altern.: int.RPC]HMCCU: Bitte um Aufklärung des Zusammenhangs zu JSON Problemen
Beitrag von: Barit am 04 Oktober 2017, 11:07:34
Sonos habe ich leider nicht im Einsatz.
Habe aber gerade mal die Versionen der Module getestet und aktualisiert:

JSON: 2.94 (war aktuell)
threads: von 2.07 auf 2.16
Thread::Queue: von 3.09 auf 3.12
threads::shared: von 1.51 auf 1.57

Benutzt du eine ältere Version (2.0) von Thread::Queue? Meine installierte war bereits 3.09 und die habe ich jetzt auf 3.12 geupdatet. Danach habe ich nochmal den externen RPC-Server getestet, aber ich bekomme noch immer JSON-Fehler bspw. beim FRITZBOX-Modul:
JSON text must be an object or array (but found number, string, true, false or null, use allow_nonref to allow this) at ./FHEM/72_FRITZBOX.pm line 4609.
Titel: Antw:[Altern.: int.RPC]HMCCU: Bitte um Aufklärung des Zusammenhangs zu JSON Problemen
Beitrag von: supernova1963 am 04 Oktober 2017, 15:32:39
Hallo zusammen,

die Versions-Abfrage der genannten Module ergibt für den Standard Ubuntu 17.04 mit apt-get -y -f install libjson-perl: 

fhem@fhem:~$ cpan -D JSON
Loading internal null logger. Install Log::Log4perl for logging messages
Reading '/opt/fhem/.cpan/Metadata'
  Database was generated on Wed, 04 Oct 2017 05:17:02 GMT
JSON
-------------------------------------------------------------------------
(no description)
I/IS/ISHIGAKI/JSON-2.94.tar.gz
/usr/share/perl5/JSON.pm
Installed: 2.90
CPAN:      2.94  Not up to date
Kenichi Ishigaki (ISHIGAKI)
ishigaki@cpan.org

fhem@fhem:~$ cpan -D threads
Loading internal null logger. Install Log::Log4perl for logging messages
Reading '/opt/fhem/.cpan/Metadata'
  Database was generated on Wed, 04 Oct 2017 05:17:02 GMT
threads
-------------------------------------------------------------------------
(no description)
J/JD/JDHEDDEN/threads-2.16.tar.gz
/usr/lib/x86_64-linux-gnu/perl/5.24/threads.pm
Installed: 2.07
CPAN:      2.16  Not up to date
Jerry D. Hedden (JDHEDDEN)
jdhedden@cpan.org

fhem@fhem:~$ cpan -D Thread::Queue
Loading internal null logger. Install Log::Log4perl for logging messages
Reading '/opt/fhem/.cpan/Metadata'
  Database was generated on Wed, 04 Oct 2017 05:17:02 GMT
Thread::Queue
-------------------------------------------------------------------------
(no description)
J/JD/JDHEDDEN/Thread-Queue-3.12.tar.gz
/usr/share/perl/5.24/Thread/Queue.pm
Installed: 3.09
CPAN:      3.12  Not up to date
Jerry D. Hedden (JDHEDDEN)
jdhedden@cpan.org

fhem@fhem:~$ cpan -D threads::shared
Loading internal null logger. Install Log::Log4perl for logging messages
Reading '/opt/fhem/.cpan/Metadata'
  Database was generated on Wed, 04 Oct 2017 05:17:02 GMT
threads::shared
-------------------------------------------------------------------------
(no description)
J/JD/JDHEDDEN/threads-shared-1.57.tar.gz
/usr/lib/x86_64-linux-gnu/perl/5.24/threads/shared.pm
Installed: 1.51
CPAN:      1.57  Not up to date
Jerry D. Hedden (JDHEDDEN)
jdhedden@cpan.org


Alle 4 genannten sind "Not up to date", was jedoch wenig überraschend ist (CPAN ist sehr oft aktueller als eine Distribution).
Das Ergebnis von Barit läßt vermuten, dass ein Heben der Versionen dieser 4 Module auf den CPAN-Stand das Problem nicht löst.
Außerdem würde der Support eines jeden FHEM Moduls, das ebenfalls eins dieser CPAN Module nutzt, erheblich aufwendiger.
Wenn es dennoch unbedingt sein soll, würde ich es in meiner Entw.-Umgebung und der Debian 9.1 Maschine nach einem Snapshot testen.

LG

Gernot
Titel: Antw:[Altern.: int.RPC]HMCCU: Bitte um Aufklärung des Zusammenhangs zu JSON Problemen
Beitrag von: zap am 06 Oktober 2017, 16:34:55
Hier geht es weiter  ;)

https://forum.fhem.de/index.php/topic,74943.msg695487.html#msg695487