Raspbmc CEC Reconnect

  Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
lmrdaddy Offline
Junior Member
Posts: 8
Joined: Jul 2014
Reputation: 0
Post: #1
Hi,
I am running the latest Raspbmc and I am using my (Toshiba) TV's remote to control XBMC via CEC. This is working fine until I turn off the TV. If I turn the TV back on the CEC connection is lost, which is probably (just guessing) the TV's fault. If I start cec-client on the Pi I can see the TV going from "Standby" to "On", but controlling XBMC does not work until I change one of the settings (doesn't matter which one) of the CEC adapter in XBMC. So the question is: is there anything I can do to automatically reconfigure/reinitialize the CEC adapter once the TV is turned on. If not: is there a way to do this via a script, maybe using the HTTP-API?

Cheers,
lmrdaddy
find quote
ActionA Online
Member
Posts: 61
Joined: Oct 2013
Reputation: 2
Post: #2
There is a much simpler way that should keep the pi aware of what it is connected to and it's capabilities.

Quote:sudo tvservice -d /boot/edid.dat

and add:
hdmi_edid_file=1
hdmi_force_hotplug=1

http://forum.stmlabs.com/showthread.php?...2#pid57862
find quote
dandnsmith Offline
Senior Member
Posts: 253
Joined: May 2013
Reputation: 1
Location: Berks, UK
Post: #3
Quote:and add:
hdmi_edid_file=1
hdmi_force_hotplug=1

Those last 2 lines are added to /boot/config.txt (in case there was any doubt)

Derek
find quote
lmrdaddy Offline
Junior Member
Posts: 8
Joined: Jul 2014
Reputation: 0
Post: #4
Thanks for the hint but I had already done that. I helped to reconnect CEC after a reboot of the Pi, but not the other way round. My suspicion is, that the TV does not "know" the Pi is still there and therefore does not send any commands.
find quote
ActionA Online
Member
Posts: 61
Joined: Oct 2013
Reputation: 2
Post: #5
Did you try unplugging the TV from it's power source for several minutes in order to give it a hard reboot of it's system? We've seen this resolve a lot of CEC issues.
find quote
lmrdaddy Offline
Junior Member
Posts: 8
Joined: Jul 2014
Reputation: 0
Post: #6
Quote:Did you try unplugging the TV from it's power source for several minutes in order to give it a hard reboot of it's system? We've seen this resolve a lot of CEC issues.

Yes, I've done this several times, I tried turning the TV completely off (unplugged it) or only going to standby, same result :-(
find quote
lmrdaddy Offline
Junior Member
Posts: 8
Joined: Jul 2014
Reputation: 0
Post: #7
Apparently the only thing that helps is reconfiguring the CEC adapter on the Pi, so back to my question: any ideas on how to this via script or HTTP requests?
find quote
lmrdaddy Offline
Junior Member
Posts: 8
Joined: Jul 2014
Reputation: 0
Post: #8
Well, just for the record, maybe someone else has the same problem: I solved by using a small Python script connecting to the Event Server and sending ACTION_EXECBUILTIN "CECActivateSource".
find quote
Milhouse Offline
Team-Kodi Member
Posts: 4,377
Joined: Jan 2011
Reputation: 96
Post: #9
Not a solution, but you might want to keep an eye on this discussion in case its related.

Texture Cache Maintenance Utility: Preload your texture cache for optimal UI performance. Remotely manage media libraries. Purge unused artwork to free up space. Find missing media. Configurable QA check to highlight metadata issues. Aid in diagnosis of library and cache related problems.
find quote
lmrdaddy Offline
Junior Member
Posts: 8
Joined: Jul 2014
Reputation: 0
Post: #10
Yep, I agree, this sounds at least similar. I will keep an eye on it, thank you.
find quote
mikkelnl Offline
Senior Member
Posts: 204
Joined: Jun 2011
Reputation: 0
Post: #11
Hi all, I have the same issue and stumbled upon this (kinda) old thread Smile

I've read quite a few topics and no 'fix' solved the issue for me: my Sony TV will control raspbmc fine via HDMI CEC until the TV is turned off/to standby. Upon restart the CEC connections seems lost. Driving me nuts.

I'd like to try this fix:

(2014-07-15 09:24)lmrdaddy Wrote:  Well, just for the record, maybe someone else has the same problem: I solved by using a small Python script connecting to the Event Server and sending ACTION_EXECBUILTIN "CECActivateSource".

But have no idea how to achieve this? Any help is appreciated Smile
find quote
mikkelnl Offline
Senior Member
Posts: 204
Joined: Jun 2011
Reputation: 0
Post: #12
Phew, I'm ready to give up Wink After spending hours trying to find out how to solve this issue (CEC lost after tv turns off/on), I tried the below suggestion, but am completely lost how to do this.

(2014-07-15 09:24)lmrdaddy Wrote:  Well, just for the record, maybe someone else has the same problem: I solved by using a small Python script connecting to the Event Server and sending ACTION_EXECBUILTIN "CECActivateSource".

It seems after spending many hours reading forums, the CEC issue is not an XBMC fault I think (tried raspbmc and xbian), I think the TV loses the CEC connection somehow.

The above mentioned 'fix' sounds logical as a workaround but again: no idea how to do that, any ideas? Or other tips to get a reliable CEC link? For the record; I have the pi powered on 24/7, so I only turn on the TV and Receiver.
find quote
lmrdaddy Offline
Junior Member
Posts: 8
Joined: Jul 2014
Reputation: 0
Post: #13
mikkelnl Wrote:I seem to have the exact same issue, and I'd like to try your fix, but have NO idea where/how to do this, could you help me? Appreciated!

Michel

Hi,

sorry for the late answer, unfortunately the notification email ended up in my Spam folder and I am not a regular user of this forum.
Let me start by saying that I am not using this method any more, I changed from using CEC to a normal IR receiver because I could never make it work really reliably. Anyway, I still have the script, here it is:

Code:
#!/usr/bin/python

import sys
sys.path.append("../../lib/python")
sys.path.append("/scripts")

from xbmcclient import *
from socket import *

def main():
    import time
    import sys

    host = "raspi"
    port = 9777
    addr = (host, port)
    sock = socket(AF_INET,SOCK_DGRAM)

    packet = PacketHELO("CECEnabler", ICON_NONE)
    packet.send(sock, addr)

    packet = PacketACTION("CECActivateSource", ACTION_EXECBUILTIN)
    packet.send(sock, addr)

    # wait for 5 seconds
    time.sleep (10)

    packet = PacketACTION("CECActivateSource", ACTION_EXECBUILTIN)
    packet.send(sock, addr)

    packet = PacketBYE()
    packet.send(sock, addr)

    return 0

if __name__=="__main__":
    main()

I hope it works for you, let me know the results.
find quote
mikkelnl Offline
Senior Member
Posts: 204
Joined: Jun 2011
Reputation: 0
Post: #14
(2014-10-16 10:38)lmrdaddy Wrote:  
mikkelnl Wrote:I seem to have the exact same issue, and I'd like to try your fix, but have NO idea where/how to do this, could you help me? Appreciated!

Michel

Hi,

sorry for the late answer, unfortunately the notification email ended up in my Spam folder and I am not a regular user of this forum.
Let me start by saying that I am not using this method any more, I changed from using CEC to a normal IR receiver because I could never make it work really reliably. Anyway, I still have the script, here it is:

Code:
#!/usr/bin/python

import sys
sys.path.append("../../lib/python")
sys.path.append("/scripts")

from xbmcclient import *
from socket import *

def main():
    import time
    import sys

    host = "raspi"
    port = 9777
    addr = (host, port)
    sock = socket(AF_INET,SOCK_DGRAM)

    packet = PacketHELO("CECEnabler", ICON_NONE)
    packet.send(sock, addr)

    packet = PacketACTION("CECActivateSource", ACTION_EXECBUILTIN)
    packet.send(sock, addr)

    # wait for 5 seconds
    time.sleep (10)

    packet = PacketACTION("CECActivateSource", ACTION_EXECBUILTIN)
    packet.send(sock, addr)

    packet = PacketBYE()
    packet.send(sock, addr)

    return 0

if __name__=="__main__":
    main()

I hope it works for you, let me know the results.

Thanks man Smile Could you please explain how to run this, and I guess you set it via a cronjob maybe? ANyway; much appreciated Smile
find quote
lmrdaddy Offline
Junior Member
Posts: 8
Joined: Jul 2014
Reputation: 0
Post: #15
You need to install xbmcclient.py from here:
https://github.com/xbmc/xbmc/blob/master...cclient.py (copy to /scripts, if you install somewhere else you need to fix the import statement).

Then you need to adjust hostname and port in the script to your system, start the script by calling
Code:
python scriptname.py

I did not run the script from cron but rather ran it via fhem (http://fhem.de) whenever the TV is turned on (done via fhem).
find quote