![]() ![]() |
Jan 27 2010, 10:20 PM
Post
#1
|
|
|
Be nice to me, I am new. Group: New Members Posts: 3 Joined: 27-January 10 Member No.: 13,111 Card: None |
Hi btmi
First off, let me just say that I've been using HIP for several years and absolutely love it ! Now, I'm not sure if HIP can solve my current issue, but I'll do my best to explain : I recently purchased a new Onkyo Amplifier/AV Receiver - while I can control it using HIP + IR codes, sometimes it just doesn't pick up the commands (not sure why - blasters are all positioned correctly, it just seems quite random). I'm guessing the Onkyo is a little more picky over IR signals than my old Yamaha amp. The Onkyo does however have an ethernet interface and I've successfully written a little C# program to send commands to it to power on / off / switch inputs (basically the same commands I use via IR and HIP). Now, in HIP, I'd use the scheduler to blast these commands via my program on 'startup', 'suspend' and 'resume' - but I've found that HIP (or more likely windows itself) doesn't like to start another process once the system is 'suspending' or being powered off, so I can't use my small program to execute the commands in that case. Do I have any options here ? I guess I could find some way of using the task scheduler (oops, I should have said I'm using Windows 7) to run the programs on the appropriate events, but ideally I'd like to use hip and keep it all centralised. Of course, having the ISCP ethernet protocol via HIP itself would be nice (it's pretty much the same as the RS232 interface) ;-) Cheers Chris |
|
|
|
Feb 1 2010, 08:58 AM
Post
#2
|
|
|
Forum Regular Group: Members Posts: 1,581 Joined: 8-October 03 From: Adelaide Member No.: 185 Card: DNTV Live! DVB-T |
The Hip Task scheduler does have On Suspend/On Resume events which you could use to run a batch file....
I am sure the ISCP protocol is not too difficult to work with, but it is not on the cards at the moment. -------------------- |
|
|
|
Feb 1 2010, 10:14 AM
Post
#3
|
|
|
Be nice to me, I am new. Group: New Members Posts: 3 Joined: 27-January 10 Member No.: 13,111 Card: None |
The Hip Task scheduler does have On Suspend/On Resume events which you could use to run a batch file.... I am sure the ISCP protocol is not too difficult to work with, but it is not on the cards at the moment. Thanks for the reply - it's strange, but I just couldn't get it to run another process once it was 'suspending' (resume worked fine) - I ended up writing a little 'exe' which just sits in my system tray and responds to the suspend/resume/shutdown windows events and sends the commands at that point As for the ISCP protocol, here's some C# code if anyone is interested in controlling an Onkyo amp - it's really simple : CODE // here's just some of the commands you can send to the AMP - there's a huge spreadsheet available of the commands on the web / onkyo website // // // public static string POWER_ON = "!1PWR01"; // public static string POWER_OFF = "!1PWR00"; // public static string PC_INPUT = "!1SLI10"; // public static string DVD_INPUT = "!1SLI00"; public static void SendCommand(String command) { try { StreamWriter clientStreamWriter = null; // hardcoded IP Address for now..... String onkyoIP = "192.168.1.69"; int length = command.Length; length++; char code = (char)length; // build up packet header and rest of command - followed by <CR> (chr(13)) // String line = "ISCP\x00\x00\x00\x10\x00\x00\x00" + code + "\x01\x00\x00\x00" + command + "\x0D"; // create a TCP Client - hardcoded port too TcpClient tcpClient = new TcpClient(onkyoIP, 60128); //get a network stream from server NetworkStream clientSockStream = tcpClient.GetStream(); clientStreamWriter = new StreamWriter(clientSockStream); // send command to receiver // clientStreamWriter.WriteLine(line); clientStreamWriter.Flush(); clientStreamWriter.Close(); tcpClient.Close(); } catch (Exception e) { Console.WriteLine(e.StackTrace); } } Cheers Chris |
|
|
|
![]() ![]() |
|
Lo-Fi Version | Time is now: 20th May 2013 - 02:49 PM |