I assume this is a JVC unit. I have one of theirs but I drive it from a PC (Which is controlled by the iPad) but the principles should be the same. It is quite easy to do using Javascript, just a little tedious and a little logic required.
I am not exactly sure what you mean by a "three way handshake". It is only 2-way (controller- the ipad, and the projector). there may be three or more steps if that is what you mean.
In general you send the command and wait for the response at which time you send the next command etc. It does not matter if the command is an ack the sending is done the same way. Forget about the timing on the iPad side, just send what you have to as soon as you get the feedback so you know what to send, even if you have to send nothing back (e.g. the sequence is done).
Whenever you send something start s setTimeout function to come back in 5 seconds and start a routine (function) to handle the timeout. The probable cause is the PJ did not see what you sent, so send it again , keeping s counter of lets say 3 so you don't keep resending the command which may be bad. If you get the response, no matter what it is, then cancel the setTimeout befor you process the response (feedback).
Hope that helps
--
You received this message because you are subscribed to the Google Groups
"CommandFusion Software" group.
To view this discussion on the web visit.
Macro is one way, or you can do feedback parsing via regex then use
onmatch item to send a command when the incoming command matches.
Jarrod
> --
> You received this message because you are subscribed to the Google
> Groups "CommandFusion Software" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/commandfusion/-/S1PJpBe7gkwJ.
Depends on the protocol for the device. Maybe it needs a carriage
return? \x0D on the end.
Macro is one way, or you can do feedback parsing via regex then use
onmatch item to send a command when the incoming command matches.
Jarrod
On 24/04/12 5:27 PM, Rocky_C wrote:
> If I want to send a plain "PJREQ" to the projector, how do i enter it
> in the command value? For now i just entered "PJREQ"
> Furthermore, as i said, i create a macro? Is there a better way that
> you think might do the trick?
> Kind regards
> --
> You received this message because you are subscribed to the Google
> Groups "CommandFusion Software" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/commandfusion/-/S1PJpBe7gkwJ.
> To post to this group, send email to comman...@googlegroups.com.
> To unsubscribe from this group, send email to
To view this discussion on the web visit https://groups.google.com/d/msg/commandfusion/-/um4PIjjQE4cJ.
To post to this group, send email to comman...@googlegroups.com.
To unsubscribe from this group, send email to commandfusio...@googlegroups.com.
All commands from the RS45 end with a line feed ("\x0A)
> commandfusio...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/commandfusion?hl=en.
--
You received this message because you are subscribed to the Google Groups
"CommandFusion Software" group.
To view this discussion on the web visit https://groups.google.com/d/msg/commandfusion/-/um4PIjjQE4cJ.
To post to this group, send email to comman...@googlegroups.com.
To unsubscribe from this group, send email to commandfusio...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/commandfusion?hl=en.
--
You received this message because you are subscribed to the Google Groups
"CommandFusion Software" group.
The protocol used by the JVC projectors is documented on their web site. It can be found at:
http://support.jvc.com/consumer/support/documents/DILAremoteControlGuide.pdf
It is one of the most complete protocol documents I have ever seen with the exception of not detailing the RS232 protocol they use. They do provide the methodology to develop Pronto hex strings from which the actual IR protocol can be deduced.
For those familiar with irp file format and notation the following are the key protocol parameters:
[Protocol]
Protocol=JVC
Modulation=PWM
Bit Order =LSB
Frequency=40000
Time Base=500
One=1,-3
Zero=1,-1
Form=[17 -8],d:8,f:8,[1 -45],d:8,f:8,[1 -100]
Repeat=1
This protocol uses a lead-in, then sends 16 bits consisting of an 8 bit device number and an eight bit function key code, it then has a delay and once again repeats the device code and the key code, and then ends with a suffix holding the line to its off state for 50 milliseconds (100*500) to ensure that two commands do not overrun. It is a PWM type code (Pulse Width Modulation) with the information carried in the off time of the IR bursts.
IR is not magic, it just needs to be understood. The IRGEN on my WEB site will generate the correct JVC IR patterns and may be added to to send all of the IR commands they document.
With regard to LAN and RS232 use, a line feed is the terminating byte. I find it convenient to define v=constants in Javascript for the prefix's they use to make the construction of commands quite simple. For example the standard command prefix is "\x21\x89\x01" which might be set as a constant as var CMD="\x21\x89\x01". Similarly the Enquiry prefix can be set as var ENQ="\x3F\x89\x01". A power on command can be set as var PWRON="\x50\x57\x31"
A full power on command can then be written as CF.send(CMD+PWRON+"\x0A") to the appropriate control system. I prefer this methodology as it allows for easy understanding by a reader
OOPS, the detailed IR protocol I posted I used for the older PJ models the following is correct for the current crop of JVC projectors:
[Protocol]
Protocol=JVC
Modulation=PWM
Bit Order =LSB
Frequency=40000
Time Base=500
One=1,-3
Zero=1,-1
Form=[17 -8],d:8,f:8,[1 -100]
Repeat=1
This protocol uses a lead-in, then sends 16 bits consisting of an 8 bit device number and an eight bit function key code, and then ends with a suffix holding the line to its off state for 50 milliseconds (100*500) to ensure that two commands do not overrun. It is a PWM type code (Pulse Width Modulation) with the information carried in the off time of the IR bursts.
I don't like to do that without being able to test it. Unfortunately the JVC PJ I own does not accept LAN commands only RS232. It is an older model. I may be upgrading this year.
Reading the protocol document, The general outline of the process would be:
Send a command, and at the same time you do that, do a setTimeout to field any timeout errors. When the feedback for a command arrives and is verified, cancel the setTimout. When the feedback arrives and is verified you can then send the next command in the series. If the setTimeout specified function fires then you need to do any sort of recovery like re-sending the command, re-establishing the connection, notifying the user of the issue, etc.
In more detail for the PJREQ:
Request a connection, setting a 1 second timeout using setTimeout. If the timeout fires then the projector did not respond and take whatever recovery action is required. If there is a feedback (Projector response), check that it is "PJ_OK" and if so cancel the timeout and send "PJREQ" with a 5 second timeout using setTimeout. The feedback to that should be "PJACK" If that is the case clear the seTimeout and send the desired command. If I was doing the Feedback analysis in JS I would just set the regex to "(^*)" which accepts all incoming data.
To establish a connection you can use CF.setSystemProperties to enable the system control for the PJ. I would do that for each command sequence sent as this will allow multiple iPads to deal with the PJ at the same time. If there is only one iPad - no harm no foul. When the required command has been sent, you can then use CF.setSystemProperties to close the connection If you are only going to have one iPad then Maintaining a constant connection will work but after CF makes the connection, the PJ will shut it down after 5 seconds of no activity at which time CF will try and re-establish the connection. IMHO the PJ is normally not commanded often enough to have a constant connection.
If you know Javascript the above should be fairly clear. If you do not know Javascript I strongly suggest you spend the time to learn it.
Hope that helps
From:
comman...@googlegroups.com [mailto:comman...@googlegroups.com] On
Behalf Of Rocky_C
Sent: Tuesday, April 24, 2012 10:57 AM
To: comman...@googlegroups.com
Subject: Re: JVC RS45 hex command use
I've got it working now.
--
You received this message because you are subscribed to the Google Groups
"CommandFusion Software" group.
To view this discussion on the web visit.
--
You received this message because you are subscribed to the Google Groups "CommandFusion Software" group.
To view this discussion on the web visit https://groups.google.com/d/msg/commandfusion/-/Fb8fd7ZKq3YJ.
I'm sorry but this script doesn't worked.I try to translate this topic into a script but it is not working.
--
You received this message because you are subscribed to the Google Groups "CommandFusion Software" group.
To view this discussion on the web visit https://groups.google.com/d/msg/commandfusion/-/KGxGM-YKN3gJ.
--
You received this message because you are subscribed to the Google Groups "CommandFusion Software" group.
To view this discussion on the web visit https://groups.google.com/d/msg/commandfusion/-/RBb8S-_wZAgJ.
I am a little confused by what you are saying. What JVC model are you using? When you say RS45 what exactly do you mean Serial (RS232)? IP?
I have a JVC RS1 Projector (RS1) and have been driving it using RS232 for many years having written my own handler (driver) for a PC in Visual Basic. I do believe all of the JVC RS232 projector protocols are the same, with some PJ's having additional commands.
I do not understand why a system would have to keep sending if it were RS232. Even using IP, I am not aware of a reason that the JVC protocol requires a "Keep alive" Communication.
From: comman...@googlegroups.com
[mailto:comman...@googlegroups.com] On Behalf Of Rocky_C
Sent: Wednesday, July 18, 2012 2:17 AM
To: comman...@googlegroups.com
Subject: Re: JVC RS45 hex command use
I got it working but not with a script, I've used a System that sends the request and keeps on sending.
--
You received this message because you are subscribed to the Google Groups
"CommandFusion Software" group.
To view this discussion on the web visit https://groups.google.com/d/msg/commandfusion/-/VgTlDC2CmS0J.
I do not believe you "Failed". When a constant connection is NOT maintained then you are correct in that as soon as you send a command the connection is made and then a disconnect occurs. Unfortunately the disconnect happens so quickly that the device I was working with (IP based relay board) did not have time to send the reply. I suspect the same may be true with an IP connection to the JVC projectors (I have a JVC projector, the RS-1, which does not have IP control only RS232).
I suggest you use the maintain constant connection and enable/disable the connection (control stack) using CF.setSystemProperties. That was how I solved my problem.
Perhaps the following logic will work:
1 When your system starts you disable the control stack in a CF.userMain function.
2 When you want to turn on the projector, enable the control stack, and send the PJREQ. You should then get back the PJ_OK . Then send whatever additional commands you need pacing them using the projectors feedback reply.
3 When you are done using the projector, then turn it off, make sure it returns the Off state and not the cooling state and then disable the control stack. Actually I see no harm in leaving the control stack always enabled, and start by checking the Power State.
My suggestions in the above are based on what I do for my JVC RS-1 using RS232. Heartbeat mode was not needed for RS232 and I suspect it will not be needed for IP.
Having said the above; the Projector should have no issues with the connection kept active all the time. JVC was smart enough to always activate the RS232 (and I assume IP) receiver/driver circuitry as long as power was applied (plugged in). The power mode (On, Standby, cooling, warning.) did not matter. I would set the heartbeat mode off, and use feedback (assuming the PJ responds to each command with some string) .
If you want a copy of my relay board communications program (It is IP based) drop me a line or wait a while and I will post it on my web site (www.the-gordons.net).
eMail me at my domain using the mailbox name of barry.
From:
comman...@googlegroups.com [mailto:comman...@googlegroups.com] On
Behalf Of rocky crick
Sent: Sunday, November 25, 2012 5:40 AM
To: comman...@googlegroups.com
Subject: Re: JVC RS45 hex command use
Hello Again,
--
You received this message because you are subscribed to the Google Groups
"CommandFusion Software" group.
To view this discussion on the web visit https://groups.google.com/d/msg/commandfusion/-/Ju23risGAaIJ.
Simon,
Do you handle feedback from the PJ or just ignore it?
From:
comman...@googlegroups.com [mailto:comman...@googlegroups.com] On
Behalf Of iCNTRL
Sent: Sunday, November 25, 2012 4:50 PM
To: comman...@googlegroups.com
Subject: Re: JVC RS45 hex command use
HI Rocky,
--
You received this message because you are subscribed to the Google Groups
"CommandFusion Software" group.
To view this discussion on the web visit https://groups.google.com/d/msg/commandfusion/-/lO1YOUkrX1UJ.
To view this discussion on the web visit https://groups.google.com/d/msg/commandfusion/-/5tvrEnjnhKEJ.
You guys piqued my curiosity so I read the JVC manual re LAN operation.
1- JVC does close the LAN connection after 5 seconds of inactivity
2- To send a command you must re-establish the LAN connection, then send the command.
3- You must do (2) above for each command.
I suggest that the best way to deal with the JVC projector using iViewer following what I have read in their manual is as follows:
Design the GUI with the JVC control stack set for "Maintain constant connection", "No heartbeat", EOM as "\x0A". Setting the EOM this way will cause the iViewer to de-block received messages (feedback) on the \X0A byte being received. Set the feedback regex for the stack to be (^*).
During initialization of your project, in CF.userMain():
Disable the JVC control stack using CF.setSystemProperties;
Set the feedback processing for the JVC control stack to whatever you name your feedback processing function (e.g. JVCfeedback)
To send a command:
Enable the Control stack using CF.setSystemProperties. This will send an open request to the PJ. You should get a feedback of PJ_OK.
When the PJ_OK is received as feedback send the PJ_REQ command. You should get PJACK as feedback
When the PJACK is received send the desired command. You should get an appropriate acknowledgement back for that command
followed in a second feedback message if there is additional data to be returned by the projector.
I am willing to write a general purpose test/exerciser if someone sends me a JVC PJ for testing as mine does not have the LAN option.
Alternatively If someone wants to do the testing for me . . . Beware I do all my work in Javascript so an understanding of Javascript will be very helpful. What I will need the tester to do is try the code as I provide it, and send me back the output from the debugger (PC running Safari or similar browser)
From: comman...@googlegroups.com [mailto:comman...@googlegroups.com] On Behalf Of Clayton Vicente
Sent: Monday, November 26, 2012 4:05 AM
To: comman...@googlegroups.com
I think you are making the right choice with RS232, and I am thinking of adding to the test routine RS232 capability via an iTach. It will just take me a little longer as I do have all the code in various other projects.
Regarding the testing I will do the RS232 capability on my PRJ, but do appreciate the offer to test the LAN capability.
From: comman...@googlegroups.com [mailto:comman...@googlegroups.com] On Behalf Of Clayton Vicente
Sent: Monday, November 26, 2012 11:38 AM
To: comman...@googlegroups.com
I toyed with IP control of multiple directv receivers briefly before going back to controlling them via 232 for this reason.