It is currently Fri Sep 10, 2010 2:32 pm

All times are UTC + 1 hour




Post new topic Reply to topic  [ 18 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: Yamaha RX-V1000 Serial
PostPosted: Sun Sep 24, 2006 10:47 pm 
Plugin Developer

Joined: Thu Sep 21, 2006 2:57 pm
Posts: 17
I've taken a shot at writing my first plug-in for EG - a serial plug-in that allows control of Yamaha RX-Vx000 series receivers. This one is tailored for the RX-V1000, but it could be easily modified to support the V1500 and V3000 receivers.

It's been 15 years since I wrote any code, and never before in Python, so I am sure there are some things that could be improved. Never-the-less, the plug-in does what it is supposed to do... It controls most of the receiver functions (that can be controlled by RS232), and generates events for most of the reports that the RX-V100 produces.

I must give credit to Oliver Wagner, upon who'se Denon Serial plug-in code this plug-in is based.

Yamaha Serial Plug-in


Top
 Profile  
 
 Post subject:
PostPosted: Sun Sep 24, 2006 11:26 pm 
Site Admin
User avatar

Joined: Mon Feb 06, 2006 11:28 pm
Posts: 2236
Nice!

Hint: You can convert a hex-string to an integer simply with the built-in "int()" function in Python:
Quote:
int( [x[, radix]])

Convert a string or number to a plain integer. If the argument is a string, it must contain a possibly signed decimal number representable as a Python integer, possibly embedded in whitespace. The radix parameter gives the base for the conversion and may be any integer in the range [2, 36], or zero. If radix is zero, the proper radix is guessed based on the contents of string; the interpretation is the same as for integer literals. If radix is specified and x is not a string, TypeError is raised. Otherwise, the argument may be a plain or long integer or a floating point number. Conversion of floating point numbers to integers truncates (towards zero). If the argument is outside the integer range a long object will be returned instead. If no arguments are given, returns 0.


So, "newdbValue = int(volstring, 16) * step - 99.5" should do the trick.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Sep 25, 2006 2:38 am 
Plugin Developer

Joined: Thu Sep 21, 2006 2:57 pm
Posts: 17
Thanks. I looked and looked and looked... and finally had to settle for the kluge you saw.

I also had some trouble with variable scope, but this object oriented stuff is pretty new to me. I wanted to define global constants for STX, ETX DC1, DC2 and DC3. Apparently they're already part of the curses libraries, but I couldn't figure out how to use them. Since I really only wanted them for code readability, I settled for the "\x02" version of STX (I guess I could have used chr(02) as well).

I am working on decoding the "power on" event string, so I'll fix the hex--> int conversion at the same time.

Mark


Top
 Profile  
 
 Post subject:
PostPosted: Mon Sep 25, 2006 3:01 am 
Site Admin
User avatar

Joined: Mon Feb 06, 2006 11:28 pm
Posts: 2236
The curses library is not implemented on Windows, so sadly you can't use it here.

Global scope is easy: just define them at the main level, as you did for "cmdList".

STX = "\x02"

Then you can use this constants everywhere in your module, as long as this name is not defined again at the local name space, like:
self.plugin.serial.write(cmd + STX)
if STX in cmd:
and so on

http://docs.python.org/tut/node11.html# ... 0000000000


Top
 Profile  
 
 Post subject:
PostPosted: Mon Sep 25, 2006 4:22 am 
Plugin Developer

Joined: Thu Sep 21, 2006 2:57 pm
Posts: 17
Clearly I have a lot more to learn, if I am going to use Python effectively!

Object oriented programming has changed a lot since the days of Borland Turbo C++ ;-)

Mark


Top
 Profile  
 
 Post subject:
PostPosted: Tue Feb 27, 2007 9:10 am 

Joined: Tue Feb 27, 2007 8:53 am
Posts: 3
Location: Huntingdon, Cambs, UK
Hi There,

Anyone Have this pluginm the download doesn't seem to work for me !

Ta,
Lee


Top
 Profile  
 
 Post subject:
PostPosted: Tue Feb 27, 2007 9:19 am 
Plugin Developer

Joined: Fri Feb 10, 2006 1:04 pm
Posts: 137
Right click, save as...works here.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Feb 27, 2007 9:41 am 

