You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
cec.EVENT_KEYPRESS not working after updating to 0.2.7 #33
I just tried this on my Raspberry Pi 4 I'm also getting no events with 2.7. I also tried with EVENT_ALL, but I don't receive anyting, but power_on and standby are working. Any idea what could be the problem?
Edit: I found keys that are working, but I'm looking for an event when the device enters standby or is powered on externally. Is this already possible?
@TheNetStriker Yes, for example my TV broadcasts CEC_OPCODE_ROUTING_CHANGE (with new address parameter set to 1.0.0.0) after it's powered on, and it broadcasts CEC_OPCODE_STANDBY when it enters standby. So just use EVENT_COMMAND callback and monitor commands your device broadcasts.
There are only two arguments to the callback, you should use def onCommand(event, cmd):.
Set up a log callback, or run cec-client from libcec and examine the logs, all communication should be there.
Activity
nforro commentedon May 5, 2019
Sorry for late reply. Could you be more specific? I just tried your code and it works fine.
TheNetStriker commentedon Sep 19, 2019
I just tried this on my Raspberry Pi 4 I'm also getting no events with 2.7. I also tried with EVENT_ALL, but I don't receive anyting, but power_on and standby are working. Any idea what could be the problem?
Edit: I found keys that are working, but I'm looking for an event when the device enters standby or is powered on externally. Is this already possible?
nforro commentedon Sep 20, 2019
@TheNetStriker Yes, for example my TV broadcasts
CEC_OPCODE_ROUTING_CHANGE(with new address parameter set to1.0.0.0) after it's powered on, and it broadcastsCEC_OPCODE_STANDBYwhen it enters standby. So just useEVENT_COMMANDcallback and monitor commands your device broadcasts.TheNetStriker commentedon Sep 20, 2019
I just tested this with the following code:
But I don't get any events. Is there any way to debug this?
nforro commentedon Sep 20, 2019
There are only two arguments to the callback, you should use
def onCommand(event, cmd):.Set up a log callback, or run
cec-clientfrom libcec and examine the logs, all communication should be there.TheNetStriker commentedon Sep 20, 2019
Thanks for the quick help. I managed to the the power events with this code: