Skip to main content

Samsung TV (Serial-over-IP)

Samsung consumer and Frame TVs expose a hidden RS-232 service port that accepts Samsung's hex-framed serial control protocol. This driver reaches that port over the network by carrying the serial line through a serial-to-IP adapter (a Global Caché iTach IP2SL, a Brainboxes ES/SW box, a MOXA NPort, or any TCP↔serial gateway). One TV becomes one GEM device, and commands target that device directly — this driver creates no zones.

Because the service port is silent when the TV is off, this driver also talks to the TV over the network — using the set's own LAN IP — to read volume and mute back and to work out whether the panel is on. So a full install uses two addresses: the adapter's IP/port for the serial control link, and the TV's own IP for status feedback.

Which Samsung driver?

This driver is for control over the TV's RS-232 service port through a serial-to-IP adapter. Three siblings cover other cases — pick by how the set is reachable:

  • Samsung TV (Tizen WebSocket) — most networked consumer Tizen smart TVs (control over Wi-Fi/LAN, on-screen pairing).
  • Samsung TV (Pro / HTTPS) — newer/Pro Tizen models using the HTTPS token-pairing API on port 1516.
  • Samsung MDC — Samsung commercial/signage displays that speak the MDC protocol (a different serial/LAN command set, with Display ID addressing).

Reach for this driver when the set is a consumer/Frame TV with no working network control API and you are wiring its service port to a serial gateway.

What's controlled

  • Power — on and off, with a power-state query. Because the serial port goes quiet when the TV is off, GEM infers power (see How GEM knows the TV is on).
  • Volume and mute — set an absolute volume level 0–100, step it up/down, and mute. Mute has a native toggle; discrete mute-on / mute-off are handled with a state check (see below).
  • Inputs — jump straight to HDMI 1–4 or to the tuner.
  • Channels — direct channel entry (analog or digital), channel up/down, last channel, and the numeric keypad 09.
  • Navigation and keys — the directional pad, enter, menu, guide, exit, info, and back.
  • Art Mode — turn The Frame's Art Mode on or off.
  • Live status feedback — GEM polls the TV and reports whether it's on, its current volume, and its mute state, so a touchpanel and triggers stay in sync.

Prerequisites

  • A TTL/RS-232 serial adapter wired to the TV's service port and exposed over TCP. Samsung's service port runs at TTL logic levels, not standard RS-232 voltages — a plain RS-232 gateway may need a level shifter in between, or the link will look dead. Note the gateway's LAN-side IP and TCP port (for example port 4999 on an iTach IP2SL).
  • The TV's own LAN IP, reachable from GEM with no NAT in between. Give the TV a static IP or a DHCP reservation so the address never moves. GEM uses this address for volume/mute read-back and power detection over the TV's built-in service — see below.
  • The TV and GEM on the same network segment for the status link.

Setup

  1. Open Devices, add a device, and choose the Samsung TV (Serial-over-IP) driver. It suggests the AV subsystem and a tv device type — accept those.
  2. Fill in the fields:
    • Adapter IP (required) — the LAN IP of the serial-to-IP adapter that fronts the TV's service port. This is not the TV's own IP.
    • TCP Port (required) — the TCP port on that adapter mapped to the TV's serial line (e.g. 4999 on an iTach IP2SL).
    • TV IP (for Power Check) (optional but strongly recommended) — the TV's own LAN IP. Without it, GEM cannot read volume/mute back or detect a power-off (see below). Enter the attribute exactly as tv_ip.
    • Status Poll Interval (ms) (optional) — how often GEM re-queries the TV over the serial link. Defaults to 60000 (60 s). Enter the attribute exactly as status_interval.
  3. Save and enable the device. GEM opens a persistent TCP connection to the adapter and keeps it up, reconnecting automatically if the link drops.
  4. On the device's Commands tab, run get_power, then power_on / power_off to confirm control end-to-end before wiring the TV into macros or a UI.

How GEM knows the TV is on

