Hello,
I'm using the serial plugin to talk to my Yamaha RX-V2500 receiver. I am using the .gml file that Kraven has posted on these boards and I can send commands to the receiver. The receiver is spitting a long hex string back to me and I would like to decipher it but don't know where to begin to do this.
An example of the end result I'm looking for is, say I send the 'volume up' command to the receiver, I want the receiver to spit back the value of the volume to me so I can post it in my NetRemote app.
If someone could point me in the right direction, I'd appreciate it.
Go to the generic serial plug in and check the receive settings. With my denon receiver, some of the receive settings in the .ini file I got here weren't correct for my model. Sending commands worked fine, but all I received was long strings of hex charecters. I forget what I had to do- uncheck hex->bin or something like that, but it was a minor change and it solved everything. Have you checked out Mike's file for the Yamaha RXV1000 in the downloads section? Importing the .ini file for serial settings may solve your problem. HTH
FTD,
Sorry, I should have explained what I was getting back a little better. I originally had the bin-->hex checkbox selected and I was getting a response that looked something like this:
0230303300020302033300 and so on
now with the bin-->hex unchecked I'm getting:
|301400||002105||001201|| and so on.
Are you saying that one of these settings in the 'receive' edit window would give me readable text or it would give me back a format that would be pretty easy to translate to english? That would be sweet if it gave me english. The only type of translate option in this window is the bin-->hex checkbox.
Maybe there is a config setting I have set on the receiver to tell it to send in a particular format? dunno just guessing.
I'm not sure if it will be quite that simple, but I think if you compare the response recieved for a given command you'll find a pattern. Have you looked at the serial protocol for your receiver? You can find it here: http://www.yamaha.com/yec/customer/c..._RS232C_ST.pdf It looks like there are 4 fields that you'll be looking for. It also looks like 2 of those will be text, so if you're not seing any text it may be that some translation needs to be done. Can you post the response you receive to Power On, Power Off, Source->CD and Source->TV commands? (responses with bin-> hex both checked and unchecked) I'll help however I can but with the disclaimer that I'm very novice to this :wink: If we can find a "string a" for each "command b" you can write a script to catch and translate the feedback received.
This looks pretty foreign to me. I read up on Hex and Dec and Bin last night and these Hex values look more like html color values than anything else to me. I tried to find info on converting Hex to Characters but all l could find were references on Hex to Integers.
OK- I think I've figured out the code to look for, although I'm still trying to figure out it the rest of those long strings is relevant or not.
In the power on response 3230 is hex for 20 which according to the protocol is the value for the report item for "power" the next value is 3031 which is hex for 01 so 32303031 is saying "power on". In the power off string you'll find 32303030 which is "power off"
In the TV string you'll fine 32313037 which is hex for 2107 which is Source CBL\SAT (trying to trick me I was looking for 2106 source tv) In the CD string you'll find 32313031 whih amounts to source CD.
So- pretty clearly on the right track. I'm sure there multiple ways to process this. What comes to mind is either a script in the receive section of your serial settings to "preprocess" the feedback or a script triggered by a Girder event->on serial event which watches for certain values in pld1 and assigns an appropriate value to a variable.
I'm attaching a small .gml file which takes the second approach to watch for power on and power off commands. I assume you have the logger plugin? Import this into your existing .gml and watch the logger window for "Power On" and "Power Off" as you cycle the unit.
I'm not sure if all the other data returned is significant for our purposed, I'll look at that later tonight. Let me know if this helps.
After importing your script I ran the 'Power On' [32303031] and got this:
---------------------------------------------------------
02:42:16.375 EVENT: Dev: 202 3F000000
02:42:17.078 EVENT: Dev: 140 YamahaRX: 0233303030303103 Pld1: 0233303030303103 Pld2: Data Pld3: YamahaRX Pld4: COM1 Bin: 30 32 33 33 33 30 33 30 ...
02:42:17.093 LUA: call main
02:42:17.093 LUA: --> call C strfind global
02:42:17.093 LUA: --> return C strfind global
02:42:17.093 LUA: --> call C strfind global
02:42:17.093 LUA: --> return C strfind global
02:42:17.093 LUA: return main
02:42:18.828 EVENT: Dev: 140 YamahaRX: 0230303230303103125230313738463842404530313930303031313030303530 39453737313031333134303330303130313030303030303031 30323030303130303238323832383238323832383238323832 38323830303030303031343134303030303030303430353530 31303030303031313132303130303030303030303030303030 30303030303030303030313035303737303030303230313030 3103 Pld1: 0230303230303103125230313738463842404530313930303031313030303530 39453737313031333134303330303130313030303030303031 303230303031303032383238323832383238323832383238323832383030 30303030313431343030303030303034303535303130303030 30313131323031303030303030303030303030303030303030 30303030303130353037373030303032303130303103 Pld2: Data Pld3: YamahaRX Pld4: COM1 Bin: 30 32 33 30 33 30 33 32 ...
02:42:18.843 LUA: call main
02:42:18.843 LUA: --> call C strfind global
02:42:18.843 LUA: --> return C strfind global
02:42:18.843 PRINT: Power On
02:42:18.843 LUA: --> call C strfind global
02:42:18.843 LUA: --> return C strfind global
02:42:18.843 PRINT: Power Off
02:42:18.843 LUA: return main
02:42:19.984 EVENT: Dev: 140 YamahaRX: 02333033363031030233303343303103 Pld1: 02333033363031030233303343303103 Pld2: Data Pld3: YamahaRX Pld4: COM1 Bin: 30 32 33 33 33 30 33 33 ...
02:42:19.984 LUA: call main
02:42:19.984 LUA: --> call C strfind global
02:42:19.984 LUA: --> return C strfind global
02:42:19.984 LUA: --> call C strfind global
02:42:19.984 LUA: --> return C strfind global
02:42:19.984 LUA: return main
---------------------------------------------------------
for some reason, I'm getting back 3 responses from the receiver and one of those responses has the "Power Off" Variable.
When I run the "Power Off" [32303030] command, I get this:
---------------------------------------------------------
02:45:13.750 EVENT: Dev: 202 3F000000
02:45:14.890 EVENT: Dev: 140 YamahaRX: 02303042303030030230303230303003125230313738463039404530313930303030423003 Pld1: 02303042303030030230303230303003125230313738463039404530313930303030423003 Pld2: Data Pld3: YamahaRX Pld4: COM1 Bin: 30 32 33 30 33 30 34 32 ...
02:45:14.890 LUA: call main
02:45:14.890 LUA: --> call C strfind global
02:45:14.890 LUA: --> return C strfind global
02:45:14.890 LUA: --> call C strfind global
02:45:14.890 LUA: --> return C strfind global
02:45:14.890 PRINT: Power Off
02:45:14.890 LUA: return main
---------------------------------------------------------
"Power Off" seems to be running OK.
After analysing these strings, I looked a PLD1 on each actions and took string positions 7-14 and put them into your script and came up with this:
---------------------------------------------------------
Power On [30303031]:
02:49:46.187 EVENT: Dev: 202 3F000000
02:49:46.906 EVENT: Dev: 140 YamahaRX: 0233303030303103 Pld1: 0233303030303103 Pld2: Data Pld3: YamahaRX Pld4: COM1 Bin: 30 32 33 33 33 30 33 30 ...
02:49:46.906 LUA: call main
02:49:46.906 LUA: --> call C strfind global
02:49:46.906 LUA: --> return C strfind global
02:49:46.906 PRINT: Power On
02:49:46.906 LUA: --> call C strfind global
02:49:46.906 LUA: --> return C strfind global
02:49:46.906 LUA: return main
02:49:48.656 EVENT: Dev: 140 YamahaRX: 0230303230303103125230313738463842404530313930303031313030303530 39453737313031333134303330303130313030303030303031 30323030303130303238323832383238323832383238323832 38323830303030303031343134303030303030303430353530 31303030303031313132303130303030303030303030303030 30303030303030303030313035303737303030303230313030 3103 Pld1: 0230303230303103125230313738463842404530313930303031313030303530 39453737313031333134303330303130313030303030303031 30323030303130303238323832383238323832383238323832 38323830303030303031343134303030303030303430353530 31303030303031313132303130303030303030303030303030 30303030303030303030313035303737303030303230313030 3103 Pld2: Data Pld3: YamahaRX Pld4: COM1 Bin: 30 32 33 30 33 30 33 32 ...
02:49:48.656 LUA: call main
02:49:48.656 LUA: --> call C strfind global
02:49:48.656 LUA: --> return C strfind global
02:49:48.656 PRINT: Power On
02:49:48.656 LUA: --> call C strfind global
02:49:48.656 LUA: --> return C strfind global
02:49:48.656 LUA: return main
02:49:49.812 EVENT: Dev: 140 YamahaRX: 02333033363031030233303343303103 Pld1: 02333033363031030233303343303103 Pld2: Data Pld3: YamahaRX Pld4: COM1 Bin: 30 32 33 33 33 30 33 33 ...
02:49:49.812 LUA: call main
02:49:49.812 LUA: --> call C strfind global
02:49:49.812 LUA: --> return C strfind global
02:49:49.812 LUA: --> call C strfind global
02:49:49.812 LUA: --> return C strfind global
02:49:49.812 LUA: return main
---------------------------------------------------------
"Power Off [42303030]"
---------------------------------------------------------
02:50:58.140 EVENT: Dev: 202 3F000000
02:50:59.281 EVENT: Dev: 140 YamahaRX: 02303042303030030230303230303003125230313738463039 404530313930303030423003 Pld1: 0230304230303003023030323030300312523031373846303940453031393030 3030423003 Pld2: Data Pld3: YamahaRX Pld4: COM1 Bin: 30 32 33 30 33 30 34 32 ...
02:50:59.281 LUA: call main
02:50:59.281 LUA: --> call C strfind global
02:50:59.281 LUA: --> return C strfind global
02:50:59.281 LUA: --> call C strfind global
02:50:59.281 LUA: --> return C strfind global
02:50:59.281 PRINT: Power Off
02:50:59.281 LUA: return main
---------------------------------------------------------
How are you figuring out what characters represent the 4 digit hex value? Can you point me to a website? Also, How do I know where to grab the Hex from? I know about the "02" starting and "03" ending the variable and they need to be trimmed out. I am just guessing where I should be looking for these values so where should I be looking?
Hmm..maybe you're misunderstanding me. Do you have a .gml file already built to control all of the functions on the receiver? I thought you were looking for a way to get feedback on events from the receiver, but maybe I misunderstood and you're trying to build a .gml to control it (we'll deal with feedback leter if that's the case)
Do me a favor and load the .gml I sent you by itself, then cycle the power on the unit using it's remote instead of G3- see if it returnas a "Power On" and\or "Power Off" in the G3 logger.
Where I'm getting the strings to look for is go to p 14 of the serial protocol. See RCMD0 RCMD1 RDAT0 and RDAT1? Those are the data we're looking for. So, look at the first line in the table for Playback- 6ch input. The "command group" is Playback, the "parameter" is 6ch input. The values for these are 10 and 00 respectively. So- RCMD0=1 RCMD1=0 RDAT0=0 RDAT1=1 (thus communicating 10 00 to the unit) Well, convert these to hex using this nifty utility: http://www.maths.hscripts.com/asciiHex.php and you get 31303030. This is the string to look for in pld1- when you execute a command changing the unit to 6ch input, it will respond with a string on it's serial link which (among other things) contains 31303030 as verification of the command which was executed. You can find the string to look for for all of the commands using this method.
But:
What are you using for the serial settings for your receiver in the Generic Serial Plugin? I have a feeling your settings are wrong in this section, and this would be a lot simpler if they were corrected. If you haven't, try downloading Mike C.'s plugin for yamaha receivers. Go to the generic serial plugin, export your current settings for the yamaha, the remove the yamaha completely from the plugin (note the com port its on). Close completely out of G3, re-launch it, go back to generic serial plugin, import the .ini file from Mike's plugin, and set it to the com port your receiver is on. Then go to G3 and see what kind of responses you're getting. If it's screwed up, you can remove the current settings and re-import your old settings. I have a feeling you'll get much clearer feed back (and hopefully more concise) from the unit- I don't see why a manufacturer would vary it's serial protocol significantly within the same line of receivers, and Mike C seems to be a real guru with this serial stuff.