Harman Kardon Serial Control

Questions and comments specific to a particular plugin should go here.

Harman Kardon Serial Control

Postby kingtd » Fri Jul 13, 2007 7:53 am

Hello everyone,

As a recent (paid/registered) girder user, I had become more and more disillusioned with the software. The numerous bugs and problems, interface inconsistencies, and inconsiderate support folks really had me irritated. When a user in the girder forums talking about a well-known HID bug mentioned that it "worked fine in Eventghost", a quick google led me here.

Everything that I've attempted to do has been smooth and I really applaud the authors and their ability to make the notoriously ugly middleware piece of automation software into something that's clean and functional.

To do my part here, I'll provide my Harman Kardon AVR serial control plugin that I worked on today (as my 2nd day of being an Eventghost user). Currently it triggers an event when the front panel display changes. Tomorrow, I plan to add support for sending commands as well.

If anyone else out there has a HK AVR receiver with a serial port, please give this a whirl and let me know how it works.

Thanks and keep it up!

-K
Attachments
hk.zip
Put this in a directory called HK under plugins and rename it to _init_.py
(3.74 KiB) Downloaded 344 times
kingtd
Plugin Developer
 
Posts: 78
Joined: Fri Jul 13, 2007 7:39 am

Re: Harman Kardon Serial Control

Postby Bitmonster » Fri Jul 13, 2007 10:20 pm

Thanks for your comments. Statements like this are always nice to read. :)

I hope I will find some time in the future to write an installation function for external plugins, so the user doesn't have much hassle to install them from the forum. But if your plugin has reached a level where you think it is quite complete, we could include it in the standard distribution if you want.
Please post software-related questions in the forum - PMs will only be answered, if really private, thanks!
User avatar
Bitmonster
Site Admin
 
Posts: 2239
Joined: Mon Feb 06, 2006 10:28 pm

Re: Harman Kardon Serial Control

Postby kingtd » Mon Jul 16, 2007 6:06 am

Here's my updated version that allows you to send commands to the receiver as well as get notified when the front panel display changes. I've been running with this for a couple days now and it seems to work pretty well.

Every once in a while the receiver will spit out some garbage codes that I haven't been able to decipher yet, but it doesn't seem to have any affect on the operation. It's been tricky to debug since the triggerevent command can't handle any ASCII characters above 128. =)

Once I get that part worked out, you're welcome to include my plug-in in the main distribution, although it would be nice if someone else that has an HK receiver could test it out.

-K
Attachments
hk.zip
(4.23 KiB) Downloaded 334 times
kingtd
Plugin Developer
 
Posts: 78
Joined: Fri Jul 13, 2007 7:39 am

Re: Harman Kardon Serial Control

Postby Bitmonster » Mon Jul 16, 2007 2:14 pm

TriggerEvent expects a "printable" string, not a byte string. Therefore all characters above ord(128) raise an error, because the program wouldn't know how to print them as this depends on the encoding of the string. So you have to convert it to a unicode string or limit it to ascii<128.

One way to make this more readable is to convert it to a "escaped string" with the .encode() method.

Something like this:
self.TriggerEvent(myEvent.encode("string_escape"))

A character with the hex value A1 will then be printed with the Python string escape syntax "\xa1".
Please post software-related questions in the forum - PMs will only be answered, if really private, thanks!
User avatar
Bitmonster
Site Admin
 
Posts: 2239
Joined: Mon Feb 06, 2006 10:28 pm

Re: Harman Kardon Serial Control

Postby kingtd » Mon Jul 16, 2007 3:40 pm

Ah, perfect! I'm still a bit of a noob when it comes to python programming, but I'm learning fast. I'll add that to my code tonight and see if that helps figure out where this extraneous data is coming from.

-K
kingtd
Plugin Developer
 
Posts: 78
Joined: Fri Jul 13, 2007 7:39 am

Re: Harman Kardon Serial Control

Postby kingtd » Sat Aug 04, 2007 2:54 am

OK, I'm just about done with my final version of this plugin, but I've run into a little issue that I can't quite figure out.

It seems like when I need to transmit just Chr(0) or \x00 by itself, that it never registers on my serial devices. A \x01 works just fine as does any other character by itself.

Does anyone know of a good way to test this out? I'm just curious whether my \x00 is being sent and the device is ignoring it, or if it's not being sent at all.

The \x00 definitely works as part of a longer string.

Any thoughts or help as always are appreciated.

-K
kingtd
Plugin Developer
 
