bitfocus / companion-module-generic-pjlink

Companion Module
MIT License
6 stars 8 forks source link

Latest update power state commands #32

Closed obcocav closed 2 years ago

obcocav commented 2 years ago

In the latest updates I have started having issues with Epson L1500U and L610U units not responding to power commands or doing so inconsistently. I’m not sure how to give more detail because the problem is very inconsistent as to what causes it but it is prevalent. Sometimes pressing and holding a button to send the power command for a long while seems to work. Other times not. This is for power on and power off. No issues until the rewrite where power state became one commands with different arguments vs a separate power on and power off command. Any ideas? Have downgraded to beta 4127 for now.

Thanks!

JonathanPowe commented 2 years ago

We have found a similar issue with our system too - When the mains power to the projector is switched on after Companion is loaded, the pjlink module appears to not be communicating with the projector. The command to turn on the projector is not acted upon by the projector, nor is the feedback about projector power state working (if the projector is turned on with its remote).

The Companion log shows an error of "Unavailable Time" for the pjlink module. This error message appears in the log multiple times if left un-touched for a while. Disabling then enabling the pjlink module doesn't fix the issue. Clicking Edit on the module, then clicking Save (without changing anything) resolved the issue.

Beta 4187 works ok; Beta 4191 and newer has the issue. On the newer version, when the projector had no mains power the pjlink module continues to report Status 'OK'; on the older version it correctly reports 'Error'.

The projector we have is an Epson EB-G7905U

(edited to add some more information and reword for clarity)

jmcc94 commented 2 years ago

@JonathanPowe & @obcocav - there was an update to the pjlink module that was in companion 2.2.0-4450-beta..

Are your problems still showing when using that beta?

JonathanPowe commented 2 years ago

Our upgrade path was: 3505 (worked ok) -> 4450 (issue encountered) -> 4443 (issue still present) -> 4191 (issue still present) -> 4187 (worked ok).

On the newer versions I tried adding the Actions again and removing the original one, but that didn't fix it. (The last downgrade to 4187 necessitated re-adding the Actions again due to the change in action type between those versions.)

JonathanPowe commented 2 years ago

Tested the latest beta 4480: unfortunately the same issue with 'power-on' not working, however feedback might actually work even when the power-on command doesn't function: I added a feedback of 'power status: standby' which correctly highlighted the button. Pressing the PJlink button to turn on the projector did nothing. Turning on the projector using the remote, or using the new Epson BusinessPJ module, resulted in the PJlink feedback colour changing correctly to 'warm up', then 'on'.

Pressing the PJlink button to turn the projector off worked successfully.

The Companion log showed the same "Unavailable Time" error on the PJlink module as before. Is this referring to the projector's internal clock time setting? as that is probably set to the wrong time in comparison to the computer running Companion.

The PJlink module now correctly reports a communication error when the projector mains power is off. However when the mains power is then turned on to the projector, the PJlink module remains stuck in this error state. I waited about a minute and it still didn't show as Connected.

A temporary workaround I've found is to add 'internal instance disable pjlink' as part of the shut down sequence button Actions, between PJlink sending 'power off' and the power switcher Action to turn off the mains power; and add 'internal instance enable pjlink' as part of the start-up sequence button Actions, a few seconds after the power switcher Action to turn on the mains power. This workaround unfortunately does not resolve the original issue of 'power on' not working.

If you would like me to test anything else I am happy to do so.

mwb9aa commented 2 years ago

I'm having the same issue with an Epson L360U projector. The pjlink module seemed to work before I upgraded to Companion 2.1.

istnv commented 2 years ago

Unavailable time (ERR3) is returned by the projector when some commands are sent too close together. If the projector just turned on and hasn't completed warm-up, it may not want to switch inputs yet and will return this error. I have some time to look through this, but do not have access to a projector :(

JonathanPowe commented 2 years ago

Thank you @istnv

I've made a Wireshark capture (attached linked below) of the PJLink traffic (port 4352) between the computer running Companion and our Epson EB-G7905U projector. Also included is the Companion log running at the same time.

I started Wireshark, then enabled the PJlink module in Companion, let it sit there for a couple of minutes, I then disabled the PJlink module in Companion, then stopped the Wireshark log.

