BIN-RPC Live Converter

Nutzung von XML RPC, Remote Script, JSON RPC, XMLAPI

Moderator: Co-Administratoren

leonsio
Beiträge: 1107
Registriert: 07.01.2012, 14:06
Danksagung erhalten: 6 Mal

Re: BIN-RPC Live Converter

Beitrag von leonsio » 03.03.2012, 20:46

So zum "Fix"

bitte kann mir wer sagen, ob es noch Probleme damit gibt?
Bzw. könnte sich jemand bei mir melden, der damit Probleme hat

der "Fix" ist eigentlich folgender:

Zeile: 143 Suche:

Code: Alles auswählen

       
 $data = explode("\r\n\r\n", $data, 2);
Ersetze durch:

Code: Alles auswählen

        $data = explode("\r\n", $data, 2);
Im Original ist es nach der RFC und sollte in den meisten Fällen greifen
Falls der Converter trotzdem nicht geht (DEBUG einschalten zur Prüfung)

benötige ich folgende Daten:
Betriebssystem
PHP Version

schriebt mir noch, ob es mit dem Fix oben klappt

jrkalf
Beiträge: 8
Registriert: 27.03.2012, 21:14

Re: BIN-RPC Live Converter

Beitrag von jrkalf » 31.03.2012, 23:00

Hi,

sorry to reply in English and not in German, but I guess it's better to do it this way then let the text be destroyed by google translate.


I've downloaded the hmxmlbin and ccu-historian, but I can't get them to work together. Perhaps I'm doing something wrong.
I have CUxD 564a on the ccu and I have a hmxmlbin on my ubuntu box with xmlrpc for php5 installed.
I run ccu-historian on my win7 box or on the ubuntu box, both is acceptable.

I managed to get the information from the CCU-Historian documentation as to do the following:

Code: Alles auswählen

ccu.interfaces.cuxd=new CcuInterfaceConfig('127.0.0.1',8701)
But this doesn't seem to work. I have the CUxD loaded on the ccu and the script ports for the CCU are set to be open.

When I load ccu-historian the logs look like this:

Code: Alles auswählen

root@elmo:~/ccu-historian-0.6.0beta5-bin# java -jar ccu-historian.jar
00:11:36|INFO   |Starting CCU-Historian V0.6.0beta5
00:11:36|INFO   |by MDZ (mdz@quantentunnel.de)
00:11:36|INFO   |Connecting to database
00:11:36|INFO   |Starting database web server
00:11:36|INFO   |Connecting to CCU
00:11:36|INFO   |Starting RPC server on port 2010
00:11:36|INFO   |Creating RPC client for http://192.168.12.4:2000 with name BidCos-Wired
00:11:36|INFO   |Creating RPC client for http://192.168.12.4:2001 with name BidCos-RF
00:11:36|INFO   |Creating RPC client for http://192.168.12.4:2002 with name System
00:11:36|INFO   |Creating RPC client for http://127.0.0.1:8701 with name cuxd
00:11:36|SEVERE |Exception: Can't connect to CCU with address http://127.0.0.1:8701
what have I overlooked?
CCU1 (HomeMatic 1.505) - CUNO v1 (culfw 1.44 doublesocket) - CUx-Daemon(v 0.567)

Lueghi
Beiträge: 630
Registriert: 01.11.2007, 21:45
System: Alternative CCU (auf Basis OCCU)
Wohnort: Siebengebirge (bei Bonn)
Hat sich bedankt: 18 Mal
Danksagung erhalten: 2 Mal

Re: BIN-RPC Live Converter

Beitrag von Lueghi » 01.04.2012, 11:29

jrkalf hat geschrieben:...

When I load ccu-historian the logs look like this:

Code: Alles auswählen

root@elmo:~/ccu-historian-0.6.0beta5-bin# java -jar ccu-historian.jar
00:11:36|INFO   |Starting CCU-Historian V0.6.0beta5
00:11:36|INFO   |by MDZ (mdz@quantentunnel.de)
00:11:36|INFO   |Connecting to database
00:11:36|INFO   |Starting database web server
00:11:36|INFO   |Connecting to CCU
00:11:36|INFO   |Starting RPC server on port 2010
00:11:36|INFO   |Creating RPC client for http://192.168.12.4:2000 with name BidCos-Wired
00:11:36|INFO   |Creating RPC client for http://192.168.12.4:2001 with name BidCos-RF
00:11:36|INFO   |Creating RPC client for http://192.168.12.4:2002 with name System
00:11:36|INFO   |Creating RPC client for http://127.0.0.1:8701 with name cuxd
00:11:36|SEVERE |Exception: Can't connect to CCU with address http://127.0.0.1:8701
what have I overlooked?
I believe you haven't configured the corresponding init-file right for the cuxd. For CCU-Historian you are using IP 192.168.12.4 and the cuxd is using 127.0.0.1 .... but I'm not familiar with cuxd. I just looked at your logfile.
Gruß Stefan

jrkalf
Beiträge: 8
Registriert: 27.03.2012, 21:14

Re: BIN-RPC Live Converter

Beitrag von jrkalf » 01.04.2012, 12:08

Thanks for your given help, but for ccu-historian to work it needs to connect to 2 gateways. One is the ccu itself for the BidCoS equipment and the hmxmlbin gateway which talks to the cuxd on the ccu.

The ccu is at 192.168.12.4
The ccu historian now runs on the same host as the hmxmlbin gateway, so it should be connected to at 127.0.0.1.
CUxD runs on the ccu and in the hmxmlbin I've correctly configured that IP address.

Does anybody else know?
CCU1 (HomeMatic 1.505) - CUNO v1 (culfw 1.44 doublesocket) - CUx-Daemon(v 0.567)

leonsio
Beiträge: 1107
Registriert: 07.01.2012, 14:06
Danksagung erhalten: 6 Mal

Re: BIN-RPC Live Converter

Beitrag von leonsio » 04.04.2012, 08:24

Example Scenario
192.168.0.10 Ubuntu pc with bin-rpc converter
192.168.0.20 Windows 7 PC with CCU Historian
192.168.12.4 CCU1


1. Step:
Setup bin-rpc converter on your ubuntu pc
in the coverter config you have to setup the URL to the CCU1

2. Test Connectivity
on your windows 7 PC open CMD and write

Code: Alles auswählen

telnet 192.168.0.10 8701
You should get a promt, if not your setup under Step 1 is wrong

3. Setup CCU Historian

ccu.interfaces.cuxd=new CcuInterfaceConfig('192.168.0.10',8701)

!!! you must enter the IP of your ubuntu pc, not localhost !!!
you can only enter localhost if historian runs on your ubuntu pc = same pc


Have fun ;)

jrkalf
Beiträge: 8
Registriert: 27.03.2012, 21:14

Re: BIN-RPC Live Converter

Beitrag von jrkalf » 04.04.2012, 19:39

Hi Leonsi,

like stated in the second message, I've moved ccu-historian directly onto the machine that has the hmxmlbin convertor running. Hence I'm using localhost as the ccu.interfaces.cuxd

Furthermore I've re-tested the hmxmlbin and it doesn't seem to be working. I haven't figured out why.
To illustrate my setup:

1. ubuntu 11.10 64-bit with the latest php5 and xmlrpc for php5 installed.
2. CUxD version 564a
3. CCU version 1.504
4. hmxmlbin version from this forums thread, version 0.2.

top part of the hmxmlbin (config part):

Code: Alles auswählen

// Homematic CUxD order anderes Interface
$hm_host = '192.168.12.4';
$hm_port = '8701';
// XMLRPC Server wird für bidirektionalle Kommunikation gebruacht
$url = "http://192.168.12.4/hms/modules/Homematic/Server.class.php";

