Your Universal Remote Control Center
RemoteCentral.com
Philips Pronto Professional Forum - View Post
Previous section Next section Previous page Next page Up level
Up level
The following page was printed from RemoteCentral.com:

Login:
Pass:
 
 

Page 1 of 2
Topic:
ProntoScript library for Sony VPL Projectors
This thread has 18 replies. Displaying posts 1 through 15.
Post 1 made on Saturday December 1, 2012 at 17:17
randman
Long Time Member
Joined:
Posts:
June 2003
424
I just got a Sony VPL-HW50ES projector. I got the RS232-C protocol interface from Sony. I am looking into writing a ProntoScript library to communicate with this projector to get status information. Before doing so, I just wanted to check to see if anyone has already written a ProntoScript library for communicating to a Sony VPL series projector (I expect that all VPL Sony projectors are mostly similar, at least 90% of commands ought to be the same, judging from the Sony protocol interfaces for the VPL-HW50ES, VPL-HW30ES, and others). If so, please let me know or PM me. Thanks!
Post 2 made on Sunday December 2, 2012 at 15:23
Lyndel McGee
RC Moderator
Joined:
Posts:
August 2001
12,999
If I recall correctly, the protocol has a checksum in it.

A couple of years ago, I created a few 1-way 232 actions including the checksum for a fellow RC member but as most of the stuff was used for setup only, we chose to not write a module.
Lyndel McGee
Philips Pronto Addict/Beta Tester
OP | Post 3 made on Sunday December 2, 2012 at 20:34
randman
Long Time Member
Joined:
Posts:
June 2003
424
Yeah, the Sony command & responses are a bit trickier than other RS232 interfaces I've programmed (such as the ones for Marantz projectors and Oppo Blu-Ray players). Instead of easy to understand "English" mnemonics, the Sony protocol entails knowing the hex and calculating the checksums w/ ORs. I'm working on querying the Sony projector so I can at a minimum get its power state (which would simplify the Pronto interface, since knowing that it doesn't have to be turned on means not having to put long "please wait" dialog boxes).
Post 4 made on Sunday December 2, 2012 at 22:37
Lyndel McGee
RC Moderator
Joined:
Posts:
August 2001
12,999
If you go to Barry's site, under the TCP documentation, I think there is an article about COM programming. If I recall correctly, there is likely a checksum algorithm there already.
Lyndel McGee
Philips Pronto Addict/Beta Tester
OP | Post 5 made on Tuesday December 4, 2012 at 14:48
randman
Long Time Member
Joined:
Posts:
June 2003
424
In the other gear that I have which I've done RS232 programming with (Oppo, Anthem, Marantz, etc.), they all had ASCII strings in their protocol document, and it's those same documented strings used for sending commands and receiving replies. The Sony projector, however, uses hex data. Sample commands are:


To power on: A9 17 2E 00 00 00 3F 9A
To power off: A9 17 2F 00 00 00 3F 9A
To request the power status (off, on, etc.): A9 01 02 01 00 00 03 9A

With my non-Sony gear, I use the serial.match() function to send & receive serial commands, where the input string to serial.matchwas the actual ASCII string documented in the protocol interface specs (for example, "#PON\r" for powering on the Oppo player).

However, the Sony commands are in hex. How do I translate the Sony hex strings to what the serial.match function needs? I can't exactly type in some of the ASCII equivalents of the hex data...

I read Barry's serial doc a couple of years ago. I looked again, but I'm not sure... Is the input to this CKSUM function the hex representation (such as A9172E0000003F9A for power on) and the CKSUM's return is what would be passed to serial.match?

function CKSUM(a)
{var result=””;
for(var i=0; i result=result & 255; return result; }

Thanks.
Post 6 made on Tuesday December 4, 2012 at 18:47
Lyndel McGee
RC Moderator
Joined:
Posts:
August 2001
12,999
I think you have to do receive() and then assemble the buffer yourself. Post link to or email me the protocol doc and I will have a look.
Lyndel McGee
Philips Pronto Addict/Beta Tester
Post 7 made on Tuesday December 4, 2012 at 21:28
Lowpro
Select Member
Joined:
Posts:
March 2004
2,081
I worked up a full set of RS-232 codes for the Sony BDP-CX7000ES a while back. Determined the checksum for each hex string using an excel sheet I found offered just for this purpose, but for Sony receivers. I'll upload a copy to my FTP and provide a download link.
LP Related Links:
View my profile to access various
links to key posts and downloads.
Post 8 made on Tuesday December 4, 2012 at 21:53
Lowpro
Select Member
Joined:
Posts:
March 2004
2,081
On December 4, 2012 at 21:28, Lowpro said...
I worked up a full set of RS-232 codes for the Sony BDP-CX7000ES a while back. Determined the checksum for each hex string using an excel sheet I found offered just for this purpose, but for Sony receivers. I'll upload a copy to my FTP and provide a download link.

Here you go. Download link below. Enjoy!

Sony RS-232 Checksum Calculator

Important Notes:
The Add-In, "Analysis ToolPak" will need to be installed/enabled in Excel via "Tools->Add-Ins" for proper calc operation.

Last edited by Lowpro on December 5, 2012 00:13.
LP Related Links:
View my profile to access various
links to key posts and downloads.
OP | Post 9 made on Tuesday December 4, 2012 at 22:47
randman
Long Time Member
Joined:
Posts:
June 2003
424
I got the Sony protocol interface doc via email from Sony support. They don't actually have it available for download in their web site, so not sure how to Make it available here. Anyway, I figured out the hex codes (and checksums) from this document, along with an Excel spreadsheet that I got from another forum member a while back for another Sony projector with almost identical commands as mine).

So, I can figure out the hex codes. What I don't understand is:

1. how to pass the data to Pronto's serial.match API
2. How to enter the data in the Pronto database

I assume the answer to both questions are similar?

For example, the hex to power on the projector is:

A9 17 2E 00 00 00 3F 9A

What format does Pronto need this to be in when passing it to the Serial class' APIs or when entering it into the Pronto database?

Something like this maybe??? :

\xA9\x17\x2E\x00\x00\x00\x3F\x9A

Then, what would the Serial.match API or receive return? I know from the doc and spreadsheet what the hex return values should be but I guess I would have to convert it back to hex?

Thanks.
OP | Post 10 made on Tuesday December 4, 2012 at 23:19
randman
Long Time Member
Joined:
Posts:
June 2003
424
Ah, when entering the hex code in the Pronto database, I should just enter the hex itself (such as A9 17 2E 00 00 00 3F 9A) in the "Hex" box. So, that at least answers my question on how to enter the data in the database. However, I'm still wondering how I should pass the data (such as A9 17 2E 00 00 00 3F 9A) to the Serial class' APIs (such as Serial.match)... And when a Serial API returns data (such as the return value of Serial.match), what format would it be (Sony document gives the hex value of what is returned, but what does the Serial class actually return)?
Post 11 made on Tuesday December 4, 2012 at 23:44
Lowpro
Select Member
Joined:
Posts:
March 2004
2,081
On December 4, 2012 at 21:53, Lowpro said...
Here you go. Download link below. Enjoy!

Sony RS-232 Checksum Calculator

Important Notes:
The Add-In, "Analysis ToolPak" will need to be installed/enabled in Excel via "Tools->Add-Ins" for proper calc operation.

I just updated my excel sheet for anyone interested. First tab contains the original checksum calculator for Sony receivers. I added a second tab for the Sony BDP-CX7000ES Blu-ray changer where I expanded the checksum calculator to allow for a byte count up to 9 if needed as can be the case for DISC_DIRECT_SET commands where a title and chapter are specified.

Last edited by Lowpro on December 5, 2012 03:31.
LP Related Links:
View my profile to access various
links to key posts and downloads.
Post 12 made on Wednesday December 5, 2012 at 20:44
Lyndel McGee
RC Moderator
Joined:
Posts:
August 2001
12,999
I believe in a string, you enter '\x9A\x01\xA9' for example. Not sure if you use

9A 01 A9, \x9A \x01 \xA9, or 0x9A 0x01 0xA9 for the PEP2 database.

For how to build the command string...

For a good read and experience, I suggest again Barry's site.

[Link: the-gordons.net]

See Serial (232) Communication 101. Will help to explain process and items.

Then a few more links outlining problems with 232 communication on RFX and likelihood that your responses could become garbled due to implementation of 232 receive buffer on RFX9600.

These were located with a search for 'receive buffer clear'

[Link: remotecentral.com]

[Link: remotecentral.com]

And this last thread also has an example of handling a 'sliding buffer' where characters are added at the end and pulled off at the front. All intended to attempt to overcome the limitations of 232 on RFX9600.

[Link: remotecentral.com]

Last edited by Lyndel McGee on December 5, 2012 20:53.
Lyndel McGee
Philips Pronto Addict/Beta Tester
OP | Post 13 made on Wednesday December 5, 2012 at 22:21
randman
Long Time Member
Joined:
Posts:
June 2003
424
Thanks, Lyndel. The PEP2 database takes the format A9 17 2E 00 00 00 3F 9A.
For passing into the Serial.match API, I tried escaping with \x but had no luck. I'll re-read Barry's document again (when I read it a long time ago, I was dealing with much simpler ASCII-based protocol interfaces (e.g. Anthem, Oppo).
Post 14 made on Thursday December 6, 2012 at 21:47
Lyndel McGee
RC Moderator
Joined:
Posts:
August 2001
12,999
Can you post the code you have here and we can see what we can do to clean it up?
Lyndel McGee
Philips Pronto Addict/Beta Tester
OP | Post 15 made on Saturday December 15, 2012 at 00:39
randman
Long Time Member
Joined:
Posts:
June 2003
424
Okay, I finally got around to working on this again. I've confirmed what the Sony projector expects to receive and how it responds. For example, the following sends the Power On command (not that I need to send it from a ProntoScript library since I can use the ProntoScript database for this):

var str1;
queryCode = "\xA9\x17\x2E\x00\x00\x00\x3F\x9A";
str1 = sProj.match(queryCode, "\x9A", 3250);

I confirmed the contents of str1 by printing its value in hex (courtesy of showHex function that I got from Barry Gordon's web site a while back).

To query the power status of the projector, I use:

"\xA9\x01\x02\x01\x00\x00\x03\x9A"

When I send above string to the projector while it is powered on, it returns:

A9 01 02 02 00 03 03 9A

Above hex corresponds to "on".

What confused me and what I got stuck on for a while is that the projector
does not respond to the power status query while it is in standby mode (I wanted to do my initial debugging while the projector was on standby mode so as to save lamp life :-).

The Sony RS232 protocol interface manual says that "standby" is one of the possible states of the projector, so I only assumed that the projector can be queried while it is in standby mode. But if it's in standby mode, I either get no response (serial.match times out eventually), or, if I send the query right after the previous query, the Sony responds with a NAK error reply.

My previous Marantz projector responds to power status queries while it is in standby, so I assumed the Sony would to. I'll need to play around with this more. Sony has a couple of standby modes, so I'll do more testing....

So, at least I've confirmed how I can send queries to the Sony, though I'll need to think more about a more elegant way to send/receive commands to the Sony (for example, calculate the checksum programmatically (right now, I am using an Excel spreadsheet that someone used for another Sony model), what JavaScript internal variable types to use for holding the values in memory (I'm more familiar with C++ so need to see best way to do this in JavaScript) or just use strings with "\x" (although that won't work if I do the checksums first), etc.... I'll need to try to look at samples of folks' Sony ProntoScript libraries. Boy, RS232 programming for components that use plain-'ol English ASCII text (e.g. Oppo) is a heck of a lot simpler!


EDIT: I couldn't find in Sony's web site the RS232 protocol manual for the Sony VPL-HW50ES projector. I got mine via email from Sony support. I uploaded a PDF of this document in the Device Command Files section of remotecentral, but I suppose it will probably take a couple of days to be processed. However, the RS232 commands are generally the same across the various Sony VPL projectors (the main differences are if new projectors support different features). But for the purposes of this thread, the RS232 manual for this Sony is close enough:

[Link: files.remotecentral.com]



Thanks.

Last edited by randman on December 15, 2012 08:13.
Page 1 of 2


Jump to


Protected Feature Before you can reply to a message...
You must first register for a Remote Central user account - it's fast and free! Or, if you already have an account, please login now.

Please read the following: Unsolicited commercial advertisements are absolutely not permitted on this forum. Other private buy & sell messages should be posted to our Marketplace. For information on how to advertise your service or product click here. Remote Central reserves the right to remove or modify any post that is deemed inappropriate.

Hosting Services by ipHouse