Alternative Samsung TV Plugin

Posted on
Wed Aug 02, 2017 10:42 pm
jon offline
Posts: 40
Joined: Jul 27, 2017

Alternative Samsung TV Plugin

There's already a Samsung TV plugin available that's been getting some attention in the forum. Unfortunately, the controls I most wanted for my TV were power on/off and direct input selection so IP control wasn't really a good solution for me. Luckily my TV has an Ex-Link port so I hooked up my serial port server and started hacking. The Ex-Link protocol has reasonably thorough crowdsourced documentation available online so once I got a few commands working it was off to the races.

There are still a few rough edges, but I think the plugin's "done enough" for anyone interested to kick the tires and see how well it works for them. Let me know if it works for you, or if you see any problems. Find the latest plugin package here.. You can find known issues (or submit new ones) in the tracker.

While this should work equally well on old or new sets so long as they have an Ex-Link port, newer TVs probably have options and key codes that this plugin isn't aware of.

Some TVs have a "secret handshake" to enable ex-link control on a service port. If you have a 3.5mm port (looks like headset jack), Google your model number and "Ex-Link" to see if it can be enabled. On my plasma, the port was labelled Ex-Link and worked out of the box with this cable.

The Ex-Link plugin supports querying the following states from the TV:
  • Power (boolean)
  • Active Input (TV / HDMI1 / SmartHub / etc)
  • Current Volume (integer)
  • Current Channel (integer)
  • Current Mute State (boolean)
  • Picture Mode (Dynamic / Standard / etc)
  • Sound Mode (Music / Movie / etc)
  • Picture Size (Zoom / Wide Fit / etc)

Besides sending key events, the Ex-Link plugin supports directly setting the following configuration options on TVs that support them:
  • Input
  • Volume
  • Channel
  • Picture Mode
  • Picture Size
  • Sound Mode
  • Backlight Level
  • Contrast Level
  • Brightness
  • Sharpness
  • Color
  • Tint
  • Black Tone
  • Dynamic Contrast
  • RGB-Only Mode
  • Color Space
  • Edge Enhancement
  • xvYCC
  • Motion Lighting
  • LED Motion Plus
  • Color Tone
  • Digital Noise Filter
  • MPEG Noise Filter
  • HDMI Black Level
  • Film Mode
  • Auto-Motion Plus
  • Shadow Detail
  • Gamma
  • White Balance (RGB offsets and gains)
  • SRS Surround
  • SRS Dialog
  • MTS (mono/stereo/SAP)
  • Auto-Volume
  • Select Speakers (internal/external)
  • Balance
  • Graphic EQ 100Hz/300Hz/1Khz/3Khz/10Khz
  • 3D Mode
  • 3D->2D
  • 3D Auto-View
  • 3D Viewpoint
  • 3D Depth
  • 3D Picture Correction
  • TV Mode Antenna/Cable
  • Language

Posted on
Thu Aug 03, 2017 5:53 am
Japple55 offline
Posts: 224
Joined: Sep 26, 2015
Location: NE Tennessee

Re: Alternative Samsung TV Plugin

Interesting, though I'm not sure what a serial port server is. Is that just a Serial to Ethernet device like this?
https://www.newegg.com/Product/Product. ... lsrc=aw.ds

Posted on
Thu Aug 03, 2017 5:56 am
siclark offline
Posts: 1960
Joined: Jun 13, 2017
Location: UK

Re: Alternative Samsung TV Plugin

This sounds great... I haven't used the existing plugin for the same reason you state, it doesn't do power. How do you connect the 3.5mm to serial cable to your mac? Are they next to each other? Mine are in 2 different rooms.

Posted on
Thu Aug 03, 2017 9:21 am
jay (support) offline
Site Admin
User avatar
Posts: 18200
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Alternative Samsung TV Plugin

Awesome!

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Thu Aug 03, 2017 9:30 am
jon offline
Posts: 40
Joined: Jul 27, 2017

Re: Alternative Samsung TV Plugin

Yes, that's it in a nutshell. The one I'm using is discontinued but I don't think they vary much in principle. The PySerial serial port layer used by Indigo supports direct connection (which includes USB and Bluetooth), raw socket TCP/IP, or RFC2217 IP serial port redirection. Most ethernet device servers I've looked at support both the latter. By default your TV should be set for 9600bps, 8-N-1, software flow control. Some of them support increasing the link speed via service commands but I've never messed with that. 9600bps is plenty fast for these small commands.

You could also use a Bluetooth serial adapter. I've never tried this but it's also pretty mature technology. In theory it'd be more secure than IP, because your typical ethernet serial device server doesn't have much in the way of authentication. With Bluetooth you'd have the usual BT pairing process to prevent unauthorized access.

Depending on your layout a USB Extender with a USB serial adapter might also do the trick.

Posted on
Thu Aug 03, 2017 10:11 am
siclark offline
Posts: 1960
Joined: Jun 13, 2017
Location: UK

