This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to use CEC?
#1
Greetings,

I've got Tinker Board S for testing, which is said to have CEC support. Installed fresh TinkerOS v 2.0.7 to SD card. How do I use CEC now? Is it available out of the box, or extra software & configuration is needed?

My research about CEC in Tinker Board S has brought no results, but found some general for Linux and Raspberry Pi. That led me to installing cec-utils (via sudo apt-get install cec-utils). The cec-client command works, here's more info on it:
Quote:cec-client -i
libCEC version: 4.0.2,  compiled on Sun Jan 29 09:05:02 UTC 2017 by marillat@karl.marillat.net on Linux 4.2.5-armv7-x2 (armv7l), features: P8_USB, DRM, P8_detect, randr

However, I was not able to find/detect the device I wanted to control - plugged the device to TV (LG 49LJ515V) via HDMI and double checked that the SIMPLINK (LG's CEC) is enabled. Here's how:
Quote:cec-client -l

libCEC version: 4.0.2,  compiled on Sun Jan 29 09:05:02 UTC 2017 by marillat@karl.marillat.net on Linux 4.2.5-armv7-x2 (armv7l), features: P8_USB, DRM, P8_detect, randr
Found devices: NONE
or/and:
Quote:echo "scan" | cec-client -s -d 1screen

autodetect FAILED



Background information: We have a script that turns the display on and off at given hours using DISPLAY=:0 xset dpms force on - it works on monitors and some TVs, but on the others it does not wake up the TV if it enters sleep / hibernation / standby mode (unsure the exact name; basically having no signal for some time, say 15 mins). This is where we hoped CEC would come in and help, but who knows - perhaps it would be useful also for other things.

Thanks
Reply
#2
Hi TinkerCookie,

cec-client is not working with tinkerOS for me too. But I figured how to get it work with v4l-utils.

1. Install v4l-utils
Code:
sudo apt-get install -y v4l-utils
2. Configure CEC
Code:
sudo cec-ctl --phys-addr=2.0.0.0 --playback
3. Test if everything works fine
Code:
sudo cec-compliance
4. Play with it
Code:
# Turn TV on
sudo cec-ctl --image-view-on -t0
# Turn TV off
sudo cec-ctl --standby -t0
# Simulate key pressed
sudo cec-ctl --user-control-pressed=ui-cmd="Volume Down" -t0
# Released key pressed
sudo cec-ctl --user-control-released -t0
# And way more things...

Man page of cec-ctl : https://www.mankier.com/1/cec-ctl

To find all commands use the "--help-xxxxxx" options like:
Code:
sudo cec-ctl --help-all


hope it helps.
Smile Tinker a day, tinker everyday! Smile
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)