What might be wrong (I'm not entirely sure) is that the problem lies in CUxD. When I telnet to the 8701 port of that device, I get a socket to be opened, but no information to be returned. When I press the enter key the socket gets disconnected. The exact same thing happens when I connect to the hmxmlbin on socket 8701.

On the CCU I've checked the firewall settings as well, none seem to be set.
I'm not sure if it could the the CUxD settings. Therefor here's a small output of my CUxD setup:

Code: Alles auswählen

;INI-File for cuxd
LISTENPORT=8700
HM-SCRIPTHOST=127.0.0.1
HM-SCRIPTPORT=8181
RPCHOST=127.0.0.1
RPCPORT=8701
HTTP-REFRESH=5
TERMINALLINES=25
CUXLOGSIZE=2000
USERLOGIN=
CUXINITCMD=X01_T01sekrit
LOGFILE=
LOGLEVEL=
LOGFILEMOVE=
DEVLOGFILE=
DEVLOGSIZE=100000
DEVLOGMOVE=
DEVTIMEFORMAT=%Y-%m-%dT%X
DEVDATAFORMAT=
SUBSCRIBE_RF=1
SUBSCRIBE_WR=0
AUTOSAVE=1
MOUNTCMD=
UMOUNTCMD=
BACKUPCMD=
INTERNAL=
CCU1 (HomeMatic 1.505) - CUNO v1 (culfw 1.44 doublesocket) - CUx-Daemon(v 0.567)

leonsio
Beiträge: 1107
Registriert: 07.01.2012, 14:06
Danksagung erhalten: 6 Mal

BIN-RPC Live Converter

Beitrag von leonsio » 05.04.2012, 08:02

Enable debugung in the converter and Look in the syslog
You can find in my orher threads some Test Scripts

jrkalf
Beiträge: 8
Registriert: 27.03.2012, 21:14

Re: BIN-RPC Live Converter

Beitrag von jrkalf » 05.04.2012, 21:29

Debugging set to true in the hmxmlbin:

Code: Alles auswählen

#!/usr/bin/php5
<?php
/**
 * Homematic BIN / XML RPC Live Converter
 * @version 0.2
 * @copyright Leonid Kogan <leon@leonsio.com>
 * @license GPL 3.0
 */
// Homematic CUxD order anderes Interface
$hm_host = '192.168.12.4';
$hm_port = '8701';
// XMLRPC Server wird für bidirektionalle Kommunikation gebruacht
$url = "http://192.168.12.4/hms/modules/Homematic/Server.class.php";
// Debug auf true setzen, zum aktivieren. Ausgabe wird nach syslog(debug) geschr
ieben
define('DEBUG', true);

##################################
#                                #
#        DO NOT EDIT             #
#                                #
##################################
Turned on syslog output in /etc/xinetd.conf:

Code: Alles auswählen

# Please note that you need a log_type line to be able to use log_on_success
# and log_on_failure. The default is the following :
log_type = SYSLOG daemon info
my hmxmlbin file in /etc/xinetd.d/:

Code: Alles auswählen

# default: on
# description: Homematic XML-RPC to BIN-RPC converter
service hmxmlbin
{
socket_type = stream
wait = no
user = root
server = /usr/bin/hmxmlbin
disable = no
port = 8701
}
I've restarted xinetd to be sure. The exact same thing happens whether I connect to the convertor or when I connect to the CUxD at port 8701. Whenever I try to do a http get or simply press enter or put in a dott and press enter, the socket gets disconnected. No syslog entries are being produced. Neither by the convertor or the syslog daemon from the CCU. I have both logging to the same syslog and that one is working well, I see other CCU messages being received.

So I'm somehow suspecting the CUxD to not be properly responsive. But I can't be sure. The CUxD daemon does work properly towards the CCU software. All FS20/FHT devices configured work properly.

I'll see if I can reinstall the CUxD software, starting with version 0.563.
CCU1 (HomeMatic 1.505) - CUNO v1 (culfw 1.44 doublesocket) - CUx-Daemon(v 0.567)

Benutzeravatar
uwe111
Beiträge: 4827
Registriert: 26.02.2011, 22:22
Hat sich bedankt: 3 Mal
Danksagung erhalten: 246 Mal
Kontaktdaten:

Re: BIN-RPC Live Converter

Beitrag von uwe111 » 05.04.2012, 23:45

jrkalf hat geschrieben: The exact same thing happens whether I connect to the convertor or when I connect to the CUxD at port 8701. Whenever I try to do a http get or simply press enter or put in a dott and press enter, the socket gets disconnected. No syslog entries are being produced.
Sorry, there are no syslog entries for invalid CUxD requests yet. CUxD will only answer if you send a valid BINRPC request. And that's what the converter is supposed to do.
I think the converter needs a valid XMLRPC request (not just enter or a dot) to translate it to BINRPC.
Could that be the problem?

Uwe.
Alle sagten: Das geht nicht. Dann kam einer, der wußte das nicht und hat's einfach gemacht.
SPENDEN :wink: Download: CUxD 2.11, SSH KeyDir

leonsio
Beiträge: 1107
Registriert: 07.01.2012, 14:06
Danksagung erhalten: 6 Mal

Re: BIN-RPC Live Converter

Beitrag von leonsio » 08.04.2012, 13:31

download an try this test scripts (see example file in archive)

http://homematic-forum.de/forum/viewtop ... =31&t=8070

try to connect to the binrpc converter and look in the syslog on your server, if you have enabled the debug output
if you get right answer, then the converter works

Antworten

Zurück zu „Softwareentwicklung von externen Applikationen“