I’ve build an IR transmitter with a RPi. Works OK, but the problem is that the IR diodes are not strong enough. The distance between the Pi & the beamer is almost 7m, so sometimes the IR signal is not received by the beamer. So my intention is now to build an WiFi2Serial gateway with a ESP8266 board. For this reason I need a serial port which can be used by Openhab.
I have added TCP/IP connection support to Epson binding while ago (forgotten to add information to binding documentation page). I use currently cheap Ethernet <-> serial port converter (USR-TCP232-24) with Epson projector. So you should be able to connect directly to ESP8266 board, which act a WiFi2Serial gateway.
thanks for your feedback. That does not work & I’m facing the following error in the logs (using Openhab 2.3)´
2018-07-04 09:34:18.659 [ERROR] [b.core.service.AbstractActiveService] - Error while executing background thread Epson projector Refresh Service
java.lang.NullPointerException: null
at org.openhab.binding.epsonprojector.connector.EpsonProjectorSerialConnector.disconnect(EpsonProjectorSerialConnector.java:99) [251:org.openhab.binding.epsonprojector:1.12.0]
at org.openhab.binding.epsonprojector.internal.EpsonProjectorDevice.disconnect(EpsonProjectorDevice.java:480) [251:org.openhab.binding.epsonprojector:1.12.0]
at org.openhab.binding.epsonprojector.internal.EpsonProjectorBinding.closeConnection(EpsonProjectorBinding.java:543) [251:org.openhab.binding.epsonprojector:1.12.0]
at org.openhab.binding.epsonprojector.internal.EpsonProjectorBinding.queryDataFromDevice(EpsonProjectorBinding.java:351) [251:org.openhab.binding.epsonprojector:1.12.0]
at org.openhab.binding.epsonprojector.internal.EpsonProjectorBinding.execute(EpsonProjectorBinding.java:163) [251:org.openhab.binding.epsonprojector:1.12.0]
at org.openhab.core.binding.AbstractActiveBinding$BindingActiveService.execute(AbstractActiveBinding.java:144) [229:org.openhab.core.compat1x:2.3.0]
at org.openhab.core.service.AbstractActiveService$RefreshThread.run(AbstractActiveService.java:166) [229:org.openhab.core.compat1x:2.3.0]
Do you have got an idea what is going wrong here? When I include my ESP8266 Serial Gateway through a virtual COM port with socat
That error is thrown as serial port open has failed. Disconnect method could be improved a little bit, but that doesn’t solve you problem. Did you tried to connect directly by using tcp?
Actually I’ve got it working with a virtual com port, but I would prefer to use it directly over tcp because with the socat process there is another source for errors
If you get the same error, then binding still tries to use serial port connection rather than TCP. If both serial port and tcp setting are configured, then binding tries to use serial port. Most probably reason is that openHAB framework doesn’t remove the serial port configuration parameter after configuration refresh. So you might need to restart the openHAB.
Thx, your hint pointed me in the right direction. I’v restarted openhab but the error stayed.
So I rembered that the cfg files are cached under
/var/lib/openhab2/config/org/openhab
and checked the file there. It contained both settings (com port & TCP) although I had changed them under
/etc/openhab2/services/epsonprojector.cfg
So long story short: stopped openhab, removed the invalid config file from cache, restarted openhab & now the tcp connection through my gateway just works
One more question, is it possible to change the luminance mode (Eco, Normal) through your binding?
Following the Epson documentation it is possible, through telnet I’ve been successful, too.
2018-07-04 13:40:32.449 [WARN ] [org.apache.karaf.services.eventadmin] - EventAdmin: Exception during event dispatch [org.osgi.service.event.Event [topic=openhab/command/epsonLuminance] {item=epsonLuminance, bridgemarker=true, command=00, timestamp=1530704432449} | {org.osgi.service.event.EventHandler, org.osgi.service.cm.ManagedService}={service.id=451, service.bundleid=251, service.scope=bundle, event.topics=openhab/command/*, service.pid=org.openhab.epsonprojector, component.name=org.openhab.binding.epsonprojector.binding, component.id=268} | Bundle(org.openhab.binding.epsonprojector_1.12.0 [251])]
java.lang.IllegalArgumentException: No enum constant org.openhab.binding.epsonprojector.internal.EpsonProjectorDevice.Luminance.00
at java.lang.Enum.valueOf(Enum.java:238) [?:?]
at org.openhab.binding.epsonprojector.internal.EpsonProjectorDevice$Luminance.valueOf(EpsonProjectorDevice.java:1) [251:org.openhab.binding.epsonprojector:1.12.0]
at org.openhab.binding.epsonprojector.internal.EpsonProjectorBinding.sendDataToDevice(EpsonProjectorBinding.java:475) [251:org.openhab.binding.epsonprojector:1.12.0]
at org.openhab.binding.epsonprojector.internal.EpsonProjectorBinding.internalReceiveCommand(EpsonProjectorBinding.java:376) [251:org.openhab.binding.epsonprojector:1.12.0]
at org.openhab.core.binding.AbstractBinding.receiveCommand(AbstractBinding.java:94) [229:org.openhab.core.compat1x:2.3.0]
at org.openhab.core.events.AbstractEventSubscriber.handleEvent(AbstractEventSubscriber.java:45) [229:org.openhab.core.compat1x:2.3.0]
at org.apache.felix.eventadmin.impl.handler.EventHandlerProxy.sendEvent(EventHandlerProxy.java:415) [3:org.apache.karaf.services.eventadmin:4.1.5]
at org.apache.felix.eventadmin.impl.tasks.HandlerTask.runWithoutBlacklistTiming(HandlerTask.java:82) [3:org.apache.karaf.services.eventadmin:4.1.5]
at org.apache.felix.eventadmin.impl.tasks.SyncDeliverTasks.execute(SyncDeliverTasks.java:104) [3:org.apache.karaf.services.eventadmin:4.1.5]
at org.apache.felix.eventadmin.impl.tasks.AsyncDeliverTasks$TaskExecuter.run(AsyncDeliverTasks.java:166) [3:org.apache.karaf.services.eventadmin:4.1.5]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:?]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:?]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:?]
at java.lang.Thread.run(Thread.java:748) [?:?]
I’ve tested it serveral times today. It seems to be working fine with the host/port mode & my ESP8266 flashed with ESP-Link. Will give it a try during the next days.