jpie
Posts: 5
Joined: Fri Feb 26, 2016 8:01 pm

Turn on TV

Fri Feb 26, 2016 8:19 pm

I'm setting up a program called TwoToneDetect which captures the A/B pager tones for the fire department and it can do different things once triggered.

One of the things I want to do is have it turn on a TV.

I'm honestly not sure where to start. I'm vaguely familiar with Pi/Linux (sudo, apt-get, basic commands) but otherwise I'm lost.

Anyone got some pointers or links to someone who may already have a script to turn a tv on some how? I'm not 100% sure that the TV we'll be using supports CEC, the TV obviously has IR and it also has the Samsung Ext "serial" port on the back.

Let me know if I can provide more info. Any help is appreciated.

jpie
Posts: 5
Joined: Fri Feb 26, 2016 8:01 pm

Re: Turn on TV

Sat Feb 27, 2016 12:20 am

I've now learned of the "tvservice".

I started reading around and I tried the "tvservice -s" and it's only saying "DVI DMT", nothing about HDMI.

pi@raspberrypi:~ $ tvservice -s

state 0x120006 [DVI DMT (81) RGB full 16:9], 1366x768 @ 60.00Hz, progressive

I'm using a new HDMI cable, no adapters. Thoughts?

User avatar
GTR2Fan
Posts: 1601
Joined: Sun Feb 23, 2014 9:20 pm
Location: South East UK

Re: Turn on TV

Sat Feb 27, 2016 12:42 am

I don't know whether this works for a TV or not, but typing vcgencmd display_power 1 in a terminal wakes my monitor up, and typing vcgencmd display_power 0 puts it to sleep.

The reason I've given those in reverse order is so that you can use the keyboard up-arrow followed by Enter to call the turn on command again blind or you'll be stuck with having to reboot the Pi to wake the display up. :D

Both work exactly as expected from inside a BASH script, so I'm fairly sure they will be accessible via other programming languages too.
Pi2B Mini-PC/Media Centre: ARM=1GHz (+3), Core=500MHz, v3d=500MHz, h264=333MHz, RAM=DDR2-1200 (+6/+4/+4+schmoo). Sandisk Ultra HC-I 32GB microSD card on '50=100' OCed slot (42MB/s read) running Raspbian/KODI16, Seagate 3.5" 1.5TB HDD mass storage.

jpie
Posts: 5
Joined: Fri Feb 26, 2016 8:01 pm

Re: Turn on TV

Sat Feb 27, 2016 12:50 am

Unfortunately it worked but didn't. It will sleep the screen but it won't "wake" it from a full off position. I've seen some TV's (Sharps) that can go into a light sleep (standby?) but I don't think this TV does that.

rzusman
Posts: 347
Joined: Fri Jan 01, 2016 10:27 pm

Re: Turn on TV

Sat Feb 27, 2016 3:54 am

I use lirc to send IR commands to turn my Vizio TV on and off.

jpie
Posts: 5
Joined: Fri Feb 26, 2016 8:01 pm

Re: Turn on TV

Sun Feb 28, 2016 1:44 am

What do you use for an IR blaster then?

rzusman
Posts: 347
Joined: Fri Jan 01, 2016 10:27 pm

Re: Turn on TV

Sun Feb 28, 2016 2:09 am

I don’t - an IR led is easily bright enough to turn on the TV from where I have the Pi located.
It’s very easy to make a super-bright IR emitter. Just use a number of IR LEDs in parallel, driven by a MOSFET.

jpie
Posts: 5
Joined: Fri Feb 26, 2016 8:01 pm

Re: Turn on TV

Sun Feb 28, 2016 4:22 pm

I'd really like to get this "tvservice" command to work if I can, nothing extra to add if it can work.

When I run any power on command it essentially blanks out the screen and the TV sees no input. Have to figure out what it's doing when it does that.

Return to “Automation, sensing and robotics”