TV remote shuts down PI

I have a Pi B+ (BCM2708 Rev 0010) running OSMC 2015.11-2 that has worked flawlessly with my Toshiba TV (including previous OSMC releases).

I’ve had to move the Pi to another room and connect to a different TV, a ‘Logik L24FED12A’. The remote didn’t work at first, I had to enable CEC in the TV’s menus but it now works fine with one exception; pressing the standby button on the remote shuts down the PI (when I say ‘shuts down’ it may be that the PI is hibernating/on standby/sleeping or whatever but it’s not available via the LAN and I have to reboot to use it - switching the TV back on simply gives me a ‘no signal’ message).

I’ve just checked and the physical on/off button on the TV (how quaint!) does exactly the same thing (i.e. shuts down the Pi).

In Power Saver settings:
shutdown function timer is off
try to wake up remote servers on access is off
shutdown function is set to shutdown (but is greyed out)

I can’t think what else to try… any suggestions please?

Cheers

Paul

Check the settings inside
System>Settings>System>Input Devices>Peripherals>CEC, press enter again to access the CEC settings …
(might not be quite the right names but is something like that)
and you will see settings for what happens when TV is shutdown.

Thanks Paul, I already looked in there (so many settings I forgot to mention it!) - ‘When the TV is switched off’ is set to ‘ignore’, I haven’t changed anything in this area and nothing else looks relevant to my problem. I just changed that setting from ‘ignore’ to ‘suspend’ just to check and the result is the same ie the Pi shuts down (or locks up somehow) and has to be rebooted.

Leave it on ignore.
On the other hand I suggest to find out what really happens on OSMC. Suggest you enable debugging and log into OSMC by SSH and use tail -f .kodi/temp/kodi.log to monitor the log file. Then press the power button and check whats going on.
Also after reboot you could paste the logfile with paste-log .kodi/temp/kodi.old.log

fzinken: Thank you for helping, here’s what I get from tail…:

14:54:44 198.068954 T:3024867888 DEBUG: ------ Window Deinit (Settings.xml) ------
14:54:44 198.070358 T:3024867888 DEBUG: CGUIWindowManager::PreviousWindow: Activate new
14:54:44 198.070801 T:3024867888 DEBUG: ------ Window Init (Home.xml) ------
14:54:53 207.739151 T:2856317984 DEBUG: script.module.osmcsetting.updates : - blurp 453 - Home.xml
14:55:12 226.024277 T:2811491360 DEBUG: Thread JobWorker 2811491360 terminating (autodelete)
14:55:43 257.806152 T:2856317984 DEBUG: script.module.osmcsetting.updates : - blurp 453 - Home.xml
14:55:44 258.204529 T:3004167200 DEBUG: CAESinkPi:Drain delay:99ms now:0ms
14:55:54 268.205017 T:3004167200 DEBUG: CAESinkPi:Deinitialize
14:55:54 268.205902 T:3004167200 DEBUG: CAESinkPi:SetAudioProps hdmi_stream_channels 0 hdmi_channel_map 00000000
14:55:54 268.217987 T:3004167200 DEBUG: COMXCoreComponent::Deinitialize : OMX.broadcom.audio_render handle 0x3f48c60
14:56:33 307.865173 T:2856317984 DEBUG: script.module.osmcsetting.updates : - blurp 453 - Home.xml

and when I press the TV remote standy button:

14:57:30 364.349854 T:2927060000 DEBUG: Previous line repeats 1 times.
14:57:30 364.351685 T:2927060000 DEBUG: PushCecKeypress - received key c4 duration 0 (rep:0 size:0)
14:57:30 364.353485 T:2927060000 DEBUG: PushCecKeypress - added key c4
14:57:30 364.361145 T:3024867888 DEBUG: OnKey: rewind (0xc4) pressed, action is ShutDown()
14:57:30 364.505005 T:3024867888 DEBUG: ------ Window Init (DialogBusy.xml) ------
14:57:30 364.505676 T:3024867888 DEBUG: CAnnouncementManager - Announcement: OnQuit from xbmc
14:57:30 364.506073 T:3024867888 DEBUG: GOT ANNOUNCEMENT, type: 8, from xbmc, message OnQuit
14:57:30 364.507751 T:3024867888 NOTICE: stop all
14:57:30 364.509369 T:3024867888 NOTICE: stop player
14:57:30 364.511353 T:3024867888 INFO: stopping PVRManager
14:57:30 364.514038 T:3024867888 DEBUG: NetworkMessage - Signaling network services to stop
14:57:30 364.515991 T:3024867888 NOTICE: ES: Stopping event server
14:57:30 364.516693 T:3024867888 DEBUG: NetworkMessage - Waiting for network services to stop
14:57:30 364.521545 T:3024867888 NOTICE: stopping upnp
14:57:30 364.530426 T:2927060000 DEBUG: PushCecKeypress - received key c4 duration 180 (rep:0 size:0)
14:57:30 364.535461 T:2927060000 DEBUG: PushCecKeypress - ignored key c4
Connection to 192.168.1.86 closed by remote host.

I’m guessing ‘stop all’ is the offending command?

After rebooting, the old log is here: http://paste.osmc.io/idupuparav

but I have no idea where to start looking for the problem in that little lot!

Cheers

Paul

How are you powering the PI?
Powering from the USB of TV might well cause the behaviour you describe.

Thanks for the idea but it’s powered directly from the mains (I have a un-powered usb hard drive attached and a wireless connection via a usb hub). This set up worked perfectly beforehand, it’s only since I’ve connected it to this particular tv that the issue has arisen.

I am not the expert here, but it might be possible that you just remap the CEC key. Hope someone else will read this.

Yes, the TV is apparently sending the power key to Kodi which triggers a shutdown.

You could disable that by remapping the power function to a noop in a custom remote.xml

Thanks for the replies each. Can you point me to instructions for remapping keys? I found a post here about changing .kodi/userdata/keymaps.xml (I think that was the file, although it didn’t exist on my system) but I couldn’t quite follow the the instructions anyway.

Many thanks

Paul

That isn’t quite the location - you want ~/.kodi/userdata/keymaps/ and then a file in that folder named something like keyboard.xml or remote.xml (probably the latter, as DBM says).
There are bits in the Kodi Wiki about remapping, and there is also an addon (which I haven’t used).
I feel unqualified to expand, as I don’t use CEC at all.
Derek

Probably not the same Toshiba model but might have similar ability …
see page 40 (printed page number) for setting in TV to enable/disable auto-standby.
I suspect that setting this to Off will stop TV sending the Power Off signal as remote key press via CEC.

http://tv.toshiba.com/media/Toshiba_40L310U_15-0048_WEB_V1_ENG_Final_lr.pdf

@paulwebster: thanks Paul but the toshiba tv worked fine - the one with the problem is a different make (‘Logik’).

@dandnsmith: the path I gave was from memory, I was actually using the path you specified. I’ve installed the add-on and my guess is that I need to re-map the ‘rewind’ button, as fzinken mentioned further up the thread, as the log contains:

OnKey: rewind (0xc4) pressed, action is ShutDown()

However, when I go to the ‘Navigation’ section of the Keymap Editor I seem to be unable to change the default value for rewind, ‘b’, to anything else!

Looking at the wiki page ( http://kodi.wiki/view/Keymap ) I’m not sure if I can manually create a remote.xml file with just a single key defined - if that’s possible I suppose I need something like :

<keymap>
  <global>
    <remote>
      <rewind></rewind>
    </remote>
  </global>
</keymap>

Any help with that much appreciated! :smiley:

Possibly your code, with noop as DBM suggested (and I’ve seen used elsewhere) will do it - worth a try

<rewind>noop</rewind>

Derek

No, that doesn’t work :frowning: There’s nothing more I can see in the OSMC or TV menus that can be changed… I wonder if trying a different ‘universal’ remote would help? Other than up it looks like I’ll have to admit defeat.

Try this as a remote.xml in /home/osmc/.kodi/userdata/keymaps/

<keymap>
  <global>
    <remote>
      <power>noop</power>
    </remote>
  </global>
</keymap>

@DBMandrake : That works!

Thanks to you and everyone else for helping out :smiley:
Paul