Wow! That's quite the Rube Goldberg Machine
I had a look at EventGhost's Onkyo ISCP plug-in
and it's a mere 183 lines of Python. The lion's share of the code is "driver overhead" and the only important work it performs is transmitting properly formed ISCP commands and parsing received ISCP commands. Quite honestly, less than a dozen lines of code do the real work. Unless you are already using EventGhost for other purposes, it's a lot of overhead for a dozen lines of Onkyo code (plus the TCP/UDP script you're running).
The ISCP protocol (see the XLS file here
) dictates that commands take this form when transmitted via Ethernet: ISCP 00000010 00000007 01000000 !1PWR01 0D
Don't take that string literally
. You have to convert everything into binary. Here's an example of what I mean taken from the AutoIT forum. It uses AutoIt's scripting language, not VBScript, but you get the idea of what needs to be done in VBScript. Global $binISCP_Header = StringToBinary("ISCP")Global $binISCP_HeaderSize = Binary("0x00000010") ; Header size = 16Global $binISCP_DataSize = Binary("0x00000007") ; Data size (command length) = 7 charsGlobal $binISCP_Version = Binary("0x01000000") ; Version 188.8.131.52Global $binISCP_Data = StringToBinary("!1PWR01"); Command=!1PWR01Global $binISCP_End = Binary("0x0D") ; @CR Global $binISCP_Message = $binISCP_Header & $binISCP_HeaderSize & _ $binISCP_DataSize & _ $binISCP_Version & _ $binISCP_Data & _ $binISCP_End TCPSend($ConnectedSocket, $binISCP_Message) ; Send message over connected socket
Here is the EventGhost plug-in's code for creating an IPSC command:datasize = self.plugin.headersize + len(message)line = pack('!4sIIBxxx', self.plugin.header, self.plugin.headersize, datasize, self.plugin.version ) + message
There's about the same amount of code for parsing a received IPSC command. That's it, that's all! The driver does nothing else (not even periodically poll your receiver to get the latest status and confirm the network connection is functional).
With a little effort you can duplicate the IPSC functionality in your Premise Receiver driver and dramatically reduce the number of components in your Rube Goldberg machine.
Edited by 123, 28 April 2012 - 05:43 PM.