Automating Video Input Switching on KM Devices - Some background

KM Model #USW-N334 (note, not a KVM, just KM).

I have been a longtime user of KVMs from way back in the VGA days, and things have gotten so incredibly complex when it comes to Video options.

Whether it be DisplayPort, HDMI, etc, even the best full KVMs eventually have either issues, or degrade the native performance of a display.

For example, I now have a QHD (3440x1440) OLED display which supports a massive 240 Hz refresh rate on both HDMI and DisplayPort.

Even if I found a KVM that supported this single monitor and 4 computers, I would lose the awesome Picture-by-Picture capabilities of this monitor.

More so, in general, I have found that your KM device provides pretty much everything I need.

In particular, with two systems connected to the monitor, using PBP, I can use the mouse roaming to seamlessly switch from one system to the other. It’s almost magic!

So now that I got what I basically need, I want more!

Using DDC/CI there are mechanisms in all of the O.S.s (Windows, macOS, and Linux) to send a signal to the monitor and have it switch inputs.

With this, and a monitor with 3 inputs, I can effectively have a super high-quality KVM device that should work pretty much forever (for 3 systems, not 4, but I can live with that).

So, as I mentioned, each of the OS’s have different tools to manage DDC/CI commands, and each tool provides for some sort of a command-line interface.

  • On Windows there is “ControlMyMonitor”,
  • on macOS there is “BetterDisplay”
  • on Linux their is " [ddcutil] and and [i2c-tools]

So, what I am hoping to either grab from soneone else, or develop, is a way to integrate the KM hotkeys (or something equivalent) that causes the monitor input, and KM input, to change in tandem.

While I am on the topic of heavy-weight use of this KM, has anyone figure out how to plug a device into the serial port?

I have a variety of USB-to-RS232 cables, but none of them have the correct gender to plug into a standard USB port on a modern system.

If I had some ancient system with an actual make RS232 port, that would be good, but no luck there.

Most modern systems utilize a straight-through ethernet cable (Cisco-type) for RS232 signaling.

2 Likes

I am going to try this cable for serial RS232:

SABRENT USB 2.0 to Serial (9 Pin) DB 9 RS 232 Converter Cable, Prolific Chipset, HEXNUTS, [Windows 11/10/8.1/8/7/VISTA/XP, Mac OS X 10.6 and Above] 2.5 Feet (CB-DB9P)

1 Like

I can confirm that this cable, plugged into a Linux system, and using the supplied Serial Port RJ11+RS232 connection I can connect to the KM and control it.

It defaults to 19200 Baud, Local Echo

1 Like

Thank you for this info!

macOS

#!/usr/bin/env bash
ssh pikvm3 /usr/local/bin/port4.sh
/usr/local/bin/betterdisplaycli set -namelike=AW3425DW -ddc=15  -vcp=inputSelect

Windows:

#Monitor Device Name: "\\.\DISPLAY6\Monitor0"
#Monitor Name: ""
#Serial Number: ""
#Adapter Name: "NVIDIA GeForce RTX 4060 Laptop GPU"
#Monitor ID: "MONITOR\DELA290\{4d36e96e-e325-11ce-bfc1-08002be10318}\0003"
#Short Monitor ID: "DELA290"
#& $ENV:USERPROFILE\Documents\controlmymonitor\controlmymonitor.exe /SetValue 22EA53 60 17
& $ENV:USERPROFILE\Documents\controlmymonitor\controlmymonitor.exe /SetValueIfNeeded "\\.\DISPLAY6\Monitor0" 60 15
ssh pikvm3 /usr/local/bin/port2.sh

Linux

#!/bin/sh
ddcutil setvcp 60 0x11
ssh pikvm3 /usr/local/bin/port1.sh

on pikvm3:

port1.sh

#!/usr/bin/env bash
stty speed 19200  </dev/ttyUSB0
printf "K=1\n" >/dev/ttyUSB0

port2.sh

#!/usr/bin/env bash
stty speed 19200  </dev/ttyUSB0
printf "K=2\n" >/dev/ttyUSB0

port3.sh

#!/usr/bin/env bash
stty speed 19200  </dev/ttyUSB0
printf "K=3\n" >/dev/ttyUSB0

So now with scripts for all three platforms, it’s a simple matter of setting up any preferable UI around it (the CLI is fine for me).

On MacOS, automator can call a shell script.

On Windows it’s a simple shortcut.

On Linux use the Application editor to add a new one.