Posts: 78
Joined: Fri Jul 13, 2007 7:39 am

Re: Harman Kardon Serial Control

Postby Bitmonster » Sat Aug 04, 2007 4:06 am

You can try a software serial port monitor. I have just used this one to verify the serial plugin sends a single \x00:
http://www.serial-port-monitor.com/

But the best way is to monitor it by a null modem cable and a second COM port.
http://en.wikipedia.org/wiki/Null_modem
(There are also some links to virtual COM port drivers that can be used to emulate a null modem link)
Please post software-related questions in the forum - PMs will only be answered, if really private, thanks!
User avatar
Bitmonster
Site Admin
 
Posts: 2239
Joined: Mon Feb 06, 2006 10:28 pm

Re: Harman Kardon Serial Control

Postby Bitmonster » Sun Apr 06, 2008 9:30 pm

I just noticed, that we haven't included this plugin in the normal installer. It is in the SVN trunk but I haven't enabled it for the release and I don't know why. Is the last version working so far with 0.3.6?
Please post software-related questions in the forum - PMs will only be answered, if really private, thanks!
User avatar
Bitmonster
Site Admin
 
Posts: 2239
Joined: Mon Feb 06, 2006 10:28 pm

Re: Harman Kardon Serial Control

Postby killervette » Sun Jun 15, 2008 2:23 pm

Would this work on a onkyo receiver? what type of modifications would be needed?
killervette
 
Posts: 5
Joined: Wed Jun 11, 2008 3:24 pm

Re: Harman Kardon Serial Control

Postby kingtd » Mon Jun 16, 2008 12:26 am

It probably won't work on an Onkyo receiver. Harman Kardon has a special set of control codes for connecting to the receiver on a serial port. I haven't seen this on many other brands, but where I have, the control commands have been totally different.

Unfortunately I don't have an Onkyo receiver to compare and tell you for sure.

~K
kingtd
Plugin Developer
 
Posts: 78
Joined: Fri Jul 13, 2007 7:39 am

Re: Harman Kardon Serial Control

Postby DraZtiK » Mon Jun 16, 2008 2:10 am

killervette wrote:Would this work on a onkyo receiver? what type of modifications would be needed?


Like King said, most likely it wont work but just find your codes and modify one of the rs232 plugins to suite your needs.
DraZtiK
 
Posts: 11
Joined: Sat May 03, 2008 11:15 pm

Re: Harman Kardon Serial Control

Postby HVR4000er » Sun Apr 12, 2009 10:09 am

Hi! Sorry for my English.

I have a Harman Kardon AVR147. It have a RS232. I don't know how I install kingtd's plugin for harman kardon. I have Kingtd's __init__.py copied to C:\Programme\EventGhost\plugins\HarmanKardon. (I made HarmanKardon folder)
In the next step I start EventGhost. I can choose HarmanKardon plugin, but EventGhost tell me a lot of errors. I made a screenshot and attach it. My EventGhost Version is 0.3.6.1484. My Windows Version is XP Professional SP2. I have tested with admin rights.

Why HarmanKardon Plugin don't work? Please help me.
Attachments
eventghost_fehler.jpg
look for this error. What's the reason?
HVR4000er
 
Posts: 7
Joined: Sun Apr 12, 2009 8:36 am

Re: Harman Kardon Serial Control

Postby HVR4000er » Sun Apr 12, 2009 10:25 am

What I want: I want send 4 commands to AVR147: Power ON, Power OFF, Volume up, Volume down.

I would be very happy when my EventGhost would able to this job.
HVR4000er
 
Posts: 7
Joined: Sun Apr 12, 2009 8:36 am

Re: Harman Kardon Serial Control

Postby Bartman » Sun Apr 12, 2009 10:34 am

Looks like something has changed in EG's internal structure.
I don't know how the plugin works but maybe you can try the serial plug in and send the raw commands.
Bartman
Plugin Developer
 
Posts: 881
Joined: Sun Feb 12, 2006 9:03 am

Re: Harman Kardon Serial Control

Postby HVR4000er » Sun Apr 12, 2009 10:44 am

thx for answer.
maybe you can try the serial plug in and send the raw commands.

How I sent raw commands? What are raw commands? Are raw commands listed in Kingtd's __init__.py?
HVR4000er
 
Posts: 7
Joined: Sun Apr 12, 2009 8:36 am

Next

Return to Plugin Support

Who is online

Users browsing this forum: enobhsiw and 3 guests

cron