Is the Epson projector binding abandoned?

HI,

I have installed 2.5.11.202012190142 and restarted OH2. But there was only one volume channel and it did not work. Hence, I have deleted the Epson thing, restarted OH2 and create new thing for Epson. But this time there is no Volume channel at all :slightly_frowning_face: and warning

2020-12-19 12:29:58.304 [WARN ] [ore.internal.thing.ThingTypeResource] - Cannot find channel type: epsonprojector:volume
2020-12-19 12:29:58.344 [WARN ] [ore.internal.thing.ThingTypeResource] - Cannot find channel type: epsonprojector:volume
2020-12-19 12:30:08.766 [WARN ] [re.thing.internal.ThingFactoryHelper] - Could not create channel 'volume' for thing type 'epsonprojector:projector-tcp:1d58e6d8', because channel type 'epsonprojector:volume' could not be found.
2020-12-19 12:30:08.843 [hingStatusInfoChangedEvent] - 'epsonprojector:projector-tcp:1d58e6d8' changed from UNINITIALIZED to UNINITIALIZED (HANDLER_CONFIGURATION_PENDING)
2020-12-19 12:30:16.913 [WARN ] [ore.internal.thing.ThingTypeResource] - Cannot find channel type: epsonprojector:volume

In addtion seems there is a confusion between Source and AspectRatio channels. I can not change Source and it displays always 30. And I can see a constant changes as follows:

2020-12-19 12:53:16.337 [vent.ItemStateChangedEvent] - EpsonAspectRatio changed from NORMAL to 30
2020-12-19 12:53:16.639 [vent.ItemStateChangedEvent] - EpsonAspectRatio changed from 30 to NORMAL
2020-12-19 12:53:27.955 [vent.ItemStateChangedEvent] - EpsonAspectRatio changed from NORMAL to 30
2020-12-19 12:53:28.353 [vent.ItemStateChangedEvent] - EpsonAspectRatio changed from 30 to NORMAL
2020-12-19 12:53:39.974 [vent.ItemStateChangedEvent] - EpsonAspectRatio changed from NORMAL to 30
2020-12-19 12:53:40.268 [vent.ItemStateChangedEvent] - EpsonAspectRatio changed from 30 to NORMAL

Let me know if I shall restart OH2 again and provide you with DEBUG level log?

PS: I wonder, maybe you can’t have 2 different Volume channels at the same time and the binding shall be changed to choose mapping type /or projector at bridge level?

For this build, I changed the name of the volume channel. Now there are two: ‘volume20’ and ‘volume40’. You need to update yours from ‘volume’ to ‘volume40’ since your volume is 0-40.

For Source and AspectRatio, the pre-defined selections have the most common options, but not all will be supported by all projectors. For the source channel, if you set the desired source manually using the remote, the source channel in the binding will update with the two digit code for that source. You can use a rule to send that value back to the binding to change to that source ie: epsonSource.sendCommand(“10”)

The issue is that I do not have any volume channel in the thing, there is no volume, no volume20 nor volume40

In the previous build I was able to select value for Source channel ex HDMI1 etc (I understand that there are codes assigned to names) but in this build Source is a read only filed without possibility to change it. I can for example change the value for AspectRatio or Luminace

I see what the problem was with the volume channels. I only applied the changes to the serial thing and not the tcp thing. I have corrected this and updated the build for the linked jar file above. You should see volume20 and volume40 channels on the projector-tcp thing now. I am not sure why there are issues with the other channels as the code for these has not changed.

I have installed 2.5.11.202012192204 but still there are no volume channels (volume or volume20, volume40) available at the thing definition :neutral_face:

You may have to delete the thing and re-create it. I checked again and both volume channels are there with the latest 2.5.11-SNAPSHOT build.

Yes, after I have created new thing I can see both volume channles (20 and 40)!
Also I have found a mistake in my items mapping which resulted in the issues with Input channel :slightly_smiling_face:
But the new volume channels do not work and there is an error

