Detecting HDMI TV on/off status for RPI 2b Raspbian

RG> # apt-cache search libcec RG> libcec-dev - USB CEC Adaptor communication Library (development files) RG> libcec2 - USB CEC Adaptor communication Library (shared library) RG> libcec3 - USB CEC Adaptor communication Library (shared library)

These are the libaries used by various programs like cec-client

RG> I tried # apt-get install cec-client RG> but this gives: RG> E: Unable to locate package cec-client

sudo apt-cache search cec-client

No results (Raspbian Wheezy)

$ sudo apt-cache search cec-utils cec-utils - USB CEC Adaptor communication Library (utility programs)

so

sudo apt-get install cec-utils

Should cover it....

RG> So can anyone give me an outline of how I can use the packages in the RG> repository to install cec-client. Also which library 2 or 3? (I am using RG> minibian i.e. a minimal Raspbian 8 Jessie)

For FYI...

formatting link

Don't know about later versions...

BUT possibly

sudo apt-get install cec-utils

formatting link

Reply to
rick christian
Loading thread data ...

I am using RPi 2b to display an unattended continuous slideshow on a TV. If someone switches the TV off and on again later, if comes on with the show is still playing. But if it reboots when the TV is off, switching the TV on shows no HDMI signal being received. I want to reboot regularly using cron but only if the TV is on.

It seems there is an application cec-client which can detect the TV on/off status, but the only instructions I can find suggest you have to download from github and compile the source. However this command indicates libcec is in the repository # apt-cache search libcec libcec-dev - USB CEC Adaptor communication Library (development files) libcec2 - USB CEC Adaptor communication Library (shared library) libcec3 - USB CEC Adaptor communication Library (shared library)

I tried # apt-get install cec-client but this gives: E: Unable to locate package cec-client

So can anyone give me an outline of how I can use the packages in the repository to install cec-client. Also which library 2 or 3? (I am using minibian i.e. a minimal Raspbian 8 Jessie)

Reply to
Russell Gadd

What about putting

hdmi_force_hotplug=1

into /boot/config.txt? That will ignore the state of the tellie when booting.

--
Mike Fleming
Reply to
Mike Fleming

I recommend making sure the Pi always comes up with the right settings, whenever rebooted, rather than trying to restrict the reboots. Here are the relevant bits from my Pi's /boot/config.txt which is connected to a standard HD TV.

# Use 16M colours rather than 64K framebuffer_depth=32 framebuffer_ignore_alpha=1

# uncomment if hdmi display is not detected and composite is being output hdmi_force_hotplug=1 hdmi_force_edid_audio=1

# uncomment to force a specific HDMI mode (2,0x44=1920x1200 1,16=1080p60) hdmi_group=1 hdmi_mode=16

# uncomment to force a HDMI mode rather than DVI. This can make audio work in # DMT (computer monitor) modes hdmi_drive=2

# uncomment to increase signal to HDMI, if you have interference, blanking, or # no display config_hdmi_boost=4

---druck

Reply to
druck

All good replies thanks folks. I was unaware of the config setting which in my situation is clearly better than trying to detect the TV state. So I'm going to use the "hdmi_force_hotplug=1" line in /boot/config.txt.

Reply to
Russell Gadd

That will make it use HDMI, but you'll get a low resolution mode (VGA?) if the TV isn't on when it reboots as it can't read the supported resolutions. To make it always use full HD, you'll also need:-

hdmi_group=1 hdmi_mode=16

---druck

Reply to
druck

A quick sample of two TV says 100% have usb ports. What about powering off the TV (booting read only) or sensing the 5V line on the TV's usb?

r^2

Reply to
colonel_hack

This is probably the only solution that will work for you anyway. I suspect your TV does not support CEC as mine will switch on if the pi boots whilst it is off

--
Well, enough clowning around.  Perl is, in intent, a cleaned up and 
summarized version of that wonderful semi-natural language known as 
"Unix". 
             -- Larry Wall in
Reply to
alister

Yes, I discovered this today and implemented exactly what you suggest. All works fine now.

Reply to
Russell Gadd

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.