Several "Unavailable time" errors appeared in the Companion log No Companion buttons were pressed, nor were any Companion pages opened whilst the Wireshark log was running. A few buttons have Feedbacks from PJlink programmed, (not sure if those update themselves if the page they are on isn't loaded anywhere?)

Edit to add: the projector was in 'Standby' state throughout the test

PJlink-enable-disable-logs.zip

If you would like me to do any more testing I am happy to help.

istnv commented 2 years ago

feedbacks are meant to auto-update so you have a current (within a few seconds) status. If you set button color for power state, the button should change color even if you power on/off from the projector or the IR remote. The module now polls the projector for variables and feedbacks so periodic traffic is normal.

jmcc94 commented 2 years ago

I suspect theUnavailable Timeerror is due to some of the polling while the projector is off - such as Input Resolution etc... I've got some code in progress to add more info to the ERR3 error to see what commands are causing it when.

I think the original code buffers the commands until a response back from the projector, but I suspect that it needs adjustment to work with the polling functions I added.

Unfortunately I'm traveling for work, so don't have access to a projector to carry on testing. I had tested it against the PJLINK test app successfully, but I suspect that it doesn't interact like a true projector.

jmcc94 commented 2 years ago

I have some time to look through this, but do not have access to a projector :(

@istnv - any and all help appreciated

istnv commented 2 years ago

I have some time to look through this, but do not have access to a projector :(

@istnv - any and all help appreciated

I'm looking through it now with the simulator. It can be set to throw random errors to check all of the error handling/checking routines. Some are improper: It just sent an 'ERR2 Out of parameter' response to a 'LAMP ?' query.

Allowing commands cue cue up until a 'sent' command is acknowledged (with or without error) before sending the next command should reduce the ERR3 results.

jmcc94 commented 2 years ago

Yeah - I think the simulator just sends out random errors - not applicable to the actual command was sent...

jmcc94 commented 2 years ago

There's something around lines 390 to 442 that puts commands into a buffer, and then shifts them off. I was thinking of putting a check somewhere in there to wait for a response from the projector before releasing the next command..

istnv commented 2 years ago

It cues the commands, but does not wait for a response. Protocol says it could take 10 seconds or more for a response. Blasting a bunch of commands is sure to throw an error. I have similar code in other modules that checks responses to commands. I'm looking to bring some of that logic in.

istnv commented 2 years ago

Also, projector 'details' only needs retrieved when the module starts. The manufacturer, serial number, etc. should be stable. Then only poll for the info that can change (input, lamp hours, on/off). That will also reduce traffic.

jmcc94 commented 2 years ago

Ah... I thought I was only collecting the initial details once, but maybe theself.socket.on('connect'... is called every time is connects to the projector with a new password...

istnv commented 2 years ago

theself.socket.on('connect'... is called every time is connects to the projector with a new password...

Correct. Every time the challenge token changes or the session times out.

Re-reading the protocol docs, the timeout period is 30 seconds. I questioned that when I was working on this and remember reading 4 seconds, but I can't find it again.

obcocav commented 2 years ago

Just for more data. Tried the latest 2.3.0 beta this morning. This module still will not command power on or off on the Epson L1500 or L610U. Feedbacks work and power commands work if I use the new Epson EB module for power commands only. Let me know if I can help diagnose any more. Thanks for all yalls work and help. @istnv @jmcc94

Mortimer85 commented 2 years ago

Same here with a "Digital Projection E-Vision Laser 13k" and "Eiki LC-HDT 700". Power ON/OFF is not working.

ON THE Eiki the connection of the instance fails after a while. (ERROR) Sometimes I could get it running again by sending commands with a button (AVMT on/off).

PJ Link commands out of Putty and Watchout work with both projectors, but only when pjlink instance is disabled.

The Evision's Feedback of AV mute is often wrong. After sending off/on it shows the right state, then it jumps back to the opposite on/off state. The commands trigger the shutter correctly.

I will roll back to the last build before "generic pjlink" update and report.

istnv commented 2 years ago

@JonathanPowe

Several "Unavailable time" errors appeared in the Companion log...

Edit to add: the projector was in 'Standby' state throughout the test

Those errors are a result of feedbacks polling for 'Mute' status while the projector is in standby.

AndrewApi commented 2 years ago

Hi, we are having power on issues with Panasonic projectors with the latest beta build, is there a resolve yet? 2.2.0 works perfectly, it is only when updating to the latest 2.3.0 beta. Not sure if 2.2.1 works either.

obcocav commented 2 years ago

@istnv . Just tried the latest beta and still have the issue. Feedback is working but power commands do not. Again not sure if it helps but this issue started for us after the update that consolidated the power state commands into a drop down selection rather than separate commands in the list. Hope this helps and thanks for working on this! Let me know if I can help.

istnv commented 2 years ago

@obcocav An update here does not automatically push forward to the betas. Core devs need to approve and integrate them into the build. That can take days (or weeks). What OS do you use? I do not have access to a projector at this time but I may be able to generate a non-official build you can test. What modules do you use (my dev environment may not have all of the modules)

obcocav commented 2 years ago

@istnv . Ok. Saw build 4505 had PJlink 1.1.2 so figured that was it. I’ll check back later. Using win64. LOTS of modules. Let me get a list when I can fire it up but may not be practical. Thank you!

istnv commented 2 years ago

@obcocav That build added a couple of debugging messages. A temp build should not be a problem if you make sure to back up your current install beforehand.

obcocav commented 2 years ago

Here’s a list of my current modules.

6D009ACE-0DAB-4C7C-9F5D-2692E3686B77 13AA9A9B-1272-4EDB-B01E-E94DC8191415 D5ACA237-75F7-4A25-B66A-9F6D0B3F09AA BCAEAE92-F7E5-4D39-A4B6-7C782760EF52 8E975AF2-8B35-49AA-902D-9A25F9405333 924DE676-D683-4CF7-8647-05F96F5BA168 4428B62F-993E-40A0-9E27-F9A4FA8E8DD4 114B5862-633F-4A57-BF65-60B619755FA2

JonathanPowe commented 2 years ago

@obcocav ... What OS do you use? I do not have access to a projector at this time but I may be able to generate a non-official build you can test. What modules do you use (my dev environment may not have all of the modules)

Thank you for working on this. I am happy to test it too. The projector I have connected is an Epson EB-G7905U

OS: Windows 10 64-bit

Modules: Blackmagic Design atem TVOne Corio OBS obs PJLink pjlink Epson epsonpj Behringer wing Resolume arena Generic tcp-udp Generic osc

istnv commented 2 years ago

If you're on slack I can send a link to a test windows build.

JonathanPowe commented 2 years ago

If you're on slack I can send a link to a test windows build.

Thank you. I have created an account on Slack and sent you a message.

obcocav commented 2 years ago

Appears solved with build 4510! Thanks @istnv!

istnv commented 2 years ago

@obcocav My updates aren't in there yet. I think you are seeing a byproduct of the config-update procedure running properly from my test build.

Appears solved with build 4510! Thanks @istnv!

obcocav commented 2 years ago

@istnv . Yep got a little too excited. It worked a few times and now back to square one on the public beta build. Your build did work great testing.

jmcc94 commented 2 years ago

PR merged into master, and have asked core devs to include it in companion beta

jmcc94 commented 2 years ago

@obcocav - the update should now be in the latest companion beta

obcocav commented 2 years ago

@istnv @jmcc94 . Hey guys. Finally got to try out the beta. Power commands work perfect! Only issue now is the AV MUTE command doesnt work on either the L1500U or L610Us. Neither the ON,OFF, or Toggle commands work for me. Button show an error indicator when pressed. Thanks

istnv commented 2 years ago

@obcocav There should be a message in the log when that happens.

obcocav commented 2 years ago

@istnv . Here you go:

22.07.05 22:50:22 instance(LEFT PROJECTOR): Projector reported %1AVMT: Out of parameter 22.07.05 22:50:22 instance(RIGHT PROJECTOR): Projector reported %1AVMT: Out of parameter 22.07.05 22:50:22 instance(MAIN PROJECTOR): Projector reported %1AVMT: Out of parameter

istnv commented 2 years ago

@obcocav Well at least it is showing the correct error :) What is in the module variable Mute Status?

The toggle option is computing the wrong command :( Opening a new issue for this while I figure out how to refactor the options.

obcocav commented 2 years ago

@istnv . haha. The variables are "A/V mute Off" and "A/V mute On". Let me know if I can get you more data. Thank you!

JonathanPowe commented 2 years ago

Thank you @istnv for your work on fixing this issue with the Power commands. Tested Beta 4517 (generic-pjlink v1.2.1) and can confirm that it now works nicely with the Epson EB-G7905U. No errors in the log, and communication with the projector works as expected.

obcocav commented 2 years ago

@istnv . AV Mute now works perfectly in the latest beta! Thank you so much for your work on this!

jmcc94 commented 2 years ago

Fixed by #34