Yamaha RX-V1000 Serial

Questions and comments specific to a particular plugin should go here.
Quantus
Plugin Developer
Posts: 17
Joined: Thu Sep 21, 2006 1:57 pm

Yamaha RX-V1000 Serial

Post by Quantus » Sun Sep 24, 2006 9:47 pm

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

User avatar
Bitmonster
Site Admin
Posts: 2239
Joined: Mon Feb 06, 2006 10:28 pm

Post by Bitmonster » Sun Sep 24, 2006 10:26 pm

Nice!

Hint: You can convert a hex-string to an integer simply with the built-in "int()" function in Python:
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.

Quantus
Plugin Developer
Posts: 17
Joined: Thu Sep 21, 2006 1:57 pm

Post by Quantus » Mon Sep 25, 2006 1:38 am

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

User avatar
Bitmonster
Site Admin
Posts: 2239
Joined: Mon Feb 06, 2006 10:28 pm

Post by Bitmonster » Mon Sep 25, 2006 2:01 am

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

Quantus
Plugin Developer
Posts: 17
Joined: Thu Sep 21, 2006 1:57 pm

Post by Quantus » Mon Sep 25, 2006 3:22 am

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

Alaric
Posts: 3
Joined: Tue Feb 27, 2007 7:53 am
Location: Huntingdon, Cambs, UK

Post by Alaric » Tue Feb 27, 2007 8:10 am

Hi There,

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

Ta,
Lee

MonsterMagnet
Plugin Developer
Posts: 137
Joined: Fri Feb 10, 2006 12:04 pm

Post by MonsterMagnet » Tue Feb 27, 2007 8:19 am

Right click, save as...works here.

Alaric
Posts: 3
Joined: Tue Feb 27, 2007 7:53 am
Location: Huntingdon, Cambs, UK

Post by Alaric » Tue Feb 27, 2007 8:41 am

Hi There,

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

Ta,
Lee

Alaric
Posts: 3
Joined: Tue Feb 27, 2007 7:53 am
Location: Huntingdon, Cambs, UK

Post by Alaric » Tue Feb 27, 2007 11:32 am

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

Quantus
Plugin Developer
Posts: 17
Joined: Thu Sep 21, 2006 1:57 pm

Post by Quantus » Tue Feb 27, 2007 1:05 pm

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

Quantus
Plugin Developer
Posts: 17
Joined: Thu Sep 21, 2006 1:57 pm

Post by Quantus » Tue Feb 27, 2007 1:07 pm

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).

aarb00
Posts: 18
Joined: Tue Apr 17, 2007 2:58 am

Help with RS-232 codes Yamaha and Panasonic

Post by aarb00 » Tue Apr 17, 2007 3:28 am

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

User avatar
Bitmonster
Site Admin
Posts: 2239
Joined: Mon Feb 06, 2006 10:28 pm

Post by Bitmonster » Tue Apr 17, 2007 10:59 am

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!

aarb00
Posts: 18
Joined: Tue Apr 17, 2007 2:58 am

Post by aarb00 » Tue Apr 17, 2007 10:03 pm

Thanks for the help!! I got both of my devices controlled and got the toggle working.

Bartman
Plugin Developer
Posts: 881
Joined: Sun Feb 12, 2006 9:03 am

Re: Yamaha RX-V1000 Serial

Post by Bartman » Fri Jan 11, 2008 8:39 pm

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.

Post Reply