2020-12-20 20:05:24.857 [ERROR] [nal.common.AbstractInvocationHandler] - An error occurred while calling method 'ThingHandler.handleCommand()' on 'org.openhab.binding.epsonprojector.internal.handler.EpsonProjectorHandler@5d7f32': Not valid command type
java.lang.IllegalArgumentException: Not valid command type
	at org.openhab.binding.epsonprojector.internal.EpsonProjectorCommandType.getCommandType(EpsonProjectorCommandType.java:120) ~[?:?]
	at org.openhab.binding.epsonprojector.internal.handler.EpsonProjectorHandler.handleCommand(EpsonProjectorHandler.java:88) ~[?:?]
	at sun.reflect.GeneratedMethodAccessor104.invoke(Unknown Source) ~[?:?]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_252]
	at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_252]
	at org.eclipse.smarthome.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:152) [bundleFile:?]
	at org.eclipse.smarthome.core.internal.common.InvocationHandlerSync.invoke(InvocationHandlerSync.java:59) [bundleFile:?]
	at com.sun.proxy.$Proxy1674.handleCommand(Unknown Source) [?:?]
	at org.eclipse.smarthome.core.thing.internal.profiles.ProfileCallbackImpl.handleCommand(ProfileCallbackImpl.java:74) [bundleFile:?]
	at org.eclipse.smarthome.core.thing.internal.profiles.SystemDefaultProfile.onCommandFromItem(SystemDefaultProfile.java:48) [bundleFile:?]
	at sun.reflect.GeneratedMethodAccessor103.invoke(Unknown Source) ~[?:?]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_252]
	at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_252]
	at org.eclipse.smarthome.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:152) [bundleFile:?]
	at org.eclipse.smarthome.core.internal.common.Invocation.call(Invocation.java:52) [bundleFile:?]
	at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_252]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_252]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_252]
	at java.lang.Thread.run(Thread.java:748) [?:1.8.0_252]

Also when I turn off Epson projector in Paper UI (Power item) the thing goes offline.

Please find attached log file showing both problems: unknown new volume channel and PWR then thing went OFFLINE
epson.log (91.5 KB)

PS. I have also upgraded to OH 2.5.11-1 while making test with this binding release

I fixed the issue using the volume channels. Please grab an updated 2.5.11-SNAPSHOT jar in the link above.

It works, great :slight_smile: Thanks!
Only a small change in sitemap, I have set up maxValue=40 (without this change the default scale is up to 100 but after poll/update it is corrected to the recent value)

Hello,

One additional remark, I have noticed that the volume40 channel generates ~constant update to the log file as follows:

2020-12-26 19:59:08.844 [vent.ItemStateChangedEvent] - Epson_Volume changed from 17 to 0
2020-12-26 19:59:09.182 [vent.ItemStateChangedEvent] - Epson_Volume changed from 0 to 17
2020-12-26 19:59:18.299 [vent.ItemStateChangedEvent] - Epson_Volume changed from 17 to 0
2020-12-26 19:59:18.604 [vent.ItemStateChangedEvent] - Epson_Volume changed from 0 to 17
2020-12-26 19:59:27.043 [vent.ItemStateChangedEvent] - Epson_Volume changed from 17 to 0
2020-12-26 19:59:27.256 [vent.ItemStateChangedEvent] - Epson_Volume changed from 0 to 17
2020-12-26 19:59:35.698 [vent.ItemStateChangedEvent] - Epson_Volume changed from 17 to 0
2020-12-26 19:59:36.004 [vent.ItemStateChangedEvent] - Epson_Volume changed from 0 to 17
2020-12-26 19:59:44.351 [vent.ItemStateChangedEvent] - Epson_Volume changed from 17 to 0
2020-12-26 19:59:44.656 [vent.ItemStateChangedEvent] - Epson_Volume changed from 0 to 17

Do you have volume20 linked as well? If so, try un-linking it and see if this stops the problem.

Yes right, thanks! in the items. file I have volume40 channel only but the volume20 link was left in the paper UI :slightly_frowning_face:

Can anyone solve this riddle?

When I was updating the Epson projector binding, I noticed that the controls for brightness, contrast, keystone, volume, etc. that had a number range (ie 0-40 for volume) used a different number in the serial protocol than what was shown on the screen. The number for the screen display was mapped across a single byte (0-255) value. For the current implementation in the binding, I made a lookup array for each range that my projector used for its various controls. This works fine, but it was quickly determined that the various models of projectors in the field used different ranges (ie one projector might use 0-20 for volume and another would use 0-40). To improve the binding, it would be better to calculate the values on the fly instead of using an array so as to make the range configurable by the user to match their projector.

I found this calculation that seems like it would work to map one range to another:

I made this test case to see if the calculated values would match the reference values from the lookup array. It works but only about 50% of the time, the other 50% are off by 1.

public class TestMap {

    public static void main(String[] args) {

        // Mapping of actual values for the Epson 0-40 volume control
        final int[] MAP40 = new int[] { 0, 6, 12, 18, 24, 31, 37, 43, 49, 56, 62, 68, 74, 81, 87, 93, 99, 106,
                112, 118, 124, 131, 137, 143, 149, 156, 162, 168, 174, 181, 187, 193, 199, 206, 212, 218, 224, 231, 237, 243,
                249 };

        // Test if the calculation matches the value from the array
        for (int i = 0; i < (MAP40.length); i++) {
            System.out.println("In: " + i + " Out: " + map40(i) + " Ref: " + MAP40[i] + (map40(i) == MAP40[i] ? " CORRECT" : " INCORRECT"));
        }
    }

    // Calculate the 0-255 output from the 0-40 input
    private static int map40(int x) {
        return map(x, 0, 41, 0, 255);
    }

