CEC Setup

Been trying for a day to get CEC setup working on rasplex, but just can’t quite get it and figured it was time to ask for help…

TV: 55KU6300
Pi: RaspberryPi 3B

What I have done:
installed kodi and verified TV / hdmi cable are working with CEC (it worked perfect, no setup needed!)
Ensured CEC was turned on in rasplex settings (System>Input Devices>Peripherals>CEC Adapter)

So far this thread has been most helpful:
forums.plex.tv/discussion/150209/cec-remote-buttons-how-do-i-find-out-which-button-has-been-pressed

After logging in via SSH I enabled debug log (tail -F /storage/.plexht/temp/plexhometheater.log) and hit the left button on my remote. It shows this as a response:

11:04:30 T:1851782112   DEBUG: CecLogMessage - >> 01:44:03
11:04:30 T:1851782112   DEBUG: CecLogMessage - SetCurrentButton left (3) D:0ms cur:3
11:04:30 T:1851782112   DEBUG: CecLogMessage - key pressed: left (3) current(ff) duration(0)
11:04:30 T:1851782112   DEBUG: CecLogMessage - Changed key left (3) D:0ms cur:ff
11:04:30 T:1851782112   DEBUG: CecLogMessage - key pressed: left (3, 0)
11:04:30 T:1851782112   DEBUG: PushCecKeypress - received key a9 duration 0 (rep:0 size:15)
11:04:30 T:1851782112   DEBUG: PushCecKeypress - added key a9
11:04:30 T:1851782112   DEBUG: CecLogMessage - CheckKeypressTimeout T:1489.293
11:04:30 T:1851782112   DEBUG: CecLogMessage - Key left: idle (duration:0) (3) timeout:500ms (rel:500,rep:0,prs:1,rel:0)
11:04:30 T:1851782112   DEBUG: CecLogMessage - >> TV (0) -> Recorder 1 (1): user control pressed (44)
11:04:30 T:1851782112   DEBUG: CecLogMessage - >> 01:8b:03
11:04:30 T:1851782112   DEBUG: CecLogMessage - key released: left (3) D:69ms
11:04:30 T:1851782112   DEBUG: PushCecKeypress - received key a9 duration 69 (rep:0 size:16)
11:04:30 T:1851782112   DEBUG: PushCecKeypress - replaced key a9
11:04:30 T:1851782112   DEBUG: CecLogMessage - >> TV (0) -> Recorder 1 (1): vendor remote button up (8B)

So I believe the CEC is working as it should, it’s just a question of setting up the key mapping.
This is where I’m a little more fuzzy on what it should be, but I’ve been trying some permutations of keymap files to no avail.

The xlm tag inside the <>, what should that be named?

* <a9>
* <left>
* <left id="a9">

Here is the current file (just trying to get basic navigation, the rest can be sorted later once I understand this)

<keymap>
    <remote name="CEC ADAPTER">
      <a9>Left</a9>
      <a8>Right</a8>
      <a6>Up</a6>
      <a7>Down</a7>
      <b>Select</b>
      <d8>Back</d8> 
    </remote>
</keymap>

Any hints what I’m doing wrong? the file is being saved as \Userdata\keymaps\remote.xml and the pi is being restarted once the file is saved there. Is there anything else I should be doing to get it to load that keymap? Any quick test I can do to ensure its being loaded correctly?

Appreciate the help!

@Santanellojohn
I’ve never had to remap the basic navigation keys on a remote for CEC. The arrows, select, and exit have always worked right out of the box for me. Try using this setup:

<keymap>
    <remote name="CEC ADAPTER">
      <key id="a9">Left</key>
      <key id="a8">Right</key>
      <key id="a6">Up</key>
      <key id="a7">Down</key>
      <b>Select</b>
      <key id="d8">Back</key> 
    </remote>
</keymap>

Still no luck getting that or any other config to work - I think I’m going to try and go a slightly different direction and add an IR receiver and program it to work that way…

Do I understand correctly you don’t like the current CEC button layout and want to change it? Or you have a CEC compatible setup but it does not work “out-of-the-box”.
You do not need to do anything to get CEC working on RPi. If you start it (RPi) connected via HDMI then CEC should work without any configuration needed (as long your setup has a CEC driver in it of course like RasPLex or Kodi :slight_smile: )