Joined: Tue Feb 27, 2007 8:53 am
Posts: 3
Location: Huntingdon, Cambs, UK
Hi There,

I can't get to the hollowhills site....It looks like a dynamic dns error !

Ta,
Lee


Top
 Profile  
 
 Post subject:
PostPosted: Tue Feb 27, 2007 12:32 pm 

Joined: Tue Feb 27, 2007 8:53 am
Posts: 3
Location: Huntingdon, Cambs, UK
Hi There,

Just tried from work....Someone couldn't download and briefly put it somewhere or email me it or something ???

lee at darkwave dot org dot uk should do it !

Ta,
Lee


Top
 Profile  
 
 Post subject:
PostPosted: Tue Feb 27, 2007 2:05 pm 
Plugin Developer

Joined: Thu Sep 21, 2006 2:57 pm
Posts: 17
Sorry 'bout that. I shut down and rebuilt the server machine. Unfortunately I don't plan to restart the web or FTP server.

Any suggestions how I can get the files to you?

Mark


Top
 Profile  
 
 Post subject:
PostPosted: Tue Feb 27, 2007 2:07 pm 
Plugin Developer

Joined: Thu Sep 21, 2006 2:57 pm
Posts: 17
Um... Duh... Sorry again. Just read your message again. More carefully.

I will send the files on this evening (we're EST here, GMT-5h, so I guess that would be at about 0200 Zulu).


Top
 Profile  
 
 Post subject: Help with RS-232 codes Yamaha and Panasonic
PostPosted: Tue Apr 17, 2007 4:28 am 

Joined: Tue Apr 17, 2007 3:58 am
Posts: 18
I have a Firefly and am currently using its software with Meedio and BeyondTV. I want to switch to EventGhost because I think it will solve the one biggest problem that I now have with my setup. I can’t control my RS-232 gear with Beyond TV.

I am having some problems with EventGhost with my serial control. I have a Yamaha RXV-2400 and a Panasonic commercial plasma. I have not been able to control either device regardless of the commands I send. I do have both working within Meedio; here are the codes I use in Meedio for reference.

Yamaha Power On &H02 30 37 41 31 44 03
Yamaha Volume UP &H02 30 37 41 31 41 03

Panasonic Power On &H02 50 4F 4E 03
Panasonic Power Off &H02 50 4F 46 03

If I put this information in EventGhost, I get no response from my equipment. I did try the Yamaha plugin, which does work, but I would like to add additional commands that aren’t there. I opened the plugin files from the installation directory to try and figure out what needs to be entered in the serial plugin, but no variation of characters from that screen worked either. I need to understand how EventGhost wants its data. In the Panasonic manual it shows the commands as follows:

Power On STX PON ETX
Power Off STX POF ETX

If you look at my Meedio commands, it makes sense. What do I put in EventGhost to control these devices?

Once I get my devices controlled, the next issue will be toggling. If I want to push Power on my remote to turn both devices On, then push the same button, to turn both devices Off. Is there a toggle plugin, or setting?

Thanks in advance for any help.

Brian


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 17, 2007 11:59 am 
Site Admin
User avatar

Joined: Mon Feb 06, 2006 11:28 pm
Posts: 2236
To use hexcodes you have to use Python string escapes.
&H02 30 37 41 31 44 03
must be written:
\x02\x30\x37\x41\x31\x44\x03

STX and ETX are names of control codes. You have to look them up in an ascii chart. http://www.asciitable.com/

For toggling look in the Example.xml (Other Examples folder).

_________________
Please post software-related questions in the forum - PMs will only be answered, if really private, thanks!


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 17, 2007 11:03 pm 

Joined: Tue Apr 17, 2007 3:58 am
Posts: 18
Thanks for the help!! I got both of my devices controlled and got the toggle working.


Top
 Profile  
 
 Post subject: Re: Yamaha RX-V1000 Serial
PostPosted: Fri Jan 11, 2008 9:39 pm 
Plugin Developer

Joined: Sun Feb 12, 2006 10:03 am
Posts: 880
Does the plugin work with a Yamaha YSP-4000?
The protocoll is documented and can be downloaded at http://www.yamaha-service.de/downloadyo ... dprod=1417
Probably I only need to switch between DSP programs.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 18 posts ]  Go to page 1, 2  Next

All times are UTC + 1 hour


Who is online

Users browsing this forum: jonib and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group