[Twisted-Python] HomeMatic - xmlrpc twisted !!
Hi everyone, I'm trying to connect to homematic server at address '192.168.1.251' and port '2001'. I have a sample twisted server and client on my localhost. It's working fine. Now to the functions in server protocol.py file, I added another function (as shown below) which creates another client that connects to homematic server. But it's giving following error when I start the client. Error: File "/home/vinodh/Desktop/homematic/xmlrpc_twisted/protocol.py", line 45, in xmlrpc_init d = ClientCreator(reactor).connectTCP(self,'192.168.1.251',2001) exceptions.TypeError: __init__() takes at least 3 arguments (2 given)" my scenario is this way: mycleint ---> myserver(protocol file--->cliet-->homematic server) Please help me out. Thanks, Vinod
ClientCreator needs a protocol. See: http://docs.huihoo.com/python/twisted/howto/clients.html On Fri, May 25, 2012 at 5:27 AM, vinod kumar <vk.86.811@gmail.com> wrote:
Hi everyone,
I'm trying to connect to homematic server at address '192.168.1.251' and port '2001'. I have a sample twisted server and client on my localhost. It's working fine. Now to the functions in server protocol.py file, I added another function (as shown below) which creates another client that connects to homematic server. But it's giving following error when I start the client. Error: File "/home/vinodh/Desktop/homematic/xmlrpc_twisted/protocol.py", line 45, in xmlrpc_init d = ClientCreator(reactor).connectTCP(self,'192.168.1.251',2001) exceptions.TypeError: __init__() takes at least 3 arguments (2 given)"
my scenario is this way: mycleint ---> myserver(protocol file--->cliet-->homematic server)
Please help me out.
Thanks, Vinod
_______________________________________________ Twisted-Python mailing list Twisted-Python@twistedmatrix.com http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python
-- Jasper
Yeah thanks a lot. I implemented it the same way inside my protocol.py. It's not giving the previous error. But the error now is : "Failure: twisted.internet.error.ConnectionLost: Connection to the other side was lost in a non-clean fashion: Connection lost" Lets leave it for a mail gap. Please clarify this small doubt. I have my sample server and client codes on same machine. For server, the last line of code where I return a service is this way : s = strports.service('ssl:'+port+':privateKey='+privateKey+':certKey='+certKey, channel.HTTPFactory(site)) return s I create my client this way : proxy = Proxy('https://%s:%s@%s:1192' % ('conetuser', 'vinodkumar','localhost')) It's running fine if both are on my system. I have changed the localhost to my ip address , and run the server on my pc and client on another pc. That case, it gave me connection error. Is it wrong? In creation of server also, should I give it some host address or something along with port ? When I run the client with localhost replaced by my ipaddress with both server and client on my pc, it's working fine.
Dear All On 05/25/2012 04:27 PM, vinod kumar wrote:
Hi everyone,
I'm trying to connect to homematic server at address '192.168.1.251' and port '2001'. I have a sample twisted server and client on my localhost. It's working fine. Now to the functions in server protocol.py file, I added another function (as shown below) which creates another client that connects to homematic server. But it's giving following error when I start the client. I don't know what homematic is ... But I played with wokkel to bridge Arduino and XMPP.
So if you still need more discussion, and have a time .. plis elaborate more about : 1. What is homematic 2. What you want your twisted script to work May be there is something that I can share Sincerely -bino-
On 29/05/2012, at 1:25 PM, bino oetomo <bino@indoakses-online.com> wrote:
Dear All On 05/25/2012 04:27 PM, vinod kumar wrote:
Hi everyone,
I'm trying to connect to homematic server at address '192.168.1.251' and port '2001'. I have a sample twisted server and client on my localhost. It's working fine. Now to the functions in server protocol.py file, I added another function (as shown below) which creates another client that connects to homematic server. But it's giving following error when I start the client. I don't know what homematic is ... But I played with wokkel to bridge Arduino and XMPP.
So if you still need more discussion, and have a time .. plis elaborate more about : 1. What is homematic
From what I can see, homematic is a networked home automation server. Being unable to comprehend German I can't glean much from their sales material, but they seem to use some kind of home-brew comms protocol
2. What you want your twisted script to work
May be there is something that I can share
Sincerely -bino-
_______________________________________________ Twisted-Python mailing list Twisted-Python@twistedmatrix.com http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python
I'd suggest setting tcpdump to watch your packets and see what data is being exchanged. It may well be that you're dealing with a fail-and-die protocol and not properly handling its failure response. It might be considered overkill, but when I'm first building a networked process I log the hell out of everything, from raw line messages to the parsing and processing steps. It helps, believe me. If you give individual messages unique ID numbers, and make sure to print iteration numbers on loops, you can easily highlight where it's going wrong, or highlight adverse behaviour patterns. Anyway, just my two cents. *ducks* -- Adrian
participants (4)
-
Adrian Overbury -
bino oetomo -
Jasper St. Pierre -
vinod kumar