The service port does not answer over serial when the TV is powered off, so a serial query alone can't tell "off" from "cable unplugged." GEM uses two mechanisms together, and both work best when TV IP is set:

  • Network read-back (needs tv_ip). Every few seconds GEM contacts the TV's built-in media service on the TV's own IP. If that service answers, the TV is on, and GEM reads the current volume and mute from it; if it stops answering, GEM marks the TV off. This is the reliable path, and it's also what keeps the volume and mute readouts live when someone changes them with the Samsung remote.
  • Serial heuristic. On the serial link, when GEM sees the TV report a state change it re-sends a power query; if nothing comes back within a few seconds it concludes the TV is off. It also marks the TV off if the set goes silent for three poll intervals while GEM believed it was on.

If TV IP is blank, only the serial heuristic runs — GEM can still send commands, but the power/volume/mute readouts become unreliable and may stick on the last seen value.

Volume, mute, and the TV's own speakers

  • Absolute volume. Send the volume command with a volume argument from 0 to 100. You always work in plain 0–100; GEM converts the level to the byte the Samsung frame expects.
  • Stepping. volume_up and volume_down nudge the level one step at a time.
  • Mute. mute_toggle flips mute directly. mute_on and mute_off are handled with a check: GEM first queries the current mute state, waits about 500 ms, and only sends a toggle if the state actually needs to change (so mute_on on an already-muted TV does nothing). On a slow or noisy serial link that extra query can add a small delay, and a missed reply can make the discrete commands look like they flap — prefer mute_toggle, or raise the command gap, if that happens.

If the room's audio comes out of the TV's own speakers, make this TV the AV zone's volume device: open AV Zones, edit the zone, and set the Volume Device field ("Device that controls volume for this zone") to this TV. The zone's volume slider and mute button then route to the TV. If the room audio instead comes from a receiver, amp, or soundbar, leave that device as the zone's Volume Device and set the TV's own audio output away from its speakers, so you aren't fighting two volume controls at once.

Inputs and channels

  • Inputs. hdmi_1 through hdmi_4 jump to those HDMI inputs; tuner switches to the TV tuner. There is no on-screen "source list" command on this driver — use the specific input commands.
  • Direct channel entry. channel takes three arguments: tuner (atv for analog or dtv for digital), major (the channel number), and minor (the sub-channel, 0 when there isn't one). GEM applies the encoding Samsung's frame requires — you supply plain channel numbers.
  • Channel stepping. channel_up, channel_down, and previous_channel (jump back to the last channel).
  • Keypad. The digit commands 09 send the numeric remote keys, and guide opens the program guide.
Input is not reported back

GEM queries the current input as part of status polling, but this driver does not store or report a "current input / source" value — only power, volume, and mute are surfaced as live attributes. Drive input selection with the input commands rather than reading a current-input attribute.

  • Navigation. up, down, left, right, enter, menu, guide, exit, info, and back map to the matching remote keys — useful for driving on-screen menus from a touchpanel.
  • Art Mode (The Frame). art_mode_on and art_mode_off toggle The Frame's Art Mode.

Sending a raw frame

For anything the named commands don't cover, passthrough takes a single command argument and sends it to the TV verbatim — supply the exact space-delimited hex bytes for the Samsung frame you want (see the wire strings in the command tables for the format). Use this only when you have Samsung's RS-232 reference in hand; a malformed frame is simply ignored by the set.

Attributes

tv_ip and status_interval are specific to this driver and are not offered in the attribute autocomplete list — type them exactly as shown when you add them. The live status attributes (power_state, volume, mute_state) are standard device attributes GEM sets automatically; you don't create them by hand, but type them exactly when you reference them in a trigger or macro.

Device — required

AttributeTypeDescription
ipstringLAN IP of the serial-to-IP adapter that fronts the TV's service port (not the TV's own IP).
portintTCP port on that adapter mapped to the TV serial line (e.g. 4999 on an iTach IP2SL).

Device — optional

AttributeTypeDefaultDescription
tv_ipstringThe TV's own LAN IP. Enables network read-back of volume/mute and power detection. Leave blank only if the TV isn't on the LAN.
status_intervalint60000How often (ms) GEM re-queries the TV over the serial link.

The driver also inherits the standard TCP tuning fields (reconnect timing, command_throttle, etc.); the defaults suit a TV on a gateway, so leave them alone unless a slow adapter is dropping back-to-back commands, in which case raise command_throttle (default 200 ms).

Device — status (set automatically)

AttributeTypeDescription
power_statestringon / off.
volumeintCurrent volume 0–100.
mute_statestringon / off.

Commands