    // Re-maps a number from one range to another
    private static int map(int x, int in_min, int in_max, int out_min, int out_max) {
        return (x - in_min) * (out_max - out_min) / (in_max - in_min) + out_min;
      }

}

Any suggestions to fix this calculation would be most appreciated.

Just tried to install this binding for my Epson EH-TW650 which has built in Wifi, but if I make a TCP/IP Thing with the correct IP it keep saying it is offline. The log file shows this warning every 30s or so:
2021-01-07 12:20:57.730 [WARN ] [sysfs.internal.SysfsUsbSerialScanner] - Could not find the device path for /sys/class/tty/ttyUSB0 in the sysfs: /sys/class/tty/ttyUSB0
But since the porjector is connected to the Wifi network, I don’t see why I would have anything to do with a USB device? Any ideas?

If you use the projector-tcp thing type, there should not be any attempt by the binding to use a serial port. Are you using a USB to serial adapter for any other device on your openHAB setup?

In the openHAB console type this command to enable debug logging for the binding:
log:set DEBUG org.openhab.binding.epsonprojector

Then post the output here.

EDIT: There is a code change that is coming in openhab v3.1.0 that allows use of the projector’s internal network adapter. The internal device requires a special handshake string to be sent before it will allow the connection. The jar is here if you want to side load it now: [epsonprojector] Add ESC/VP.net handshake for projectors with built-in ethernet by mlobstein · Pull Request #9375 · openhab/openhab-addons · GitHub

After enabling debug, the log file shows this:

2021-01-15 08:21:17.004 [DEBUG] [connector.EpsonProjectorTcpConnector] - Open connection to address’192.168.0.35:23’
2021-01-15 08:21:17.020 [DEBUG] [ternal.handler.EpsonProjectorHandler] - Couldn’t execute command ‘Power’, java.net.ConnectException: Connection refused (Connection refused)
2021-01-15 08:21:17.021 [DEBUG] [ternal.handler.EpsonProjectorHandler] - Closing connection to device ‘epsonprojector:projector-tcp:c79371b5’
2021-01-15 08:21:17.022 [DEBUG] [connector.EpsonProjectorTcpConnector] - Closed
2021-01-15 08:21:23.564 [WARN ] [sysfs.internal.SysfsUsbSerialScanner] - Could not find the device path for /sys/class/tty/ttyUSB0 in the sysfs: /sys/class/tty/ttyUSB0

Is 23 the correct port? I’ve also tried 3620 and 3629:

2021-01-15 08:27:13.379 [DEBUG] [connector.EpsonProjectorTcpConnector] - Open connection to address’192.168.0.35:3620’
2021-01-15 08:27:13.385 [DEBUG] [jector.internal.EpsonProjectorDevice] - Query: ‘PWR?’
2021-01-15 08:27:18.394 [DEBUG] [ternal.handler.EpsonProjectorHandler] - Couldn’t execute command ‘Power’, No response received
2021-01-15 08:27:18.395 [DEBUG] [ternal.handler.EpsonProjectorHandler] - Closing connection to device ‘epsonprojector:projector-tcp:c79371b5’
2021-01-15 08:27:18.396 [DEBUG] [connector.EpsonProjectorTcpConnector] - Close tcp out stream
2021-01-15 08:27:18.398 [DEBUG] [connector.EpsonProjectorTcpConnector] - Close tcp in stream
2021-01-15 08:27:18.399 [DEBUG] [connector.EpsonProjectorTcpConnector] - Closing socket
2021-01-15 08:27:18.400 [DEBUG] [connector.EpsonProjectorTcpConnector] - Closed

Can I use the Openhab 3 binding in 2.5.11? The Epson web interface needs a login to allow remote control, doesn’t this binding need that as well? I searched bit further on the usb device error and this could have something to do with permission, so maybe not related. I only have an eBus device connected to USB.

I have updated the 2.5.11 test build with the code from the 3.1.0 PR. You can download the jar below and load it. Use port 3629. Currently there is no way to send a password to the projector. However in my tests it was not needed even when a password for the web interface was enabled.

https://github.com/mlobstein/mlobstein-beta-test/raw/master/org.openhab.binding.epsonprojector-2.5.11-SNAPSHOT.jar

Great, works perfectly. Thanks a lot!
No password needed indeed.

I just got a docker image of openhab-3.1.0-SNAPSHOT, and it seems like the epson projector binding is built in but does depend on Apache Commons IO, which was removed in the recent past?

2021-05-28 13:48:12.713 [ERROR] [Events.Framework                    ] - FrameworkEvent ERROR
org.osgi.framework.BundleException: Could not resolve module: org.openhab.binding.epsonprojector [36]
  Unresolved requirement: Import-Package: org.apache.commons.io; version="[2.2.0,3.0.0)"

Is there a JAR somewhere that doesn’t have that dependency? I looked in https://github.com/mlobstein/mlobstein-beta-test/ but only saw builds for 2.5 and 3.0.