Skip to content

Training / AVCleared Programming Specialist / Lesson 2 of 7

Device control protocols

RS-232, IR, IP (raw TCP, HTTP/REST), CEC, relays and contact closures, and reading protocol documents.

About 14 minutes

RS-232 serial

Serial control is still everywhere. You need transmit, receive and ground, and both ends must agree on settings, typically 9600 baud, 8 data bits, no parity, 1 stop bit (8N1). If transmit and receive need crossing, use a null-modem cable or adapter. If nothing comes back, check settings and wiring before blaming the device.

Infrared

IR emitters copy a remote control. It's simple, but one-way: the system can't know whether the command worked. Use discrete codes (separate "on" and "off") rather than toggles wherever possible.

IP control

  • Raw TCP (often port 23, Telnet-style) with text or binary commands.
  • HTTP/REST APIs with JSON.
  • WebSockets and vendor protocols.

Network devices may close idle connections. A good driver detects a dropped connection, reconnects, and re-reads the device's state.

CEC

HDMI-CEC can power displays on and off over the HDMI cable, but support varies by device. Treat it as a convenience, not something to depend on when better control is available.

Relays and contact closures

Relays and contact inputs handle simple jobs: screens, lifts, shades, occupancy sensors, fire alarm inputs, and signaling to other building systems.

Reading the protocol document

Protocol documents list commands as text or hex bytes (for example 0x02 for STX and 0x03 for ETX around a command). Note the delimiters, the checksums if any, and what the device sends back. Test each command with a terminal tool before you build it into the program.

Create a free account to track which lessons you've finished and take the exam.