Driver-declared commands appear on the device's Commands tab and can be used in macros, triggers, and on UI buttons. The Sends column is the raw Samsung serial frame (hex), shown so you can match it against Samsung's RS-232 control reference; GEM appends the checksum byte automatically where a frame ends in one.

Power

CommandSendsAction
power_on08 22 00 00 00 02 D4Turn the TV on.
power_off08 22 00 00 00 01 D5Turn the TV off.
get_power08 22 F0 00 00 00 E6Query the current power state.

Volume and mute

CommandSendsAction
volume (arg volume)08 22 01 00 00 [volume] [checksum]Set absolute volume; volume is 0–100.
volume_up08 22 01 00 01 00 D4Step volume up.
volume_down08 22 01 00 02 00 D3Step volume down.
get_volume08 22 f0 01 00 00 E5Query the current volume.
mute_toggle08 22 02 00 00 00 D4Toggle mute directly.
mute_onMute (checks current state first, then toggles if needed).
mute_offUnmute (checks current state first, then toggles if needed).
get_mute08 22 F0 02 00 00 E4Query the current mute state.

Inputs and channels

CommandSendsAction
hdmi_1hdmi_408 22 0a 00 05 00…03 …Jump to HDMI input 1–4.
tuner08 22 0a 00 00 00 CCSwitch to the TV tuner.
get_input08 22 f0 04 00 00 E2Query the current input.
channel (args tuner, major, minor)08 22 04 [tuner] [major] [minor] [checksum]Tune a channel; tuner = atv or dtv.
channel_up / channel_down08 22 03 00 01/02 00 …Tuner channel up / down.
previous_channel08 22 0d 00 00 13 B6Jump to the last channel.
get_channel08 22 f0 03 00 00 E3Query the current channel.
0908 22 0d 00 00 … …Numeric keypad digits.
guide08 22 0d 00 00 4F 7AOpen the program guide.
CommandSendsAction
up down left right08 22 0D 00 00 60/61/65/62 …Directional pad.
enter08 22 0D 00 00 68 61Select.
menu08 22 0D 00 00 1A AFOpen the menu.
exit08 22 0D 00 00 2D 9CExit / close.
info08 22 0D 00 00 1F AAShow the info banner.
back08 22 0D 00 00 58 71Back / return.

Art Mode and advanced

CommandSendsAction
art_mode_on / art_mode_off08 22 0B 0B 0E 01/00 …Turn The Frame's Art Mode on / off.
passthrough (arg command)[command]Send a raw hex frame verbatim (see above).

Known limitations and quirks

  • The TV is silent on serial when off. Power state is inferred, not read directly — keep TV IP set so the network read-back can confirm on/off reliably (see above).
  • Service port runs at TTL levels. A true RS-232 gateway may need a level shifter, or the link won't work. If there's no serial response at all, suspect wiring/levels first.
  • mute_on / mute_off add a short delay. They query mute state and wait ~500 ms before toggling; use mute_toggle for a direct, immediate mute flip.
  • Input isn't reported. Only power, volume, and mute are surfaced as live attributes; there's no current-input read-back.
  • Single device, no zones. A Samsung TV is one GEM device; it creates no zones. Group rooms and multi-room behavior at the AV-zone / macro layer.

Troubleshooting

SymptomCheck
Power state stuck on the last valueSet TV IP to the TV's own LAN IP (not the serial adapter). Without it, GEM can't read power/volume/mute back over the network.
No serial responses at allConfirm the adapter's baud/framing matches the TV, and remember the service port is TTL — a level shifter may be needed for a true RS-232 gateway. Confirm Adapter IP and TCP Port point at the serial line, not the TV.
mute_on / mute_off seem to flapThese query get_mute first, then blind-toggle after ~500 ms if no clear reply; a slow or noisy link makes them unreliable. Use mute_toggle, or raise command_throttle.
Volume slider does nothingConfirm the TV's own speakers are the audio path and this TV is set as the zone's Volume Device; if the room uses a receiver/amp, that device should be the Volume Device instead.
Link keeps dropping / reconnectingVerify only GEM is connected to that gateway port — many serial gateways allow a single TCP client at a time, so a second controller or a stuck session will fight GEM for the port.
Volume/power readout never reflects the remoteConfirm TV IP is set and reachable; the live read-back is what catches changes made from the Samsung remote.

See also