Re: Alternative Samsung TV Plugin

Wow. That's an expensive device.
I've been looking at ser2net on the pi. A headphone cable plugged into the TV and then cut and joined onto the GPIO pounds running ser2net on a PiZero would be a cheaper way to do it if it would work?

Posted on
Thu Aug 03, 2017 10:54 am
jon offline
Posts: 40
Joined: Jul 27, 2017

Re: Alternative Samsung TV Plugin

Despite the funny connector, Ex-Link is RS232, which is +/-12V. You do not want to connect it directly to GPIOs on your Pi.

You could use an RS232 level shifter to build your own adapter for a Pi, but that's not saving much over a USB serial adapter. It comes down do how much tinkering you feel like doing.

Posted on
Thu Aug 03, 2017 10:57 am
siclark offline
Posts: 1960
Joined: Jun 13, 2017
Location: UK

Re: Alternative Samsung TV Plugin

Ok thanks. But 3.5mm to serial cable into the serial to USB cable into pi works. That's still $20 rather than $80.

Posted on
Thu Aug 03, 2017 11:14 am
roussell offline
User avatar
Posts: 1108
Joined: Aug 18, 2008
Location: Alabama

Re: Alternative Samsung TV Plugin

I've used this: http://www.mouser.com/Search/m_ProductDetail.aspx?WIZnet%2fWIZ110SR%2f&qs=b%252bXOOdUOuvZH%252bm20t7cyLg%3d%3d&gclid=EAIaIQobChMIz6PNuMa71QIVg4izCh2xwgcXEAQYASABEgL-6_D_BwE

several times through the years on Linux and Windows computers to extend all sorts of RS232 devices. Never had a problem with them, but I don't know if they work with pyserial...

Terry


Sent from my iPhone using Tapatalk

Posted on
Thu Aug 03, 2017 11:19 am
jon offline
Posts: 40
Joined: Jul 27, 2017

Re: Alternative Samsung TV Plugin

$20 plus a pi and power supply :)

Posted on
Thu Aug 03, 2017 11:24 am
jon offline
Posts: 40
Joined: Jul 27, 2017

Re: Alternative Samsung TV Plugin

Looks like that WIZnet device should work fine with PySerial if you set it for server mode with no password. Choose "socket" in the plugin setup and enter the device's IP and port number.

Posted on
Sat Aug 05, 2017 1:44 am
agame offline
Posts: 514
Joined: Jul 13, 2017
Location: Melbourne, Australia

Re: Alternative Samsung TV Plugin

Would using this interface require CEC to be disabled ?
Would be a pain to loose auto switching to Apple TV....I guess this could be emulated though..

Posted on
Sat Aug 05, 2017 2:29 pm
jon offline
Posts: 40
Joined: Jul 27, 2017

Re: Alternative Samsung TV Plugin

I've found at least one report to that effect: https://forum.samygo.tv/viewtopic.php?t=10242

Enter the Service Menu (how is explaned in a thread on this forum) -> Options -> Sub Options
Set: RS232 Jack - UART
Set: Enable UART - ON
Leave the menu's and power off the TV with the remote.

Power on the TV in normal mode and TURN OFF Anynet+ (HDMI-CEC). As long as this is on you won't be able to control the TV.
Turn off the TV once again and turn it back on again.


This falls under the "some TVs have a secret handshake" section of the requirements. There doesn't seem to be much consistency from model to model on Ex-Link activation details like that. I'd suggest trying it with Anynet+ enabled and see what happens.

I don't have any HDMI-CEC devices to test with, so I can't share any direct experience on the topic.

Posted on
Tue Jan 23, 2018 12:23 pm
Swancoat offline
Posts: 503
Joined: Nov 20, 2009
Location: Houston

Re: Alternative Samsung TV Plugin

Found this...

https://www.dropbox.com/s/ht3vp4tr943e1 ... .xlsx?dl=0

I hope it's useful for you.

I haven't downloaded this plugin yet (just ordered an exlink cable) but it looks great. I'm interested in PIP control (which is why I went hunting around for this thing). It'd be nice if the TVs would automatically report status changes though.

http://nerdhome.jimdo.com

Posted on
Mon Jan 29, 2018 9:53 pm
jon offline
Posts: 40
Joined: Jul 27, 2017

Re: Alternative Samsung TV Plugin

That looks like basically the same spreadsheet I got most of the commands from. You should find everything above the "duplicate/untested" line available in the plugin already.

I didn't experiment with any of the untested PIP commands because PIP on my TV is stupid (only works with the tuner).

If you are able to add and verify any of the PIP commands, please send me your changes and I'll include them in the next release. Sorry the plugin architecture is a little... odd. It's both my first plugin and first python project. I'd do it differently now, but seems a waste to rewrite at this point.

Who is online

Users browsing this forum: No registered users and 11 guests