Hdmi cec binding

Hmm, the openhab user has been added to the staff group, the staff group is group owner of the /usr/local/lib/python3.5/dist-packages/cec

However I’m still getting:

2017-09-27 18:13:00.501 [ERROR] [nding.hdmicec.handler.HdmiCecHandler] - java.io.IOException: Cannot run program “/usr/local/lib/python3.5/dist-packages/cec”: error=13, Permission denied

Odd…

Is /usr/local/lib/python3.5/dist-packages/cec a folder or the acutal executable? The executable shoud be named cec-client, not just cec. On my RPI the executable is here: /usr/local/bin/cec-client

Also check if the chmod of the file allows group users to execute the file.

ah, I assumed it was a folder because there was no mention of a file extension…

I can see the cec-client in the same folder as yours, however I now have 2 there because I built the new 3.5 version, while still having 2.7, I’ll need to purge it I guess… apparently I don’t make things easy on myself :stuck_out_tongue:

I updated the settings, however it’s stuck on initializing… probably because there are 2 cec-client files in that destination?

I also have two files cecc-client-4.0.2 and cecc-client which points at the cecc-client-4.0.2 file. You can test if the cec port works if you just run “cec-client RPI”. If that works without problems you can enable the trace log for my addon to see whats the problem.

hmm, my status for hdmi cec currently says “OFFLINE - COMMUNICATION_ERROR process ended”

however I’m not getting any errors in karaf debug or openhab / event log…

You have to enable the trace log for this addon in /var/lib/openhab2/etc/org.ops4j.pax.logging.cfg. I’ve configured a separate log file for it:

#HdmiCec
log4j.appender.hdmicec=org.apache.log4j.RollingFileAppender
log4j.appender.hdmicec.layout=org.apache.log4j.PatternLayout
log4j.appender.hdmicec.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss.SSS} [%-5.5p] [%-26.26c{1}] - %m%n
log4j.appender.hdmicec.file=${openhab.logdir}/hdmicec.log
log4j.appender.hdmicec.append=true
log4j.appender.hdmicec.maxFileSize=10MB
log4j.appender.hdmicec.maxBackupIndex=10
log4j.logger.org.openhab.binding.hdmicec= TRACE, hdmicec
log4j.additivity.org.openhab.binding.hdmicec= false

ok so just bolt this on to the end of file and restart openhab2 service? (sorry new to the openhab2 method of logging)

There is no need to restart, OH2 recognizes changes to this file, so logging should start immediately. Just restart the binding using karaf.

After adding the changes to the file (/var/lib/openhab2/etc/org.ops4j.pax.logging.cfg), I am not getting any seperate hdmi cec log file in /var/log/openhab2?

That’s stange, it should at least create an empty log file. And after a complete restart?

Nothing :slight_smile:
Will have a looking again in a bit however my partner is watching girly movies at the moment.

I’ve had some time today and tried this myself and had the same problems as you. (Except the logging, that worked perfectly on my installation) As it turns out the messages from the cec-client are slightly different on the Raspberry hdmi port.

I’ve just uploaded a new version that works on my Raspberry. Also the version is compiled for OH 2.2, but it also works on OH 2.1: https://github.com/TheNetStriker/openhab2-addons/releases/tag/2.2.0.beta1

Please let me know if this works for you.

sorry, I only just had time to check will do now.

I’m still getting “Communication Error - Process Ended” in paperUI, however I don’t get any errors when restarting openHab, infact there is no reference to HDMI CEC loading on restart, despite the bundle showing as active.

“Process Ended” means that the cec-client process ended. This means something during the initialization went wrong. If you can run the cec-client without problems as root this has to mean that the openhab user still doesn’t have the rights to access the hdmi hardware.

Sadly I don’t remember exactly which rights I had to give to run this on my installation, but my openhab user has the “video” group assigned. If I remember correctly this group was also necessary to access the hdmi device. If this doesn’t work, please also try to add the “dialout” and “tty” groups to the openhab user. And you will have to restart Openhab completely to receive the rights from the groups.

My openhab user already belongs to both groups…

And does the user also belongs to the dialout and tty group? I think to communicate with cec the process also needs to access a serial port.

Yes, user belongs to both dialout and tty

In this case I have no more ideas without the trace log of the addon. And I also don’t have an idea why the log isn’t working on your installation. When I tested this I immediateley got entries in the log when the addon started. There should be at least an “initialize client:” log message at startup.

I’ll reinstall later :slight_smile: thanks for your help :slight_smile: