#HDMI-CEC TV Controller

59 messages ยท Page 1 of 1 (latest)

gilded swift
#

I finished this project today. Fairly straightforward.
It can control the TV and connected devices using the HDMI-CEC protocol. I mainly just use it to turn the TV on/off and switch the input source.
Attached the schematic and the config as well in case anyone wants to try it.

ionic ibex
#

what ESP board do you use?

#

Also, what's your TV type?

gilded swift
#

esp-12f (it has a ESP8266), it's pretty cheap. My TV is a 10yo Samsung.

velvet dune
#

oh, that is big...and esp8266 ๐Ÿšฎ but need to test that component if it works with esp-idf - it is supported. I totally forgod that I already added it to my cec dongle config, just the device is still somwehere on my electronics workbench ๐Ÿ˜„

dusk basalt
#

Compiled for the Tuya CB3S module. I will definitely be testing it on several LG TVs as soon as I can get my hands on an HDMI connector. Thank you! ๐Ÿ™‚

HARDWARE: BK7231N 120MHz, 256KB RAM, 1.03MB Flash
FIRMWARE: ESPHome 2024.8.3 (board: cb3s; framework: arduino; platform: libretiny @ 1.5.1)
RAM: [==== ] 36.1% (used 94548 bytes from 262144 bytes)
Flash: [======= ] 74.7% (used 809576 bytes from 1083136 bytes)

summer vapor
#

ooh I have a prebuilt cec controller adapter for my PC, but diy is intruiging ๐Ÿค”

gilded swift
summer vapor
#

yeah pulse eight

gilded swift
#

yeah I came across that but suspected that the wiring might be somewhat cumbersome for my setup. Do I understand correctly that you plug the USB to you PC, then connect the device to your TV with HDMI, and also connect your PC itself to your TV with another HDMI?

summer vapor
#

the HDMI video signal is passed through, so it's PC --HDMI--> adapter --HDMI--> TV, as well as a PC --USB--> adapter

gilded swift
#

ah so it has two HDMI, that makes sense ๐Ÿ˜†

summer vapor
#

yep!

autumn wind
#

I think it should work in an extra port without a video passthrough. 4K 120Hz HDR can't be passed though it anyway, or is it?

gilded swift
#

The on I put together does not have an input, and I use it precisely that way, in an extra HDMI input of the TV. I would expect the pulse eight to be able to work in the same way but I can't tell for sure.

valid pine
#

Hi, can you tell me, I have a toshiba soundbar, how do I choose the input and signals for it?

sullen heart
#

would this work if I just took an HDMI cable, cut one end off it, and used just pins 13 & 17 (gnd & CEC) ?
I'm wondering if I can power the ESP right from the 5v pin on the HDMI port, so it may be possible to make a very small board with just an esp and HDMI port and make a very small dongle for this.

velvet dune
#

it can be even smaller - just search for a picture of my device which I posted a long time ago. The only issue is that many devices are not providing power in sleep mode, so this is the season why I am not using it (ext power is an ugly solution)

gilded swift
gilded swift
#

Additionally I also used a raspberry pi and some command line hdmi cec utility to display the commands coming from the tv

valid pine
valid pine
gilded swift
#

I also used the cec-ctl utility to sniff traffic:

-M, โ€‰--monitor-all
Start monitoring all CEC traffic. This will monitor all CEC messages, including directed messages between other CEC devices. This option requires root. Not all CEC devices support this monitoring mode. It will fallback to regular monitoring mode if it is not supported.

(source: https://wiki.archlinux.org/title/HDMI-CEC#CEC_traffic_monitoring)

#

You can probably install it with sudo apt install v4l-utils

#

once you run the monitor, you just try to do stuff with your TV remote or whatever and see the commands you get, then you try to replicate it.

#

But you'll probably need to spend some time to understand what the hdmi-cec protocol looks like and how to craft messages by hand.

sullen heart
velvet dune
#

@sullen heart #show-off-archive message

sullen heart
summer vapor
#

FWIW, I still wanted to be able to use the HDMI port mine is plugged in to (and some TVs will only listen to certain commands if that input is selected, although that seems to be rare) so I picked up these passthrough breakout boards (in my case, female to female) so I can plug it in to something actually outputting video, but control and receive commands from the TV
https://www.aliexpress.com/item/3256804916438745.html

fossil lark
#

I'm intrigued by these breakout boards. I have an old sony tv that I spent far to much time on automating with an IR. Given that it works and given that I have no other particular use case if I wanted to build one of these devices to, say, turn on a computer monitor would I buy "male-to-male" breakout and wire that into an esp?

summer vapor
#

Are you sure that the tv/display supports CEC? Not all of them do, and even those that do don't necessarily support all commands (i.e. some don't support power, or changing inputs, etc.)

fossil lark
#

Interesting point.

#

I see no mention of this in the old sony tv manual but sony often renames things. They talk about "bravia Sync". I'll have to check the manual for the other equipment I'm interested in.

fossil lark
#

But let's say that the destination equipment supports it. I'm assuing that you'd want the controller device to plug directly into the back so a male-to-make is the best bet to experiment with?

#

I've always been very annoyed that my new-ish roku smart tv refuses to turn on my ancient xbox one but every time I try to investigate this I give up in disbelief.

summer vapor
#

I personally prefer female-to-female, because it lets you use two HDMI cables (of varying lengths, if you like) which lets you position the breakout and input device more flexibly. If you go with male-to-male, you'll either need to plug it directly into the display (which might not be possible depending on the position of the port) and would require an HDMI extension cable (male-to-female) or adapter (female-to-female) which exist, but are more expensive than just a normal HDMI cable (male-to-male).

fossil lark
#

Ah, ok, thanks for the advice.

opaque hornet
#

is the esp talking hdmi-cec to the hdmi port? the hdmi port module is just a dumb breakout correct?

clear cliff
#

yes

opaque hornet
#

So that would use up an hdmi port on the tv?

clear cliff
#

You might be able to put this inline, but probably.

opaque hornet
#

So I guess for samsung wise better to use exlink but this would be more universal.

summer vapor
#

You can do it inline with one of the passthrough breakouts like the one I linkd

opaque hornet
summer vapor
#

CEC uses its own pin and all of the devices share it, there's a protocol to (at least attempt to) make them not talk over each other

opaque hornet
#

So it's kind of like an i2c bus you can attach multiple devices to it without causing issues?

summer vapor
#

I'd say it's more like 1-Wire since there isn't a separate clock line, but yeah similar idea

spice pagoda
summer vapor
spice pagoda
#

I haven't touched it in a while but it still works for me!

#

I use it to pretend to be an HDMI ARC device and instead send IR signals to my soundbar when my TV tries to set volume over HDMI

sullen heart
#

I got an HDMI breakout and connected built one, technically it is working, I can turn the TV off, and switch input to HDMI1,2,3 but cant switch it to DisplayPort (which is a shame, as that's the main use!), but the TV is ignoring the 'turn on' signal, which is sort of the important one!
I'm pleased to have got this close, and I'll probably lose interest in it for a little while now, but I'll certainly come back to it if EspHome gets native support for it.
My TV is likely just not following the protocol properly anyway. It's a fun and easy project and I recommend it.

summer vapor
#

Go through your TV settings. Mine had a separate one for turning general CEC stuff on/off, and a separate setting for enabling the CEC power controls

gilded swift